JAGS-4.3.2/0000755000175000017500000000000014400711327007244 500000000000000JAGS-4.3.2/m4/0000755000175000017500000000000014400711323007560 500000000000000JAGS-4.3.2/m4/R.m40000664000175000017500000027526614224052371010174 00000000000000### R.m4 -- extra macros for configuring R -*- Autoconf -*- ### ### Copyright (C) 1998-2005 R Core Team ### ### This file is part of R. ### ### R 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 of the License, or (at your ### option) any later version. ### ### R 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 R; if not, you can obtain it via the World Wide Web at ### `http://www.gnu.org/copyleft/gpl.html', or by writing to the Free ### Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ### 02110-1301, USA. ### * General support macros ## R_ARG_USE ## --------- AC_DEFUN([R_ARG_USE], [if test "${withval}" = no; then use_$1=no else use_$1=yes fi ])# R_ARG_USE ## R_ARG_USE_SYSTEM ## ---------------- AC_DEFUN([R_ARG_USE_SYSTEM], [if test "${withval}" = no; then use_system_$1=no else use_system_$1=yes fi ])# R_ARG_USE_SYSTEM ## R_SH_VAR_ADD(VARIABLE, VALUE, [SEPARATOR = " "]) ## ------------------------------------------------ ## Set sh variable VARIABLE to VALUE if empty (or undefined), or append ## VALUE to the value of VARIABLE, separated by SEPARATOR. ## Currently, safe only if all arguments are literals. ## Useful mostly when we do not know whether VARIABLE is empty or not. ## Should maybe also have a fourth argument to control whether adding ## happens by appending (default) or prepending ... AC_DEFUN([R_SH_VAR_ADD], [separator="$3" test -z "${separator}" && separator=" " if test -z "${[$1]}"; then $1="$2" else $1="${[$1]}${separator}$2" fi])# R_SH_VAR_ADD ## R_MISSING_PROG(NAME, PROGRAM) ## ----------------------------- ## Simplified variant of AM_MISSING_PROG. ## Set NAME to PROGRAM if this is found and works (in the sense of ## properly implementing --version, or to an appropriate invocation ## if the missing script otherwise. AC_DEFUN([R_MISSING_PROG], [AC_MSG_CHECKING([for working $2]) if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT([found]) else $1="\$(SHELL) \$(top_srcdir)/tools/missing $2" AC_MSG_RESULT([missing]) fi AC_SUBST($1) ])# R_MISSING_PROG ### * Programs ## R_PROG_AR ## --------- AC_DEFUN([R_PROG_AR], [AC_CHECK_PROGS(AR, [${AR} ar]) : ${ARFLAGS="rc"} AC_SUBST(ARFLAGS) ])# R_PROG_AR ## R_PROG_INSTALL ## -------------- ## Find a good install program. ## We like to provide INSTALL in the top-level Makeconf. ## Hence, if AC_PROG_INSTALL ends up with the 'tools/install-sh' script, ## we need to ensure a relative path (i.e., in case we build in srcdir) ## gets prefixed by top_srcdir. (This would not be necessary if we had ## '@INSTALL@' in each Makefile.in, but we prefer to share ...) AC_DEFUN([R_PROG_INSTALL], [AC_REQUIRE([AC_PROG_INSTALL]) case "${INSTALL}" in [[\\/]]* | ?:[[\\/]]* ) # absolute ;; *) INSTALL="\$\(top_srcdir\)/tools/install-sh -c" ;; esac case "${host_os}" in hpux*) ## On some versions of HP-UX (seen on both 10.20 and 11.0) we end up ## a broken install (seen in /opt/imake/bin) which has the default ## permissions wrong (PR#2091). Let's just always use install-sh on ## HP-UX. INSTALL="\$\(top_srcdir\)/tools/install-sh -c" ;; esac ])# R_PROG_INSTALL ## R_PROG_PAGER ## ------------ AC_DEFUN([R_PROG_PAGER], [AC_PATH_PROGS(PAGER, [${PAGER} less more page pg], false) if test "${PAGER}" = false; then warn_pager="I could not determine a pager" AC_MSG_WARN([${warn_pager}]) fi ])# R_PROG_PAGER ## R_PROG_PERL ## ----------- AC_DEFUN([R_PROG_PERL], [AC_PATH_PROGS(PERL, [${PERL} perl]) if test -n "${PERL}"; then _R_PROG_PERL_VERSION else ## ## Need a full path for '@PERL@' substitutions when starting Perl ## scripts with a line of the form '#! FOO'. AC_PATH_PROGS(FALSE, false) PERL="${FALSE}" ## fi if test "${r_cv_prog_perl_v5}" = yes; then NO_PERL5=false else warn_perl5="you cannot build the object documentation system" AC_MSG_WARN([${warn_perl5}]) NO_PERL5=true fi AC_SUBST(NO_PERL5) ])# R_PROG_PERL ## _R_PROG_PERL_VERSION ## -------------------- ## Building the R documentation system (Rdconv and friends) requires ## Perl version 5.004 or better. ## Set shell variable r_cv_prog_perl_v5 to 'yes' if a recent enough ## Perl is found, and to 'no' otherwise. AC_DEFUN([_R_PROG_PERL_VERSION], [AC_CACHE_CHECK([whether perl version is at least 5.004], [r_cv_prog_perl_v5], [if ${PERL} -e 'require 5.004 or exit 1'; then r_cv_prog_perl_v5=yes else r_cv_prog_perl_v5=no fi]) ])# _R_PROG_PERL_VERSION ## R_PROG_TEXMF ## ------------ AC_DEFUN([R_PROG_TEXMF], [AC_REQUIRE([R_PROG_PERL]) AC_PATH_PROGS(DVIPS, [${DVIPS} dvips], false) AC_PATH_PROGS(TEX, [${TEX} tex], false) AC_PATH_PROGS(LATEX, [${LATEX} latex], false) if test -z "${ac_cv_path_TEX}" ; then warn_dvi="you cannot build DVI versions of the R manuals" elif test -z "${ac_cv_path_LATEX}"; then warn_dvi="you cannot build DVI versions of all the help pages" fi if test -n "${warn_dvi}"; then AC_MSG_WARN([${warn_dvi}]) fi AC_PATH_PROGS(MAKEINDEX, [${MAKEINDEX} makeindex], false) AC_PATH_PROGS(PDFTEX, [${PDFTEX} pdftex], false) AC_PATH_PROGS(PDFLATEX, [${PDFLATEX} pdflatex], false) if test -z "${ac_cv_path_PDFTEX}" ; then warn_pdf="you cannot build PDF versions of the R manuals" elif test -z "${ac_cv_path_PDFLATEX}" ; then warn_pdf="you cannot build PDF versions of all the help pages" fi if test -n "${warn_pdf}"; then AC_MSG_WARN([${warn_pdf}]) fi AC_PATH_PROGS(MAKEINFO_CMD, [${MAKEINFO} makeinfo]) ## This test admittedly looks a bit strange ... see R_PROG_PERL. if test "${PERL}" = "${FALSE}"; then AC_PATH_PROGS(INSTALL_INFO, [${INSTALL_INFO} install-info], false) else INSTALL_INFO="\$(PERL) \$(top_srcdir)/tools/install-info.pl" AC_SUBST(INSTALL_INFO) fi : ${R_RD4DVI="ae"} AC_SUBST(R_RD4DVI) : ${R_RD4PDF="times,hyper"} AC_SUBST(R_RD4PDF) ])# R_PROG_TEXMF ## R_PROG_MAKEINFO ## --------------- AC_DEFUN([R_PROG_MAKEINFO], ## This used to be part of R_PROG_TEXMF, where it really belongs. ## Unfortunately, AC_PROG_LIBTOOL unconditionally overwrites MAKEINFO ## by makeinfo or missing. To allow users to pass a MAKEINFO setting to ## configure, we thus have to run R_PROG_TEXMF before AC_PROG_LIBTOOL, ## save the result to something not overwritten (hence MAKEINFO_CMD), ## and finally set MAKEINFO according to our needs. [AC_REQUIRE([R_PROG_TEXMF]) AC_REQUIRE([AC_PROG_LIBTOOL]) if test -n "${MAKEINFO_CMD}"; then _R_PROG_MAKEINFO_VERSION fi if test "${r_cv_prog_makeinfo_v4}" != yes; then warn_info="you cannot build info or html versions of the R manuals" AC_MSG_WARN([${warn_info}]) MAKEINFO=false else MAKEINFO="${MAKEINFO_CMD}" fi ])# R_PROG_MAKEINFO ## _R_PROG_MAKEINFO_VERSION ## ------------------------ ## Building the R Texinfo manuals requires Makeinfo v4.7 or better. ## Set shell variable r_cv_prog_makeinfo_v4 to 'yes' if a recent ## enough Makeinfo is found, and to 'no' otherwise. ## If you change the minimum version here, also change it in ## doc/manual/Makefile.in and doc/manual/R-admin.texi. AC_DEFUN([_R_PROG_MAKEINFO_VERSION], [AC_CACHE_CHECK([whether makeinfo version is at least 4.7], [r_cv_prog_makeinfo_v4], [makeinfo_version=`${MAKEINFO_CMD} --version | \ grep "^makeinfo" | sed 's/[[^)]]*) \(.*\)/\1/'` makeinfo_version_maj=`echo ${makeinfo_version} | cut -f1 -d.` makeinfo_version_min=`echo ${makeinfo_version} | cut -f2 -d.` if test -z "${makeinfo_version_maj}" \ || test -z "${makeinfo_version_min}"; then r_cv_prog_makeinfo_v4=no elif test ${makeinfo_version_maj} -lt 4 \ || test ${makeinfo_version_min} -lt 7; then r_cv_prog_makeinfo_v4=no else r_cv_prog_makeinfo_v4=yes fi]) ])# _R_PROG_MAKEINFO_VERSION ## R_PROG_BROWSER ## -------------- AC_DEFUN([R_PROG_BROWSER], [if test -z "${R_BROWSER}"; then AC_PATH_PROGS(R_BROWSER, [firefox mozilla netscape galeon kfmclient opera gnome-moz-remote open]) fi if test -z "${R_BROWSER}"; then warn_browser="I could not determine a browser" AC_MSG_WARN([${warn_browser}]) else AC_MSG_RESULT([using default browser ... ${R_BROWSER}]) fi AC_SUBST(R_BROWSER) ])# R_BROWSER ## R_PROG_PDFVIEWER ## ---------------- ## Try to determine a PDF viewer. ## According to Jeff Gentry , 'acroread4' is ## the FreeBSD acroread port. AC_DEFUN([R_PROG_PDFVIEWER], [AC_PATH_PROGS(R_PDFVIEWER, [${R_PDFVIEWER} acroread acroread4 xpdf gv gnome-gv ggv kghostview open gpdf]) if test -z "${R_PDFVIEWER}"; then warn_pdfviewer="I could not determine a PDF viewer" AC_MSG_WARN([${warn_pdfviewer}]) fi AC_SUBST(R_PDFVIEWER) ])# R_PDFVIEWER ### * C compiler and its characteristics. ## R_PROG_CPP_CPPFLAGS ## ------------------- ## In case of gcc, check whether the C preprocessor complains about ## having '/usr/local/include' in its header search path (no matter how ## it came there). GCC 3.1 and 3.2 (at least) give warnings about ## 'changing search order for system directory "/usr/local/include" as ## it has already been specified as a non-system directory' which are at ## least quite annoying. ## ## We currently do not distinguish whether '/usr/local/include' was ## added as the R default, or by an explicit CPPFLAGS arg to configure. ## If we wanted to, we should change ## : ${CPPFLAGS="-I/usr/local/include"} ## in 'configure.ac' by something like ## : ${CPPFLAGS=${r_default_CPPFLAGS="-I/usr/local/include"}} ## and test whether r_default_CPPFLAGS is non-empty. ## AC_DEFUN([R_PROG_CPP_CPPFLAGS], [AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CPP]) if test "${GCC}" = yes; then AC_LANG_PUSH(C) AC_LANG_CONFTEST([AC_LANG_PROGRAM()]) if ${CPP} ${CPPFLAGS} conftest.${ac_ext} 2>&1 1>/dev/null | \ grep 'warning:.*system directory.*/usr/local/include' >/dev/null; then CPPFLAGS=`echo ${CPPFLAGS} | \ sed 's|\(.*\)-I/usr/local/include *\(.*\)|\1\2|'` fi rm -f conftest.${ac_ext} AC_LANG_POP(C) fi])# R_PROG_CPP_CPPFLAGS ## R_PROG_CC_VERSION ## ----------------- ## Determine the version of the C compiler (currently only for gcc). AC_DEFUN([R_PROG_CC_VERSION], [AC_REQUIRE([AC_PROG_CC]) CC_VERSION= if test "${GCC}" = yes; then CC_VERSION=`${CC} -v 2>&1 | grep "^.*g.. version" | \ sed -e 's/^.*g.. version *//'` fi])# R_PROG_CC_VERSION ## R_PROG_CC_M ## ----------- ## Check whether we can figure out C Make dependencies. AC_DEFUN([R_PROG_CC_M], [AC_REQUIRE([R_PROG_CC_VERSION]) AC_MSG_CHECKING([whether we can compute C Make dependencies]) AC_CACHE_VAL([r_cv_prog_cc_m], [echo "#include " > conftest.c ## No real point in using AC_LANG_* and ${ac_ext}, as we need to create ## hard-wired suffix rules. ## Another obvious candidate to try is '${MAKEDEPEND-makedepend} -f-'. ## However, this does not work out of the box when srcdir and builddir ## are different, as it creates dependencies of the form ## ${srcdir}/foo.o: /path/to/bar.h ## Could be made to work, of course ... ## Note also that it does not create a 'conftest.o: conftest.c' line. ## For gcc 3.2 or better, we want to use '-MM' in case this works. cc_minus_MM=false if test "${GCC}" = yes; then case "${CC_VERSION}" in 1.*|2.*|3.[[01]]*) ;; *) cc_minus_MM="${CC} -MM" ;; esac fi for prog in "${cc_minus_MM}" "${CC} -M" "${CPP} -M" "cpp -M"; do if ${prog} conftest.c 2>/dev/null | \ grep 'conftest.o: conftest.c' >/dev/null; then r_cv_prog_cc_m="${prog}" break fi done]) if test -z "${r_cv_prog_cc_m}"; then AC_MSG_RESULT([no]) else AC_MSG_RESULT([yes, using ${r_cv_prog_cc_m}]) fi ])# R_PROG_CC_M ## R_PROG_CC_C_O_LO ## ---------------- ## Check whether the C compiler supports '-c -o FILE.lo'. AC_DEFUN([R_PROG_CC_C_O_LO], [AC_CACHE_CHECK([whether ${CC} supports -c -o FILE.lo], [r_cv_prog_cc_c_o_lo], [test -d TMP || mkdir TMP echo "int some_variable = 0;" > conftest.c ## No real point in using AC_LANG_* and ${ac_ext}, as we need to create ## hard-wired suffix rules. ac_try='${CC} ${CFLAGS} -c conftest.c -o TMP/conftest.lo 1>&AS_MESSAGE_LOG_FD' if AC_TRY_EVAL(ac_try) \ && test -f TMP/conftest.lo \ && AC_TRY_EVAL(ac_try); then r_cv_prog_cc_c_o_lo=yes else r_cv_prog_cc_c_o_lo=no fi rm -rf conftest* TMP]) ])# R_PROG_CC_C_O_LO ## R_PROG_CC_MAKEFRAG ## ------------------ ## Generate a Make fragment with suffix rules for the C compiler. ## Used for both building R (Makeconf) and add-ons (etc/Makeconf). AC_DEFUN([R_PROG_CC_MAKEFRAG], [r_cc_rules_frag=Makefrag.cc AC_REQUIRE([R_PROG_CC_M]) cat << \EOF > ${r_cc_rules_frag} .c.o: $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $[@] EOF if test -n "${r_cv_prog_cc_m}"; then cat << EOF >> ${r_cc_rules_frag} .c.d: @echo "making \$[@] from \$<" @${r_cv_prog_cc_m} \$(ALL_CPPFLAGS) $< > \$[@] EOF else cat << \EOF >> ${r_cc_rules_frag} .c.d: @echo > $[@] EOF fi AC_SUBST_FILE(r_cc_rules_frag) ])# R_PROG_CC_MAKEFRAG ## R_PROG_CC_LO_MAKEFRAG ## --------------------- ## Generate a Make fragment with suffix rules for the C compiler. ## Used for both building R (Makeconf) and add-ons (etc/Makeconf). ## Need to make .lo files in src/nmath/standalone only ## NB test -d .libs || mkdir .libs can be run more than once ## and hence race when a parallel make is used AC_DEFUN([R_PROG_CC_LO_MAKEFRAG], [r_cc_lo_rules_frag=Makefrag.cc_lo AC_REQUIRE([R_PROG_CC_C_O_LO]) if test "${r_cv_prog_cc_c_o_lo}" = yes; then cat << \EOF > ${r_cc_lo_rules_frag} .c.lo: $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS_LO) -c $< -o $[@] EOF else cat << \EOF > ${r_cc_lo_rules_frag} .c.lo: @-test -d .libs || mkdir .libs $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS_LO) -c $< -o .libs/$[*].o mv .libs/$[*].o $[*].lo EOF fi AC_SUBST_FILE(r_cc_lo_rules_frag) ])# R_PROG_CC_LO_MAKEFRAG ## R_PROG_CC_FLAG(FLAG, [ACTION-IF-TRUE]) ## --------------------------------------- ## Check whether the C compiler handles command line option FLAG, ## and set shell variable r_cv_prog_cc_flag_SFLAG accordingly (where ## SFLAG is a shell-safe transliteration of FLAG). ## In addition, execute ACTION-IF-TRUE in case of success. AC_DEFUN([R_PROG_CC_FLAG], [ac_safe=AS_TR_SH($1) AC_MSG_CHECKING([whether ${CC} accepts $1]) AC_CACHE_VAL([r_cv_prog_cc_flag_${ac_safe}], [AC_LANG_PUSH(C) r_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} $1" AC_LINK_IFELSE([AC_LANG_PROGRAM()], [eval "r_cv_prog_cc_flag_${ac_safe}=yes"], [eval "r_cv_prog_cc_flag_${ac_safe}=no"]) CFLAGS="${r_save_CFLAGS}" AC_LANG_POP(C) ]) if eval "test \"`echo '$r_cv_prog_cc_flag_'$ac_safe`\" = yes"; then AC_MSG_RESULT([yes]) [$2] else AC_MSG_RESULT([no]) fi ])# R_PROG_CC_FLAG ## R_PROG_CC_FLAG_D__NO_MATH_INLINES ## --------------------------- ## In glibc 2.1, inline version [x86] of exp was broken (exp(-Inf) = NaN). ## We fix this by adding '-D__NO_MATH_INLINES' to R_XTRA_CFLAGS rather ## than AC_DEFINE(__NO_MATH_INLINES) as the former also takes care of ## compiling C code for add-on packages. AC_DEFUN([R_PROG_CC_FLAG_D__NO_MATH_INLINES], [AC_CACHE_CHECK([whether C runtime needs -D__NO_MATH_INLINES], [r_cv_c_no_math_inlines], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #if defined(__GLIBC__) int main () { double x, y; x = -0./1.; y = exp(x); exit (y != 0.); } #else int main () { exit(0); } #endif ]])], [r_cv_c_no_math_inlines=yes], [r_cv_c_no_math_inlines=no], [r_cv_c_no_math_inlines=no])]) if test "${r_cv_c_no_math_inlines}" = yes; then R_SH_VAR_ADD(R_XTRA_CFLAGS, [-D__NO_MATH_INLINES]) fi ])# R_PROG_CC_FLAG_D__NO_MATH_INLINES ## R_C_OPTIEEE ## ----------- ## Check whether the C compiler needs '-OPT:IEEE_NaN_inf=ON' to ## correctly deal with IEEE NaN/Inf. ## This flag is needed for the native SGI C compiler. ## If needed, add the flag to R_XTRA_CFLAGS. AC_DEFUN([R_C_OPTIEEE], [AC_CACHE_CHECK([whether C compiler needs -OPT:IEEE_NaN_inf=ON], [r_cv_c_optieee], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include int main () { double x = 0; fpsetmask(0); x = x / x; exit (x != x); } ]])], [r_cv_c_optieee=yes], [r_cv_c_optieee=no], [r_cv_c_optieee=no])]) if test "${r_cv_c_optieee}" = yes; then R_SH_VAR_ADD(R_XTRA_CFLAGS, [-OPT:IEEE_NaN_inf=ON]) fi ])# R_C_OPTIEEE ## R_C_INLINE ## ---------- ## modified version of AC_C_INLINE to use R_INLINE not inline AC_DEFUN([R_C_INLINE], [AC_REQUIRE([AC_PROG_CC_STDC]) dnl AC_CACHE_CHECK([for inline], r_cv_c_inline, [r_cv_c_inline="" for ac_kw in inline __inline__ __inline; do AC_COMPILE_IFELSE([AC_LANG_SOURCE( [#ifndef __cplusplus static $ac_kw int static_foo () {return 0; } $ac_kw int foo () {return 0; } #endif ])], [r_cv_c_inline=$ac_kw; break]) done ]) case $r_cv_c_inline in no) AC_DEFINE(R_INLINE,, [Define as `inline', or `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if it is not supported.]) ;; *) AC_DEFINE_UNQUOTED(R_INLINE, $r_cv_c_inline) ;; esac ])# R_C_INLINE ### * C++ compiler and its characteristics. ## R_PROG_CXX_M ## ------------ ## Check whether the C++ compiler accepts '-M' for generating ## dependencies. AC_DEFUN([R_PROG_CXX_M], [AC_REQUIRE([R_PROG_CC_M]) AC_CACHE_CHECK([whether ${CXX} accepts -M for generating dependencies], [r_cv_prog_cxx_m], [echo "#include " > conftest.cc ## No real point in using AC_LANG_* and ${ac_ext}, as we need to create ## hard-wired suffix rules. We could be a bit more careful as we ## actually only test suffix '.cc'. if test -n "`${CXX} -M conftest.cc 2>/dev/null | grep conftest`"; then r_cv_prog_cxx_m=yes else r_cv_prog_cxx_m=no fi]) ])# R_PROG_CXX_M ## R_PROG_CXX_MAKEFRAG ## ------------------- ## Generate a Make fragment with suffix rules for the C++ compiler. ## Used for both building R (Makeconf) and add-ons (etc/Makeconf). AC_DEFUN([R_PROG_CXX_MAKEFRAG], [r_cxx_rules_frag=Makefrag.cxx AC_REQUIRE([R_PROG_CXX_M]) cat << \EOF > ${r_cxx_rules_frag} .cc.o: $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $[@] .cpp.o: $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $[@] .C.o: $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $[@] EOF if test "${r_cv_prog_cxx_m}" = yes; then cat << \EOF >> ${r_cxx_rules_frag} .cc.d: @echo "making $[@] from $<" @$(CXX) -M $(ALL_CPPFLAGS) $< > $[@] .cpp.d: @echo "making $[@] from $<" @$(CXX) -M $(ALL_CPPFLAGS) $< > $[@] .C.d: @echo "making $[@] from $<" @$(CXX) -M $(ALL_CPPFLAGS) $< > $[@] EOF else cat << \EOF >> ${r_cxx_rules_frag} .cc.d: @echo > $[@] .cpp.d: @echo > $[@] .C.d: @echo > $[@] EOF fi AC_SUBST_FILE(r_cxx_rules_frag) ])# R_PROG_CXX_MAKEFRAG ## R_PROG_CXX_FLAG ## --------------- ## Check whether the C++ compiler handles command line option FLAG, ## and set shell variable r_cv_prog_cc_flag_SFLAG accordingly (where ## SFLAG is a shell-safe transliteration of FLAG). ## In addition, execute ACTION-IF-TRUE in case of success. AC_DEFUN([R_PROG_CXX_FLAG], [ac_safe=AS_TR_SH($1) AC_MSG_CHECKING([whether ${CXX-c++} accepts $1]) AC_CACHE_VAL([r_cv_prog_cxx_flag_${ac_safe}], [AC_LANG_PUSH(C++) r_save_CXXFLAGS="${CXXFLAGS}" CXXFLAGS="${CXXFLAGS} $1" AC_LINK_IFELSE([AC_LANG_PROGRAM()], [eval "r_cv_prog_cxx_flag_${ac_safe}=yes"], [eval "r_cv_prog_cxx_flag_${ac_safe}=no"]) CXXFLAGS="${r_save_CXXFLAGS}" AC_LANG_POP(C++) ]) if eval "test \"`echo '$r_cv_prog_cxx_flag_'$ac_safe`\" = yes"; then AC_MSG_RESULT([yes]) [$2] else AC_MSG_RESULT([no]) fi ])# R_PROG_CXX_FLAG ### * Fortran 77 compiler/converter and its characteristics. ## R_PROG_F77 ## ---------- ## Find a Fortran 77 compiler ## ## If we have not been forced to use a particular Fortran compiler, try ## to find one using one of the several common names. The list is based ## on what the current autoconf CVS contains (2005-05-21). This says, ## ## ## Known compilers: ## f77/f90/f95: generic compiler names ## g77: GNU Fortran 77 compiler ## gfortran: putative GNU Fortran 95+ compiler (in progress) ## ftn: native Fortran 95 compiler on Cray X1 ## cf77: native F77 compiler under older Crays (prefer over fort77) ## fort77: native F77 compiler under HP-UX (and some older Crays) ## frt: Fujitsu F77 compiler ## pgf77/pgf90/pghpf/pgf95: Portland Group F77/F90/F95 compilers ## xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers ## lf95: Lahey-Fujitsu F95 compiler ## fl32: Microsoft Fortran 77 "PowerStation" compiler ## af77: Apogee F77 compiler for Intergraph hardware running CLIX ## epcf90: "Edinburgh Portable Compiler" F90 ## fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha ## ifort, previously ifc: Intel Fortran 95 compiler for Linux/x86 ## efc: Intel Fortran 95 compiler for IA64 ## ## ## and uses the following lists: ## F95: f95 fort xlf95 ifort ifc efc pgf95 lf95 gfortran ftn ## F90: f90 xlf90 pgf90 pghpf epcf90 ## F77: g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77 ## ## We use basically the same, with the following exceptions: ## * On HP-UX fort77 is the POSIX-compatible native compiler and ## f77 is not: hence we need look for fort77 first! ## ## Is this still true? ## ## * It seems that g95 has been resurrected, see www.g95.org, hence we ## add this to the list of F95 compilers. ## * Older versions of the Autoconf code used to have 'fc' as a wrapper ## around f2c (last in the list). It no longer has, but we still do. ## ## Is this still needed? ## ## * If the C compiler is gcc, we try looking for a matching GCC Fortran ## compiler (gfortran for 4.x, g77 for 3.x) first. This should handle ## problems if GCC 4.x and 3.x suites are installed and, depending on ## the gcc default, the "wrong" GCC Fortran compiler is picked up (as ## reported by Bill Northcott for OSX with ## 4.0 as default and g77 around and the "old" search order F77 F95 ## F90 in use). AC_DEFUN([R_PROG_F77], [AC_BEFORE([$0], [AC_PROG_LIBTOOL]) AC_REQUIRE([R_PROG_CC_VERSION]) if test -n "${F77}"; then AC_MSG_RESULT([defining F77 to be ${F77}]) else F77= F95_compilers="f95 fort xlf95 ifort ifc efc pgf95 lf95 gfortran ftn g95" F90_compilers="f90 xlf90 pgf90 pghpf epcf90" case "${host_os}" in hpux*) F77_compilers="g77 fort77 f77 xlf frt pgf77 cf77 fl32 af77" ;; *) F77_compilers="g77 f77 xlf frt pgf77 cf77 fort77 fl32 af77" ;; esac GCC_Fortran_compiler= if test "${GCC}" = yes; then case "${CC_VERSION}" in 3.*) GCC_Fortran_compiler=g77 ;; 4.*) GCC_Fortran_compiler=gfortran ;; esac fi AC_CHECK_PROGS(F77, [ ${GCC_Fortran_compiler} ${F95_compilers} \ ${F90_compilers} ${F77_compilers} fc ]) fi if test -n "${F77}"; then ## If the above 'found' a Fortran 77 compiler, we run AC_PROG_F77 as ## this does additional testing (GNU, '-g', ...). AC_PROG_F77 else AC_MSG_ERROR([Neither an F77 compiler nor f2c found]) fi ])# R_PROG_F77 ## R_PROG_F77_FLIBS ## ---------------- ## Run AC_F77_LIBRARY_LDFLAGS, and fix some known problems with FLIBS. ## Only do this if the user has not already set FLIBS. AC_DEFUN([R_PROG_F77_FLIBS], [AC_BEFORE([$0], [AC_F77_LIBRARY_LDFLAGS]) if test -z "${FLIBS}"; then ## ## Currently (Autoconf 2.50 or better, it seems) FLIBS also contains all ## elements of LIBS when AC_F77_LIBRARY_LDFLAGS is run. This is because ## _AC_PROG_F77_V_OUTPUT() uses 'eval $ac_link' for obtaining verbose ## linker output, and AC_LANG(Fortran 77) sets up ac_link to contain ## LIBS. Most likely a bug, and a nuisance in any case ... ## But we cannot simply eliminate the elements in FLIBS duplicated from ## LIBS (e.g. '-lm' should be preserved). Hence, we try to call ## AC_F77_LIBRARY_LDFLAGS() with LIBS temporarily set to empty. r_save_LIBS="${LIBS}" LIBS= AC_F77_LIBRARY_LDFLAGS if test -z "${MAIN_LD}" ; then LIBS= R_C_LIBRARY_LDFLAGS else CLIBS= fi LIBS="${r_save_LIBS}" ## Currently g77 on Darwin links against '-lcrt1.o' (and for GCC 3.1 or ## better also against '-lcrtbegin.o'), which (unlike '-lcrt0.o') are ## not stripped by AC_F77_LIBRARY_LDFLAGS. This in particular causes ## R_PROG_F77_CC_COMPAT to fail. Hence, we make sure all -lcrt*.o are ## removed. ## ## Native f90 on HPUX 11 comes up with '-l:libF90.a' causing trouble ## when using gcc for linking. The '-l:' construction is similar to ## plain '-l' except that search order (archive/shared) given by '-a' ## is not important. We escape such flags via '-Wl,' in case of gcc. ## Note that the current Autoconf CVS uses _AC_LINKER_OPTION for a ## similar purpose when computing FLIBS: this uses '-Xlinker' escapes ## for gcc and does nothing otherwise. Note also that we cannot simply ## unconditionally escape with '${wl}' from libtool as on HPUX we need ## SHLIB_LD=ld for native C compilers (problem with non-PIC 'crt0.o', ## see 'Individual platform overrides' in section 'DLL stuff' in file ## 'configure.ac'. ## ## Using the Intel Fortran compiler (ifc) one typically gets incorrect ## flags, as the output from _AC_PROG_F77_V_OUTPUT() contains double ## quoted options, e.g. "-mGLOB_options_string=......", see also e.g. ## http://www.octave.org/octave-lists/archive/octave-maintainers.2002/msg00038.html. ## One possible solution is to change AC_F77_LIBRARY_LDFLAGS() to remove ## double quotes for ifc, as it already does for the Cray cft90. As we ## prefer not to overload Autoconf code, we try to fix things here ... ## ## As of 2.1.0 we try to tidy this up a bit. ## 1) -lfrtbegin and -lgfortranbegin are used by g77/gfortran only for a ## Fortran main program, which we do not have. ## 2) g77 also tends to duplicate paths via ../../.., so we canonicalize ## paths and remove duplicates. ## 3) We do not need -L/lib etc, nor those in LDFLAGS ## 4) We exclude path with CC will include when linking. ## ## First try to fathom out what -Lfoo commands are unnecessary. case "${host_os}" in linux*) r_libpath_default="/usr/lib64 /lib64 /usr/lib /lib" ;; solaris*) r_libpath_default="/usr/lib /lib" ;; *) r_libpath_default= ;; esac r_extra_libs= for arg in ${LDFLAGS} ${CLIBS}; do case "${arg}" in -L*) lib=`echo ${arg} | sed "s/^-L//"` test -d "${lib}" || continue ## Canonicalize (/usr/lib/gcc-lib/i686-linux/3.4.3/../../..). lib=`cd "${lib}" && ${GETWD}` r_extra_libs="${r_extra_libs} $lib" ;; esac done flibs= if test "${GCC}" = yes; then linker_option="-Wl," else linker_option= fi r_save_flibs="" for arg in ${FLIBS}; do case "${arg}" in ## this is not for a Fortran main program -lcrt*.o | -lfrtbegin | -lgfortranbegin) ;; -[[a-zA-Z]]/*\" | -[[a-zA-Z]]*\\) # ifc ;; -l:*) flibs="${flibs} ${linker_option}${arg}" ;; -L*) lib=`echo ${arg} | sed "s/^-L//"` ## Do not add non-existent directories. test -d "${lib}" || continue ## Canonicalize (/usr/lib/gcc-lib/i686-linux/3.4.3/../../..). lib=`cd "${lib}" && ${GETWD}` r_want_lib=true ## Do not add something twice nor default paths nor those in LDFLAGS for dir in ${r_save_flibs} ${r_libpath_default} ${r_extra_libs}; do if test "${dir}" = "${lib}"; then r_want_lib=false break fi done if test x"${r_want_lib}" = xtrue; then flibs="${flibs} -L${lib}" r_save_flibs="${r_save_flibs} ${lib}" fi ;; *) flibs="${flibs} ${arg}" ;; esac done FLIBS="${flibs}" fi ])# R_PROG_F77_FLIBS ## R_PROG_F77_APPEND_UNDERSCORE ## ---------------------------- ## See if the Fortran 77 compiler appends underscores. ## What we really should do is determine how to properly mangle the ## names of C/C++ identifiers (potentially containing underscores) so ## that they match the name-mangling scheme used by the Fortran 77 ## compiler. Autoconf 2.50 or better has macros F77_FUNC(name, NAME) ## and F77_FUNC_(name, NAME) for this. However, the F77_* macros in ## the R API have one argument only and therefore cannot deal with ## Fortran 77 compilers which convert to upper case or add an extra ## underscore for identifiers containing underscores. We give an error ## in the former case; as ISO Fortran 77 does not allow underscores in ## function names, we do nothing about the latter. AC_DEFUN([R_PROG_F77_APPEND_UNDERSCORE], [AC_REQUIRE([AC_F77_WRAPPERS]) ## DANGER! We really needs the results of _AC_F77_NAME_MANGLING as ## stored in the cache var ac_cv_f77_mangling which is not documented ## and hence may change ... case "${ac_cv_f77_mangling}" in "upper "*) AC_MSG_WARN([Fortran compiler uses uppercase external names]) AC_MSG_ERROR([cannot use Fortran]) ;; esac AC_MSG_CHECKING([whether ${F77} appends underscores to external names]) AC_CACHE_VAL([r_cv_prog_f77_append_underscore], [case "${ac_cv_f77_mangling}" in *", underscore, "*) r_cv_prog_f77_append_underscore=yes ;; *", no underscore, "*) r_cv_prog_f77_append_underscore=no ;; esac]) if test -n "${r_cv_prog_f77_append_underscore}"; then AC_MSG_RESULT([${r_cv_prog_f77_append_underscore}]) else AC_MSG_RESULT([unknown]) AC_MSG_ERROR([cannot use Fortran]) fi if test "${r_cv_prog_f77_append_underscore}" = yes; then AC_DEFINE(HAVE_F77_UNDERSCORE, 1, [Define if your Fortran compiler appends an underscore to external names.]) fi ])# R_PROG_F77_APPEND_UNDERSCORE ## R_PROG_F77_CAN_RUN ## -------------------- ## Check whether the C/Fortran set up produces runnable code, as ## a preliminary to the compatibility tests. ## May fail if Fortran shared libraries are not in the library path. AC_DEFUN([R_PROG_F77_CAN_RUN], [AC_REQUIRE([AC_CHECK_LIBM]) AC_MSG_CHECKING([whether mixed C/Fortran code can be run]) AC_CACHE_VAL([r_cv_prog_f77_can_run], [cat > conftestf.f <&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ## Yes we need to double quote this ... [cat > conftest.c < #include "confdefs.h" #ifdef HAVE_F77_UNDERSCORE # define F77_SYMBOL(x) x ## _ #else # define F77_SYMBOL(x) x #endif int main () { exit(0); } EOF] if ${CC} ${CFLAGS} -c conftest.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then ## ## This should really use MAIN_LD, and hence come after this is ## determined (and necessary additions to MAIN_LDFLAGS were made). ## But it seems that we currently can always use the C compiler. ## Also, to be defensive there should be a similar test with SHLIB_LD ## and SHLIB_LDFLAGS (and note that on HPUX with native cc we have to ## use ld for SHLIB_LD) ... if ${CC} ${LDFLAGS} ${MAIN_LDFLAGS} -o conftest${ac_exeext} \ conftest.${ac_objext} conftestf.${ac_objext} ${FLIBS} \ ${LIBM} 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; ## then ## redirect error messages to config.log output=`./conftest${ac_exeext} 2>&AS_MESSAGE_LOG_FD` if test ${?} = 0; then r_cv_prog_f77_can_run=yes fi fi fi ]) rm -rf conftest conftest.* conftestf.* core if test -n "${r_cv_prog_f77_can_run}"; then AC_MSG_RESULT([yes]) else AC_MSG_WARN([cannot run mixed C/Fortan code]) AC_MSG_ERROR([Maybe check LDFLAGS for paths to Fortran libraries?]) fi ])# R_PROG_F77_CAN_RUN ## R_PROG_F77_CC_COMPAT ## -------------------- ## Check whether the Fortran 77 and C compilers agree on int and double. AC_DEFUN([R_PROG_F77_CC_COMPAT], [AC_REQUIRE([AC_CHECK_LIBM]) AC_MSG_CHECKING([whether ${F77} and ${CC} agree on int and double]) AC_CACHE_VAL([r_cv_prog_f77_cc_compat], [cat > conftestf.f <&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ## Yes we need to double quote this ... [cat > conftest.c < #include "confdefs.h" #ifdef HAVE_F77_UNDERSCORE # define F77_SYMBOL(x) x ## _ #else # define F77_SYMBOL(x) x #endif extern void F77_SYMBOL(cftest)(int *a, int *b, double *x, double *y); int main () { int a[3] = {17, 237, 2000000000}, b[2], res = 0; double x[3] = {3.14159265, 123.456789, 2.3e34}, z[3]; double eps = 1e-6; double zres[3]; int i, bres[2]; zres[0] = (double) a[2]/x[1]; zres[1] = x[2]*x[0]; zres[2] = pow(x[1]/x[0], 17.0); bres[0] = a[2]/a[1]; bres[1] = a[2] - a[0]*a[1]; F77_SYMBOL(cftest)(a, b, x, z); if(b[0] != bres[0]) res++; if(b[1] != bres[1]) res++; for(i = 0; i < 3; i++) if(fabs(z[i]/zres[i] - 1) > eps) res++; printf("number of errors %d\n", res); exit(res); } EOF] if ${CC} ${CFLAGS} -c conftest.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then ## ## This should really use MAIN_LD, and hence come after this is ## determined (and necessary additions to MAIN_LDFLAGS were made). ## But it seems that we currently can always use the C compiler. ## Also, to be defensive there should be a similar test with SHLIB_LD ## and SHLIB_LDFLAGS (and note that on HPUX with native cc we have to ## use ld for SHLIB_LD) ... if ${CC} ${LDFLAGS} ${MAIN_LDFLAGS} -o conftest${ac_exeext} \ conftest.${ac_objext} conftestf.${ac_objext} ${FLIBS} \ ${LIBM} 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; ## then ## redirect error messages to config.log output=`./conftest${ac_exeext} 2>&AS_MESSAGE_LOG_FD` if test ${?} = 0; then r_cv_prog_f77_cc_compat=yes fi fi fi ]) rm -rf conftest conftest.* conftestf.* core if test -n "${r_cv_prog_f77_cc_compat}"; then AC_MSG_RESULT([yes]) else AC_MSG_WARN([${F77} and ${CC} disagree on int and double]) AC_MSG_ERROR([Maybe change CFLAGS or FFLAGS?]) fi ])# R_PROG_F77_CC_COMPAT ## R_PROG_F77_CC_COMPAT_COMPLEX ## ---------------------------- ## Check whether the Fortran 77 and C compilers agree on double complex. AC_DEFUN([R_PROG_F77_CC_COMPAT_COMPLEX], [AC_REQUIRE([AC_CHECK_LIBM]) AC_MSG_CHECKING([whether ${F77} and ${CC} agree on double complex]) AC_CACHE_VAL([r_cv_prog_f77_cc_compat_complex], [cat > conftestf.f <&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ## Yes we need to double quote this ... [cat > conftest.c < #include "confdefs.h" #ifdef HAVE_F77_UNDERSCORE # define F77_SYMBOL(x) x ## _ #else # define F77_SYMBOL(x) x #endif typedef struct { double r; double i; } Rcomplex; extern void F77_SYMBOL(cftest)(Rcomplex *x); int main () { Rcomplex z[3]; z[0].r = 3.14159265; z[0].i = 2.172; z[1].i = 3.14159265; z[1].r = 2.172; z[2].r = 123.456; z[2].i = 0.123456; F77_SYMBOL(cftest)(z); printf("%f %f\n", z[0].r, z[0].i); if(fabs(z[0].r - 123.456) < 1e-4 && fabs(z[0].i - 14.71065) < 1e-4) exit(0); else exit(1); } EOF] if ${CC} ${CFLAGS} -c conftest.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then ## ## This should really use MAIN_LD, and hence come after this is ## determined (and necessary additions to MAIN_LDFLAGS were made). ## But it seems that we currently can always use the C compiler. ## Also, to be defensive there should be a similar test with SHLIB_LD ## and SHLIB_LDFLAGS (and note that on HPUX with native cc we have to ## use ld for SHLIB_LD) ... if ${CC} ${LDFLAGS} ${MAIN_LDFLAGS} -o conftest${ac_exeext} \ conftest.${ac_objext} conftestf.${ac_objext} ${FLIBS} \ ${LIBM} 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; ## then ## redirect error messages to config.log output=`./conftest${ac_exeext} 2>&AS_MESSAGE_LOG_FD` if test ${?} = 0; then r_cv_prog_f77_cc_compat_complex=yes fi fi fi ]) rm -rf conftest conftest.* conftestf.* core if test -n "${r_cv_prog_f77_cc_compat_complex}"; then AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_FORTRAN_DOUBLE_COMPLEX, 1, [Define if C's Rcomplex and Fortran's COMPLEX*16 can be interchanged, and can do arithmetic on the latter.]) else warn_f77_cc_double_complex="${F77} and ${CC} disagree on double complex" AC_MSG_WARN([${warn_f77_cc_double_complex}]) fi AC_SUBST(HAVE_FORTRAN_DOUBLE_COMPLEX) ])# R_PROG_F77_CC_COMPAT_COMPLEX ## R_PROG_F77_FLAG(FLAG, [ACTION-IF-TRUE]) ## --------------------------------------- ## Check whether the Fortran 77 compiler handles command line option ## FLAG, and set shell variable r_cv_prog_f77_flag_SFLAG accordingly ## (where SFLAG is a shell-safe transliteration of FLAG). ## In addition, execute ACTION-IF-TRUE in case of success. AC_DEFUN([R_PROG_F77_FLAG], [ac_safe=AS_TR_SH($1) AC_MSG_CHECKING([whether ${F77} accepts $1]) AC_CACHE_VAL([r_cv_prog_f77_flag_${ac_safe}], [AC_LANG_PUSH(Fortran 77) r_save_FFLAGS="${FFLAGS}" FFLAGS="${FFLAGS} $1" AC_LINK_IFELSE([AC_LANG_PROGRAM()], [eval "r_cv_prog_f77_flag_${ac_safe}=yes"], [eval "r_cv_prog_f77_flag_${ac_safe}=no"]) FFLAGS="${r_save_FFLAGS}" AC_LANG_POP(Fortran 77) ]) if eval "test \"`echo '$r_cv_prog_f77_flag_'$ac_safe`\" = yes"; then AC_MSG_RESULT([yes]) [$2] else AC_MSG_RESULT([no]) fi ])# R_PROG_F77_FLAG ### * Library functions ## R_FUNC___SETFPUCW ## ----------------- AC_DEFUN([R_FUNC___SETFPUCW], [AC_CHECK_FUNC(__setfpucw, [AC_CACHE_CHECK([whether __setfpucw is needed], [r_cv_func___setfpucw_needed], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ int main () { #include #if defined(_FPU_DEFAULT) && defined(_FPU_IEEE) exit(_FPU_DEFAULT != _FPU_IEEE); #endif exit(0); } ]])], [r_cv_func___setfpucw_needed=no], [r_cv_func___setfpucw_needed=yes], [r_cv_func___setfpucw_needed=no])]) if test "x${r_cv_func___setfpucw_needed}" = xyes; then AC_DEFINE(NEED___SETFPUCW, 1, [Define if your system needs __setfpucw() to control FPU rounding. This was used to control floating point precision, rounding and floating point exceptions on older Linux systems. As of GLIBC 2.1 this function is not used anymore.]) fi]) ])# R_FUNC___SETFPUCW ## R_FUNC_CALLOC ## ------------- AC_DEFUN([R_FUNC_CALLOC], [AC_CACHE_CHECK([for working calloc], [r_cv_func_calloc_works], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main () { int *p = calloc(0, sizeof(int)); exit(p == 0); } ]])], [r_cv_func_calloc_works=yes], [r_cv_func_calloc_works=no], [r_cv_func_calloc_works=no])]) if test "x${r_cv_func_calloc_works}" = xyes; then AC_DEFINE(HAVE_WORKING_CALLOC, 1, [Define if calloc(0) returns a null pointer.]) fi ])# R_FUNC_CALLOC ## R_FUNC_FINITE ## ------------- AC_DEFUN([R_FUNC_FINITE], [AC_CACHE_CHECK([for working finite], [r_cv_func_finite_works], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include "confdefs.h" int main () { #ifdef HAVE_FINITE exit(finite(1./0.) | finite(0./0.) | finite(-1./0.)); #else exit(1); #endif } ]])], [r_cv_func_finite_works=yes], [r_cv_func_finite_works=no], [r_cv_func_finite_works=no])]) if test "x${r_cv_func_finite_works}" = xyes; then AC_DEFINE(HAVE_WORKING_FINITE, 1, [Define if finite() is correct for -Inf/NaN/Inf.]) fi ])# R_FUNC_FINITE ## R_FUNC_ISFINITE ## --------------- AC_DEFUN([R_FUNC_ISFINITE], [AC_CACHE_CHECK([for working isfinite], [r_cv_func_isfinite_works], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include "confdefs.h" int main () { #ifdef HAVE_DECL_ISFINITE exit(isfinite(1./0.) | isfinite(0./0.) | isfinite(-1./0.)); #else exit(1); #endif } ]])], [r_cv_func_isfinite_works=yes], [r_cv_func_isfinite_works=no], [r_cv_func_isfinite_works=no])]) if test "x${r_cv_func_isfinite_works}" = xyes; then AC_DEFINE(HAVE_WORKING_ISFINITE, 1, [Define if isfinite() is correct for -Inf/NaN/Inf.]) fi ])# R_FUNC_ISFINITE ## R_FUNC_LOG ## ---------- AC_DEFUN([R_FUNC_LOG], [AC_CACHE_CHECK([for working log], [r_cv_func_log_works], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include "confdefs.h" int main () { /* we require isnan as from R 2.0.0 */ exit(!(log(0.) == -1. / 0. && isnan(log(-1.)))); } ]])], [r_cv_func_log_works=yes], [r_cv_func_log_works=no], [r_cv_func_log_works=no])]) if test "x${r_cv_func_log_works}" = xyes; then AC_DEFINE(HAVE_WORKING_LOG, 1, [Define if log() is correct for 0/-1.]) RMATH_HAVE_WORKING_LOG="# define HAVE_WORKING_LOG 1" else RMATH_HAVE_WORKING_LOG="# undef HAVE_WORKING_LOG" fi AC_SUBST(RMATH_HAVE_WORKING_LOG) ])# R_FUNC_LOG ## R_FUNC_LOG1P ## ------------ ## Suggested by Nelson H. F. Beebe to deal with ## inaccuracies on at least NetBSD 1.6 and OpenBSD 3.2. ## However, don't test all the way into denormalized x (he had k > -1074) ## and at x = 2^-54 (d - x)/x is around 3e-17. AC_DEFUN([R_FUNC_LOG1P], [AC_CACHE_CHECK([for working log1p], [r_cv_func_log1p_works], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include "confdefs.h" int main () { #ifdef HAVE_LOG1P int k; double d; double x = 1.0; for(k = 0; k < 53; k++) x /= 2.0; /* log(1+x) = x - (1/2)x^2 + (1/3)x^3 - (1/4)x^4 ... */ /* = x for x sufficiently small */ for(k = -54; k > -1022; --k) { x /= 2.0; if(x == 0.0) exit(0); /* OK: reached underflow limit */ d = log1p(x); if(d == 0.0) exit(1); /* ERROR: inaccurate log1p() */ /* for large k, ((1/2)x^2)/x might appear in the guard digits */ if(k < -80 && d != x) exit(1); /* ERROR: inaccurate log1p() */ } exit(0); #else exit(1); #endif } ]])], [r_cv_func_log1p_works=yes], [r_cv_func_log1p_works=no], [r_cv_func_log1p_works=no])]) if test "x${r_cv_func_log1p_works}" = xyes; then AC_DEFINE(HAVE_WORKING_LOG1P, 1, [Define if log1p() exists and is accurate enough.]) RMATH_HAVE_WORKING_LOG1P="# define HAVE_WORKING_LOG1P 1" else RMATH_HAVE_WORKING_LOG1P="# undef HAVE_WORKING_LOG1P" fi AC_SUBST(RMATH_HAVE_WORKING_LOG1P) ])# R_FUNC_LOG1P ## R_FUNC_STRPTIME ## --------------- AC_DEFUN([R_FUNC_STRPTIME], [AC_CACHE_CHECK([for working strptime], [r_cv_func_strptime_works], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #if defined(HAVE_GLIBC2) && !defined(__USE_XOPEN) #define __USE_XOPEN #endif #include int main () { #ifdef HAVE_STRPTIME struct tm tm; char *p, *q, *p2; p = strptime("1960-01-01", "%Y-%m-%d", &tm); /* works on MacOS X */ p2 =strptime("1899-01-01", "%Y-%m-%d", &tm); /* but this one does not */ q = strptime("2003-02-40", "%Y-%m-%d", &tm); exit(p == 0 || p2 == 0 || q); #else exit(1); #endif } ]])], [r_cv_func_strptime_works=yes], [r_cv_func_strptime_works=no], [r_cv_func_strptime_works=no])]) if test "x${r_cv_func_strptime_works}" = xyes; then AC_DEFINE(HAVE_WORKING_STRPTIME, 1, [Define if strptime() exists, validates and does not fail pre-1970.]) fi ])# R_FUNC_STRPTIME ## R_FUNC_FTELL ## ------------ AC_DEFUN([R_FUNC_FTELL], [AC_CACHE_CHECK([whether ftell works correctly on files opened for append], [r_cv_working_ftell], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include main() { FILE *fp; int pos; fp = fopen("testit", "wb"); fwrite("0123456789\n", 11, 1, fp); fclose(fp); fp = fopen("testit", "ab"); pos = ftell(fp); fclose(fp); unlink("testit"); exit(pos != 11); } ]])], [r_cv_working_ftell=yes], [r_cv_working_ftell=no], [r_cv_working_ftell=no])]) if test "x${r_cv_working_ftell}" = xyes; then AC_DEFINE(HAVE_WORKING_FTELL, 1, [Define if your ftell works correctly on files opened for append.]) fi ])# R_FUNC_FTELL ### * Headers ## R_HEADER_SETJMP ## --------------- AC_DEFUN([R_HEADER_SETJMP], [AC_CACHE_CHECK([whether setjmp.h is POSIX.1 compatible], [r_cv_header_setjmp_posix], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [[#include ]], [[sigjmp_buf b; sigsetjmp(b, 0); siglongjmp(b, 1);]])], [r_cv_header_setjmp_posix=yes], [r_cv_header_setjmp_posix=no])]) AC_CHECK_DECLS([sigsetjmp, siglongjmp], , , [#include ]) if test "$ac_cv_have_decl_sigsetjmp" = no; then r_cv_header_setjmp_posix=no fi if test "$ac_cv_have_decl_siglongjmp" = no; then r_cv_header_setjmp_posix=no fi if test "${r_cv_header_setjmp_posix}" = yes; then AC_DEFINE(HAVE_POSIX_SETJMP, 1, [Define if you have POSIX.1 compatible sigsetjmp/siglongjmp.]) fi ])# R_HEADER_SETJMP ## R_HEADER_GLIBC2 ## --------------- AC_DEFUN([R_HEADER_GLIBC2], [AC_CACHE_CHECK([for GNU C library with version >= 2], [r_cv_header_glibc2], [AC_EGREP_CPP([yes], [#include #if defined __GLIBC__ && __GLIBC__ >= 2 yes #endif ], [r_cv_header_glibc2=yes], [r_cv_header_glibc2=no], [r_cv_header_glibc2=no]) ]) if test "${r_cv_header_glibc2}" = yes; then AC_DEFINE(HAVE_GLIBC2, 1, [Define if you have the GNU C library version >= 2. This is needed to fix a problem with getting the prototype of strptime().]) fi ])# R_HEADER_GLIBC2 ### * Types ## R_TYPE_SOCKLEN ## -------------- AC_DEFUN([R_TYPE_SOCKLEN], [AC_MSG_CHECKING([for type of socket length]) AC_CACHE_VAL([r_cv_type_socklen], [for t in socklen_t size_t int; do AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #ifdef HAVE_SYS_SOCKET_H # include #endif #ifdef Win32 # include #endif ]], [[(void)getsockopt (1, 1, 1, NULL, (${t} *)NULL)]])], [r_cv_type_socklen=${t}; break], [r_cv_type_socklen=]) done]) ## size_t works on Windows but is unsigned and int is correct case "${host_os}" in cygwin*|mingw*|windows*|winnt) r_cv_type_socklen=int ;; esac if test "x${r_cv_type_socklen}" = x; then warn_type_socklen="could not determine type of socket length" AC_MSG_WARN([${warn_type_socklen}]) else AC_MSG_RESULT([${r_cv_type_socklen} *]) fi AC_DEFINE_UNQUOTED(R_SOCKLEN_T, ${r_cv_type_socklen}, [Type for socket lengths: socklen_t, sock_t, int?]) ])# R_TYPE_SOCKLEN ## R_HAVE_KEYSYM ## ------------- ## Check whether X11/X.h has KeySym typedef-ed. AC_DEFUN([R_TYPE_KEYSYM], [AC_REQUIRE([R_X11]) if test "${use_X11}" = yes; then r_save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} ${X_CFLAGS}" AC_CHECK_TYPE([KeySym], r_cv_type_keysym=yes, r_cv_type_keysym=no, [#include ]) CFLAGS="${r_save_CFLAGS}" if test "${r_cv_type_keysym}" = yes; then AC_DEFINE(HAVE_KEYSYM, 1, [Define if you have KeySym defined in X11.]) fi fi])# R_TYPE_KEYSYM ### * System services ## R_X11 ## ----- AC_DEFUN([R_X11], [AC_PATH_XTRA # standard X11 search macro if test -z "${no_x}"; then ## We force the use of -lX11 (perhaps this is not necessary?). X_LIBS="${X_LIBS} -lX11 -lXt" use_X11="yes" AC_DEFINE(HAVE_X11, 1, [Define if you have the X11 headers and libraries, and want the X11 GUI to be built.]) r_save_LIBS=${LIBS} if test "$want_utf8_support" == yes ; then LIBS="${LIBS} ${X_LIBS}" AC_CHECK_FUNCS(Xutf8DrawString Xutf8DrawImageString Xutf8LookupString \ Xutf8TextEscapement Xutf8TextExtents \ XmbDrawString XmbDrawImageString XmbLookupString \ XmbTextEscapement XmbTextExtents, , , [#include ]) LIBS=${r_save_LIBS} fi else use_X11="no" if test "x${with_x}" != "xno"; then AC_MSG_ERROR( [--with-x=yes (default) and X11 headers/libs are not available]) fi fi AC_MSG_RESULT([using X11 ... ${use_X11}]) ])# R_X11 # R_CHECK_FRAMEWORK(function, framework, # [action-if-found], [action-if-not-found], # [other-libs]) # generic check for a framework, a function should be supplied to # make sure the proper framework is found. # default action is to set have_..._fw to yes/no and to define # HAVE_..._FW if present AC_DEFUN([R_CHECK_FRAMEWORK], [ AC_CACHE_CHECK([for $1 in $2 framework], [r_check_fw_$2], r_check_fw_save_LIBS=$LIBS r_check_fw_$2=no LIBS="-framework $2 $5 $LIBS" AC_LINK_IFELSE([AC_LANG_CALL([],[$1])], [r_check_fw_$2="-framework $2"],[]) LIBS=$r_check_fw_save_LIBS AS_IF([test "$r_check_fw_$2" != no], [m4_default([$3], [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$2_FW), 1, [Defined if framework $2 is present]) AS_TR_SH(have_$2_fw)=yes])], [m4_default([$4], AS_TR_SH(have_$2_fw)=no)]) ) ])# R_CHECK_FRAMEWORK ## R_AQUA ## ------ AC_DEFUN([R_AQUA], [use_aqua=no if test "${want_aqua}" = yes; then case "${host_os}" in darwin*) ## we can build AQUA only with CoreFoundation, otherwise ## Quartz device won't build if test "${have_CoreFoundation_fw}" = yes; then use_aqua=yes fi ;; esac fi if test "${use_aqua}" = yes; then AC_DEFINE(HAVE_AQUA, 1, [Define if you have the Aqua headers and libraries, and want the Aqua GUI to be built.]) fi ])# R_AQUA ## R_IEEE_754 ## ---------- ## According to C99, isnan and isfinite are macros in math.h, ## but some older systems have isnan as a function (possibly as well). AC_DEFUN([R_IEEE_754], [AC_CHECK_FUNCS([isnan]) AC_CHECK_DECLS([isfinite, isnan], , , [#include ]) AC_CACHE_CHECK([whether you have IEEE 754 floating-point arithmetic], [r_cv_ieee_754], [if (test "${ac_cv_func_isnan}" = yes \ || test "${ac_cv_have_decl_isnan}" = yes); then r_cv_ieee_754=yes else r_cv_ieee_754=no fi]) if test "${r_cv_ieee_754}" = yes; then AC_DEFINE(IEEE_754, 1, [Define if you have IEEE 754 floating point arithmetic.]) else AC_MSG_ERROR([IEEE 754 floating-point arithmetic is required]) fi ])# R_IEEE_754 ## R_BSD_NETWORKING ## ---------------- AC_DEFUN([R_BSD_NETWORKING], [AC_CACHE_CHECK([for BSD networking], [r_cv_bsd_networking], [if test "${ac_cv_header_netdb_h}" = yes \ && test "${ac_cv_header_netinet_in_h}" = yes \ && test "${ac_cv_header_sys_socket_h}" = yes \ && test "${ac_cv_search_connect}" != no \ && test "${ac_cv_search_gethostbyname}" != no; then r_cv_bsd_networking=yes else r_cv_bsd_networking=no fi]) if test "${r_cv_bsd_networking}" = yes; then AC_DEFINE(HAVE_BSD_NETWORKING, 1, [Define if you have BSD networking headers and libraries.]) AC_DEFINE(HAVE_SOCKETS, 1, [Define if you have support for sockets.]) AC_DEFINE(HAVE_INTERNET, 1, [Define if you have support for ftp/http access.]) AC_DEFINE(SUPPORT_LIBXML, 1, [Define if you provide support for the libxml ftp/http functions.]) fi ])# R_BSD_NETWORKING ## R_BITMAPS ## --------- ## Here we only need any old -lz, and don't need zlib.h. ## However, we do need recent enough libpng and jpeg, and so check both ## the header versions and for key routines in the library. ## The png code will do a run-time check of the consistency of libpng ## versions. AC_DEFUN([R_BITMAPS], [BITMAP_LIBS= if test "${use_jpeglib}" = yes; then _R_HEADER_JPEGLIB have_jpeg=${r_cv_header_jpeglib_h} if test "${have_jpeg}" = yes; then AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [have_jpeg=yes], [have_jpeg=no], [${LIBS}]) fi if test "${have_jpeg}" = yes; then BITMAP_LIBS="-ljpeg" AC_DEFINE(HAVE_JPEG, 1, [Define if you have the JPEG headers and libraries.]) fi fi if test "${use_libpng}" = yes; then AC_CHECK_LIB(z, main, [have_png=yes], [have_png=no]) if test "${have_png}" = yes; then _R_HEADER_PNG have_png=${r_cv_header_png_h} fi if test "${have_png}" = yes; then AC_CHECK_LIB(png, png_create_write_struct, [have_png=yes], [have_png=no], [-lz ${LIBS}]) fi if test "${have_png}" = yes; then BITMAP_LIBS="${BITMAP_LIBS} -lpng -lz" AC_DEFINE(HAVE_PNG, 1, [Define if you have the PNG headers and libraries.]) fi fi AC_SUBST(BITMAP_LIBS) ])# R_BITMAPS ## _R_HEADER_JPEGLIB ## ----------------- ## Set shell variable r_cv_header_jpeglib_h to 'yes' if a recent enough ## jpeglib.h is found, and to 'no' otherwise. AC_DEFUN([_R_HEADER_JPEGLIB], [AC_CACHE_CHECK([if jpeglib version >= 6b], [r_cv_header_jpeglib_h], AC_EGREP_CPP([yes], [#include #if (JPEG_LIB_VERSION >= 62) yes #endif ], [r_cv_header_jpeglib_h=yes], [r_cv_header_jpeglib_h=no])) ])# _R_HEADER_JPEGLIB ## _R_HEADER_PNG ## ------------- ## Set shell variable r_cv_header_png_h to 'yes' if a recent enough ## 'png.h' is found, and to 'no' otherwise. AC_DEFUN([_R_HEADER_PNG], [AC_CACHE_CHECK([if libpng version >= 1.0.5], [r_cv_header_png_h], AC_EGREP_CPP([yes], [#include #if (PNG_LIBPNG_VER >= 10005) yes #endif ], [r_cv_header_png_h=yes], [r_cv_header_png_h=no])) ])# _R_HEADER_PNG ## _R_PATH_TCL_CONFIG ## ------------------ ## Try finding tclConfig.sh in common library directories and their ## tcl$x.$y subdirectories. Set shell variable r_cv_path_TCL_CONFIG ## to the entire path of the script if found, and leave it empty ## otherwise. AC_DEFUN([_R_PATH_TCL_CONFIG], [AC_MSG_CHECKING([for tclConfig.sh in library (sub)directories]) AC_CACHE_VAL([r_cv_path_TCL_CONFIG], [for ldir in /opt/lib /sw/lib /usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib /lib64 /lib ; do for dir in \ ${ldir} \ `ls -d ${ldir}/tcl[[8-9]].[[0-9]]* 2>/dev/null | sort -r`; do if test -f ${dir}/tclConfig.sh; then r_cv_path_TCL_CONFIG="${dir}/tclConfig.sh" break 2 fi done done]) if test -n "${r_cv_path_TCL_CONFIG}"; then AC_MSG_RESULT([${r_cv_path_TCL_CONFIG}]) else AC_MSG_RESULT([no]) fi ])# _R_PATH_TCL_CONFIG ## _R_PATH_TK_CONFIG ## ------------------ ## Try finding tkConfig.sh in common library directories and their ## tk$x.$y subdirectories. Set shell variable r_cv_path_TK_CONFIG ## to the entire path of the script if found, and leave it empty ## otherwise. AC_DEFUN([_R_PATH_TK_CONFIG], [AC_MSG_CHECKING([for tkConfig.sh in library (sub)directories]) AC_CACHE_VAL([r_cv_path_TK_CONFIG], [for ldir in /opt/lib /sw/lib /usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib /lib64 /lib ; do for dir in \ ${ldir} \ `ls -d ${ldir}/tk[[8-9]].[[0-9]]* 2>/dev/null | sort -r`; do if test -f ${dir}/tkConfig.sh; then r_cv_path_TK_CONFIG="${dir}/tkConfig.sh" break 2 fi done done]) if test -n "${r_cv_path_TK_CONFIG}"; then AC_MSG_RESULT([${r_cv_path_TK_CONFIG}]) else AC_MSG_RESULT([no]) fi ])# _R_PATH_TK_CONFIG ## _R_TCLTK_CONFIG ## --------------- ## Try finding the tclConfig.sh and tkConfig.sh scripts in PATH as well ## as in common library directories and their tcl/tk subdirectories. ## Set shell variables TCL_CONFIG and TK_CONFIG to the entire paths to ## the scripts if found and check that the corresponding Tcl/Tk versions ## are at least 8; if not, set shell variable have_tcltk to 'no'. AC_DEFUN([_R_TCLTK_CONFIG], [AC_PATH_PROGS(TCL_CONFIG, [${TCL_CONFIG} tclConfig.sh]) if test -z "${TCL_CONFIG}"; then _R_PATH_TCL_CONFIG if test -n "${r_cv_path_TCL_CONFIG}"; then TCL_CONFIG="${r_cv_path_TCL_CONFIG}" fi fi AC_PATH_PROGS(TK_CONFIG, [${TK_CONFIG} tkConfig.sh]) if test -z "${TK_CONFIG}"; then _R_PATH_TK_CONFIG if test -n "${r_cv_path_TK_CONFIG}"; then TK_CONFIG="${r_cv_path_TK_CONFIG}" fi fi if test -z "${TCLTK_CPPFLAGS}" \ || test -z "${TCLTK_LIBS}"; then ## Check whether the versions found via the *Config.sh files are at ## least 8; otherwise, issue a warning and turn off Tcl/Tk support. ## Note that in theory a system could have outdated versions of the ## *Config.sh scripts and yet up-to-date installations of Tcl/Tk in ## standard places ... if test -n "${TCL_CONFIG}"; then . ${TCL_CONFIG} if test ${TCL_MAJOR_VERSION} -lt 8; then warn_tcltk_version="Tcl/Tk support requires Tcl version >= 8" AC_MSG_WARN([${warn_tcltk_version}]) have_tcltk=no fi fi if test -n "${TK_CONFIG}" \ && test -z "${warn_tcltk_version}"; then . ${TK_CONFIG} if test ${TK_MAJOR_VERSION} -lt 8; then warn_tcltk_version="Tcl/Tk support requires Tk version >= 8" AC_MSG_WARN([${warn_tcltk_version}]) have_tcltk=no fi fi if test -n "${TCL_CONFIG}" \ && test -n "${TK_CONFIG}" \ && test -z "${warn_tcltk_version}"; then if test ${TCL_MAJOR_VERSION} -ne ${TK_MAJOR_VERSION} \ || test ${TCL_MINOR_VERSION} -ne ${TK_MINOR_VERSION}; then warn_tcltk_version="Tcl and Tk major or minor versions disagree" AC_MSG_WARN([${warn_tcltk_version}]) have_tcltk=no fi fi fi ])# _R_TCLTK_CONFIG ## _R_HEADER_TCL ## ------------- ## Set shell variable 'r_cv_header_tcl_h' to 'yes' if a recent enough ## 'tcl.h' is found, and to 'no' otherwise. AC_DEFUN([_R_HEADER_TCL], [AC_CACHE_CHECK([for tcl.h], [r_cv_header_tcl_h], [AC_EGREP_CPP([yes], [#include #if (TCL_MAJOR_VERSION >= 8) yes #endif ], [r_cv_header_tcl_h=yes], [r_cv_header_tcl_h=no])]) ])# _R_HEADER_TCL ## _R_HEADER_TK ## ------------- ## Set shell variable 'r_cv_header_tk_h' to 'yes' if a recent enough ## 'tk.h' is found, and to 'no' otherwise. AC_DEFUN([_R_HEADER_TK], [AC_CACHE_CHECK([for tk.h], [r_cv_header_tk_h], [AC_EGREP_CPP([yes], [#include #if (TK_MAJOR_VERSION >= 8) yes #endif ], [r_cv_header_tk_h=yes], [r_cv_header_tk_h=no])]) ])# _R_HEADER_TK ## _R_TCLTK_CPPFLAGS ## ----------------- ## Need to ensure that we can find the tcl.h and tk.h headers, which ## may be in non-standard and/or version-dependent directories, such as ## on FreeBSD systems. ## ## The logic is as follows. If TCLTK_CPPFLAGS was specified, then we ## do not investigate any further. Otherwise, if we still think we ## have Tcl/Tk, then first try via the corresponding *Config.sh file, ## or else try the obvious. AC_DEFUN([_R_TCLTK_CPPFLAGS], [AC_REQUIRE([_R_TCLTK_CONFIG]) if test -z "${TCLTK_CPPFLAGS}"; then ## We have to do the work. if test "${have_tcltk}" = yes; then ## Part 1. Check for tcl.h. found_tcl_h=no if test -n "${TCL_CONFIG}"; then . ${TCL_CONFIG} ## Look for tcl.h in ## ${TCL_PREFIX}/include/tcl${TCL_VERSION} ## ${TCL_PREFIX}/include ## Also look in ## ${TCL_PREFIX}/include/tcl${TCL_VERSION}/generic ## to deal with current FreeBSD layouts. These also link the real ## thing to the version subdir, but the link cannot be used as it ## fails to include 'tclDecls.h' which is not linked. Hence we ## must look for the real thing first. Argh ... for dir in \ ${TCL_PREFIX}/include/tcl${TCL_VERSION}/generic \ ${TCL_PREFIX}/include/tcl${TCL_VERSION} \ ${TCL_PREFIX}/include; do AC_CHECK_HEADER([${dir}/tcl.h], [TCLTK_CPPFLAGS="-I${dir}" found_tcl_h=yes break]) done fi if test "${found_tcl_h}" = no; then _R_HEADER_TCL if test "${r_cv_header_tcl_h}" = yes; then found_tcl_h=yes else have_tcltk=no fi fi fi if test "${have_tcltk}" = yes; then ## Part 2. Check for tk.h. found_tk_h=no if test -n "${TK_CONFIG}"; then . ${TK_CONFIG} ## Look for tk.h in ## ${TK_PREFIX}/include/tk${TK_VERSION} ## ${TK_PREFIX}/include ## Also look in ## ${TK_PREFIX}/include/tcl${TK_VERSION} ## to compensate for Debian madness ... ## Also look in ## ${TK_PREFIX}/include/tk${TK_VERSION}/generic ## to deal with current FreeBSD layouts. See above for details. ## ## As the AC_CHECK_HEADER test tries including the header file and ## tk.h includes tcl.h and X11/Xlib.h, we need to change CPPFLAGS ## for the check. r_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${CPPFLAGS} ${TK_XINCLUDES} ${TCLTK_CPPFLAGS}" for dir in \ ${TK_PREFIX}/include/tk${TK_VERSION}/generic \ ${TK_PREFIX}/include/tk${TK_VERSION} \ ${TK_PREFIX}/include/tcl${TK_VERSION} \ ${TK_PREFIX}/include; do AC_CHECK_HEADER([${dir}/tk.h], [TCLTK_CPPFLAGS="${TCLTK_CPPFLAGS} -I${dir}" found_tk_h=yes break]) done CPPFLAGS="${r_save_CPPFLAGS}" fi if test "${found_tk_h}" = no; then _R_HEADER_TK if test "{r_cv_header_tk_h}" = yes; then found_tk_h=yes else have_tcltk=no fi fi fi fi if test "${have_tcltk}" = yes; then if test -n "${TK_XINCLUDES}"; then TCLTK_CPPFLAGS="${TCLTK_CPPFLAGS} ${TK_XINCLUDES}" else TCLTK_CPPFLAGS="${TCLTK_CPPFLAGS} ${X_CFLAGS}" fi fi ])# _R_TCLTK_CPPFLAGS ## _R_TCLTK_LIBS ## ------------- ## Find the tcl and tk libraries. AC_DEFUN([_R_TCLTK_LIBS], [AC_REQUIRE([AC_PATH_XTRA]) AC_REQUIRE([_R_TCLTK_CONFIG]) if test -z "${TCLTK_LIBS}"; then ## We have to do the work. if test "${have_tcltk}" = yes; then ## Part 1. Try finding the tcl library. if test -n "${TCL_CONFIG}"; then . ${TCL_CONFIG} TCLTK_LIBS="${TCL_LIB_SPEC}" else AC_CHECK_LIB(tcl, Tcl_CreateInterp, [TCLTK_LIBS=-ltcl], [have_tcltk=no]) fi fi if test "${have_tcltk}" = yes; then ## Part 2. Try finding the tk library. if test -n "${TK_CONFIG}"; then . ${TK_CONFIG} TCLTK_LIBS="${TCLTK_LIBS} ${TK_LIB_SPEC} ${TK_XLIBSW}" else AC_CHECK_LIB(tk, Tk_Init, , , [${TCLTK_LIBS}]) if test "${ac_cv_lib_tk_Tk_Init}" = no; then ## Grr, simple -ltk does not work. ## But maybe we simply need to add X11 libs. ## Note that we cannot simply repeat the above test with extra ## libs, because AC_CHECK_LIB uses the corresponding cache var ## (ac_cv_lib_tk_Tk_Init in our case) if set. As using unset ## is not portable shell programming according to the Autoconf ## docs, we use Tk_SafeInit in the test with X11 libs added. AC_CHECK_LIB(tk, Tk_SafeInit, [TCLTK_LIBS="${TCLTK_LIBS} -ltk ${X_LIBS}"], [have_tcltk=no], [${TCLTK_LIBS} ${X_LIBS}]) fi fi fi ## Postprocessing for AIX. ## On AIX, the *_LIB_SPEC variables need to contain '-bI:' flags for ## the Tcl export file. These are really flags for ld rather than the ## C/C++ compilers, and hence may need protection via '-Wl,'. ## We have two ways of doing that: ## * Recording whether '-Wl,' is needed for the C or C++ compilers, ## and getting this info into the TCLTK_LIBS make variable ... mess! ## * Protecting all entries in TCLTK_LIBS that do not start with '-l' ## or '-L' with '-Wl,' (hoping that all compilers understand this). ## Easy, hence ... case "${host_os}" in aix*) orig_TCLTK_LIBS="${TCLTK_LIBS}" TCLTK_LIBS= for flag in ${orig_TCLTK_LIBS}; do case "${flag}" in -l*|-L*|-Wl,*) ;; *) flag="-Wl,${flag}" ;; esac TCLTK_LIBS="${TCLTK_LIBS} ${flag}" done ;; esac ## Force evaluation ('-ltcl8.3${TCL_DBGX}' and friends ...). eval "TCLTK_LIBS=\"${TCLTK_LIBS}\"" fi ])# _R_TCLTK_LIBS ## _R_TCLTK_WORKS ## -------------- ## Check whether compiling and linking code using Tcl/Tk works. ## Set shell variable r_cv_tcltk_works to 'yes' or 'no' accordingly. AC_DEFUN([_R_TCLTK_WORKS], [AC_CACHE_CHECK([whether compiling/linking Tcl/Tk code works], [r_cv_tcltk_works], [AC_LANG_PUSH(C) r_save_CPPFLAGS="${CPPFLAGS}" r_save_LIBS="${LIBS}" CPPFLAGS="${CPPFLAGS} ${TCLTK_CPPFLAGS}" LIBS="${LIBS} ${TCLTK_LIBS}" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include #include ]], [[static char * p1 = (char *) Tcl_Init; static char * p2 = (char *) Tk_Init; ]])], r_cv_tcltk_works=yes, r_cv_tcltk_works=no) CPPFLAGS="${r_save_CPPFLAGS}" LIBS="${r_save_LIBS}" AC_LANG_POP(C)]) ])# _R_TCLTK_WORKS ## R_TCLTK ## ------- AC_DEFUN([R_TCLTK], [if test "${want_tcltk}" = yes; then have_tcltk=yes ## (Note that the subsequent 3 macros assume that have_tcltk has been ## set appropriately.) _R_TCLTK_CONFIG _R_TCLTK_CPPFLAGS _R_TCLTK_LIBS if test "${have_tcltk}" = yes; then _R_TCLTK_WORKS have_tcltk=${r_cv_tcltk_works} fi else have_tcltk=no ## Just making sure. TCLTK_CPPFLAGS= TCLTK_LIBS= fi if test "${have_tcltk}" = yes; then AC_DEFINE(HAVE_TCLTK, 1, [Define if you have the Tcl/Tk headers and libraries and want Tcl/Tk support to be built.]) use_tcltk=yes else use_tcltk=no fi AC_SUBST(TCLTK_CPPFLAGS) AC_SUBST(TCLTK_LIBS) AC_SUBST(use_tcltk) ])# R_TCLTK ## R_BLAS_LIBS ## ----------- ## Look for a library that implements the BLAS linear-algebra interface ## (see http://www.netlib.org/blas/). On success, sets BLAS_LIBS to the ## requisite library linkages. ## ## This is based on ACX_BLAS by Steven G. Johnson ## from the Official Autoconf Macro Archive ## (http://www.gnu.org/software/ac-archive/htmldoc/acx_blas.m4), ## with the following changes: ## * We also handle HPUX .sl command line specifications. ## * We explictly deal with the case of f2c. Most likely pointless. ## * We only care about the Fortran 77 interface to Atlas, hence do not ## test for -lcblas. ## * We do not use BLAS libs that caused problems in the past: Alpha ## CXML and DXML, and SGI SCSL and SGIMATH (marked with COMMENT tags). ## * As we link with $BLAS_LIBS $FLIBS $LIBS (in that order), we use the ## same order in the tests. ## * We do not use ACTION-IF-FOUND and ACTION-IF-NOT-FOUND. ## The sunperf test calls the library as now required. ## Based on acx_blas.m4 version 1.2 (2001-12-13) AC_DEFUN([R_BLAS_LIBS], [AC_REQUIRE([R_PROG_F77_FLIBS]) AC_REQUIRE([R_PROG_F77_APPEND_UNDERSCORE]) acx_blas_ok=no case "${with_blas}" in yes | "") ;; no) acx_blas_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.sl | *.sl.* | *.o) BLAS_LIBS="${with_blas}" ;; *) BLAS_LIBS="-l${with_blas}" ;; esac if test "${r_cv_prog_f77_append_underscore}" = yes; then dgemm=dgemm_ sgemm=sgemm_ xerbla=xerbla_ else dgemm=dgemm sgemm=sgemm xerbla=xerbla fi acx_blas_save_LIBS="${LIBS}" LIBS="${FLIBS} ${LIBS}" ## First, check BLAS_LIBS environment variable if test "${acx_blas_ok}" = no; then if test "x${BLAS_LIBS}" != x; then r_save_LIBS="${LIBS}"; LIBS="${BLAS_LIBS} ${LIBS}" AC_MSG_CHECKING([for ${dgemm} in ${BLAS_LIBS}]) AC_TRY_LINK([void ${xerbla}(char *srname, int *info){}], ${dgemm}(), [acx_blas_ok=yes], [BLAS_LIBS=""]) AC_MSG_RESULT([${acx_blas_ok}]) LIBS="${r_save_LIBS}" fi fi ## BLAS linked to by default? (happens on some supercomputers) if test "${acx_blas_ok}" = no; then AC_CHECK_FUNC(${dgemm}, [acx_blas_ok=yes]) fi ## BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) if test "${acx_blas_ok}" = no; then AC_CHECK_LIB(atlas, ATL_xerbla, [AC_CHECK_LIB(f77blas, ${dgemm}, [acx_blas_ok=yes BLAS_LIBS="-lf77blas -latlas"], [], [-latlas])]) fi ## BLAS in PhiPACK libraries? (requires generic BLAS lib, too) if test "${acx_blas_ok}" = no; then AC_CHECK_LIB(blas, ${dgemm}, [AC_CHECK_LIB(dgemm, $dgemm, [AC_CHECK_LIB(sgemm, ${sgemm}, [acx_blas_ok=yes BLAS_LIBS="-lsgemm -ldgemm -lblas"], [], [-lblas])], [], [-lblas])]) fi ## ## ## BLAS in Alpha CXML library? ## if test "${acx_blas_ok}" = no; then ## AC_CHECK_LIB(cxml, ${sgemm}, ## [acx_blas_ok=yes; BLAS_LIBS="-lcxml"]) ## fi ## ## ## # BLAS in Alpha DXML library? (now called CXML, see above) ## if test "${acx_blas_ok}" = no; then ## AC_CHECK_LIB(dxml, ${sgemm}, ## [acx_blas_ok=yes; BLAS_LIBS="-ldxml"]) ## fi ## ## BLAS in Sun Performance library? ## Some versions require -xlic_lib=sunperf: -lsunperf will not work ## Not sure whether -lsunmath is required, but it helps anyway if test "${acx_blas_ok}" = no; then if test "x$GCC" != xyes; then # only works with Sun CC AC_MSG_CHECKING([for ${dgemm} in -lsunperf]) r_save_LIBS="${LIBS}" LIBS="-xlic_lib=sunperf -lsunmath ${LIBS}" AC_TRY_LINK_FUNC([${dgemm}], [R_sunperf=yes], [R_sunperf=no]) if test "${R_sunperf}" = yes; then BLAS_LIBS="-xlic_lib=sunperf -lsunmath" acx_blas_ok=yes fi LIBS="${r_save_LIBS}" AC_MSG_RESULT([${acx_blas_ok}]) fi fi ## ## ## BLAS in SCSL library? (SGI/Cray Scientific Library) ## if test "${acx_blas_ok}" = no; then ## AC_CHECK_LIB(scs, ${sgemm}, ## [acx_blas_ok=yes; BLAS_LIBS="-lscs"]) ## fi ## ## ## ## BLAS in SGIMATH library? ## if test "${acx_blas_ok}" = no; then ## AC_CHECK_LIB(complib.sgimath, ${sgemm}, ## [acx_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"]) ## fi ## ## BLAS in IBM ESSL library? (requires generic BLAS lib, too) if test "${acx_blas_ok}" = no; then AC_CHECK_LIB(blas, ${dgemm}, [AC_CHECK_LIB(essl, ${dgemm}, [acx_blas_ok=yes BLAS_LIBS="-lessl -lblas"], [], [-lblas ${FLIBS}])]) fi ## Generic BLAS library? if test "${acx_blas_ok}" = no; then AC_CHECK_LIB(blas, ${dgemm}, [acx_blas_ok=yes; BLAS_LIBS="-lblas"]) fi ## Now check if zdotu works (fails on AMD64 with the wrong compiler; ## also fails on OS X with vecLib and gfortran; but in that case we ## have a work-around using USE_VECLIB_G95FIX) if test "${acx_blas_ok}" = yes; then AC_MSG_CHECKING([whether double complex BLAS can be used]) AC_CACHE_VAL([r_cv_zdotu_is_usable], [cat > conftestf.f < 1.0d-10) then iflag = 1 else iflag = 0 endif end EOF ${F77} ${FFLAGS} -c conftestf.f 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ## Yes we need to double quote this ... [cat > conftest.c < #include "confdefs.h" #ifdef HAVE_F77_UNDERSCORE # define F77_SYMBOL(x) x ## _ #else # define F77_SYMBOL(x) x #endif extern void F77_SYMBOL(test1)(int *iflag); int main () { int iflag; F77_SYMBOL(test1)(&iflag); exit(iflag); } EOF] if ${CC} ${CFLAGS} -c conftest.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then ## ## This should really use MAIN_LD, and hence come after this is ## determined (and necessary additions to MAIN_LDFLAGS were made). ## But it seems that we currently can always use the C compiler. ## Also, to be defensive there should be a similar test with SHLIB_LD ## and SHLIB_LDFLAGS (and note that on HPUX with native cc we have to ## use ld for SHLIB_LD) ... if ${CC} ${LDFLAGS} ${MAIN_LDFLAGS} -o conftest${ac_exeext} \ conftest.${ac_objext} conftestf.${ac_objext} ${FLIBS} \ ${LIBM} ${BLAS_LIBS} 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; ## then ## redirect error messages to config.log output=`./conftest${ac_exeext} 2>&AS_MESSAGE_LOG_FD` if test ${?} = 0; then r_cv_zdotu_is_usable=yes fi fi fi ]) rm -rf conftest conftest.* conftestf.* core if test -n "${r_cv_zdotu_is_usable}"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) if test "${have_vecLib_fw}" = "yes"; then ## for vecLib we have a work-around by using cblas_..._sub use_veclib_g95fix=yes ## The fix may not work with internal lapack, because ## the lapack dylib won't have the fixed functions. ## those are available to the lapack module only. # use_lapack=yes # with_lapack="" else BLAS_LIBS= acx_blas_ok="no" fi fi fi if test "${acx_blas_ok}" = yes; then AC_MSG_CHECKING([whether the BLAS is complete]) AC_CACHE_VAL([r_cv_complete_blas], [[cat > conftest.c < #include "confdefs.h" #ifdef HAVE_F77_UNDERSCORE # define F77_SYMBOL(x) x ## _ #else # define F77_SYMBOL(x) x #endif void F77_SYMBOL(xerbla)(char *srname, int *info) {} void blas_set () { F77_SYMBOL(dasum)(); F77_SYMBOL(daxpy)(); F77_SYMBOL(dcopy)(); F77_SYMBOL(ddot)(); F77_SYMBOL(dgbmv)(); F77_SYMBOL(dgemm)(); F77_SYMBOL(dgemv)(); F77_SYMBOL(dger)(); F77_SYMBOL(dnrm2)(); F77_SYMBOL(drot)(); F77_SYMBOL(drotg)(); F77_SYMBOL(drotm)(); F77_SYMBOL(drotmg)(); F77_SYMBOL(dsbmv)(); F77_SYMBOL(dscal)(); F77_SYMBOL(dspmv)(); F77_SYMBOL(dspr)(); F77_SYMBOL(dspr2)(); F77_SYMBOL(dspmv)(); F77_SYMBOL(dsymm)(); F77_SYMBOL(dsymv)(); F77_SYMBOL(dsyr)(); F77_SYMBOL(dsyr2)(); F77_SYMBOL(dsyr2k)(); F77_SYMBOL(dsyrk)(); F77_SYMBOL(dtbmv)(); F77_SYMBOL(dtrsm)(); F77_SYMBOL(idamax)(); /* F77_SYMBOL(lsame)(); */ F77_SYMBOL(dcabs1)(); F77_SYMBOL(dgemv)(); F77_SYMBOL(dger)(); F77_SYMBOL(dsymv)(); F77_SYMBOL(dsyr2)(); F77_SYMBOL(dsyr2k)(); F77_SYMBOL(dsyrk)(); F77_SYMBOL(dtbmv)(); F77_SYMBOL(dtbsv)(); F77_SYMBOL(dtpmv)(); F77_SYMBOL(dtpsv)(); F77_SYMBOL(dtrmm)(); F77_SYMBOL(dtrmv)(); F77_SYMBOL(dtrsv)(); F77_SYMBOL(dtrsm)(); F77_SYMBOL(dtrsv)(); /* cmplblas */ F77_SYMBOL(dzasum)(); F77_SYMBOL(dznrm2)(); F77_SYMBOL(izamax)(); F77_SYMBOL(zaxpy)(); F77_SYMBOL(zcopy)(); F77_SYMBOL(zdotc)(); F77_SYMBOL(zdotu)(); F77_SYMBOL(zdrot)(); F77_SYMBOL(zdscal)(); F77_SYMBOL(zgbmv)(); F77_SYMBOL(zgemm)(); F77_SYMBOL(zgemv)(); F77_SYMBOL(zgerc)(); F77_SYMBOL(zgeru)(); F77_SYMBOL(zhbmv)(); F77_SYMBOL(zhemm)(); F77_SYMBOL(zhemv)(); F77_SYMBOL(zher)(); F77_SYMBOL(zherk)(); F77_SYMBOL(zher2)(); F77_SYMBOL(zher2k)(); F77_SYMBOL(zhpmv)(); F77_SYMBOL(zhpr)(); F77_SYMBOL(zhpr2)(); F77_SYMBOL(zrotg)(); F77_SYMBOL(zscal)(); F77_SYMBOL(zswap)(); F77_SYMBOL(zsymm)(); F77_SYMBOL(zsyr2k)(); F77_SYMBOL(zsyrk)(); F77_SYMBOL(ztbmv)(); F77_SYMBOL(ztbsv)(); F77_SYMBOL(ztpmv)(); F77_SYMBOL(ztpsv)(); F77_SYMBOL(ztrmm)(); F77_SYMBOL(ztrmv)(); F77_SYMBOL(ztrsm)(); F77_SYMBOL(ztrsv)(); } int main () { exit(0); } EOF] if ${CC} ${CFLAGS} -c conftest.c 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then ## ## This should really use MAIN_LD, and hence come after this is ## determined (and necessary additions to MAIN_LDFLAGS were made). ## But it seems that we currently can always use the C compiler. ## Also, to be defensive there should be a similar test with SHLIB_LD ## and SHLIB_LDFLAGS (and note that on HPUX with native cc we have to ## use ld for SHLIB_LD) ... if ${CC} ${LDFLAGS} ${MAIN_LDFLAGS} -o conftest${ac_exeext} \ conftest.${ac_objext} ${FLIBS} \ ${LIBM} ${BLAS_LIBS} 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; ## then r_cv_complete_blas=yes fi fi ]) if test x"${r_cv_complete_blas}" != xyes; then acx_blas_ok="no" r_cv_complete_blas=no BLAS_LIBS="" fi AC_MSG_RESULT([${r_cv_complete_blas}]) fi LIBS="${acx_blas_save_LIBS}" AC_SUBST(BLAS_LIBS) ])# R_BLAS_LIBS ## R_LAPACK_LIBS ## ------------- ## Look for a library that implements LAPACK (see ## http://www.netlib.org/lapack/). On success, sets LAPACK_LIBS to the ## requisite library linkages. Only used by the lapack module at ## present. ## ## This is roughly based on ACX_LAPACK by Steven G. Johnson ## from the Official Autoconf Macro Archive ## (http://www.gnu.org/software/ac-archive/htmldoc/acx_lapack.m4), ## with the following changes: ## * We also handle HPUX .sl command line specifications. ## * We explictly deal with the case of f2c. Most likely pointless. ## * We test for a LAPACK_LIBS environment variable after checking ## whether LAPACK is already linked (see below). ## * We do not test for the generic lapack_rs6k library (why not?). ## * As we link with $LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS (in that ## order), we use the same order in the tests. ## * We do not use ACTION-IF-FOUND and ACTION-IF-NOT-FOUND. ## Note that Debian ATLAS has LAPACK libs in /usr/lib/atlas (or $arch ## variants) which should be used if ATLAS is used for BLAS, and not ## found at configure time but used at run time ... ## Note also that (see R-admin) that our main intention is to allow a ## LAPACK-containing BLAS to be used ... there are too many slow or ## broken LAPACKs out there. ## Based on acx_lapack.m4 version 1.3 (2002-03-12). AC_DEFUN([R_LAPACK_LIBS], [AC_REQUIRE([R_PROG_F77_FLIBS]) AC_REQUIRE([R_PROG_F77_APPEND_UNDERSCORE]) AC_REQUIRE([R_BLAS_LIBS]) acx_lapack_ok=no case "${with_lapack}" in yes | "") ;; no) acx_lapack_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.sl | *.sl.* | *.o) LAPACK_LIBS="${with_lapack}" ;; *) LAPACK_LIBS="-l${with_lapack}" ;; esac if test "${r_cv_prog_f77_append_underscore}" = yes; then zgeev=zgeev_ else zgeev=zgeev fi # We cannot use LAPACK if BLAS is not found if test "x${acx_blas_ok}" != xyes; then acx_lapack_ok=noblas fi acx_lapack_save_LIBS="${LIBS}" LIBS="${BLAS_LIBS} ${FLIBS} ${LIBS}" ## LAPACK linked to by default? (Could be in the BLAS libs.) if test "${acx_lapack_ok}" = no; then AC_CHECK_FUNC(${zgeev}, [acx_lapack_ok=yes]) fi ## Next, check LAPACK_LIBS environment variable if test "${acx_lapack_ok}" = no; then if test "x${LAPACK_LIBS}" != x; then r_save_LIBS="${LIBS}"; LIBS="${LAPACK_LIBS} ${LIBS}" AC_MSG_CHECKING([for ${zgeev} in ${LAPACK_LIBS}]) AC_TRY_LINK_FUNC(${zgeev}, [acx_lapack_ok=yes], [LAPACK_LIBS=""]) AC_MSG_RESULT([${acx_lapack_ok}]) LIBS="${r_save_LIBS}" fi fi ## LAPACK in Sun Performance library? ## No longer test here as will be picked up by the default test. ## Generic LAPACK library? if test "${acx_lapack_ok}" = no; then AC_CHECK_LIB(lapack, ${zgeev}, [acx_lapack_ok=yes; LAPACK_LIBS="-llapack"]) fi LIBS="${acx_lapack_save_LIBS}" AC_SUBST(LAPACK_LIBS) ])# R_LAPACK_LIBS ## R_XDR ## ----- ## Try finding XDR library functions and headers. ## FreeBSD in particular needs rpc/types.h before rpc/xdr.h. AC_DEFUN([R_XDR], [AC_CHECK_HEADER(rpc/types.h) if test "${ac_cv_header_rpc_types_h}" = yes ; then AC_CHECK_HEADER(rpc/xdr.h, , , [#include ]) fi AC_CACHE_CHECK([for XDR support], [r_cv_xdr], [if test "${ac_cv_header_rpc_types_h}" = yes \ && test "${ac_cv_header_rpc_xdr_h}" = yes \ && test "${ac_cv_search_xdr_string}" != no ; then r_cv_xdr=yes else r_cv_xdr=no fi ]) AM_CONDITIONAL(BUILD_XDR, [test "x${r_cv_xdr}" = xno]) ])# R_XDR ## R_ZLIB ## ------ ## Try finding zlib library and headers. ## We check that both are installed, and that the header >= 1.2.1 ## and that gzeof is in the library (which suggests the library ## is also recent enough). AC_DEFUN([R_ZLIB], [if test "x${use_system_zlib}" = xyes; then AC_CHECK_LIB(z, gzeof, [have_zlib=yes], [have_zlib=no]) if test "${have_zlib}" = yes; then AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no]) fi if test "${have_zlib}" = yes; then _R_HEADER_ZLIB have_zlib=${r_cv_header_zlib_h} fi else have_zlib="no" fi AC_MSG_CHECKING([whether zlib support needs to be compiled]) if test "${have_zlib}" = yes; then AC_MSG_RESULT([no]) LIBS="-lz ${LIBS}" else AC_MSG_RESULT([yes]) _R_ZLIB_MMAP fi AM_CONDITIONAL(BUILD_ZLIB, [test "x${have_zlib}" = xno]) AM_CONDITIONAL(USE_MMAP_ZLIB, [test "x${have_zlib}" = xno && test "x${r_cv_zlib_mmap}" = xyes]) ])# R_ZLIB ## _R_HEADER_ZLIB ## -------------- ## Set shell variable r_cv_header_zlib_h to 'yes' if a recent enough ## zlib.h is found, and to 'no' otherwise. AC_DEFUN([_R_HEADER_ZLIB], [AC_CACHE_CHECK([if zlib version >= 1.2.1], [r_cv_header_zlib_h], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include int main() { #ifdef ZLIB_VERSION exit(strcmp(ZLIB_VERSION, "1.2.1") < 0); #else exit(1); #endif } ]])], [r_cv_header_zlib_h=yes], [r_cv_header_zlib_h=no], [r_cv_header_zlib_h=no])]) ])# _R_HEADER_ZLIB ## _R_ZLIB_MMAP ## ------------ AC_DEFUN([_R_ZLIB_MMAP], [AC_CACHE_CHECK([mmap support for zlib], [r_cv_zlib_mmap], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include caddr_t hello() { exit(mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0)); } ]])], [r_cv_zlib_mmap=no], [r_cv_zlib_mmap=yes], [r_cv_zlib_mmap=yes])]) ])# _R_ZLIB_MMAP ## R_PCRE ## ------ ## Try finding pcre library and headers. ## RedHat puts the headers in /usr/include/pcre. AC_DEFUN([R_PCRE], [if test "x${use_system_pcre}" = xyes; then AC_CHECK_LIB(pcre, pcre_fullinfo, [have_pcre=yes], [have_pcre=no]) if test "${have_pcre}" = yes; then AC_CHECK_HEADERS(pcre.h pcre/pcre.h) if test "${ac_cv_header_pcre_h}" = no \ && test "${ac_cv_header_pcre_pcre_h}" = no; then have_pcre=no fi fi else have_pcre=no fi if test "x${have_pcre}" = xyes; then AC_CACHE_CHECK([if PCRE version >= 4.0], [r_have_pcre4], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #ifdef HAVE_PCRE_PCRE_H #include #else #ifdef HAVE_PCRE_H #include #endif #endif int main() { #ifdef PCRE_MAJOR exit(PCRE_MAJOR<4); #else exit(1); #endif } ]])], [r_have_pcre4=yes], [r_have_pcre4=no], [r_have_pcre4=no])]) fi if test "x${r_have_pcre4}" = xyes; then LIBS="-lpcre ${LIBS}" fi AC_MSG_CHECKING([whether PCRE support needs to be compiled]) if test "x${r_have_pcre4}" = xyes; then AC_MSG_RESULT([no]) else AC_MSG_RESULT([yes]) fi AM_CONDITIONAL(BUILD_PCRE, [test "x${r_have_pcre4}" != xyes]) ])# R_PCRE ## R_BZLIB ## ------- ## Try finding bzlib library and headers. ## We check that both are installed, ## and that BZ2_bzlibVersion is in the library. AC_DEFUN([R_BZLIB], [if test "x${use_system_bzlib}" = xyes; then AC_CHECK_LIB(bz2, BZ2_bzlibVersion, [have_bzlib=yes], [have_bzlib=no]) if test "${have_bzlib}" = yes; then AC_CHECK_HEADER(bzlib.h, [have_bzlib=yes], [have_bzlib=no]) fi else have_bzlib=no fi AC_MSG_CHECKING([whether bzip2 support needs to be compiled]) if test "x${have_bzlib}" = xyes; then AC_MSG_RESULT([no]) LIBS="-lbz2 ${LIBS}" else AC_MSG_RESULT([yes]) fi AM_CONDITIONAL(BUILD_BZLIB, [test "x${have_bzlib}" = xno]) ])# R_BZLIB ## R_SYS_POSIX_LEAPSECONDS ## ----------------------- ## See if your system time functions do not count leap seconds, as ## required by POSIX. AC_DEFUN([R_SYS_POSIX_LEAPSECONDS], [AC_CACHE_CHECK([whether leap seconds are treated according to POSIX], [r_cv_sys_posix_leapseconds], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include #include #include "confdefs.h" int main () { struct tm *tm; time_t ct = 0; /* required on 64bit AIX */ ctime(&ct); ct = ct - (ct % 60); tm = gmtime(&ct); if(tm->tm_sec == 0) exit(1); else exit(0); } ]])], [r_cv_sys_posix_leapseconds=no], [r_cv_sys_posix_leapseconds=yes], [r_cv_sys_posix_leapseconds=yes])]) if test "x${r_cv_sys_posix_leapseconds}" = xyes; then AC_DEFINE(HAVE_POSIX_LEAPSECONDS, 1, [Define if your system time functions do not count leap seconds, as required by POSIX.]) fi ])# R_SYS_POSIX_LEAPSECONDS ### * Miscellaneous ## R_RECOMMENDED_PACKAGES ## ---------------------- ## See if the sources for the recommended packages are available. AC_DEFUN([R_RECOMMENDED_PACKAGES], [AC_CACHE_CHECK([for recommended packages], [r_cv_misc_recommended_packages], [r_cv_misc_recommended_packages=yes recommended_pkgs=`grep '^R_PKGS_RECOMMENDED_SOURCES *=' \ ${srcdir}/share/make/vars.mk | sed 's/.*=//'` for pkg in ${recommended_pkgs}; do n_pkg=`ls ${srcdir}/src/library/Recommended/${pkg}_*.tar.gz | wc -l` if test ${n_pkg} -ne 1; then r_cv_misc_recommended_packages=no break fi done]) use_recommended_packages=${r_cv_misc_recommended_packages} if test "x${r_cv_misc_recommended_packages}" = xno; then AC_MSG_ERROR([Some of the recommended packages are missing Use --without-recommended-packages if this was intentional]) fi ])# R_RECOMMENDED_PACKAGES ## R_SIZE_MAX ## ---------- ## Look for a definition of SIZE_MAX (the maximum of size_t). ## C99 has it declared in , glibc in ## and Solaris 8 in ! ## autoconf tests for inttypes.h and stdint.h by default AC_DEFUN([R_SIZE_MAX], [AC_CACHE_CHECK([whether SIZE_MAX is declared], [r_cv_size_max], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_LIMITS_H # include #endif int main() { #ifndef SIZE_MAX char *p = (char *) SIZE_MAX; #endif ; return 0; } ]])], [r_cv_size_max=yes], [r_cv_size_max=no], [r_cv_size_max=no])]) if test "x${r_cv_size_max}" = xyes; then AC_DEFINE(HAVE_DECL_SIZE_MAX, 1, [Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you don't.]) fi ])# R_SIZE_MAX ## R_ICONV ## ------- ## Look for iconv, possibly in libiconv. ## Need to include as this may define iconv as a macro. ## libiconv, e.g. on MacOS X, has iconv as a macro and needs -liconv. AC_DEFUN([R_ICONV], [AC_CHECK_HEADERS(iconv.h) ## need to ignore cache for this as it may set LIBS unset ac_cv_func_iconv AC_CACHE_CHECK(for iconv, ac_cv_func_iconv, [ ac_cv_func_iconv="no" AC_TRY_LINK([#include #ifdef HAVE_ICONV_H #include #endif], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], ac_cv_func_iconv=yes) if test "$ac_cv_func_iconv" != yes; then r_save_LIBS="$LIBS" LIBS="$LIBS -liconv" AC_TRY_LINK([#include #ifdef HAVE_ICONV_H #include #endif], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], ac_cv_func_iconv="in libiconv") if test "$ac_cv_func_iconv" = no; then LIBS="$r_save_LIBS" fi fi ]) if test "$ac_cv_func_iconv" != no; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the `iconv' function.]) AC_CACHE_CHECK([whether iconv() accepts "UTF-8", "latin1" and "UCS-*"], [r_cv_iconv_latin1], [AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include "confdefs.h" #include #ifdef HAVE_ICONV_H #include #endif int main () { iconv_t cd; cd = iconv_open("latin1","UTF-8"); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("UTF-8","latin1"); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("","latin1"); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("","UTF-8"); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("latin1", ""); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("UTF-8",""); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("UCS-2LE",""); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("", "UCS-2LE"); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("UCS-2BE",""); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("", "UCS-2BE"); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("UCS-4LE",""); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("", "UCS-4LE"); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("UCS-4BE",""); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); cd = iconv_open("", "UCS-4BE"); if(cd == (iconv_t)(-1)) exit(1); iconv_close(cd); exit(0); } ]])], [r_cv_iconv_latin1=yes], [r_cv_iconv_latin1=no], [r_cv_iconv_latin1=no])]) if test "$r_cv_iconv_latin1" = yes; then AC_DEFINE(ICONV_LATIN1, 1, [Define if `iconv' accepts "UTF-8", "latin1" and "UCS-*".]) fi fi ## if the iconv we are using was in libiconv we have already included -liconv AC_CACHE_CHECK(for iconvlist, ac_cv_func_iconvlist, [ ac_cv_func_iconvlist="no" AC_TRY_LINK([#include #ifdef HAVE_ICONV_H #include #endif static int count_one (unsigned int namescount, char * *names, void *data) {return 0;}], [iconvlist(count_one, NULL);], ac_cv_func_iconvlist=yes) ]) if test "$ac_cv_func_iconvlist" = yes; then AC_DEFINE(HAVE_ICONVLIST, 1, [Define if you have the `iconvlist' function.]) fi ])# R_ICONV ## R_MBCS ## ------------- ## locales - support for MBCS and specifically UTF-8 AC_DEFUN([R_MBCS], [ ## require functional iconv if test "$want_mbcs_support" = yes ; then if test "$r_cv_iconv_latin1" != yes ; then want_mbcs_support=no fi fi ## Wide character support -- first test for headers (which are assumed in code) if test "$want_mbcs_support" = yes ; then AC_CHECK_HEADERS(wchar.h wctype.h) for ac_header in wchar wctype; do as_ac_var=`echo "ac_cv_header_${ac_header}_h"` this=`eval echo '${'$as_ac_var'}'` if test "x$this" = xno; then want_mbcs_support=no fi done fi if test "$want_mbcs_support" = yes ; then ## Solaris 8 is missing iswblank, but we can make it from iswctype. R_CHECK_FUNCS([mbrtowc wcrtomb wcscoll wcsftime], [#include ]) R_CHECK_FUNCS([mbstowcs wcstombs], [#include ]) R_CHECK_FUNCS([wctrans iswblank wctype iswctype], [#include ]) for ac_func in mbrtowc mbstowcs wcrtomb wcscoll wcsftime wcstombs \ wctrans wctype iswctype do as_ac_var=`echo "ac_cv_func_$ac_func"` this=`eval echo '${'$as_ac_var'}'` if test "x$this" = xno; then want_mbcs_support=no fi done fi ## it seems IRIX has wctrans but not wctrans_t: we check this when we ## know we have the headers and wctrans(). if test "$want_mbcs_support" = yes ; then AC_CHECK_TYPES([wctrans_t], , , [#include #include ]) if test $ac_cv_type_wctrans_t != yes; then want_mbcs_support=no fi fi if test "x${want_mbcs_support}" = xyes; then AC_DEFINE(SUPPORT_UTF8, 1, [Define this to enable support for UTF-8 locales.]) AC_SUBST(SUPPORT_UTF8) AC_DEFINE(SUPPORT_MBCS, 1, [Define this to enable support for MBCS locales.]) AC_SUBST(SUPPORT_MBCS) fi ])# R_MBCS ## R_C99_COMPLEX ## ------------- ## C99 complex AC_DEFUN([R_C99_COMPLEX], [ AC_CACHE_CHECK([whether C99 double complex is supported], [r_cv_c99_complex], [ AC_MSG_RESULT([]) AC_CHECK_HEADER(complex.h, [r_cv_c99_complex="yes"], [r_cv_c99_complex="no"]) if test "${r_cv_c99_complex}" = "yes"; then AC_CHECK_TYPE([double complex], , r_cv_c99_complex=no, [#include ]) fi if test "${r_cv_c99_complex}" = "yes"; then for ac_func in cexp clog csqrt cpow ccos csin ctan cacos casin catan \ ccosh csinh ctanh cacosh casinh catanh do R_CHECK_DECL($ac_func, , [r_cv_c99_complex=no], [#include]) dnl done fi dnl Now check if the representation is the same as Rcomplex if test "${r_cv_c99_complex}" = "yes"; then AC_MSG_CHECKING([whether C99 double complex is compatible with Rcomplex]) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include "confdefs.h" #include #include typedef struct { double r; double i; } Rcomplex; void set_it(Rcomplex *z) { z[0].r = 3.14159265; z[0].i = 2.172; z[1].i = 3.14159265; z[1].r = 2.172; z[2].r = 123.456; z[2].i = 0.123456; } int main () { double complex z[3]; set_it(z); if(cabs(z[2] - 123.456 - 0.123456 * _Complex_I) < 1e-4) exit(0); else exit(1); } ]])], [r_c99_complex=yes], [r_c99_complex=no], [r_c99_complex=no]) AC_MSG_RESULT(${r_c99_complex}) r_cv_c99_complex=${r_c99_complex} fi ]) if test "${r_cv_c99_complex}" = "yes"; then AC_DEFINE(HAVE_C99_COMPLEX, 1, [Define this if you have support for C99 complex types.]) AC_SUBST(HAVE_C99_COMPLEX) fi ])# R_COMPLEX ## R_CHECK_DECL(SYMBOL, ## [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], ## [INCLUDES = DEFAULT-INCLUDES]) ## ------------------------------------------------------- ## Check if SYMBOL (a variable or a function) is declared. AC_DEFUN([R_CHECK_DECL], [AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1]) dnl AC_CACHE_CHECK([whether $1 exists and is declared], ac_Symbol, [AC_LINK_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])], [#ifndef $1 char *p = (char *) $1; #endif ])], [AS_VAR_SET(ac_Symbol, yes)], [AS_VAR_SET(ac_Symbol, no)])]) AS_IF([test AS_VAR_GET(ac_Symbol) = yes], [$2], [$3])[] dnl AS_VAR_POPDEF([ac_Symbol]) dnl ])# R_CHECK_DECL ## R_CHECK_FUNCS(SYMBOLS, ## [INCLUDES = DEFAULT-INCLUDES]) ## -------------------------------------------------------- ## Defines HAVE_SYMBOL if declared. SYMBOLS is an m4 list. AC_DEFUN([R_CHECK_FUNCS], [AC_FOREACH([AC_Func], [$1], [AH_TEMPLATE(AS_TR_CPP([HAVE_]AC_Func), [Define to 1 if you have the `]AC_Func[' function.])]) dnl for ac_func in $1 do R_CHECK_DECL($ac_func, [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$ac_func]), 1)], , [$2]) dnl done ])# R_CHECK_FUNCS ## R_GCC4_VISIBILITY ## Sets up suitable macros for visibility attributes in gcc4/gfortran AC_DEFUN([R_GCC4_VISIBILITY], [AC_CACHE_CHECK([whether __attribute__((visibility())) is supported], [r_cv_visibility_attribute], [cat > conftest.c <&AS_MESSAGE_LOG_FD); then if grep '\.hidden.*foo' conftest.s >/dev/null; then r_cv_visibility_attribute=yes fi fi rm -f conftest.[cs] ]) if test $r_cv_visibility_attribute = yes; then AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE, 1, [Define to 1 if __attribute__((visibility())) is supported]) fi ## test if visibility flag is accepted: NB Solaris compilers do and ignore, ## so only make use of this if HAVE_VISIBILITY_ATTRIBUTE is true. r_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -fvisibility=hidden" AC_CACHE_CHECK(whether $CC accepts -fvisibility, r_cv_prog_cc_vis, [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [r_cv_prog_cc_vis=yes], [r_cv_prog_cc_vis=no])]) CFLAGS=$r_save_CFLAGS if test "${r_cv_prog_cc_vis}" = yes; then if test "${r_cv_visibility_attribute}" = yes; then C_VISIBILITY="-fvisibility=hidden" fi fi ## Need to exclude Intel compilers, where this does not work. ## The flag is documented, and is effective but also hides ## unsatisfied references. We cannot test for GCC, as icc passes that test. case "${CC}" in ## Intel compiler *icc) C_VISIBILITY= ;; esac AC_SUBST(C_VISIBILITY) AC_LANG_PUSH(Fortran 77) r_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS -fvisibility=hidden" AC_CACHE_CHECK(whether $F77 accepts -fvisibility, r_cv_prog_f77_vis, [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [r_cv_prog_f77_vis=yes], [r_cv_prog_f77_vis=no])]) FFLAGS=$r_save_FFLAGS AC_LANG_POP(Fortran 77) if test "${r_cv_prog_f77_vis}" = yes; then if test "${r_cv_visibility_attribute}" = yes; then F77_VISIBILITY="-fvisibility=hidden" fi fi ## need to exclude Intel compilers. case "${F77}" in ## Intel compiler *ifc|*ifort) F77_VISIBILITY= ;; esac AC_SUBST(F77_VISIBILITY) ])# R_GCC4_VISIBILITY ### Local variables: *** ### mode: outline-minor *** ### outline-regexp: "### [*]+" *** ### End: *** JAGS-4.3.2/m4/ax_lapack.m40000664000175000017500000001166014224052371011700 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_lapack.html # =========================================================================== # # SYNOPSIS # # AX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro looks for a library that implements the LAPACK linear-algebra # interface (see http://www.netlib.org/lapack/). On success, it sets the # LAPACK_LIBS output variable to hold the requisite library linkages. # # To link with LAPACK, you should link with: # # $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS # # in that order. BLAS_LIBS is the output variable of the AX_BLAS macro, # called automatically. FLIBS is the output variable of the # AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is # sometimes necessary in order to link with F77 libraries. Users will also # need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same # reason. # # The user may also use --with-lapack= in order to use some specific # LAPACK library . In order to link successfully, however, be aware # that you will probably need to use the same Fortran compiler (which can # be set via the F77 env. var.) as was used to compile the LAPACK and BLAS # libraries. # # ACTION-IF-FOUND is a list of shell commands to run if a LAPACK library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_LAPACK. # # LICENSE # # Copyright (c) 2009 Steven G. Johnson # # 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 3 of the License, 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, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 7 AU_ALIAS([ACX_LAPACK], [AX_LAPACK]) AC_DEFUN([AX_LAPACK], [ AC_REQUIRE([AX_BLAS]) ax_lapack_ok=no AC_ARG_WITH(lapack, [AS_HELP_STRING([--with-lapack=], [use LAPACK library ])]) case $with_lapack in yes | "") ;; no) ax_lapack_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;; *) LAPACK_LIBS="-l$with_lapack" ;; esac # Get fortran linker name of LAPACK function to check for. AC_F77_FUNC(cheev) # We cannot use LAPACK if BLAS is not found if test "x$ax_blas_ok" != xyes; then ax_lapack_ok=noblas LAPACK_LIBS="" fi # First, check LAPACK_LIBS environment variable if test "x$LAPACK_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS]) AC_TRY_LINK_FUNC($cheev, [ax_lapack_ok=yes], [LAPACK_LIBS=""]) AC_MSG_RESULT($ax_lapack_ok) LIBS="$save_LIBS" if test $ax_lapack_ok = no; then LAPACK_LIBS="" fi fi # LAPACK linked to by default? (is sometimes included in BLAS lib) if test $ax_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" AC_CHECK_FUNC($cheev, [ax_lapack_ok=yes]) LIBS="$save_LIBS" fi # Generic LAPACK library? for lapack in lapack lapack_rs6k; do if test $ax_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" AC_CHECK_LIB($lapack, $cheev, [ax_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) LIBS="$save_LIBS" fi done AC_SUBST(LAPACK_LIBS) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_lapack_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1]) : else ax_lapack_ok=no $2 fi ])dnl AX_LAPACK JAGS-4.3.2/m4/axx_blas.m40000664000175000017500000001517714224052371011565 00000000000000# 2010/11/09 - Modified to use new syntax for sunperf. MTP # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_blas.html # =========================================================================== # # SYNOPSIS # # AX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro looks for a library that implements the BLAS linear-algebra # interface (see http://www.netlib.org/blas/). On success, it sets the # BLAS_LIBS output variable to hold the requisite library linkages. # # To link with BLAS, you should link with: # # $BLAS_LIBS $LIBS $FLIBS # # in that order. FLIBS is the output variable of the # AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is # sometimes necessary in order to link with F77 libraries. Users will also # need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same # reason. # # Many libraries are searched for, from ATLAS to CXML to ESSL. The user # may also use --with-blas= in order to use some specific BLAS # library . In order to link successfully, however, be aware that you # will probably need to use the same Fortran compiler (which can be set # via the F77 env. var.) as was used to compile the BLAS library. # # ACTION-IF-FOUND is a list of shell commands to run if a BLAS library is # found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is # not found. If ACTION-IF-FOUND is not specified, the default action will # define HAVE_BLAS. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # # 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 3 of the License, 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, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 11 AU_ALIAS([ACX_BLAS], [AX_BLAS]) AC_DEFUN([AX_BLAS], [ AC_PREREQ(2.50) AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) ax_blas_ok=no AC_ARG_WITH(blas, [AS_HELP_STRING([--with-blas=], [use BLAS library ])]) case $with_blas in yes | "") ;; no) ax_blas_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;; *) BLAS_LIBS="-l$with_blas" ;; esac # Get fortran linker names of BLAS functions to check for. AC_F77_FUNC(sgemm) AC_F77_FUNC(dgemm) ax_blas_save_LIBS="$LIBS" LIBS="$LIBS $FLIBS" # First, check BLAS_LIBS environment variable if test $ax_blas_ok = no; then if test "x$BLAS_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS]) AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes], [BLAS_LIBS=""]) AC_MSG_RESULT($ax_blas_ok) LIBS="$save_LIBS" fi fi # BLAS linked to by default? (happens on some supercomputers) if test $ax_blas_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS" AC_MSG_CHECKING([if $sgemm is being linked in already]) AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes]) AC_MSG_RESULT($ax_blas_ok) LIBS="$save_LIBS" fi # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) if test $ax_blas_ok = no; then AC_CHECK_LIB(atlas, ATL_xerbla, [AC_CHECK_LIB(f77blas, $sgemm, [AC_CHECK_LIB(cblas, cblas_dgemm, [ax_blas_ok=yes BLAS_LIBS="-lcblas -lf77blas -latlas"], [], [-lf77blas -latlas])], [], [-latlas])]) fi # BLAS in PhiPACK libraries? (requires generic BLAS lib, too) if test $ax_blas_ok = no; then AC_CHECK_LIB(blas, $sgemm, [AC_CHECK_LIB(dgemm, $dgemm, [AC_CHECK_LIB(sgemm, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], [], [-lblas])], [], [-lblas])]) fi # BLAS in Intel MKL library? if test $ax_blas_ok = no; then AC_CHECK_LIB(mkl, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lmkl"]) fi # BLAS in Apple vecLib library? if test $ax_blas_ok = no; then save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS" AC_MSG_CHECKING([for $sgemm in -framework vecLib]) AC_TRY_LINK_FUNC($sgemm, [ax_blas_ok=yes;BLAS_LIBS="-framework vecLib"]) AC_MSG_RESULT($ax_blas_ok) LIBS="$save_LIBS" fi # BLAS in Alpha CXML library? if test $ax_blas_ok = no; then AC_CHECK_LIB(cxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-lcxml"]) fi # BLAS in Alpha DXML library? (now called CXML, see above) if test $ax_blas_ok = no; then AC_CHECK_LIB(dxml, $sgemm, [ax_blas_ok=yes;BLAS_LIBS="-ldxml"]) fi # BLAS in Sun Performance library? if test $ax_blas_ok = no; then if test "x$GCC" != xyes; then # only works with Sun CC AC_CHECK_LIB(sunmath, acosp, [AC_CHECK_LIB(sunperf, $sgemm, [BLAS_LIBS="-library=sunperf" ax_blas_ok=yes])]) fi fi # BLAS in SCSL library? (SGI/Cray Scientific Library) if test $ax_blas_ok = no; then AC_CHECK_LIB(scs, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lscs"]) fi # BLAS in SGIMATH library? if test $ax_blas_ok = no; then AC_CHECK_LIB(complib.sgimath, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"]) fi # BLAS in IBM ESSL library? (requires generic BLAS lib, too) if test $ax_blas_ok = no; then AC_CHECK_LIB(blas, $sgemm, [AC_CHECK_LIB(essl, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], [], [-lblas $FLIBS])]) fi # Generic BLAS library? if test $ax_blas_ok = no; then AC_CHECK_LIB(blas, $sgemm, [ax_blas_ok=yes; BLAS_LIBS="-lblas"]) fi AC_SUBST(BLAS_LIBS) LIBS="$ax_blas_save_LIBS" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_blas_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1]) : else ax_blas_ok=no $2 fi ])dnl AX_BLAS JAGS-4.3.2/m4/libtool.m40000644000175000017500000112776414266326445011451 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . ]) # serial 59 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_DECL_FILECMD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -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 Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} _LT_DECL([], [AR], [1], [The archiver]) # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS _LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. _LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -z "$STRIP"; then AC_MSG_RESULT([no]) else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_FILECMD # ---------------- # Check for a file(cmd) program that can be used to detect file type and magic m4_defun([_LT_DECL_FILECMD], [AC_CHECK_TOOL([FILECMD], [file], [:]) _LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) ])# _LD_DECL_FILECMD # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS JAGS-4.3.2/m4/ltargz.m40000644000175000017500000000515614214520133011254 00000000000000# Portability macros for glibc argz. -*- Autoconf -*- # # Copyright (C) 2004-2007, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 2 ltargz.m4 AC_DEFUN([LT_FUNC_ARGZ], [ dnl Required for use of '$SED' in Cygwin configuration. AC_REQUIRE([AC_PROG_SED])dnl AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_TYPES([error_t], [], [AC_DEFINE([error_t], [int], [Define to a type to use for 'error_t' if it is not otherwise available.]) AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h does not typedef error_t.])], [#if defined(HAVE_ARGZ_H) # include #endif]) LT_ARGZ_H= AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \ argz_next argz_stringify], [], [LT_ARGZ_H=lt__argz.h; AC_LIBOBJ([lt__argz])]) dnl if have system argz functions, allow forced use of dnl libltdl-supplied implementation (and default to do so dnl on "known bad" systems). Could use a runtime check, but dnl (a) detecting malloc issues is notoriously unreliable dnl (b) only known system that declares argz functions, dnl provides them, yet they are broken, is cygwin dnl releases prior to 16-Mar-2007 (1.5.24 and earlier) dnl So, it's more straightforward simply to special case dnl this for known bad systems. AS_IF([test -z "$LT_ARGZ_H"], [AC_CACHE_CHECK( [if argz actually works], [lt_cv_sys_argz_works], [[case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test no != "$cross_compiling"; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | $SED -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test 1 -lt "$lt_os_major" \ || { test 1 -eq "$lt_os_major" \ && { test 5 -lt "$lt_os_minor" \ || { test 5 -eq "$lt_os_minor" \ && test 24 -lt "$lt_os_micro"; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac]]) AS_IF([test yes = "$lt_cv_sys_argz_works"], [AC_DEFINE([HAVE_WORKING_ARGZ], 1, [This value is set to 1 to indicate that the system argz facility works])], [LT_ARGZ_H=lt__argz.h AC_LIBOBJ([lt__argz])])]) AC_SUBST([LT_ARGZ_H]) ]) JAGS-4.3.2/m4/ltdl.m40000644000175000017500000007255514214520133010717 00000000000000# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*- # # Copyright (C) 1999-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Thomas Tanner, 1999 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 21 LTDL_INIT # LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE]) # ------------------------------------------ # DIRECTORY contains the libltdl sources. It is okay to call this # function multiple times, as long as the same DIRECTORY is always given. AC_DEFUN([LT_CONFIG_LTDL_DIR], [AC_BEFORE([$0], [LTDL_INIT]) _$0($*) ])# LT_CONFIG_LTDL_DIR # We break this out into a separate macro, so that we can call it safely # internally without being caught accidentally by the sed scan in libtoolize. m4_defun([_LT_CONFIG_LTDL_DIR], [dnl remove trailing slashes m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$])) m4_case(_LTDL_DIR, [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply '.' m4_if(_ARG_DIR, [.], [], [m4_define([_LTDL_DIR], _ARG_DIR) _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])], [m4_if(_ARG_DIR, _LTDL_DIR, [], [m4_fatal([multiple libltdl directories: ']_LTDL_DIR[', ']_ARG_DIR['])])]) m4_popdef([_ARG_DIR]) ])# _LT_CONFIG_LTDL_DIR # Initialise: m4_define([_LTDL_DIR], []) # _LT_BUILD_PREFIX # ---------------- # If Autoconf is new enough, expand to '$(top_build_prefix)', otherwise # to '$(top_builddir)/'. m4_define([_LT_BUILD_PREFIX], [m4_ifdef([AC_AUTOCONF_VERSION], [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]), [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX], [$(top_build_prefix)], [$(top_builddir)/])], [$(top_build_prefix)])], [$(top_builddir)/])[]dnl ]) # LTDL_CONVENIENCE # ---------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called here. LIBLTDL will be prefixed with # '$(top_build_prefix)' if available, otherwise with '$(top_builddir)/', # and LTDLINCL will be prefixed with '$(top_srcdir)/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_build_prefix, top_builddir, and top_srcdir appropriately # in your Makefiles. AC_DEFUN([LTDL_CONVENIENCE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_CONVENIENCE # AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_CONVENIENCE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_CONVENIENCE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], []) # _LTDL_CONVENIENCE # ----------------- # Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]). m4_defun([_LTDL_CONVENIENCE], [case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}" AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL=$LTDLINCL AC_SUBST([INCLTDL]) ])# _LTDL_CONVENIENCE # LTDL_INSTALLABLE # ---------------- # sets LIBLTDL to the link flags for the libltdl installable library # and LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that # AC_CONFIG_SUBDIRS is not called from here. If an installed libltdl # is not found, LIBLTDL will be prefixed with '$(top_build_prefix)' if # available, otherwise with '$(top_builddir)/', and LTDLINCL will be # prefixed with '$(top_srcdir)/' (note the single quotes!). If your # package is not flat and you're not using automake, define top_build_prefix, # top_builddir, and top_srcdir appropriately in your Makefiles. # In the future, this macro may have to be called after LT_INIT. AC_DEFUN([LTDL_INSTALLABLE], [AC_BEFORE([$0], [LTDL_INIT])dnl dnl Although the argument is deprecated and no longer documented, dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one dnl here make sure it is the same as any other declaration of libltdl's dnl location! This also ensures lt_ltdl_dir is set when configure.ac is dnl not yet using an explicit LT_CONFIG_LTDL_DIR. m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl _$0() ])# LTDL_INSTALLABLE # AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools, # now we have LT_CONFIG_LTDL_DIR: AU_DEFUN([AC_LIBLTDL_INSTALLABLE], [_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])]) _LTDL_INSTALLABLE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], []) # _LTDL_INSTALLABLE # ----------------- # Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]). m4_defun([_LTDL_INSTALLABLE], [if test -f "$prefix/lib/libltdl.la"; then lt_save_LDFLAGS=$LDFLAGS LDFLAGS="-L$prefix/lib $LDFLAGS" AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes]) LDFLAGS=$lt_save_LDFLAGS if test yes = "${lt_lib_ltdl-no}"; then if test yes != "$enable_ltdl_install"; then # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install AC_MSG_WARN([not overwriting libltdl at $prefix, force with '--enable-ltdl-install']) enable_ltdl_install=no fi elif test no = "$enable_ltdl_install"; then AC_MSG_WARN([libltdl not installed, but installation disabled]) fi fi # If configure.ac declared an installable ltdl, and the user didn't override # with --disable-ltdl-install, we will install the shipped libltdl. case $enable_ltdl_install in no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; *) enable_ltdl_install=yes ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}" ;; esac AC_SUBST([LIBLTDL]) AC_SUBST([LTDLDEPS]) AC_SUBST([LTDLINCL]) # For backwards non-gettext consistent compatibility... INCLTDL=$LTDLINCL AC_SUBST([INCLTDL]) ])# LTDL_INSTALLABLE # _LTDL_MODE_DISPATCH # ------------------- m4_define([_LTDL_MODE_DISPATCH], [dnl If _LTDL_DIR is '.', then we are configuring libltdl itself: m4_if(_LTDL_DIR, [], [], dnl if _LTDL_MODE was not set already, the default value is 'subproject': [m4_case(m4_default(_LTDL_MODE, [subproject]), [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR) _LT_SHELL_INIT([lt_dlopen_dir=$lt_ltdl_dir])], [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir=$lt_ltdl_dir; lt_libobj_prefix=$lt_ltdl_dir/])], [recursive], [], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl dnl Be careful not to expand twice: m4_define([$0], []) ])# _LTDL_MODE_DISPATCH # _LT_LIBOBJ(MODULE_NAME) # ----------------------- # Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead # of into LIBOBJS. AC_DEFUN([_LT_LIBOBJ], [ m4_pattern_allow([^_LT_LIBOBJS$]) _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext" ])# _LT_LIBOBJS # LTDL_INIT([OPTIONS]) # -------------------- # Clients of libltdl can use this macro to allow the installer to # choose between a shipped copy of the ltdl sources or a preinstalled # version of the library. If the shipped ltdl sources are not in a # subdirectory named libltdl, the directory name must be given by # LT_CONFIG_LTDL_DIR. AC_DEFUN([LTDL_INIT], [dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) dnl We need to keep our own list of libobjs separate from our parent project, dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while dnl we look for our own LIBOBJs. m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ])) m4_pushdef([AC_LIBSOURCES]) dnl If not otherwise defined, default to the 1.5.x compatible subproject mode: m4_if(_LTDL_MODE, [], [m4_define([_LTDL_MODE], m4_default([$2], [subproject])) m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])], [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])]) AC_ARG_WITH([included_ltdl], [AS_HELP_STRING([--with-included-ltdl], [use the GNU ltdl sources included here])]) if test yes != "$with_included_ltdl"; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. AC_CHECK_HEADER([ltdl.h], [AC_CHECK_DECL([lt_dlinterface_register], [AC_CHECK_LIB([ltdl], [lt_dladvise_preload], [with_included_ltdl=no], [with_included_ltdl=yes])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT #include ])], [with_included_ltdl=yes], [AC_INCLUDES_DEFAULT] ) fi dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE dnl was called yet, then for old times' sake, we assume libltdl is in an dnl eponymous directory: AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])]) AC_ARG_WITH([ltdl_include], [AS_HELP_STRING([--with-ltdl-include=DIR], [use the ltdl headers installed in DIR])]) if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else AC_MSG_ERROR([invalid ltdl include directory: '$with_ltdl_include']) fi else with_ltdl_include=no fi AC_ARG_WITH([ltdl_lib], [AS_HELP_STRING([--with-ltdl-lib=DIR], [use the libltdl.la installed in DIR])]) if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else AC_MSG_ERROR([invalid ltdl library directory: '$with_ltdl_lib']) fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) m4_case(m4_default(_LTDL_TYPE, [convenience]), [convenience], [_LTDL_CONVENIENCE], [installable], [_LTDL_INSTALLABLE], [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)]) ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. AC_DEFINE([HAVE_LTDL], [1], [Define this if a modern libltdl is already installed]) LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) AC_MSG_ERROR(['--with-ltdl-include' and '--with-ltdl-lib' options must be used together]) ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL=-I$with_ltdl_include ;; esac INCLTDL=$LTDLINCL # Report our decision... AC_MSG_CHECKING([where to find libltdl headers]) AC_MSG_RESULT([$LTDLINCL]) AC_MSG_CHECKING([where to find libltdl library]) AC_MSG_RESULT([$LIBLTDL]) _LTDL_SETUP dnl restore autoconf definition. m4_popdef([AC_LIBOBJ]) m4_popdef([AC_LIBSOURCES]) AC_CONFIG_COMMANDS_PRE([ _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | $SED "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs]) AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs]) ]) # Only expand once: m4_define([LTDL_INIT]) ])# LTDL_INIT # Old names: AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)]) AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)]) AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIB_LTDL], []) dnl AC_DEFUN([AC_WITH_LTDL], []) dnl AC_DEFUN([LT_WITH_LTDL], []) # _LTDL_SETUP # ----------- # Perform all the checks necessary for compilation of the ltdl objects # -- including compiler checks and header checks. This is a public # interface mainly for the benefit of libltdl's own configure.ac, most # other users should call LTDL_INIT instead. AC_DEFUN([_LTDL_SETUP], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_SYS_MODULE_EXT])dnl AC_REQUIRE([LT_SYS_MODULE_PATH])dnl AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl AC_REQUIRE([LT_LIB_DLLOAD])dnl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl AC_REQUIRE([LT_FUNC_ARGZ])dnl m4_require([_LT_CHECK_OBJDIR])dnl m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL dnl _LTDL_MODE specific code must be called at least once: _LTDL_MODE_DISPATCH # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). AC_CONFIG_COMMANDS_PRE([dnl m4_pattern_allow([^LT_CONFIG_H$])dnl m4_ifset([AH_HEADER], [LT_CONFIG_H=AH_HEADER], [m4_ifset([AC_LIST_HEADERS], [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's|^[[ ]]*||;s|[[ :]].*$||'`], [])])]) AC_SUBST([LT_CONFIG_H]) AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h], [], [], [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])]) AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])]) m4_pattern_allow([LT_LIBEXT])dnl AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension]) name= eval "lt_libprefix=\"$libname_spec\"" m4_pattern_allow([LT_LIBPREFIX])dnl AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix]) name=ltdl eval "LTDLOPEN=\"$libname_spec\"" AC_SUBST([LTDLOPEN]) ])# _LTDL_SETUP # _LT_ENABLE_INSTALL # ------------------ m4_define([_LT_ENABLE_INSTALL], [AC_ARG_ENABLE([ltdl-install], [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])]) case ,$enable_ltdl_install,$enable_ltdl_convenience in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac m4_ifdef([AM_CONDITIONAL], [AM_CONDITIONAL(INSTALL_LTDL, test no != "${enable_ltdl_install-no}") AM_CONDITIONAL(CONVENIENCE_LTDL, test no != "${enable_ltdl_convenience-no}")]) ])# _LT_ENABLE_INSTALL # LT_SYS_DLOPEN_DEPLIBS # --------------------- AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_CACHE_CHECK([whether deplibs are loaded by dlopen], [lt_cv_sys_dlopen_deplibs], [# PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this 'case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[[4-9]]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; bitrig*) lt_cv_sys_dlopen_deplibs=yes ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly* | midnightbsd*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[[12345]]*|irix6.[[01]]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[[1234]]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say 'no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to 'yes'. Without it, it would be 'no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say 'yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac ]) if test yes != "$lt_cv_sys_dlopen_deplibs"; then AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1], [Define if the OS needs help to load dependent libraries for dlopen().]) fi ])# LT_SYS_DLOPEN_DEPLIBS # Old name: AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], []) # LT_SYS_MODULE_EXT # ----------------- AC_DEFUN([LT_SYS_MODULE_EXT], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([what extension is used for runtime loadable modules], [libltdl_cv_shlibext], [ module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds ]) if test -n "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_MODULE_EXT])dnl AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"], [Define to the extension used for runtime loadable modules, say, ".so".]) fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then m4_pattern_allow([LT_SHARED_EXT])dnl AC_DEFINE_UNQUOTED([LT_SHARED_EXT], ["$libltdl_cv_shrext"], [Define to the shared library suffix, say, ".dylib".]) fi if test -n "$shared_archive_member_spec"; then m4_pattern_allow([LT_SHARED_LIB_MEMBER])dnl AC_DEFINE_UNQUOTED([LT_SHARED_LIB_MEMBER], ["($shared_archive_member_spec.o)"], [Define to the shared archive member specification, say "(shr.o)".]) fi ])# LT_SYS_MODULE_EXT # Old name: AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBEXT], []) # LT_SYS_MODULE_PATH # ------------------ AC_DEFUN([LT_SYS_MODULE_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([what variable specifies run-time module search path], [lt_cv_module_path_var], [lt_cv_module_path_var=$shlibpath_var]) if test -n "$lt_cv_module_path_var"; then m4_pattern_allow([LT_MODULE_PATH_VAR])dnl AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"], [Define to the name of the environment variable that determines the run-time module search path.]) fi ])# LT_SYS_MODULE_PATH # Old name: AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SHLIBPATH], []) # LT_SYS_DLSEARCH_PATH # -------------------- AC_DEFUN([LT_SYS_DLSEARCH_PATH], [m4_require([_LT_SYS_DYNAMIC_LINKER])dnl AC_CACHE_CHECK([for the default library search path], [lt_cv_sys_dlsearch_path], [lt_cv_sys_dlsearch_path=$sys_lib_dlsearch_path_spec]) if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path=$dir else sys_dlsearch_path=$sys_dlsearch_path$PATH_SEPARATOR$dir fi done m4_pattern_allow([LT_DLSEARCH_PATH])dnl AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"], [Define to the system default library search path.]) fi ])# LT_SYS_DLSEARCH_PATH # Old name: AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], []) # _LT_CHECK_DLPREOPEN # ------------------- m4_defun([_LT_CHECK_DLPREOPEN], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen], [libltdl_cv_preloaded_symbols], [if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi ]) if test yes = "$libltdl_cv_preloaded_symbols"; then AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1], [Define if libtool can extract symbol lists from object files.]) fi ])# _LT_CHECK_DLPREOPEN # LT_LIB_DLLOAD # ------------- AC_DEFUN([LT_LIB_DLLOAD], [m4_pattern_allow([^LT_DLLOADERS$]) LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) lt_dlload_save_LIBS=$LIBS LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) if test "$ac_cv_search_dlopen" != "none required"; then LIBADD_DLOPEN=-ldl fi libltdl_cv_lib_dl_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H # include #endif ]], [[dlopen(0, 0);]])], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"], [AC_CHECK_LIB([svld], [dlopen], [AC_DEFINE([HAVE_LIBDL], [1], [Define if you have the libdl library or equivalent.]) LIBADD_DLOPEN=-lsvld libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])]) if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen" then lt_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" AC_CHECK_FUNCS([dlerror]) LIBS=$lt_save_LIBS fi AC_SUBST([LIBADD_DLOPEN]) LIBADD_SHL_LOAD= AC_CHECK_FUNC([shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"], [AC_CHECK_LIB([dld], [shl_load], [AC_DEFINE([HAVE_SHL_LOAD], [1], [Define if you have the shl_load function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD=-ldld])]) AC_SUBST([LIBADD_SHL_LOAD]) case $host_os in darwin[[1567]].*) # We only want this for pre-Mac OS X 10.4. AC_CHECK_FUNC([_dyld_func_lookup], [AC_DEFINE([HAVE_DYLD], [1], [Define if you have the _dyld_func_lookup function.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"]) ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | pw32*) AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include ]]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac AC_CHECK_LIB([dld], [dld_link], [AC_DEFINE([HAVE_DLD], [1], [Define if you have the GNU dld library.]) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"]) AC_SUBST([LIBADD_DLD_LINK]) m4_pattern_allow([^LT_DLPREOPEN$]) LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done AC_DEFINE([HAVE_LIBDLLOADER], [1], [Define if libdlloader will be built on this platform]) fi AC_SUBST([LT_DLPREOPEN]) dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) LIBS=$lt_dlload_save_LIBS AC_LANG_POP ])# LT_LIB_DLLOAD # Old name: AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLLIB], []) # LT_SYS_SYMBOL_USCORE # -------------------- # does the compiler prefix global symbols with an underscore? AC_DEFUN([LT_SYS_SYMBOL_USCORE], [m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl AC_CACHE_CHECK([for _ prefix in compiled symbols], [lt_cv_sys_symbol_underscore], [lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.c >&AS_MESSAGE_LOG_FD fi rm -rf conftest* ]) sys_symbol_underscore=$lt_cv_sys_symbol_underscore AC_SUBST([sys_symbol_underscore]) ])# LT_SYS_SYMBOL_USCORE # Old name: AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], []) # LT_FUNC_DLSYM_USCORE # -------------------- AC_DEFUN([LT_FUNC_DLSYM_USCORE], [AC_REQUIRE([_LT_COMPILER_PIC])dnl for lt_prog_compiler_wl AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl for lt_cv_sys_symbol_underscore AC_REQUIRE([LT_SYS_MODULE_EXT])dnl for libltdl_cv_shlibext if test yes = "$lt_cv_sys_symbol_underscore"; then if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"; then AC_CACHE_CHECK([whether we have to add an underscore for dlsym], [libltdl_cv_need_uscore], [libltdl_cv_need_uscore=unknown dlsym_uscore_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" libname=conftmod # stay within 8.3 filename limits! cat >$libname.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; }] _LT_EOF # ltfn_module_cmds module_cmds # Execute tilde-delimited MODULE_CMDS with environment primed for # $module_cmds or $archive_cmds type content. ltfn_module_cmds () {( # subshell avoids polluting parent global environment module_cmds_save_ifs=$IFS; IFS='~' for cmd in @S|@1; do IFS=$module_cmds_save_ifs libobjs=$libname.$ac_objext; lib=$libname$libltdl_cv_shlibext rpath=/not-exists; soname=$libname$libltdl_cv_shlibext; output_objdir=. major=; versuffix=; verstring=; deplibs= ECHO=echo; wl=$lt_prog_compiler_wl; allow_undefined_flag= eval $cmd done IFS=$module_cmds_save_ifs )} # Compile a loadable module using libtool macro expansion results. $CC $pic_flag -c $libname.$ac_ext ltfn_module_cmds "${module_cmds:-$archive_cmds}" # Try to fetch fnord with dlsym(). libltdl_dlunknown=0; libltdl_dlnouscore=1; libltdl_dluscore=2 cat >conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifndef RTLD_GLOBAL # ifdef DL_GLOBAL # define RTLD_GLOBAL DL_GLOBAL # else # define RTLD_GLOBAL 0 # endif #endif #ifndef RTLD_NOW # ifdef DL_NOW # define RTLD_NOW DL_NOW # else # define RTLD_NOW 0 # endif #endif int main () { void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW); int status = $libltdl_dlunknown; if (handle) { if (dlsym (handle, "fnord")) status = $libltdl_dlnouscore; else { if (dlsym (handle, "_fnord")) status = $libltdl_dluscore; else puts (dlerror ()); } dlclose (handle); } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null libltdl_status=$? case x$libltdl_status in x$libltdl_dlnouscore) libltdl_cv_need_uscore=no ;; x$libltdl_dluscore) libltdl_cv_need_uscore=yes ;; x*) libltdl_cv_need_uscore=unknown ;; esac fi rm -rf conftest* $libname* LIBS=$dlsym_uscore_save_LIBS ]) fi fi if test yes = "$libltdl_cv_need_uscore"; then AC_DEFINE([NEED_USCORE], [1], [Define if dlsym() requires a leading underscore in symbol names.]) fi ])# LT_FUNC_DLSYM_USCORE # Old name: AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) JAGS-4.3.2/m4/ltoptions.m40000644000175000017500000003427514214520133012010 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free # Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 8 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option '$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl 'shared' nor 'disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the 'shared' and # 'disable-shared' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the 'static' and # 'disable-static' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the 'fast-install' # and 'disable-fast-install' LT_INIT options. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the 'pic-only' and 'no-pic' # LT_INIT options. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac], [pic_mode=m4_default([$1], [default])]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the 'pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) JAGS-4.3.2/m4/ltsugar.m40000644000175000017500000001045314214520133011426 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software # Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59, which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) JAGS-4.3.2/m4/ltversion.m40000644000175000017500000000131214214520272011770 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, # Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4245 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.7]) m4_define([LT_PACKAGE_REVISION], [2.4.7]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.7' macro_revision='2.4.7' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) JAGS-4.3.2/m4/lt~obsolete.m40000644000175000017500000001400714214520133012316 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free # Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) JAGS-4.3.2/m4/Makefile.in0000644000175000017500000003164314400675235011567 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ DISTFILES = axx_blas.m4 ax_lapack.m4 libtool.m4 Makefile.in Makefile.am R.m4 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu m4/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu m4/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/m4/Makefile.am0000664000175000017500000000011514224052514011537 00000000000000DISTFILES = axx_blas.m4 ax_lapack.m4 libtool.m4 Makefile.in Makefile.am R.m4 JAGS-4.3.2/Makefile.am0000664000175000017500000000112614224261675011234 00000000000000ACLOCAL_AMFLAGS = -I m4 SUBDIRS = m4 libltdl src etc win doc test EXTRA_DIST = Doxyfile .PHONY: win32-install win64-install installer docs win32-install: make prefix=`pwd`/win/inst32 make install prefix=`pwd`/win/inst32 win64-install: make prefix=`pwd`/win/inst64 make install prefix=`pwd`/win/inst64 installer: (for f in `find win/runtime64 -name '*.dll' -print`; do \ ${INSTALL} $$f win/inst64/bin/; done;) (for f in `find win/runtime64 -name '*.dll.a' -print`; do \ ${INSTALL} $$f win/inst64/lib/; done;) (cd win && $(MAKE) $@) docs: FORCE -@(cd doc && $(MAKE) $@) FORCE: JAGS-4.3.2/configure0000755000175000017500000331116614400675237011117 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for JAGS 4.3.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: martyn_plummer@users.sourceforge.net about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval 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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" lt_ltdl_dir='libltdl' SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='JAGS' PACKAGE_TARNAME='JAGS' PACKAGE_VERSION='4.3.2' PACKAGE_STRING='JAGS 4.3.2' PACKAGE_BUGREPORT='martyn_plummer@users.sourceforge.net' PACKAGE_URL='' ac_unique_file="src/lib/Console.cc" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='ltdl_LTLIBOBJS ltdl_LIBOBJS am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS jagsmoddir LAPACK_LIBS BLAS_LIBS FLIBS WINDOWS_FALSE WINDOWS_TRUE YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX ac_ct_F77 FFLAGS F77 CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX LTDLOPEN LT_CONFIG_H CONVENIENCE_LTDL_FALSE CONVENIENCE_LTDL_TRUE INSTALL_LTDL_FALSE INSTALL_LTDL_TRUE LT_ARGZ_H sys_symbol_underscore LIBADD_DL LT_DLPREOPEN LIBADD_DLD_LINK LIBADD_SHL_LOAD LIBADD_DLOPEN LT_DLLOADERS INCLTDL LTDLINCL LTDLDEPS LIBLTDL LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR FILECMD LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC LIBTOOL OBJDUMP DLLTOOL AS CANCHECK_FALSE CANCHECK_TRUE CPPUNIT_LIBS CPPUNIT_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V CSCOPE ETAGS CTAGS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM host_os host_vendor host_cpu host build_os build_vendor build_cpu build JAGS_MINOR JAGS_MAJOR target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_static enable_shared with_pic enable_fast_install with_aix_soname enable_dependency_tracking with_gnu_ld with_sysroot enable_libtool_lock with_included_ltdl with_ltdl_include with_ltdl_lib enable_ltdl_install with_blas with_lapack ' ac_precious_vars='build_alias host_alias target_alias PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR CPPUNIT_CFLAGS CPPUNIT_LIBS CC CFLAGS LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH CXX CXXFLAGS CCC CXXCPP F77 FFLAGS YACC YFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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 case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -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_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=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 ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$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'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" 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 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # 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 the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | 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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 JAGS 4.3.2 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 \`..'] 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] --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] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/JAGS] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of JAGS 4.3.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-libtool-lock avoid locking (might break parallel builds) --enable-ltdl-install install libltdl Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-included-ltdl use the GNU ltdl sources included here --with-ltdl-include=DIR use the ltdl headers installed in DIR --with-ltdl-lib=DIR use the libltdl.la installed in DIR --with-blas= use BLAS library --with-lapack= use LAPACK library Some influential environment variables: PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path CPPUNIT_CFLAGS C compiler flags for CPPUNIT, overriding pkg-config CPPUNIT_LIBS linker flags for CPPUNIT, overriding pkg-config CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. 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 else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF JAGS configure 4.3.2 generated by GNU Autoconf 2.71 Copyright (C) 2021 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 fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* 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_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR # ------------------------------------------------------------------ # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR. ac_fn_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_check_decl # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main (void) { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_f77_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_f77_try_compile # ac_fn_f77_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_f77_try_link # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that # executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by JAGS $as_me 4.3.2, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&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_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=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append 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 as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*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; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Test code for whether the C++ compiler supports C++98 (global declarations) ac_cxx_conftest_cxx98_globals=' // Does the compiler advertise C++98 conformance? #if !defined __cplusplus || __cplusplus < 199711L # error "Compiler does not advertise C++98 conformance" #endif // These inclusions are to reject old compilers that // lack the unsuffixed header files. #include #include // and are *not* freestanding headers in C++98. extern void assert (int); namespace std { extern int strcmp (const char *, const char *); } // Namespaces, exceptions, and templates were all added after "C++ 2.0". using std::exception; using std::strcmp; namespace { void test_exception_syntax() { try { throw "test"; } catch (const char *s) { // Extra parentheses suppress a warning when building autoconf itself, // due to lint rules shared with more typical C programs. assert (!(strcmp) (s, "test")); } } template struct test_template { T const val; explicit test_template(T t) : val(t) {} template T add(U u) { return static_cast(u) + val; } }; } // anonymous namespace ' # Test code for whether the C++ compiler supports C++98 (body of main) ac_cxx_conftest_cxx98_main=' assert (argc); assert (! argv[0]); { test_exception_syntax (); test_template tt (2.0); assert (tt.add (4) == 6.0); assert (true && !false); } ' # Test code for whether the C++ compiler supports C++11 (global declarations) ac_cxx_conftest_cxx11_globals=' // Does the compiler advertise C++ 2011 conformance? #if !defined __cplusplus || __cplusplus < 201103L # error "Compiler does not advertise C++11 conformance" #endif namespace cxx11test { constexpr int get_val() { return 20; } struct testinit { int i; double d; }; class delegate { public: delegate(int n) : n(n) {} delegate(): delegate(2354) {} virtual int getval() { return this->n; }; protected: int n; }; class overridden : public delegate { public: overridden(int n): delegate(n) {} virtual int getval() override final { return this->n * 2; } }; class nocopy { public: nocopy(int i): i(i) {} nocopy() = default; nocopy(const nocopy&) = delete; nocopy & operator=(const nocopy&) = delete; private: int i; }; // for testing lambda expressions template Ret eval(Fn f, Ret v) { return f(v); } // for testing variadic templates and trailing return types template auto sum(V first) -> V { return first; } template auto sum(V first, Args... rest) -> V { return first + sum(rest...); } } ' # Test code for whether the C++ compiler supports C++11 (body of main) ac_cxx_conftest_cxx11_main=' { // Test auto and decltype auto a1 = 6538; auto a2 = 48573953.4; auto a3 = "String literal"; int total = 0; for (auto i = a3; *i; ++i) { total += *i; } decltype(a2) a4 = 34895.034; } { // Test constexpr short sa[cxx11test::get_val()] = { 0 }; } { // Test initializer lists cxx11test::testinit il = { 4323, 435234.23544 }; } { // Test range-based for int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; for (auto &x : array) { x += 23; } } { // Test lambda expressions using cxx11test::eval; assert (eval ([](int x) { return x*2; }, 21) == 42); double d = 2.0; assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); assert (d == 5.0); assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); assert (d == 5.0); } { // Test use of variadic templates using cxx11test::sum; auto a = sum(1); auto b = sum(1, 2); auto c = sum(1.0, 2.0, 3.0); } { // Test constructor delegation cxx11test::delegate d1; cxx11test::delegate d2(); cxx11test::delegate d3(45); } { // Test override and final cxx11test::overridden o1(55464); } { // Test nullptr char *c = nullptr; } { // Test template brackets test_template<::test_template> v(test_template(12)); } { // Unicode literals char const *utf8 = u8"UTF-8 string \u2500"; char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ' # Test code for whether the C compiler supports C++11 (complete). ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} ${ac_cxx_conftest_cxx11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} ${ac_cxx_conftest_cxx11_main} return ok; } " # Test code for whether the C compiler supports C++98 (complete). ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} return ok; } " # Auxiliary files required by this configure script. ac_aux_files="compile ltmain.sh missing install-sh config.guess config.sub" # Locations in which to look for auxiliary files. ac_aux_dir_candidates="${srcdir}${PATH_SEPARATOR}${srcdir}/..${PATH_SEPARATOR}${srcdir}/../.." # Search for a directory containing all of the required auxiliary files, # $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. # If we don't find one directory that contains all the files we need, # we report the set of missing files from the *first* directory in # $ac_aux_dir_candidates and give up. ac_missing_aux_files="" ac_first_candidate=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in $ac_aux_dir_candidates do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 ac_aux_dir_found=yes ac_install_sh= for ac_aux in $ac_aux_files do # As a special case, if "install-sh" is required, that requirement # can be satisfied by any of "install-sh", "install.sh", or "shtool", # and $ac_install_sh is set appropriately for whichever one is found. if test x"$ac_aux" = x"install-sh" then if test -f "${as_dir}install-sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 ac_install_sh="${as_dir}install-sh -c" elif test -f "${as_dir}install.sh"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 ac_install_sh="${as_dir}install.sh -c" elif test -f "${as_dir}shtool"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 ac_install_sh="${as_dir}shtool install -c" else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} install-sh" else break fi fi else if test -f "${as_dir}${ac_aux}"; then printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 else ac_aux_dir_found=no if $ac_first_candidate; then ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" else break fi fi fi done if test "$ac_aux_dir_found" = yes; then ac_aux_dir="$as_dir" break fi ac_first_candidate=false as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. if test -f "${ac_aux_dir}config.guess"; then ac_config_guess="$SHELL ${ac_aux_dir}config.guess" fi if test -f "${ac_aux_dir}config.sub"; then ac_config_sub="$SHELL ${ac_aux_dir}config.sub" fi if test -f "$ac_aux_dir/configure"; then ac_configure="$SHELL ${ac_aux_dir}configure" fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; 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,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$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 # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$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. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## 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 JAGS_MAJOR=4 JAGS_MINOR=3 JAGS_PATCH=2 printf "%s\n" "#define JAGS_MAJOR $JAGS_MAJOR" >>confdefs.h printf "%s\n" "#define JAGS_MINOR $JAGS_MINOR" >>confdefs.h printf "%s\n" "#define JAGS_PATCH $JAGS_PATCH" >>confdefs.h printf "%s\n" "#define HG_VERSION \"r29e0491115fd 2022-04-12\"" >>confdefs.h printf "%s\n" "#define HG_YEAR \"2022\"" >>confdefs.h printf "%s\n" "#define HG_MONTH_DAY \"0412\"" >>confdefs.h # Make sure we can run config.sub. $SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ac_config_headers="$ac_config_headers config.h" am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac # Account for fact that we put trailing slashes in our PATH walk. case $as_dir in #(( ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test ${ac_cv_path_mkdir+y} then : printf %s "(cached) " >&6 else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir ('*'coreutils) '* | \ 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 printf "%s\n" "$AWK" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } SET_MAKE= else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test ${enable_silent_rules+y} then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 printf %s "checking whether $am_make supports nested variables... " >&6; } if test ${am_cv_make_support_nested_variables+y} then : printf %s "(cached) " >&6 else $as_nop if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='JAGS' VERSION='4.3.2' printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi if test -z "$ETAGS"; then ETAGS=etags fi if test -z "$CSCOPE"; then CSCOPE=cscope fi # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else $as_nop case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 printf "%s\n" "$PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} then : printf %s "(cached) " >&6 else $as_nop case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } PKG_CONFIG="" fi fi if test -n "$PKG_CONFIG" then : pkg_failed=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CPPUNIT" >&5 printf %s "checking for CPPUNIT... " >&6; } if test -n "$CPPUNIT_CFLAGS"; then pkg_cv_CPPUNIT_CFLAGS="$CPPUNIT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cppunit >= 1.12.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "cppunit >= 1.12.1") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CPPUNIT_CFLAGS=`$PKG_CONFIG --cflags "cppunit >= 1.12.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$CPPUNIT_LIBS"; then pkg_cv_CPPUNIT_LIBS="$CPPUNIT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"cppunit >= 1.12.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "cppunit >= 1.12.1") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_CPPUNIT_LIBS=`$PKG_CONFIG --libs "cppunit >= 1.12.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then CPPUNIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "cppunit >= 1.12.1" 2>&1` else CPPUNIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "cppunit >= 1.12.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CPPUNIT_PKG_ERRORS" >&5 cancheck=no elif test $pkg_failed = untried; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } cancheck=no else CPPUNIT_CFLAGS=$pkg_cv_CPPUNIT_CFLAGS CPPUNIT_LIBS=$pkg_cv_CPPUNIT_LIBS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } cancheck=yes fi fi if test x$cancheck = xyes; then CANCHECK_TRUE= CANCHECK_FALSE='#' else CANCHECK_TRUE='#' CANCHECK_FALSE= fi case `pwd` in *\ * | *\ *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.7' macro_revision='2.4.7' ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case $ECHO in printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 printf "%s\n" "printf" >&6; } ;; print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 printf "%s\n" "print -r" >&6; } ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 printf "%s\n" "cat" >&6; } ;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test ${enable_dependency_tracking+y} then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= 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 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM 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. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 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 | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; 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 ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi 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_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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 printf %s "checking for a sed that does not truncate output... " >&6; } if test ${ac_cv_path_SED+y} then : printf %s "(cached) " >&6 else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in sed gsed do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in grep ggrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in egrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in fgrep do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test ${lt_cv_path_NM+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DUMPBIN+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 printf "%s\n" "$DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DUMPBIN+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 printf %s "checking the name lister ($NM) interface... " >&6; } if test ${lt_cv_nm_interface+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 printf "%s\n" "$lt_cv_nm_interface" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 printf %s "checking the maximum length of command line arguments... " >&6; } if test ${lt_cv_sys_max_cmd_len+y} then : printf %s "(cached) " >&6 else $as_nop i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n "$lt_cv_sys_max_cmd_len"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 printf %s "checking how to convert $build file names to $host format... " >&6; } if test ${lt_cv_to_host_file_cmd+y} then : printf %s "(cached) " >&6 else $as_nop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 printf %s "checking how to convert $build file names to toolchain format... " >&6; } if test ${lt_cv_to_tool_file_cmd+y} then : printf %s "(cached) " >&6 else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 printf %s "checking for $LD option to reload object files... " >&6; } if test ${lt_cv_ld_reload_flag+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ld_reload_flag='-r' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; then reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. set dummy ${ac_tool_prefix}file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_FILECMD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$FILECMD"; then ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_FILECMD="${ac_tool_prefix}file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi FILECMD=$ac_cv_prog_FILECMD if test -n "$FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 printf "%s\n" "$FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_FILECMD"; then ac_ct_FILECMD=$FILECMD # Extract the first word of "file", so it can be a program name with args. set dummy file; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_FILECMD+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_FILECMD"; then ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_FILECMD="file" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD if test -n "$ac_ct_FILECMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 printf "%s\n" "$ac_ct_FILECMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_FILECMD" = x; then FILECMD=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac FILECMD=$ac_ct_FILECMD fi else FILECMD="$ac_cv_prog_FILECMD" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 printf %s "checking how to recognize dependent libraries... " >&6; } if test ${lt_cv_deplibs_check_method+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 printf %s "checking how to associate runtime and link libraries... " >&6; } if test ${lt_cv_sharedlib_from_linklib_cmd+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 printf "%s\n" "$AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 printf "%s\n" "$ac_ct_AR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} # Use ARFLAGS variable as AR's operation code to sync the variable naming with # Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have # higher priority because thats what people were doing historically (setting # ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS # variable obsoleted/removed. test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} lt_ar_flags=$AR_FLAGS # Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override # by AR_FLAGS because that was never working and AR_FLAGS is about to die. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 printf %s "checking for archiver @FILE support... " >&6; } if test ${lt_cv_ar_at_file+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 printf "%s\n" "$STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_STRIP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 printf "%s\n" "$ac_ct_STRIP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 printf "%s\n" "$RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 printf "%s\n" "$ac_ct_RANLIB" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 printf %s "checking command to parse $NM output from $compiler object... " >&6; } if test ${lt_cv_sys_global_symbol_pipe+y} then : printf %s "(cached) " >&6 else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 printf "%s\n" "failed" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test ${with_sysroot+y} then : withval=$with_sysroot; else $as_nop with_sysroot=no fi lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 printf "%s\n" "${lt_sysroot:-no}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 printf %s "checking for a working dd... " >&6; } if test ${ac_cv_path_lt_DD+y} then : printf %s "(cached) " >&6 else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_prog in dd do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 printf "%s\n" "$ac_cv_path_lt_DD" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 printf %s "checking how to truncate binary pipes... " >&6; } if test ${lt_cv_truncate_bin+y} then : printf %s "(cached) " >&6 else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 printf "%s\n" "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test ${enable_libtool_lock+y} then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 printf %s "checking whether the C compiler needs -belf... " >&6; } if test ${lt_cv_cc_needs_belf+y} then : printf %s "(cached) " >&6 else $as_nop 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_cc_needs_belf=yes else $as_nop lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext 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 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 printf "%s\n" "$MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if test ${lt_cv_path_mainfest_tool+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DSYMUTIL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 printf "%s\n" "$DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_NMEDIT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 printf "%s\n" "$NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_NMEDIT+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 printf "%s\n" "$ac_ct_NMEDIT" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LIPO+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 printf "%s\n" "$LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_LIPO+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 printf "%s\n" "$ac_ct_LIPO" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 printf "%s\n" "$OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 printf "%s\n" "$ac_ct_OTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OTOOL64+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 printf "%s\n" "$OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OTOOL64+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 printf "%s\n" "$ac_ct_OTOOL64" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 printf %s "checking for -single_module linker flag... " >&6; } if test ${lt_cv_apple_cc_single_mod+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 printf %s "checking for -exported_symbols_list linker flag... " >&6; } if test ${lt_cv_ld_exported_symbols_list+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_ld_exported_symbols_list=yes else $as_nop lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 printf %s "checking for -force_load linker flag... " >&6; } if test ${lt_cv_ld_force_load+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) case $MACOSX_DEPLOYMENT_TARGET,$host in 10.[012],*|,*powerpc*-darwin[5-8]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi # Set options enable_dlopen=yes # Check whether --enable-static was given. if test ${enable_static+y} then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop enable_static=no fi enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AS+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 printf "%s\n" "$AS" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AS+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 printf "%s\n" "$ac_ct_AS" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_DLLTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 printf "%s\n" "$DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_DLLTOOL+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_OBJDUMP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 printf "%s\n" "$OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_OBJDUMP+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --enable-shared was given. if test ${enable_shared+y} then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop enable_shared=yes fi # Check whether --with-pic was given. if test ${with_pic+y} then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for lt_pkg in $withval; do IFS=$lt_save_ifs if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop pic_mode=default fi # Check whether --enable-fast-install was given. if test ${enable_fast_install+y} then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, for pkg in $enableval; do IFS=$lt_save_ifs if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS=$lt_save_ifs ;; esac else $as_nop enable_fast_install=yes fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test ${with_aix_soname+y} then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else $as_nop if test ${lt_cv_with_aix_soname+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 printf %s "checking for objdir... " >&6; } if test ${lt_cv_objdir+y} then : printf %s "(cached) " >&6 else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC and # ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o func_cc_basename $compiler cc_basename=$func_cc_basename_result # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 printf %s "checking for ${ac_tool_prefix}file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/${ac_tool_prefix}file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 printf %s "checking for file... " >&6; } if test ${lt_cv_path_MAGIC_CMD+y} then : printf %s "(cached) " >&6 else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/file"; then lt_cv_path_MAGIC_CMD=$ac_dir/"file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 printf "%s\n" "$MAGIC_CMD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC=$CC 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 # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test yes = "$GCC"; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test ${lt_cv_prog_compiler_rtti_exceptions+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test ${lt_cv_prog_compiler_pic_works+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : else lt_prog_compiler_static= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' export_dynamic_flag_spec='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='$wl--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs=yes ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test no = "$ld_shlibs"; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath_+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' $wl-bernotok' allow_undefined_flag=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 printf %s "checking if $CC understands -b... " >&6; } if test ${lt_cv_prog_compiler__b+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec='$wl+b $wl$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else $as_nop lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='$wl-rpath,$libdir' export_dynamic_flag_spec='$wl-E' else archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes file_list_spec='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag=' $wl-expect_unresolved $wl\*' archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='$wl-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='$wl-z,text' allow_undefined_flag='$wl-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='$wl-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc+y} then : printf %s "(cached) " >&6 else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else $as_nop ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else $as_nop lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : lt_cv_dlopen=shl_load else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char shl_load (); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else $as_nop ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes then : lt_cv_dlopen=dlopen else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 printf %s "checking for dlopen in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlopen=yes else $as_nop ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else $as_nop ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dld_link (); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else $as_nop ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi fi fi fi fi fi ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 printf %s "checking whether a program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self+y} then : printf %s "(cached) " >&6 else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 printf %s "checking whether a statically linked program can dlopen itself... " >&6; } if test ${lt_cv_dlopen_self_static+y} then : printf %s "(cached) " >&6 else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 printf %s "checking whether stripping libraries is possible... " >&6; } if test -z "$STRIP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } else if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else case $host_os in darwin*) # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } ;; freebsd*) if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then old_striplib="$STRIP --strip-debug" striplib="$STRIP --strip-unneeded" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } ;; esac fi fi # Report what library types will actually be built { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } 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 CC=$lt_save_CC ac_config_commands="$ac_config_commands libtool" # Only expand once: { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5 printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; } if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" # This test program should *not* compile successfully. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { (void) strchr; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the # off chance that they somehow elicit warnings. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include extern void ac_decl (int, char *); int main (void) { (void) ac_decl (0, (char *) 0); (void) ac_decl; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' else $as_nop ac_cv_c_undeclared_builtin_options=$ac_arg fi break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins See \`config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking what extension is used for runtime loadable modules" >&5 printf %s "checking what extension is used for runtime loadable modules... " >&6; } if test ${libltdl_cv_shlibext+y} then : printf %s "(cached) " >&6 else $as_nop module=yes eval libltdl_cv_shlibext=$shrext_cmds module=no eval libltdl_cv_shrext=$shrext_cmds fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_shlibext" >&5 printf "%s\n" "$libltdl_cv_shlibext" >&6; } if test -n "$libltdl_cv_shlibext"; then printf "%s\n" "#define LT_MODULE_EXT \"$libltdl_cv_shlibext\"" >>confdefs.h fi if test "$libltdl_cv_shrext" != "$libltdl_cv_shlibext"; then printf "%s\n" "#define LT_SHARED_EXT \"$libltdl_cv_shrext\"" >>confdefs.h fi if test -n "$shared_archive_member_spec"; then printf "%s\n" "#define LT_SHARED_LIB_MEMBER \"($shared_archive_member_spec.o)\"" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking what variable specifies run-time module search path" >&5 printf %s "checking what variable specifies run-time module search path... " >&6; } if test ${lt_cv_module_path_var+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_module_path_var=$shlibpath_var fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_module_path_var" >&5 printf "%s\n" "$lt_cv_module_path_var" >&6; } if test -n "$lt_cv_module_path_var"; then printf "%s\n" "#define LT_MODULE_PATH_VAR \"$lt_cv_module_path_var\"" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the default library search path" >&5 printf %s "checking for the default library search path... " >&6; } if test ${lt_cv_sys_dlsearch_path+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_sys_dlsearch_path=$sys_lib_dlsearch_path_spec fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlsearch_path" >&5 printf "%s\n" "$lt_cv_sys_dlsearch_path" >&6; } if test -n "$lt_cv_sys_dlsearch_path"; then sys_dlsearch_path= for dir in $lt_cv_sys_dlsearch_path; do if test -z "$sys_dlsearch_path"; then sys_dlsearch_path=$dir else sys_dlsearch_path=$sys_dlsearch_path$PATH_SEPARATOR$dir fi done printf "%s\n" "#define LT_DLSEARCH_PATH \"$sys_dlsearch_path\"" >>confdefs.h fi LT_DLLOADERS= 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 lt_dlload_save_LIBS=$LIBS LIBADD_DLOPEN= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 printf %s "checking for library containing dlopen... " >&6; } if test ${ac_cv_search_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF for ac_lib in '' dl do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_dlopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_dlopen+y} then : break fi done if test ${ac_cv_search_dlopen+y} then : else $as_nop ac_cv_search_dlopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 printf "%s\n" "$ac_cv_search_dlopen" >&6; } ac_res=$ac_cv_search_dlopen if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAVE_LIBDL 1" >>confdefs.h if test "$ac_cv_search_dlopen" != "none required"; then LIBADD_DLOPEN=-ldl fi libltdl_cv_lib_dl_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_DLFCN_H # include #endif int main (void) { dlopen(0, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : printf "%s\n" "#define HAVE_LIBDL 1" >>confdefs.h libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 printf %s "checking for dlopen in -lsvld... " >&6; } if test ${ac_cv_lib_svld_dlopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlopen (); int main (void) { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_svld_dlopen=yes else $as_nop ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes then : printf "%s\n" "#define HAVE_LIBDL 1" >>confdefs.h LIBADD_DLOPEN=-lsvld libltdl_cv_func_dlopen=yes LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la" fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen" then lt_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" ac_fn_c_check_func "$LINENO" "dlerror" "ac_cv_func_dlerror" if test "x$ac_cv_func_dlerror" = xyes then : printf "%s\n" "#define HAVE_DLERROR 1" >>confdefs.h fi LIBS=$lt_save_LIBS fi LIBADD_SHL_LOAD= ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes then : printf "%s\n" "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 printf %s "checking for shl_load in -ldld... " >&6; } if test ${ac_cv_lib_dld_shl_load+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char shl_load (); int main (void) { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_shl_load=yes else $as_nop ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes then : printf "%s\n" "#define HAVE_SHL_LOAD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la" LIBADD_SHL_LOAD=-ldld fi fi case $host_os in darwin[1567].*) # We only want this for pre-Mac OS X 10.4. ac_fn_c_check_func "$LINENO" "_dyld_func_lookup" "ac_cv_func__dyld_func_lookup" if test "x$ac_cv_func__dyld_func_lookup" = xyes then : printf "%s\n" "#define HAVE_DYLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la" fi ;; beos*) LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la" ;; cygwin* | mingw* | pw32*) ac_fn_check_decl "$LINENO" "cygwin_conv_path" "ac_cv_have_decl_cygwin_conv_path" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_cygwin_conv_path" = xyes then : ac_have_decl=1 else $as_nop ac_have_decl=0 fi printf "%s\n" "#define HAVE_DECL_CYGWIN_CONV_PATH $ac_have_decl" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 printf %s "checking for dld_link in -ldld... " >&6; } if test ${ac_cv_lib_dld_dld_link+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dld_link (); int main (void) { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dld_dld_link=yes else $as_nop ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes then : printf "%s\n" "#define HAVE_DLD 1" >>confdefs.h LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la" fi LT_DLPREOPEN= if test -n "$LT_DLLOADERS" then for lt_loader in $LT_DLLOADERS; do LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader " done printf "%s\n" "#define HAVE_LIBDLLOADER 1" >>confdefs.h fi LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" LIBS=$lt_dlload_save_LIBS 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5 printf %s "checking for _ prefix in compiled symbols... " >&6; } if test ${lt_cv_sys_symbol_underscore+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_sys_symbol_underscore=no cat > conftest.$ac_ext <<_LT_EOF void nm_test_func(){} int main(){nm_test_func;return 0;} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. ac_nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then lt_cv_sys_symbol_underscore=yes else if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&5 fi fi else echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "configure: failed program was:" >&5 cat conftest.c >&5 fi rm -rf conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5 printf "%s\n" "$lt_cv_sys_symbol_underscore" >&6; } sys_symbol_underscore=$lt_cv_sys_symbol_underscore if test yes = "$lt_cv_sys_symbol_underscore"; then if test yes = "$libltdl_cv_func_dlopen" || test yes = "$libltdl_cv_lib_dl_dlopen"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we have to add an underscore for dlsym" >&5 printf %s "checking whether we have to add an underscore for dlsym... " >&6; } if test ${libltdl_cv_need_uscore+y} then : printf %s "(cached) " >&6 else $as_nop libltdl_cv_need_uscore=unknown dlsym_uscore_save_LIBS=$LIBS LIBS="$LIBS $LIBADD_DLOPEN" libname=conftmod # stay within 8.3 filename limits! cat >$libname.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } _LT_EOF # ltfn_module_cmds module_cmds # Execute tilde-delimited MODULE_CMDS with environment primed for # $module_cmds or $archive_cmds type content. ltfn_module_cmds () {( # subshell avoids polluting parent global environment module_cmds_save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$module_cmds_save_ifs libobjs=$libname.$ac_objext; lib=$libname$libltdl_cv_shlibext rpath=/not-exists; soname=$libname$libltdl_cv_shlibext; output_objdir=. major=; versuffix=; verstring=; deplibs= ECHO=echo; wl=$lt_prog_compiler_wl; allow_undefined_flag= eval $cmd done IFS=$module_cmds_save_ifs )} # Compile a loadable module using libtool macro expansion results. $CC $pic_flag -c $libname.$ac_ext ltfn_module_cmds "${module_cmds:-$archive_cmds}" # Try to fetch fnord with dlsym(). libltdl_dlunknown=0; libltdl_dlnouscore=1; libltdl_dluscore=2 cat >conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifndef RTLD_GLOBAL # ifdef DL_GLOBAL # define RTLD_GLOBAL DL_GLOBAL # else # define RTLD_GLOBAL 0 # endif #endif #ifndef RTLD_NOW # ifdef DL_NOW # define RTLD_NOW DL_NOW # else # define RTLD_NOW 0 # endif #endif int main () { void *handle = dlopen ("`pwd`/$libname$libltdl_cv_shlibext", RTLD_GLOBAL|RTLD_NOW); int status = $libltdl_dlunknown; if (handle) { if (dlsym (handle, "fnord")) status = $libltdl_dlnouscore; else { if (dlsym (handle, "_fnord")) status = $libltdl_dluscore; else puts (dlerror ()); } dlclose (handle); } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null libltdl_status=$? case x$libltdl_status in x$libltdl_dlnouscore) libltdl_cv_need_uscore=no ;; x$libltdl_dluscore) libltdl_cv_need_uscore=yes ;; x*) libltdl_cv_need_uscore=unknown ;; esac fi rm -rf conftest* $libname* LIBS=$dlsym_uscore_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_need_uscore" >&5 printf "%s\n" "$libltdl_cv_need_uscore" >&6; } fi fi if test yes = "$libltdl_cv_need_uscore"; then printf "%s\n" "#define NEED_USCORE 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether deplibs are loaded by dlopen" >&5 printf %s "checking whether deplibs are loaded by dlopen... " >&6; } if test ${lt_cv_sys_dlopen_deplibs+y} then : printf %s "(cached) " >&6 else $as_nop # PORTME does your system automatically load deplibs for dlopen? # or its logical equivalent (e.g. shl_load for HP-UX < 11) # For now, we just catch OSes we know something about -- in the # future, we'll try test this programmatically. lt_cv_sys_dlopen_deplibs=unknown case $host_os in aix3*|aix4.1.*|aix4.2.*) # Unknown whether this is true for these versions of AIX, but # we want this 'case' here to explicitly catch those versions. lt_cv_sys_dlopen_deplibs=unknown ;; aix[4-9]*) lt_cv_sys_dlopen_deplibs=yes ;; amigaos*) case $host_cpu in powerpc) lt_cv_sys_dlopen_deplibs=no ;; esac ;; bitrig*) lt_cv_sys_dlopen_deplibs=yes ;; darwin*) # Assuming the user has installed a libdl from somewhere, this is true # If you are looking for one http://www.opendarwin.org/projects/dlcompat lt_cv_sys_dlopen_deplibs=yes ;; freebsd* | dragonfly* | midnightbsd*) lt_cv_sys_dlopen_deplibs=yes ;; gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu) # GNU and its variants, using gnu ld.so (Glibc) lt_cv_sys_dlopen_deplibs=yes ;; hpux10*|hpux11*) lt_cv_sys_dlopen_deplibs=yes ;; interix*) lt_cv_sys_dlopen_deplibs=yes ;; irix[12345]*|irix6.[01]*) # Catch all versions of IRIX before 6.2, and indicate that we don't # know how it worked for any of those versions. lt_cv_sys_dlopen_deplibs=unknown ;; irix*) # The case above catches anything before 6.2, and it's known that # at 6.2 and later dlopen does load deplibs. lt_cv_sys_dlopen_deplibs=yes ;; netbsd*) lt_cv_sys_dlopen_deplibs=yes ;; openbsd*) lt_cv_sys_dlopen_deplibs=yes ;; osf[1234]*) # dlopen did load deplibs (at least at 4.x), but until the 5.x series, # it did *not* use an RPATH in a shared library to find objects the # library depends on, so we explicitly say 'no'. lt_cv_sys_dlopen_deplibs=no ;; osf5.0|osf5.0a|osf5.1) # dlopen *does* load deplibs and with the right loader patch applied # it even uses RPATH in a shared library to search for shared objects # that the library depends on, but there's no easy way to know if that # patch is installed. Since this is the case, all we can really # say is unknown -- it depends on the patch being installed. If # it is, this changes to 'yes'. Without it, it would be 'no'. lt_cv_sys_dlopen_deplibs=unknown ;; osf*) # the two cases above should catch all versions of osf <= 5.1. Read # the comments above for what we know about them. # At > 5.1, deplibs are loaded *and* any RPATH in a shared library # is used to find them so we can finally say 'yes'. lt_cv_sys_dlopen_deplibs=yes ;; qnx*) lt_cv_sys_dlopen_deplibs=yes ;; solaris*) lt_cv_sys_dlopen_deplibs=yes ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) libltdl_cv_sys_dlopen_deplibs=yes ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_dlopen_deplibs" >&5 printf "%s\n" "$lt_cv_sys_dlopen_deplibs" >&6; } if test yes != "$lt_cv_sys_dlopen_deplibs"; then printf "%s\n" "#define LTDL_DLOPEN_DEPLIBS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "argz.h" "ac_cv_header_argz_h" "$ac_includes_default " if test "x$ac_cv_header_argz_h" = xyes then : printf "%s\n" "#define HAVE_ARGZ_H 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "error_t" "ac_cv_type_error_t" "#if defined(HAVE_ARGZ_H) # include #endif " if test "x$ac_cv_type_error_t" = xyes then : printf "%s\n" "#define HAVE_ERROR_T 1" >>confdefs.h else $as_nop printf "%s\n" "#define error_t int" >>confdefs.h printf "%s\n" "#define __error_t_defined 1" >>confdefs.h fi LT_ARGZ_H= for ac_func in argz_add argz_append argz_count argz_create_sep argz_insert argz_next argz_stringify do : as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else $as_nop LT_ARGZ_H=lt__argz.h; _LT_LIBOBJS="$_LT_LIBOBJS lt__argz.$ac_objext" fi done if test -z "$LT_ARGZ_H" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if argz actually works" >&5 printf %s "checking if argz actually works... " >&6; } if test ${lt_cv_sys_argz_works+y} then : printf %s "(cached) " >&6 else $as_nop case $host_os in #( *cygwin*) lt_cv_sys_argz_works=no if test no != "$cross_compiling"; then lt_cv_sys_argz_works="guessing no" else lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/' save_IFS=$IFS IFS=-. set x `uname -r | $SED -e "$lt_sed_extract_leading_digits"` IFS=$save_IFS lt_os_major=${2-0} lt_os_minor=${3-0} lt_os_micro=${4-0} if test 1 -lt "$lt_os_major" \ || { test 1 -eq "$lt_os_major" \ && { test 5 -lt "$lt_os_minor" \ || { test 5 -eq "$lt_os_minor" \ && test 24 -lt "$lt_os_micro"; }; }; }; then lt_cv_sys_argz_works=yes fi fi ;; #( *) lt_cv_sys_argz_works=yes ;; esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_argz_works" >&5 printf "%s\n" "$lt_cv_sys_argz_works" >&6; } if test yes = "$lt_cv_sys_argz_works" then : printf "%s\n" "#define HAVE_WORKING_ARGZ 1" >>confdefs.h else $as_nop LT_ARGZ_H=lt__argz.h _LT_LIBOBJS="$_LT_LIBOBJS lt__argz.$ac_objext" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether libtool supports -dlopen/-dlpreopen" >&5 printf %s "checking whether libtool supports -dlopen/-dlpreopen... " >&6; } if test ${libltdl_cv_preloaded_symbols+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$lt_cv_sys_global_symbol_pipe"; then libltdl_cv_preloaded_symbols=yes else libltdl_cv_preloaded_symbols=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libltdl_cv_preloaded_symbols" >&5 printf "%s\n" "$libltdl_cv_preloaded_symbols" >&6; } if test yes = "$libltdl_cv_preloaded_symbols"; then printf "%s\n" "#define HAVE_PRELOADED_SYMBOLS 1" >>confdefs.h fi # Set options # Check whether --with-included_ltdl was given. if test ${with_included_ltdl+y} then : withval=$with_included_ltdl; fi if test yes != "$with_included_ltdl"; then # We are not being forced to use the included libltdl sources, so # decide whether there is a useful installed version we can use. ac_fn_c_check_header_compile "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default " if test "x$ac_cv_header_ltdl_h" = xyes then : ac_fn_check_decl "$LINENO" "lt_dlinterface_register" "ac_cv_have_decl_lt_dlinterface_register" "$ac_includes_default #include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_lt_dlinterface_register" = xyes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lt_dladvise_preload in -lltdl" >&5 printf %s "checking for lt_dladvise_preload in -lltdl... " >&6; } if test ${ac_cv_lib_ltdl_lt_dladvise_preload+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lltdl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char lt_dladvise_preload (); int main (void) { return lt_dladvise_preload (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ltdl_lt_dladvise_preload=yes else $as_nop ac_cv_lib_ltdl_lt_dladvise_preload=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ltdl_lt_dladvise_preload" >&5 printf "%s\n" "$ac_cv_lib_ltdl_lt_dladvise_preload" >&6; } if test "x$ac_cv_lib_ltdl_lt_dladvise_preload" = xyes then : with_included_ltdl=no else $as_nop with_included_ltdl=yes fi else $as_nop with_included_ltdl=yes fi else $as_nop with_included_ltdl=yes fi fi # Check whether --with-ltdl_include was given. if test ${with_ltdl_include+y} then : withval=$with_ltdl_include; fi if test -n "$with_ltdl_include"; then if test -f "$with_ltdl_include/ltdl.h"; then : else as_fn_error $? "invalid ltdl include directory: '$with_ltdl_include'" "$LINENO" 5 fi else with_ltdl_include=no fi # Check whether --with-ltdl_lib was given. if test ${with_ltdl_lib+y} then : withval=$with_ltdl_lib; fi if test -n "$with_ltdl_lib"; then if test -f "$with_ltdl_lib/libltdl.la"; then : else as_fn_error $? "invalid ltdl library directory: '$with_ltdl_lib'" "$LINENO" 5 fi else with_ltdl_lib=no fi case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in ,yes,no,no,) case $enable_ltdl_convenience in no) as_fn_error $? "this package needs a convenience libltdl" "$LINENO" 5 ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='$(top_build_prefix)'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" LTDLDEPS=$LIBLTDL LTDLINCL='-I$(top_srcdir)'"${lt_ltdl_dir+/$lt_ltdl_dir}" # For backwards non-gettext consistent compatibility... INCLTDL=$LTDLINCL ;; ,no,no,no,) # If the included ltdl is not to be used, then use the # preinstalled libltdl we found. printf "%s\n" "#define HAVE_LTDL 1" >>confdefs.h LIBLTDL=-lltdl LTDLDEPS= LTDLINCL= ;; ,no*,no,*) as_fn_error $? "'--with-ltdl-include' and '--with-ltdl-lib' options must be used together" "$LINENO" 5 ;; *) with_included_ltdl=no LIBLTDL="-L$with_ltdl_lib -lltdl" LTDLDEPS= LTDLINCL=-I$with_ltdl_include ;; esac INCLTDL=$LTDLINCL # Report our decision... { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find libltdl headers" >&5 printf %s "checking where to find libltdl headers... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LTDLINCL" >&5 printf "%s\n" "$LTDLINCL" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find libltdl library" >&5 printf %s "checking where to find libltdl library... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBLTDL" >&5 printf "%s\n" "$LIBLTDL" >&6; } # Check whether --enable-ltdl-install was given. if test ${enable_ltdl_install+y} then : enableval=$enable_ltdl_install; fi case ,$enable_ltdl_install,$enable_ltdl_convenience in *yes*) ;; *) enable_ltdl_convenience=yes ;; esac if test no != "${enable_ltdl_install-no}"; then INSTALL_LTDL_TRUE= INSTALL_LTDL_FALSE='#' else INSTALL_LTDL_TRUE='#' INSTALL_LTDL_FALSE= fi if test no != "${enable_ltdl_convenience-no}"; then CONVENIENCE_LTDL_TRUE= CONVENIENCE_LTDL_FALSE='#' else CONVENIENCE_LTDL_TRUE='#' CONVENIENCE_LTDL_FALSE= fi # In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS # the user used. This is so that ltdl.h can pick up the parent projects # config.h file, The first file in AC_CONFIG_HEADERS must contain the # definitions required by ltdl.c. # FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default " if test "x$ac_cv_header_unistd_h" = xyes then : printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default " if test "x$ac_cv_header_dl_h" = xyes then : printf "%s\n" "#define HAVE_DL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/dl.h" "ac_cv_header_sys_dl_h" "$ac_includes_default " if test "x$ac_cv_header_sys_dl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_DL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dld.h" "ac_cv_header_dld_h" "$ac_includes_default " if test "x$ac_cv_header_dld_h" = xyes then : printf "%s\n" "#define HAVE_DLD_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "mach-o/dyld.h" "ac_cv_header_mach_o_dyld_h" "$ac_includes_default " if test "x$ac_cv_header_mach_o_dyld_h" = xyes then : printf "%s\n" "#define HAVE_MACH_O_DYLD_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default " if test "x$ac_cv_header_dirent_h" = xyes then : printf "%s\n" "#define HAVE_DIRENT_H 1" >>confdefs.h fi for ac_func in closedir opendir readdir do : as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else $as_nop _LT_LIBOBJS="$_LT_LIBOBJS lt__dirent.$ac_objext" fi done for ac_func in strlcat strlcpy do : as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : cat >>confdefs.h <<_ACEOF #define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else $as_nop _LT_LIBOBJS="$_LT_LIBOBJS lt__strl.$ac_objext" fi done printf "%s\n" "#define LT_LIBEXT \"$libext\"" >>confdefs.h name= eval "lt_libprefix=\"$libname_spec\"" printf "%s\n" "#define LT_LIBPREFIX \"$lt_libprefix\"" >>confdefs.h name=ltdl eval "LTDLOPEN=\"$libname_spec\"" # Only expand once: 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_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" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; 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 ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi 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_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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 printf %s "checking whether $CC understands -c and -o together... " >&6; } if test ${am_cv_prog_cc_c_o+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 depcc="$CC" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CC_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 printf "%s\n" "$CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 printf "%s\n" "$ac_ct_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_prog_cxx_stdcxx=no if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx11_program _ACEOF for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx11" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx98_program _ACEOF for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx98=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx98" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 fi 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 depcc="$CXX" am_compiler_list= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 printf %s "checking dependency style of $depcc... " >&6; } if test ${am_cv_CXX_dependencies_compiler_type+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi func_stripname_cnf () { case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;; esac } # func_stripname_cnf if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test ${ac_cv_prog_CXXCPP+y} then : printf %s "(cached) " >&6 else $as_nop # Double quotes because $CXX needs to be expanded for CXXCPP in "$CXX -E" cpp /lib/cpp do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else $as_nop # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else $as_nop # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 printf "%s\n" "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # 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 confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : else $as_nop # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO" then : # Broken: success on invalid input. continue else $as_nop # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test ${with_gnu_ld+y} then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 printf %s "checking for GNU ld... " >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 printf %s "checking for non-GNU ld... " >&6; } fi if test ${lt_cv_path_LD+y} then : printf %s "(cached) " >&6 else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 printf "%s\n" "$LD" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 printf %s "checking if the linker ($LD) is GNU ld... " >&6; } if test ${lt_cv_prog_gnu_ld+y} then : printf %s "(cached) " >&6 else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_CXX='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__CXX+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' $wl-bernotok' allow_undefined_flag_CXX=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl* | ,icl* | no,icl*) # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='$wl--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else ld_shlibs_CXX=no fi ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes file_list_spec_CXX='@' ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='$wl-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' export_dynamic_flag_spec_CXX='$wl--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='$wl-E' whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then no_undefined_flag_CXX=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='$wl-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='$wl-z,text' allow_undefined_flag_CXX='$wl-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='$wl-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX LD_CXX=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX=$prev$p else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX=$prev$p else postdeps_CXX="${postdeps_CXX} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_CXX"; then predep_objects_CXX=$p else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX=$p else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic_CXX+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test ${lt_cv_prog_compiler_pic_works_CXX+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works_CXX+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : else lt_prog_compiler_static_CXX= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_CXX+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc_CXX+y} then : printf %s "(cached) " >&6 else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 printf "%s\n" "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" 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_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_F77+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $F77" >&5 printf "%s\n" "$F77" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_F77+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5 printf "%s\n" "$ac_ct_F77" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU Fortran 77" >&5 printf %s "checking whether the compiler supports GNU Fortran 77... " >&6; } if test ${ac_cv_f77_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_f77_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5 printf "%s\n" "$ac_cv_f77_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_f77_compiler_gnu ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+y} ac_save_FFLAGS=$FFLAGS FFLAGS= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5 printf %s "checking whether $F77 accepts -g... " >&6; } if test ${ac_cv_prog_f77_g+y} then : printf %s "(cached) " >&6 else $as_nop FFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO" then : ac_cv_prog_f77_g=yes else $as_nop ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5 printf "%s\n" "$ac_cv_prog_f77_g" >&6; } if test $ac_test_FFLAGS; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi if test $ac_compiler_gnu = yes; then G77=yes else G77= 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_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_direct_absolute_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no inherit_rpath_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds reload_flag_F77=$reload_flag reload_cmds_F77=$reload_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC compiler_F77=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result GCC=$G77 if test -n "$compiler"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 printf %s "checking if libtool supports shared libraries... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 printf "%s\n" "$can_build_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 printf "%s\n" "$enable_shared" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 printf "%s\n" "$enable_static" >&6; } GCC_F77=$G77 LD_F77=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= if test yes = "$GCC"; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi lt_prog_compiler_pic_F77='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_F77='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_F77='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_F77='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_F77= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_F77='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl_F77='-Xlinker ' if test -n "$lt_prog_compiler_pic_F77"; then lt_prog_compiler_pic_F77="-Xcompiler $lt_prog_compiler_pic_F77" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl_F77='-Wl,-Wl,,' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_F77='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fPIC' lt_prog_compiler_static_F77='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='--shared' lt_prog_compiler_static_F77='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl_F77='-Wl,-Wl,,' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-qpic' lt_prog_compiler_static_F77='-qstaticlink' ;; *) case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fPIC' lt_prog_compiler_static_F77='-static' ;; *Portland\ Group*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_F77='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; rdos*) lt_prog_compiler_static_F77='-non_shared' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 printf %s "checking for $compiler option to produce PIC... " >&6; } if test ${lt_cv_prog_compiler_pic_F77+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_pic_F77=$lt_prog_compiler_pic_F77 fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_F77" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_F77" >&6; } lt_prog_compiler_pic_F77=$lt_cv_prog_compiler_pic_F77 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; } if test ${lt_cv_prog_compiler_pic_works_F77+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_F77=yes fi fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_F77" >&5 printf "%s\n" "$lt_cv_prog_compiler_pic_works_F77" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_F77"; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test ${lt_cv_prog_compiler_static_works_F77+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_static_works_F77=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_F77=yes fi else lt_cv_prog_compiler_static_works_F77=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_F77" >&5 printf "%s\n" "$lt_cv_prog_compiler_static_works_F77" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_F77"; then : else lt_prog_compiler_static_F77= fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_F77+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_c_o_F77=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_F77" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test ${lt_cv_prog_compiler_c_o_F77+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_prog_compiler_c_o_F77=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 printf "%s\n" "$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_F77" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_F77= always_export_symbols_F77=no archive_cmds_F77= archive_expsym_cmds_F77= compiler_needs_object_F77=no enable_shared_with_static_runtimes_F77=no export_dynamic_flag_spec_F77= export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic_F77=no hardcode_direct_F77=no hardcode_direct_absolute_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported inherit_rpath_F77=no link_all_deplibs_F77=unknown module_cmds_F77= module_expsym_cmds_F77= old_archive_from_new_cmds_F77= old_archive_from_expsyms_cmds_F77= thread_safe_flag_spec_F77= whole_archive_flag_spec_F77= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir' export_dynamic_flag_spec_F77='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='' ;; m68k) archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' export_dynamic_flag_spec_F77='$wl--export-all-symbols' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_F77='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_F77='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_F77=no fi ;; haiku*) archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_F77=yes ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported shrext_cmds=.dll archive_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_F77=yes file_list_spec_F77='@' ;; interix[3-9]*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='$wl-rpath,$libdir' export_dynamic_flag_spec_F77='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_F77='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec_F77= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec_F77='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_F77=yes ;; esac case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_F77='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object_F77=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) export_dynamic_flag_spec_F77='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec_F77='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir' archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_F77=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir' archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test no = "$ld_shlibs_F77"; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_direct_absolute_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes file_list_spec_F77='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_F77=no hardcode_direct_absolute_F77=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_F77='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__F77+y} then : printf %s "(cached) " >&6 else $as_nop cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__F77=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__F77"; then lt_cv_aix_libpath__F77=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__F77"; then lt_cv_aix_libpath__F77=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__F77 fi hardcode_libdir_flag_spec_F77='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_F77='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if test ${lt_cv_aix_libpath__F77+y} then : printf %s "(cached) " >&6 else $as_nop cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO" then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__F77=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__F77"; then lt_cv_aix_libpath__F77=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__F77"; then lt_cv_aix_libpath__F77=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__F77 fi hardcode_libdir_flag_spec_F77='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' $wl-bernotok' allow_undefined_flag_F77=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_F77='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' fi archive_cmds_need_lc_F77=yes archive_expsym_cmds_F77='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='' ;; m68k) archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl* | icl*) # Native MSVC or ICC hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes file_list_spec_F77='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_F77='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, F77)='true' enable_shared_with_static_runtimes_F77=yes exclude_expsyms_F77='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds_F77='chmod 644 $oldlib' postlink_cmds_F77='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes_F77=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_F77='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' compiler_needs_object_F77=yes else whole_archive_flag_spec_F77='' fi link_all_deplibs_F77=yes allow_undefined_flag_F77=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_F77="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" module_expsym_cmds_F77="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs_F77=no fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly* | midnightbsd*) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds_F77='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds_F77='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='$wl+b $wl$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds_F77='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_F77='$wl+b $wl$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes hardcode_direct_absolute_F77=yes export_dynamic_flag_spec_F77='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_F77='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds_F77='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_F77='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_F77='$wl+b $wl$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes hardcode_direct_absolute_F77=yes export_dynamic_flag_spec_F77='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if test ${lt_cv_irix_exported_symbol+y} then : printf %s "(cached) " >&6 else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat > conftest.$ac_ext <<_ACEOF subroutine foo end _ACEOF if ac_fn_f77_try_link "$LINENO" then : lt_cv_irix_exported_symbol=yes else $as_nop lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc_F77='no' hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir' hardcode_libdir_separator_F77=: inherit_rpath_F77=yes link_all_deplibs_F77=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs_F77=yes archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no hardcode_direct_absolute_F77=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='$wl-rpath,$libdir' export_dynamic_flag_spec_F77='$wl-E' else archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='$wl-rpath,$libdir' fi else ld_shlibs_F77=no fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported shrext_cmds=.dll archive_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_F77=yes file_list_spec_F77='@' ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag_F77=' $wl-expect_unresolved $wl\*' archive_cmds_F77='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi archive_cmds_need_lc_F77='no' hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag_F77=' $wl-expect_unresolved $wl\*' archive_cmds_F77='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi archive_cmds_need_lc_F77='no' hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds_F77='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds_F77='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' archive_cmds_F77='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then whole_archive_flag_spec_F77='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_F77='$wl-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds_F77='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_F77='$wl-z,text' allow_undefined_flag_F77='$wl-z,nodefs' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='$wl-R,$libdir' hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes export_dynamic_flag_spec_F77='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds_F77='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec_F77='$wl-Blargedynsym' ;; esac fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5 printf "%s\n" "$ld_shlibs_F77" >&6; } test no = "$ld_shlibs_F77" && can_build_shared=no with_gnu_ld_F77=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 printf %s "checking whether -lc should be explicitly linked in... " >&6; } if test ${lt_cv_archive_cmds_need_lc_F77+y} then : printf %s "(cached) " >&6 else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 pic_flag=$lt_prog_compiler_pic_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_F77=no else lt_cv_archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_F77" >&5 printf "%s\n" "$lt_cv_archive_cmds_need_lc_F77" >&6; } archive_cmds_need_lc_F77=$lt_cv_archive_cmds_need_lc_F77 ;; esac fi ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 printf %s "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl* | *,icl*) # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_F77='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if test ${lt_cv_shlibpath_overrides_runpath+y} then : printf %s "(cached) " >&6 else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_F77\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_F77\"" cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO" then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || test -n "$runpath_var_F77" || test yes = "$hardcode_automatic_F77"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_F77" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, F77)" && test no != "$hardcode_minus_L_F77"; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5 printf "%s\n" "$hardcode_action_F77" >&6; } if test relink = "$hardcode_action_F77" || test yes = "$inherit_rpath_F77"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" 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 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_LEX+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 printf "%s\n" "$LEX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %{ #ifdef __cplusplus extern "C" #endif int yywrap(void); %} %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ #ifdef __cplusplus yyless ((yyinput () != 0)); #else yyless ((input () != 0)); #endif } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int yywrap (void) { return 1; } int main (void) { return ! yylex (); } _ACEOF { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex output file root" >&5 printf %s "checking for lex output file root... " >&6; } if test ${ac_cv_prog_lex_root+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_lex_root=unknown { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && 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 fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 printf "%s\n" "$ac_cv_prog_lex_root" >&6; } if test "$ac_cv_prog_lex_root" = unknown then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find output from $LEX; giving up on $LEX" >&5 printf "%s\n" "$as_me: WARNING: cannot find output from $LEX; giving up on $LEX" >&2;} LEX=: LEXLIB= fi LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test ${LEXLIB+y} then : else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 printf %s "checking for lex library... " >&6; } if test ${ac_cv_lib_lex+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_LIBS="$LIBS" ac_found=false for ac_cv_lib_lex in 'none needed' -lfl -ll 'not found'; do case $ac_cv_lib_lex in #( 'none needed') : ;; #( 'not found') : break ;; #( *) : LIBS="$ac_cv_lib_lex $ac_save_LIBS" ;; #( *) : ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_found=: fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if $ac_found; then break fi done LIBS="$ac_save_LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 printf "%s\n" "$ac_cv_lib_lex" >&6; } if test "$ac_cv_lib_lex" = 'not found' then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: required lex library not found; giving up on $LEX" >&5 printf "%s\n" "$as_me: WARNING: required lex library not found; giving up on $LEX" >&2;} LEX=: LEXLIB= elif test "$ac_cv_lib_lex" = 'none needed' then : LEXLIB='' else $as_nop LEXLIB=$ac_cv_lib_lex fi ac_save_LIBS="$LIBS" LIBS= { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing yywrap" >&5 printf %s "checking for library containing yywrap... " >&6; } if test ${ac_cv_search_yywrap+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char yywrap (); int main (void) { return yywrap (); ; return 0; } _ACEOF for ac_lib in '' fl l do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_yywrap=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_yywrap+y} then : break fi done if test ${ac_cv_search_yywrap+y} then : else $as_nop ac_cv_search_yywrap=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yywrap" >&5 printf "%s\n" "$ac_cv_search_yywrap" >&6; } ac_res=$ac_cv_search_yywrap if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" LEXLIB="$LIBS" fi LIBS="$ac_save_LIBS" fi if test "$LEX" != : then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 printf %s "checking whether yytext is a pointer... " >&6; } if test ${ac_cv_prog_lex_yytext_pointer+y} then : printf %s "(cached) " >&6 else $as_nop # 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 printf "%s\n" "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then printf "%s\n" "#define YYTEXT_POINTER 1" >>confdefs.h fi fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex 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 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_YACC+y} then : printf %s "(cached) " >&6 else $as_nop 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 case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 printf "%s\n" "$YACC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" ac_fn_c_check_header_compile "$LINENO" "ieeefp.h" "ac_cv_header_ieeefp_h" "$ac_includes_default" if test "x$ac_cv_header_ieeefp_h" = xyes then : printf "%s\n" "#define HAVE_IEEEFP_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "isnan" "ac_cv_func_isnan" if test "x$ac_cv_func_isnan" = xyes then : printf "%s\n" "#define HAVE_ISNAN 1" >>confdefs.h fi ac_fn_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_isfinite" = xyes then : ac_have_decl=1 else $as_nop ac_have_decl=0 fi printf "%s\n" "#define HAVE_DECL_ISFINITE $ac_have_decl" >>confdefs.h ac_fn_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "#include " "$ac_c_undeclared_builtin_options" "CFLAGS" if test "x$ac_cv_have_decl_isnan" = xyes then : ac_have_decl=1 else $as_nop ac_have_decl=0 fi printf "%s\n" "#define HAVE_DECL_ISNAN $ac_have_decl" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether you have IEEE 754 floating-point arithmetic" >&5 printf %s "checking whether you have IEEE 754 floating-point arithmetic... " >&6; } if test ${r_cv_ieee_754+y} then : printf %s "(cached) " >&6 else $as_nop if (test "${ac_cv_func_isnan}" = yes \ || test "${ac_cv_have_decl_isnan}" = yes); then r_cv_ieee_754=yes else r_cv_ieee_754=no fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r_cv_ieee_754" >&5 printf "%s\n" "$r_cv_ieee_754" >&6; } if test "${r_cv_ieee_754}" = yes; then printf "%s\n" "#define IEEE_754 1" >>confdefs.h else as_fn_error $? "IEEE 754 floating-point arithmetic is required" "$LINENO" 5 fi if test "${ac_cv_func_finite}" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working finite" >&5 printf %s "checking for working finite... " >&6; } if test ${r_cv_func_finite_works+y} then : printf %s "(cached) " >&6 else $as_nop if test "$cross_compiling" = yes then : r_cv_func_finite_works=no else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include "confdefs.h" int main () { #ifdef HAVE_FINITE exit(finite(1./0.) | finite(0./0.) | finite(-1./0.)); #else exit(1); #endif } _ACEOF if ac_fn_c_try_run "$LINENO" then : r_cv_func_finite_works=yes else $as_nop r_cv_func_finite_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r_cv_func_finite_works" >&5 printf "%s\n" "$r_cv_func_finite_works" >&6; } if test "x${r_cv_func_finite_works}" = xyes; then printf "%s\n" "#define HAVE_WORKING_FINITE 1" >>confdefs.h fi fi if test "${ac_cv_have_decl_isfinite}" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working isfinite" >&5 printf %s "checking for working isfinite... " >&6; } if test ${r_cv_func_isfinite_works+y} then : printf %s "(cached) " >&6 else $as_nop if test "$cross_compiling" = yes then : r_cv_func_isfinite_works=no else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include "confdefs.h" int main () { #ifdef HAVE_DECL_ISFINITE exit(isfinite(1./0.) | isfinite(0./0.) | isfinite(-1./0.)); #else exit(1); #endif } _ACEOF if ac_fn_c_try_run "$LINENO" then : r_cv_func_isfinite_works=yes else $as_nop r_cv_func_isfinite_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $r_cv_func_isfinite_works" >&5 printf "%s\n" "$r_cv_func_isfinite_works" >&6; } if test "x${r_cv_func_isfinite_works}" = xyes; then printf "%s\n" "#define HAVE_WORKING_ISFINITE 1" >>confdefs.h fi fi case "${host_os}" in mingw*) win=true ;; *) win=false ;; esac if test x$win = xtrue; then WINDOWS_TRUE= WINDOWS_FALSE='#' else WINDOWS_TRUE='#' WINDOWS_FALSE= fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $F77" >&5 printf %s "checking how to get verbose linking output from $F77... " >&6; } if test ${ac_cv_prog_f77_v+y} then : printf %s "(cached) " >&6 else $as_nop cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO" then : ac_cv_prog_f77_v= # Try some options frequently used verbose output for ac_verb in -v -verbose --verbose -V -\#\#\#; do cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_verb" eval "set x $ac_link" shift printf "%s\n" "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` printf "%s\n" "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_f77_v_output="`echo $ac_f77_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_f77_v_output in # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed ' s/,/ /g s/ -link / /g s/) *$// ' ` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_f77_v_output=`echo $ac_f77_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d s/^.*"gcc"/"gcc"/ s/"//gp }'` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; esac # look for -l* and *.a constructs in the output for ac_arg in $ac_f77_v_output; do case $ac_arg in [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) ac_cv_prog_f77_v=$ac_verb break 2 ;; esac done done if test -z "$ac_cv_prog_f77_v"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $F77" >&5 printf "%s\n" "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;} fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 printf "%s\n" "$as_me: WARNING: compilation failed" >&2;} fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_v" >&5 printf "%s\n" "$ac_cv_prog_f77_v" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 libraries of $F77" >&5 printf %s "checking for Fortran 77 libraries of $F77... " >&6; } if test ${ac_cv_f77_libs+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$FLIBS" != "x"; then ac_cv_f77_libs="$FLIBS" # Let the user override the test. else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_cv_prog_f77_v" eval "set x $ac_link" shift printf "%s\n" "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` printf "%s\n" "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_f77_v_output="`echo $ac_f77_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_f77_v_output in # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed ' s/,/ /g s/ -link / /g s/) *$// ' ` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_f77_v_output=`echo $ac_f77_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d s/^.*"gcc"/"gcc"/ s/"//gp }'` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; esac ac_cv_f77_libs= # Save positional arguments (if any) ac_save_positional="$@" set X $ac_f77_v_output while test $# != 1; do shift ac_arg=$1 case $ac_arg in [\\/]*.a | ?:[\\/]*.a) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue then : else $as_nop ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; -bI:*) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue then : else $as_nop if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_arg; do ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" done else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi fi ;; # Ignore these flags. -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ |-LANG:=* | -LIST:* | -LNO:* | -link) ;; -lkernel32) # Ignore this library only on Windows-like systems. case $host_os in cygwin* | msys* ) ;; *) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue then : else $as_nop ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; esac ;; -[LRuYz]) # These flags, when seen by themselves, take an argument. # We remove the space between option and argument and re-iterate # unless we find an empty arg or a new option (starting with -) case $2 in "" | -*);; *) ac_arg="$ac_arg$2" shift; shift set X $ac_arg "$@" ;; esac ;; -YP,*) for ac_j in `printf "%s\n" "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_j" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue then : else $as_nop ac_arg="$ac_arg $ac_j" ac_cv_f77_libs="$ac_cv_f77_libs $ac_j" fi done ;; -[lLR]*) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue then : else $as_nop ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; -zallextract*| -zdefaultextract) ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" ;; -mllvm) ${2+shift};; # Defend against 'clang -mllvm -loopopt=0'. # Ignore everything else. esac done # restore positional arguments set X $ac_save_positional; shift # We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, # then we insist that the "run path" must be an absolute path (i.e. it # must begin with a "/"). case `(uname -sr) 2>/dev/null` in "SunOS 5"*) ac_ld_run_path=`printf "%s\n" "$ac_f77_v_output" | sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` test "x$ac_ld_run_path" != x && if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_ld_run_path; do ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" done else ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path" fi ;; esac fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_libs" >&5 printf "%s\n" "$ac_cv_f77_libs" >&6; } FLIBS="$ac_cv_f77_libs" 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_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran 77 libraries" >&5 printf %s "checking for dummy main to link with Fortran 77 libraries... " >&6; } if test ${ac_cv_f77_dummy_main+y} then : printf %s "(cached) " >&6 else $as_nop ac_f77_dm_save_LIBS=$LIBS LIBS="$LIBS $FLIBS" ac_fortran_dm_var=F77_DUMMY_MAIN 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 # First, try linking without a dummy main: cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_fortran_dummy_main=none else $as_nop ac_cv_fortran_dummy_main=unknown fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test $ac_cv_fortran_dummy_main = unknown; then for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define $ac_fortran_dm_var $ac_func #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_fortran_dummy_main=$ac_func; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu ac_cv_f77_dummy_main=$ac_cv_fortran_dummy_main rm -rf conftest* LIBS=$ac_f77_dm_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_dummy_main" >&5 printf "%s\n" "$ac_cv_f77_dummy_main" >&6; } F77_DUMMY_MAIN=$ac_cv_f77_dummy_main if test "$F77_DUMMY_MAIN" != unknown then : if test $F77_DUMMY_MAIN != none; then printf "%s\n" "#define F77_DUMMY_MAIN $F77_DUMMY_MAIN" >>confdefs.h if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then printf "%s\n" "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h fi fi else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "linking to Fortran libraries from C fails See \`config.log' for more details" "$LINENO" 5; } 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_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 name-mangling scheme" >&5 printf %s "checking for Fortran 77 name-mangling scheme... " >&6; } if test ${ac_cv_f77_mangling+y} then : printf %s "(cached) " >&6 else $as_nop cat > conftest.$ac_ext <<_ACEOF subroutine foobar() return end subroutine foo_bar() return end _ACEOF if ac_fn_f77_try_compile "$LINENO" then : mv conftest.$ac_objext cfortran_test.$ac_objext ac_save_LIBS=$LIBS LIBS="cfortran_test.$ac_objext $LIBS $FLIBS" 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_success=no for ac_foobar in foobar FOOBAR; do for ac_underscore in "" "_"; do ac_func="$ac_foobar$ac_underscore" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $ac_func (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_success=yes; break 2 fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done done ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test "$ac_success" = "yes"; then case $ac_foobar in foobar) ac_case=lower ac_foo_bar=foo_bar ;; FOOBAR) ac_case=upper ac_foo_bar=FOO_BAR ;; esac 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_success_extra=no for ac_extra in "" "_"; do ac_func="$ac_foo_bar$ac_underscore$ac_extra" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $ac_func (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_success_extra=yes; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test "$ac_success_extra" = "yes"; then ac_cv_f77_mangling="$ac_case case" if test -z "$ac_underscore"; then ac_cv_f77_mangling="$ac_cv_f77_mangling, no underscore" else ac_cv_f77_mangling="$ac_cv_f77_mangling, underscore" fi if test -z "$ac_extra"; then ac_cv_f77_mangling="$ac_cv_f77_mangling, no extra underscore" else ac_cv_f77_mangling="$ac_cv_f77_mangling, extra underscore" fi else ac_cv_f77_mangling="unknown" fi else ac_cv_f77_mangling="unknown" fi LIBS=$ac_save_LIBS rm -rf conftest* rm -f cfortran_test* else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compile a simple Fortran program See \`config.log' for more details" "$LINENO" 5; } fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_mangling" >&5 printf "%s\n" "$ac_cv_f77_mangling" >&6; } 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_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu case $ac_cv_f77_mangling in "lower case, no underscore, no extra underscore") printf "%s\n" "#define F77_FUNC(name,NAME) name" >>confdefs.h printf "%s\n" "#define F77_FUNC_(name,NAME) name" >>confdefs.h ;; "lower case, no underscore, extra underscore") printf "%s\n" "#define F77_FUNC(name,NAME) name" >>confdefs.h printf "%s\n" "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, no extra underscore") printf "%s\n" "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h printf "%s\n" "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, extra underscore") printf "%s\n" "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h printf "%s\n" "#define F77_FUNC_(name,NAME) name ## __" >>confdefs.h ;; "upper case, no underscore, no extra underscore") printf "%s\n" "#define F77_FUNC(name,NAME) NAME" >>confdefs.h printf "%s\n" "#define F77_FUNC_(name,NAME) NAME" >>confdefs.h ;; "upper case, no underscore, extra underscore") printf "%s\n" "#define F77_FUNC(name,NAME) NAME" >>confdefs.h printf "%s\n" "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, no extra underscore") printf "%s\n" "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h printf "%s\n" "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, extra underscore") printf "%s\n" "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h printf "%s\n" "#define F77_FUNC_(name,NAME) NAME ## __" >>confdefs.h ;; *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 printf "%s\n" "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} ;; esac 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_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $F77" >&5 printf %s "checking how to get verbose linking output from $F77... " >&6; } if test ${ac_cv_prog_f77_v+y} then : printf %s "(cached) " >&6 else $as_nop cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO" then : ac_cv_prog_f77_v= # Try some options frequently used verbose output for ac_verb in -v -verbose --verbose -V -\#\#\#; do cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_verb" eval "set x $ac_link" shift printf "%s\n" "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` printf "%s\n" "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_f77_v_output="`echo $ac_f77_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_f77_v_output in # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed ' s/,/ /g s/ -link / /g s/) *$// ' ` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_f77_v_output=`echo $ac_f77_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d s/^.*"gcc"/"gcc"/ s/"//gp }'` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; esac # look for -l* and *.a constructs in the output for ac_arg in $ac_f77_v_output; do case $ac_arg in [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) ac_cv_prog_f77_v=$ac_verb break 2 ;; esac done done if test -z "$ac_cv_prog_f77_v"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $F77" >&5 printf "%s\n" "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;} fi else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 printf "%s\n" "$as_me: WARNING: compilation failed" >&2;} fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_v" >&5 printf "%s\n" "$ac_cv_prog_f77_v" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 libraries of $F77" >&5 printf %s "checking for Fortran 77 libraries of $F77... " >&6; } if test ${ac_cv_f77_libs+y} then : printf %s "(cached) " >&6 else $as_nop if test "x$FLIBS" != "x"; then ac_cv_f77_libs="$FLIBS" # Let the user override the test. else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_cv_prog_f77_v" eval "set x $ac_link" shift printf "%s\n" "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` printf "%s\n" "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_f77_v_output="`echo $ac_f77_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_f77_v_output in # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed ' s/,/ /g s/ -link / /g s/) *$// ' ` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_f77_v_output=`echo $ac_f77_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d s/^.*"gcc"/"gcc"/ s/"//gp }'` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; esac ac_cv_f77_libs= # Save positional arguments (if any) ac_save_positional="$@" set X $ac_f77_v_output while test $# != 1; do shift ac_arg=$1 case $ac_arg in [\\/]*.a | ?:[\\/]*.a) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue then : else $as_nop ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; -bI:*) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue then : else $as_nop if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_arg; do ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" done else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi fi ;; # Ignore these flags. -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ |-LANG:=* | -LIST:* | -LNO:* | -link) ;; -lkernel32) # Ignore this library only on Windows-like systems. case $host_os in cygwin* | msys* ) ;; *) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue then : else $as_nop ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; esac ;; -[LRuYz]) # These flags, when seen by themselves, take an argument. # We remove the space between option and argument and re-iterate # unless we find an empty arg or a new option (starting with -) case $2 in "" | -*);; *) ac_arg="$ac_arg$2" shift; shift set X $ac_arg "$@" ;; esac ;; -YP,*) for ac_j in `printf "%s\n" "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_j" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue then : else $as_nop ac_arg="$ac_arg $ac_j" ac_cv_f77_libs="$ac_cv_f77_libs $ac_j" fi done ;; -[lLR]*) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue then : else $as_nop ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; -zallextract*| -zdefaultextract) ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" ;; -mllvm) ${2+shift};; # Defend against 'clang -mllvm -loopopt=0'. # Ignore everything else. esac done # restore positional arguments set X $ac_save_positional; shift # We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, # then we insist that the "run path" must be an absolute path (i.e. it # must begin with a "/"). case `(uname -sr) 2>/dev/null` in "SunOS 5"*) ac_ld_run_path=`printf "%s\n" "$ac_f77_v_output" | sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` test "x$ac_ld_run_path" != x && if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_ld_run_path; do ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" done else ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path" fi ;; esac fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_libs" >&5 printf "%s\n" "$ac_cv_f77_libs" >&6; } FLIBS="$ac_cv_f77_libs" 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 ax_blas_ok=no # Check whether --with-blas was given. if test ${with_blas+y} then : withval=$with_blas; fi case $with_blas in yes | "") ;; no) ax_blas_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;; *) BLAS_LIBS="-l$with_blas" ;; esac # Get fortran linker names of BLAS functions to check for. ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu case $ac_cv_f77_mangling in upper*) ac_val="SGEMM" ;; lower*) ac_val="sgemm" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac sgemm="$ac_val" 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_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu case $ac_cv_f77_mangling in upper*) ac_val="DGEMM" ;; lower*) ac_val="dgemm" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac dgemm="$ac_val" 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 ax_blas_save_LIBS="$LIBS" LIBS="$LIBS $FLIBS" # First, check BLAS_LIBS environment variable if test $ax_blas_ok = no; then if test "x$BLAS_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in $BLAS_LIBS" >&5 printf %s "checking for $sgemm in $BLAS_LIBS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_blas_ok=yes else $as_nop BLAS_LIBS="" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_blas_ok" >&5 printf "%s\n" "$ax_blas_ok" >&6; } LIBS="$save_LIBS" fi fi # BLAS linked to by default? (happens on some supercomputers) if test $ax_blas_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $sgemm is being linked in already" >&5 printf %s "checking if $sgemm is being linked in already... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_blas_ok=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_blas_ok" >&5 printf "%s\n" "$ax_blas_ok" >&6; } LIBS="$save_LIBS" fi # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) if test $ax_blas_ok = no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ATL_xerbla in -latlas" >&5 printf %s "checking for ATL_xerbla in -latlas... " >&6; } if test ${ac_cv_lib_atlas_ATL_xerbla+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-latlas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char ATL_xerbla (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return ATL_xerbla (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_atlas_ATL_xerbla=yes else $as_nop ac_cv_lib_atlas_ATL_xerbla=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_atlas_ATL_xerbla" >&5 printf "%s\n" "$ac_cv_lib_atlas_ATL_xerbla" >&6; } if test "x$ac_cv_lib_atlas_ATL_xerbla" = xyes then : as_ac_Lib=`printf "%s\n" "ac_cv_lib_f77blas_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lf77blas" >&5 printf %s "checking for $sgemm in -lf77blas... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lf77blas -latlas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cblas_dgemm in -lcblas" >&5 printf %s "checking for cblas_dgemm in -lcblas... " >&6; } if test ${ac_cv_lib_cblas_cblas_dgemm+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcblas -lf77blas -latlas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char cblas_dgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return cblas_dgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_cblas_cblas_dgemm=yes else $as_nop ac_cv_lib_cblas_cblas_dgemm=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cblas_cblas_dgemm" >&5 printf "%s\n" "$ac_cv_lib_cblas_cblas_dgemm" >&6; } if test "x$ac_cv_lib_cblas_cblas_dgemm" = xyes then : ax_blas_ok=yes BLAS_LIBS="-lcblas -lf77blas -latlas" fi fi fi fi # BLAS in PhiPACK libraries? (requires generic BLAS lib, too) if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 printf %s "checking for $sgemm in -lblas... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : as_ac_Lib=`printf "%s\n" "ac_cv_lib_dgemm_$dgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $dgemm in -ldgemm" >&5 printf %s "checking for $dgemm in -ldgemm... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldgemm -lblas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $dgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $dgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : as_ac_Lib=`printf "%s\n" "ac_cv_lib_sgemm_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lsgemm" >&5 printf %s "checking for $sgemm in -lsgemm... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsgemm -lblas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : ax_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas" fi fi fi fi # BLAS in Intel MKL library? if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_mkl_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lmkl" >&5 printf %s "checking for $sgemm in -lmkl... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lmkl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : ax_blas_ok=yes;BLAS_LIBS="-lmkl" fi fi # BLAS in Apple vecLib library? if test $ax_blas_ok = no; then save_LIBS="$LIBS"; LIBS="-framework vecLib $LIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -framework vecLib" >&5 printf %s "checking for $sgemm in -framework vecLib... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_blas_ok=yes;BLAS_LIBS="-framework vecLib" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_blas_ok" >&5 printf "%s\n" "$ax_blas_ok" >&6; } LIBS="$save_LIBS" fi # BLAS in Alpha CXML library? if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_cxml_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lcxml" >&5 printf %s "checking for $sgemm in -lcxml... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcxml $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : ax_blas_ok=yes;BLAS_LIBS="-lcxml" fi fi # BLAS in Alpha DXML library? (now called CXML, see above) if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_dxml_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -ldxml" >&5 printf %s "checking for $sgemm in -ldxml... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldxml $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : ax_blas_ok=yes;BLAS_LIBS="-ldxml" fi fi # BLAS in Sun Performance library? if test $ax_blas_ok = no; then if test "x$GCC" != xyes; then # only works with Sun CC { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for acosp in -lsunmath" >&5 printf %s "checking for acosp in -lsunmath... " >&6; } if test ${ac_cv_lib_sunmath_acosp+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsunmath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char acosp (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return acosp (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_sunmath_acosp=yes else $as_nop ac_cv_lib_sunmath_acosp=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sunmath_acosp" >&5 printf "%s\n" "$ac_cv_lib_sunmath_acosp" >&6; } if test "x$ac_cv_lib_sunmath_acosp" = xyes then : as_ac_Lib=`printf "%s\n" "ac_cv_lib_sunperf_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lsunperf" >&5 printf %s "checking for $sgemm in -lsunperf... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsunperf $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : BLAS_LIBS="-library=sunperf" ax_blas_ok=yes fi fi fi fi # BLAS in SCSL library? (SGI/Cray Scientific Library) if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_scs_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lscs" >&5 printf %s "checking for $sgemm in -lscs... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lscs $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : ax_blas_ok=yes; BLAS_LIBS="-lscs" fi fi # BLAS in SGIMATH library? if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_complib.sgimath_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lcomplib.sgimath" >&5 printf %s "checking for $sgemm in -lcomplib.sgimath... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lcomplib.sgimath $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : ax_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath" fi fi # BLAS in IBM ESSL library? (requires generic BLAS lib, too) if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 printf %s "checking for $sgemm in -lblas... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : as_ac_Lib=`printf "%s\n" "ac_cv_lib_essl_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lessl" >&5 printf %s "checking for $sgemm in -lessl... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lessl -lblas $FLIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : ax_blas_ok=yes; BLAS_LIBS="-lessl -lblas" fi fi fi # Generic BLAS library? if test $ax_blas_ok = no; then as_ac_Lib=`printf "%s\n" "ac_cv_lib_blas_$sgemm" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $sgemm in -lblas" >&5 printf %s "checking for $sgemm in -lblas... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lblas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $sgemm (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $sgemm (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : ax_blas_ok=yes; BLAS_LIBS="-lblas" fi fi LIBS="$ax_blas_save_LIBS" # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_blas_ok" = xyes; then printf "%s\n" "#define HAVE_BLAS 1" >>confdefs.h : else ax_blas_ok=no fi ax_lapack_ok=no # Check whether --with-lapack was given. if test ${with_lapack+y} then : withval=$with_lapack; fi case $with_lapack in yes | "") ;; no) ax_lapack_ok=disable ;; -* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;; *) LAPACK_LIBS="-l$with_lapack" ;; esac # Get fortran linker name of LAPACK function to check for. ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu case $ac_cv_f77_mangling in upper*) ac_val="CHEEV" ;; lower*) ac_val="cheev" ;; *) ac_val="unknown" ;; esac case $ac_cv_f77_mangling in *," underscore"*) ac_val="$ac_val"_ ;; esac cheev="$ac_val" 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 # We cannot use LAPACK if BLAS is not found if test "x$ax_blas_ok" != xyes; then ax_lapack_ok=noblas LAPACK_LIBS="" fi # First, check LAPACK_LIBS environment variable if test "x$LAPACK_LIBS" != x; then save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $cheev in $LAPACK_LIBS" >&5 printf %s "checking for $cheev in $LAPACK_LIBS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $cheev (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $cheev (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : ax_lapack_ok=yes else $as_nop LAPACK_LIBS="" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_lapack_ok" >&5 printf "%s\n" "$ax_lapack_ok" >&6; } LIBS="$save_LIBS" if test $ax_lapack_ok = no; then LAPACK_LIBS="" fi fi # LAPACK linked to by default? (is sometimes included in BLAS lib) if test $ax_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" as_ac_var=`printf "%s\n" "ac_cv_func_$cheev" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$cheev" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes" then : ax_lapack_ok=yes fi LIBS="$save_LIBS" fi # Generic LAPACK library? for lapack in lapack lapack_rs6k; do if test $ax_lapack_ok = no; then save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" as_ac_Lib=`printf "%s\n" "ac_cv_lib_$lapack""_$cheev" | $as_tr_sh` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $cheev in -l$lapack" >&5 printf %s "checking for $cheev in -l$lapack... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-l$lapack $FLIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char $cheev (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main (void) { return $cheev (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" else $as_nop eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : ax_lapack_ok=yes; LAPACK_LIBS="-l$lapack" fi LIBS="$save_LIBS" fi done # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_lapack_ok" = xyes; then printf "%s\n" "#define HAVE_LAPACK 1" >>confdefs.h : else ax_lapack_ok=no as_fn_error $? "\"You need to install the LAPACK library\"" "$LINENO" 5 fi jagsmoddir=${libdir}/JAGS/modules-${JAGS_MAJOR} ac_config_files="$ac_config_files Makefile m4/Makefile etc/Makefile etc/jags.pc libltdl/Makefile src/Makefile src/lib/Makefile src/lib/version.cc src/lib/util/Makefile src/lib/sarray/Makefile src/lib/function/Makefile src/lib/distribution/Makefile src/lib/graph/Makefile src/lib/sampler/Makefile src/lib/model/Makefile src/lib/module/Makefile src/lib/compiler/Makefile src/lib/rng/Makefile src/jrmath/Makefile src/include/Makefile src/include/util/Makefile src/include/sarray/Makefile src/include/function/Makefile src/include/distribution/Makefile src/include/graph/Makefile src/include/sampler/Makefile src/include/model/Makefile src/include/module/Makefile src/include/compiler/Makefile src/include/rng/Makefile src/modules/Makefile src/modules/base/Makefile src/modules/base/functions/Makefile src/modules/base/rngs/Makefile src/modules/base/samplers/Makefile src/modules/base/monitors/Makefile src/modules/bugs/Makefile src/modules/bugs/functions/Makefile src/modules/bugs/distributions/Makefile src/modules/bugs/samplers/Makefile src/modules/bugs/matrix/Makefile src/modules/msm/Makefile src/modules/msm/functions/Makefile src/modules/msm/distributions/Makefile src/modules/msm/matrix/Makefile src/modules/mix/Makefile src/modules/mix/distributions/Makefile src/modules/mix/samplers/Makefile src/modules/dic/Makefile src/modules/lecuyer/Makefile src/modules/glm/Makefile src/modules/glm/SSparse/Makefile src/modules/glm/SSparse/config/Makefile src/modules/glm/SSparse/AMD/Makefile src/modules/glm/SSparse/CAMD/Makefile src/modules/glm/SSparse/CCOLAMD/Makefile src/modules/glm/SSparse/COLAMD/Makefile src/modules/glm/SSparse/CHOLMOD/Makefile src/modules/glm/SSparse/CHOLMOD/Check/Makefile src/modules/glm/SSparse/CHOLMOD/Cholesky/Makefile src/modules/glm/SSparse/CHOLMOD/Core/Makefile src/modules/glm/SSparse/CHOLMOD/Include/Makefile src/modules/glm/SSparse/CHOLMOD/MatrixOps/Makefile src/modules/glm/SSparse/CHOLMOD/Modify/Makefile src/modules/glm/SSparse/CHOLMOD/Supernodal/Makefile src/modules/glm/samplers/Makefile src/modules/glm/distributions/Makefile src/terminal/Makefile win/Makefile win/runtime64/Makefile doc/Makefile doc/manual/Makefile test/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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${CANCHECK_TRUE}" && test -z "${CANCHECK_FALSE}"; then as_fn_error $? "conditional \"CANCHECK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi LT_CONFIG_H=config.h _ltdl_libobjs= _ltdl_ltlibobjs= if test -n "$_LT_LIBOBJS"; then # Remove the extension. _lt_sed_drop_objext='s/\.o$//;s/\.obj$//' for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | $SED "$_lt_sed_drop_objext" | sort -u`; do _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext" _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo" done fi ltdl_LIBOBJS=$_ltdl_libobjs ltdl_LTLIBOBJS=$_ltdl_ltlibobjs if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WINDOWS_TRUE}" && test -z "${WINDOWS_FALSE}"; then as_fn_error $? "conditional \"WINDOWS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $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} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; 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 printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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 if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # 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 # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval 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="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by JAGS $as_me 4.3.2, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent 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 Configuration commands: $config_commands Report bugs to ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ JAGS config.status 4.3.2 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; 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 || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' LD_F77='`$ECHO "$LD_F77" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_F77='`$ECHO "$reload_flag_F77" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_F77='`$ECHO "$reload_cmds_F77" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_F77='`$ECHO "$old_archive_cmds_F77" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' compiler_F77='`$ECHO "$compiler_F77" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' GCC_F77='`$ECHO "$GCC_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_F77='`$ECHO "$lt_prog_compiler_no_builtin_flag_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_F77='`$ECHO "$lt_prog_compiler_pic_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_F77='`$ECHO "$lt_prog_compiler_wl_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_F77='`$ECHO "$lt_prog_compiler_static_F77" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_F77='`$ECHO "$lt_cv_prog_compiler_c_o_F77" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_F77='`$ECHO "$archive_cmds_need_lc_F77" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_F77='`$ECHO "$enable_shared_with_static_runtimes_F77" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_F77='`$ECHO "$export_dynamic_flag_spec_F77" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_F77='`$ECHO "$whole_archive_flag_spec_F77" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_F77='`$ECHO "$compiler_needs_object_F77" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_F77='`$ECHO "$old_archive_from_new_cmds_F77" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_F77='`$ECHO "$old_archive_from_expsyms_cmds_F77" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_F77='`$ECHO "$archive_cmds_F77" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_F77='`$ECHO "$archive_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_F77='`$ECHO "$module_cmds_F77" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_F77='`$ECHO "$module_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_F77='`$ECHO "$with_gnu_ld_F77" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_F77='`$ECHO "$allow_undefined_flag_F77" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_F77='`$ECHO "$no_undefined_flag_F77" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_F77='`$ECHO "$hardcode_libdir_flag_spec_F77" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_F77='`$ECHO "$hardcode_libdir_separator_F77" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_F77='`$ECHO "$hardcode_direct_F77" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_F77='`$ECHO "$hardcode_direct_absolute_F77" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_F77='`$ECHO "$hardcode_minus_L_F77" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_F77='`$ECHO "$hardcode_shlibpath_var_F77" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_F77='`$ECHO "$hardcode_automatic_F77" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_F77='`$ECHO "$inherit_rpath_F77" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_F77='`$ECHO "$link_all_deplibs_F77" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_F77='`$ECHO "$always_export_symbols_F77" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_F77='`$ECHO "$export_symbols_cmds_F77" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_F77='`$ECHO "$exclude_expsyms_F77" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_F77='`$ECHO "$include_expsyms_F77" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_F77='`$ECHO "$prelink_cmds_F77" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_F77='`$ECHO "$postlink_cmds_F77" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_F77='`$ECHO "$file_list_spec_F77" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_F77='`$ECHO "$hardcode_action_F77" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_F77='`$ECHO "$compiler_lib_search_dirs_F77" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_F77='`$ECHO "$predep_objects_F77" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_F77='`$ECHO "$postdep_objects_F77" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' predeps_F77='`$ECHO "$predeps_F77" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_F77='`$ECHO "$postdeps_F77" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_F77='`$ECHO "$compiler_lib_search_path_F77" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in AS \ DLLTOOL \ OBJDUMP \ SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ FILECMD \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ LD_F77 \ reload_flag_CXX \ reload_flag_F77 \ compiler_CXX \ compiler_F77 \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_no_builtin_flag_F77 \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_static_CXX \ lt_prog_compiler_static_F77 \ lt_cv_prog_compiler_c_o_CXX \ lt_cv_prog_compiler_c_o_F77 \ export_dynamic_flag_spec_CXX \ export_dynamic_flag_spec_F77 \ whole_archive_flag_spec_CXX \ whole_archive_flag_spec_F77 \ compiler_needs_object_CXX \ compiler_needs_object_F77 \ with_gnu_ld_CXX \ with_gnu_ld_F77 \ allow_undefined_flag_CXX \ allow_undefined_flag_F77 \ no_undefined_flag_CXX \ no_undefined_flag_F77 \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_separator_CXX \ hardcode_libdir_separator_F77 \ exclude_expsyms_CXX \ exclude_expsyms_F77 \ include_expsyms_CXX \ include_expsyms_F77 \ file_list_spec_CXX \ file_list_spec_F77 \ compiler_lib_search_dirs_CXX \ compiler_lib_search_dirs_F77 \ predep_objects_CXX \ predep_objects_F77 \ postdep_objects_CXX \ postdep_objects_F77 \ predeps_CXX \ predeps_F77 \ postdeps_CXX \ postdeps_F77 \ compiler_lib_search_path_CXX \ compiler_lib_search_path_F77; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ reload_cmds_F77 \ old_archive_cmds_CXX \ old_archive_cmds_F77 \ old_archive_from_new_cmds_CXX \ old_archive_from_new_cmds_F77 \ old_archive_from_expsyms_cmds_CXX \ old_archive_from_expsyms_cmds_F77 \ archive_cmds_CXX \ archive_cmds_F77 \ archive_expsym_cmds_CXX \ archive_expsym_cmds_F77 \ module_cmds_CXX \ module_cmds_F77 \ module_expsym_cmds_CXX \ module_expsym_cmds_F77 \ export_symbols_cmds_CXX \ export_symbols_cmds_F77 \ prelink_cmds_CXX \ prelink_cmds_F77 \ postlink_cmds_CXX \ postlink_cmds_F77; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "etc/jags.pc") CONFIG_FILES="$CONFIG_FILES etc/jags.pc" ;; "libltdl/Makefile") CONFIG_FILES="$CONFIG_FILES libltdl/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;; "src/lib/version.cc") CONFIG_FILES="$CONFIG_FILES src/lib/version.cc" ;; "src/lib/util/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/util/Makefile" ;; "src/lib/sarray/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/sarray/Makefile" ;; "src/lib/function/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/function/Makefile" ;; "src/lib/distribution/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/distribution/Makefile" ;; "src/lib/graph/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/graph/Makefile" ;; "src/lib/sampler/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/sampler/Makefile" ;; "src/lib/model/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/model/Makefile" ;; "src/lib/module/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/module/Makefile" ;; "src/lib/compiler/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/compiler/Makefile" ;; "src/lib/rng/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/rng/Makefile" ;; "src/jrmath/Makefile") CONFIG_FILES="$CONFIG_FILES src/jrmath/Makefile" ;; "src/include/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/Makefile" ;; "src/include/util/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/util/Makefile" ;; "src/include/sarray/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/sarray/Makefile" ;; "src/include/function/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/function/Makefile" ;; "src/include/distribution/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/distribution/Makefile" ;; "src/include/graph/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/graph/Makefile" ;; "src/include/sampler/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/sampler/Makefile" ;; "src/include/model/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/model/Makefile" ;; "src/include/module/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/module/Makefile" ;; "src/include/compiler/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/compiler/Makefile" ;; "src/include/rng/Makefile") CONFIG_FILES="$CONFIG_FILES src/include/rng/Makefile" ;; "src/modules/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/Makefile" ;; "src/modules/base/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/base/Makefile" ;; "src/modules/base/functions/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/base/functions/Makefile" ;; "src/modules/base/rngs/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/base/rngs/Makefile" ;; "src/modules/base/samplers/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/base/samplers/Makefile" ;; "src/modules/base/monitors/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/base/monitors/Makefile" ;; "src/modules/bugs/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/bugs/Makefile" ;; "src/modules/bugs/functions/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/bugs/functions/Makefile" ;; "src/modules/bugs/distributions/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/bugs/distributions/Makefile" ;; "src/modules/bugs/samplers/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/bugs/samplers/Makefile" ;; "src/modules/bugs/matrix/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/bugs/matrix/Makefile" ;; "src/modules/msm/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/msm/Makefile" ;; "src/modules/msm/functions/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/msm/functions/Makefile" ;; "src/modules/msm/distributions/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/msm/distributions/Makefile" ;; "src/modules/msm/matrix/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/msm/matrix/Makefile" ;; "src/modules/mix/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/mix/Makefile" ;; "src/modules/mix/distributions/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/mix/distributions/Makefile" ;; "src/modules/mix/samplers/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/mix/samplers/Makefile" ;; "src/modules/dic/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/dic/Makefile" ;; "src/modules/lecuyer/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/lecuyer/Makefile" ;; "src/modules/glm/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/Makefile" ;; "src/modules/glm/SSparse/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/Makefile" ;; "src/modules/glm/SSparse/config/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/config/Makefile" ;; "src/modules/glm/SSparse/AMD/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/AMD/Makefile" ;; "src/modules/glm/SSparse/CAMD/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/CAMD/Makefile" ;; "src/modules/glm/SSparse/CCOLAMD/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/CCOLAMD/Makefile" ;; "src/modules/glm/SSparse/COLAMD/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/COLAMD/Makefile" ;; "src/modules/glm/SSparse/CHOLMOD/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/CHOLMOD/Makefile" ;; "src/modules/glm/SSparse/CHOLMOD/Check/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/CHOLMOD/Check/Makefile" ;; "src/modules/glm/SSparse/CHOLMOD/Cholesky/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/CHOLMOD/Cholesky/Makefile" ;; "src/modules/glm/SSparse/CHOLMOD/Core/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/CHOLMOD/Core/Makefile" ;; "src/modules/glm/SSparse/CHOLMOD/Include/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/CHOLMOD/Include/Makefile" ;; "src/modules/glm/SSparse/CHOLMOD/MatrixOps/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/CHOLMOD/MatrixOps/Makefile" ;; "src/modules/glm/SSparse/CHOLMOD/Modify/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/CHOLMOD/Modify/Makefile" ;; "src/modules/glm/SSparse/CHOLMOD/Supernodal/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/SSparse/CHOLMOD/Supernodal/Makefile" ;; "src/modules/glm/samplers/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/samplers/Makefile" ;; "src/modules/glm/distributions/Makefile") CONFIG_FILES="$CONFIG_FILES src/modules/glm/distributions/Makefile" ;; "src/terminal/Makefile") CONFIG_FILES="$CONFIG_FILES src/terminal/Makefile" ;; "win/Makefile") CONFIG_FILES="$CONFIG_FILES win/Makefile" ;; "win/runtime64/Makefile") CONFIG_FILES="$CONFIG_FILES win/runtime64/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/manual/Makefile") CONFIG_FILES="$CONFIG_FILES doc/manual/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; 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+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #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. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # 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. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; "libtool":C) # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . # The names of the tagged configurations supported by this script. available_tags='CXX F77 ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build static libraries. build_old_libs=$enable_static # Assembler program. AS=$lt_AS # DLL creation program. DLLTOOL=$lt_DLLTOOL # Object dumper program. OBJDUMP=$lt_OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # A file(cmd) program that detects file types. FILECMD=$lt_FILECMD # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive (by configure). lt_ar_flags=$lt_ar_flags # Flags to create an archive. AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name lister interface. nm_interface=$lt_lt_cv_nm_interface # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain=$ac_aux_dir/ltmain.sh # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: F77 # The linker used to build libraries. LD=$lt_LD_F77 # How to create reloadable object files. reload_flag=$lt_reload_flag_F77 reload_cmds=$lt_reload_cmds_F77 # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_F77 # A language specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU compiler? with_gcc=$GCC_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_F77 # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_F77 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_F77 # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_F77 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_F77 # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_F77 # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_F77 # Specify filename containing input files. file_list_spec=$lt_file_list_spec_F77 # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_F77 postdep_objects=$lt_postdep_objects_F77 predeps=$lt_predeps_F77 postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # ### END LIBTOOL TAG CONFIG: F77 _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # 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 || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi JAGS-4.3.2/configure.ac0000664000175000017500000001044014400674730011461 00000000000000dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.63) AC_INIT([JAGS],[4.3.2],[martyn_plummer@users.sourceforge.net],[JAGS]) JAGS_MAJOR=4 JAGS_MINOR=3 JAGS_PATCH=2 AC_SUBST(JAGS_MAJOR) AC_DEFINE_UNQUOTED([JAGS_MAJOR], [$JAGS_MAJOR], [Major version of JAGS library]) AC_SUBST(JAGS_MINOR) AC_DEFINE_UNQUOTED([JAGS_MINOR], [$JAGS_MINOR], [Minor version of JAGS library]) AC_DEFINE_UNQUOTED([JAGS_PATCH], [$JAGS_PATCH], [Patch level of JAGS]) define([hgversion], esyscmd([sh -c 'hg parent --template "r{node|short} {date|shortdate}"'])) AC_DEFINE(HG_VERSION, "hgversion", [Mercurial Version]) define([hgyear], esyscmd([sh -c 'hg parent --template "{date(date, \"%Y\")}"'])) AC_DEFINE(HG_YEAR, "hgyear", [Mercurial Year]) define([hgmd], esyscmd([sh -c 'hg parent --template "{date(date, \"%m%d\")}"'])) AC_DEFINE(HG_MONTH_DAY, "hgmd", [Mercurial Month and Dday]) AC_CANONICAL_HOST AC_CONFIG_SRCDIR([src/lib/Console.cc]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([subdir-objects]) dnl pkg-config and cppunit are required only for checks, so make them optional PKG_PROG_PKG_CONFIG() AS_IF([test -n "$PKG_CONFIG"],[ PKG_CHECK_MODULES([CPPUNIT], [cppunit >= 1.12.1], [cancheck=yes], [cancheck=no]) ]) AM_CONDITIONAL([CANCHECK], [test x$cancheck = xyes]) dnl libtool and ltdl configuration LT_PREREQ(2.2.6) LT_CONFIG_LTDL_DIR([libltdl]) LT_INIT([dlopen disable-static win32-dll]) LTDL_INIT([recursive]) AC_PROG_CC AC_PROG_CXX AC_PROG_F77 AM_PROG_LEX AC_PROG_YACC dnl IEEE 754 arithmetic AC_CHECK_HEADERS(ieeefp.h) R_IEEE_754 if test "${ac_cv_func_finite}" = "yes"; then R_FUNC_FINITE fi if test "${ac_cv_have_decl_isfinite}" = "yes"; then R_FUNC_ISFINITE fi case "${host_os}" in mingw*) win=true ;; *) win=false ;; esac AM_CONDITIONAL(WINDOWS, test x$win = xtrue) dnl fortran stuff AC_F77_WRAPPERS AC_F77_LIBRARY_LDFLAGS ACX_LAPACK([],[ AC_MSG_ERROR("You need to install the LAPACK library") ]) jagsmoddir=${libdir}/JAGS/modules-${JAGS_MAJOR} AC_SUBST(jagsmoddir) AC_CONFIG_FILES([ Makefile m4/Makefile etc/Makefile etc/jags.pc libltdl/Makefile src/Makefile src/lib/Makefile src/lib/version.cc src/lib/util/Makefile src/lib/sarray/Makefile src/lib/function/Makefile src/lib/distribution/Makefile src/lib/graph/Makefile src/lib/sampler/Makefile src/lib/model/Makefile src/lib/module/Makefile src/lib/compiler/Makefile src/lib/rng/Makefile src/jrmath/Makefile src/include/Makefile src/include/util/Makefile src/include/sarray/Makefile src/include/function/Makefile src/include/distribution/Makefile src/include/graph/Makefile src/include/sampler/Makefile src/include/model/Makefile src/include/module/Makefile src/include/compiler/Makefile src/include/rng/Makefile src/modules/Makefile src/modules/base/Makefile src/modules/base/functions/Makefile src/modules/base/rngs/Makefile src/modules/base/samplers/Makefile src/modules/base/monitors/Makefile src/modules/bugs/Makefile src/modules/bugs/functions/Makefile src/modules/bugs/distributions/Makefile src/modules/bugs/samplers/Makefile src/modules/bugs/matrix/Makefile src/modules/msm/Makefile src/modules/msm/functions/Makefile src/modules/msm/distributions/Makefile src/modules/msm/matrix/Makefile src/modules/mix/Makefile src/modules/mix/distributions/Makefile src/modules/mix/samplers/Makefile src/modules/dic/Makefile src/modules/lecuyer/Makefile src/modules/glm/Makefile src/modules/glm/SSparse/Makefile src/modules/glm/SSparse/config/Makefile src/modules/glm/SSparse/AMD/Makefile src/modules/glm/SSparse/CAMD/Makefile src/modules/glm/SSparse/CCOLAMD/Makefile src/modules/glm/SSparse/COLAMD/Makefile src/modules/glm/SSparse/CHOLMOD/Makefile src/modules/glm/SSparse/CHOLMOD/Check/Makefile src/modules/glm/SSparse/CHOLMOD/Cholesky/Makefile src/modules/glm/SSparse/CHOLMOD/Core/Makefile src/modules/glm/SSparse/CHOLMOD/Include/Makefile src/modules/glm/SSparse/CHOLMOD/MatrixOps/Makefile src/modules/glm/SSparse/CHOLMOD/Modify/Makefile src/modules/glm/SSparse/CHOLMOD/Supernodal/Makefile src/modules/glm/samplers/Makefile src/modules/glm/distributions/Makefile src/terminal/Makefile win/Makefile win/runtime64/Makefile doc/Makefile doc/manual/Makefile test/Makefile ]) AC_OUTPUT JAGS-4.3.2/aclocal.m40000644000175000017500000015503214400675234011040 00000000000000# generated automatically by aclocal 1.16.5 -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, [m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 11 (pkg-config-0.29.1) dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, but dnl WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA dnl 02111-1307, USA. dnl dnl As a special exception to the GNU General Public License, if you dnl distribute this file as part of a program that contains a dnl configuration script generated by Autoconf, you may include it under dnl the same distribution terms that you use for the rest of that dnl program. dnl PKG_PREREQ(MIN-VERSION) dnl ----------------------- dnl Since: 0.29 dnl dnl Verify that the version of the pkg-config macros are at least dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's dnl installed version of pkg-config, this checks the developer's version dnl of pkg.m4 when generating configure. dnl dnl To ensure that this macro is defined, also add: dnl m4_ifndef([PKG_PREREQ], dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) dnl dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], [m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) dnl ---------------------------------- dnl Since: 0.16 dnl dnl Search for the pkg-config tool and set the PKG_CONFIG variable to dnl first found in the path. Checks that the version of pkg-config found dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is dnl used since that's the first version where most current features of dnl pkg-config existed. AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])dnl PKG_PROG_PKG_CONFIG dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------------------------------- dnl Since: 0.18 dnl dnl Check to see whether a particular set of modules exists. Similar to dnl PKG_CHECK_MODULES(), but does not set variables or print errors. dnl dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) dnl only at the first occurence in configure.ac, so if the first place dnl it's called might be skipped (such as if it is within an "if", you dnl have to call PKG_CHECK_EXISTS manually AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) dnl --------------------------------------------- dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting dnl pkg_failed based on the result. m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])dnl _PKG_CONFIG dnl _PKG_SHORT_ERRORS_SUPPORTED dnl --------------------------- dnl Internal check to see if pkg-config supports short errors. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])dnl _PKG_SHORT_ERRORS_SUPPORTED dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl -------------------------------------------------------------- dnl Since: 0.4.0 dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES might not happen, you should be sure to include an dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])dnl PKG_CHECK_MODULES dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], dnl [ACTION-IF-NOT-FOUND]) dnl --------------------------------------------------------------------- dnl Since: 0.29 dnl dnl Checks for existence of MODULES and gathers its build flags with dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags dnl and VARIABLE-PREFIX_LIBS from --libs. dnl dnl Note that if there is a possibility the first call to dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to dnl include an explicit call to PKG_PROG_PKG_CONFIG in your dnl configure.ac. AC_DEFUN([PKG_CHECK_MODULES_STATIC], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl _save_PKG_CONFIG=$PKG_CONFIG PKG_CONFIG="$PKG_CONFIG --static" PKG_CHECK_MODULES($@) PKG_CONFIG=$_save_PKG_CONFIG[]dnl ])dnl PKG_CHECK_MODULES_STATIC dnl PKG_INSTALLDIR([DIRECTORY]) dnl ------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable pkgconfigdir as the location where a module dnl should install pkg-config .pc files. By default the directory is dnl $libdir/pkgconfig, but the default can be changed by passing dnl DIRECTORY. The user can override through the --with-pkgconfigdir dnl parameter. AC_DEFUN([PKG_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([pkgconfigdir], [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, [with_pkgconfigdir=]pkg_default) AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_INSTALLDIR dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) dnl -------------------------------- dnl Since: 0.27 dnl dnl Substitutes the variable noarch_pkgconfigdir as the location where a dnl module should install arch-independent pkg-config .pc files. By dnl default the directory is $datadir/pkgconfig, but the default can be dnl changed by passing DIRECTORY. The user can override through the dnl --with-noarch-pkgconfigdir parameter. AC_DEFUN([PKG_NOARCH_INSTALLDIR], [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) m4_pushdef([pkg_description], [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) AC_ARG_WITH([noarch-pkgconfigdir], [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, [with_noarch_pkgconfigdir=]pkg_default) AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) m4_popdef([pkg_default]) m4_popdef([pkg_description]) ])dnl PKG_NOARCH_INSTALLDIR dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl ------------------------------------------- dnl Since: 0.28 dnl dnl Retrieves the value of the pkg-config variable for the given module. AC_DEFUN([PKG_CHECK_VAR], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl _PKG_CONFIG([$1], [variable="][$3]["], [$2]) AS_VAR_COPY([$1], [pkg_cv_][$1]) AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------ dnl dnl Prepare a "--with-" configure option using the lowercase dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and dnl PKG_CHECK_MODULES in a single macro. AC_DEFUN([PKG_WITH_MODULES], [ m4_pushdef([with_arg], m4_tolower([$1])) m4_pushdef([description], [m4_default([$5], [build with ]with_arg[ support])]) m4_pushdef([def_arg], [m4_default([$6], [auto])]) m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) m4_case(def_arg, [yes],[m4_pushdef([with_without], [--without-]with_arg)], [m4_pushdef([with_without],[--with-]with_arg)]) AC_ARG_WITH(with_arg, AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, [AS_TR_SH([with_]with_arg)=def_arg]) AS_CASE([$AS_TR_SH([with_]with_arg)], [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], [auto],[PKG_CHECK_MODULES([$1],[$2], [m4_n([def_action_if_found]) $3], [m4_n([def_action_if_not_found]) $4])]) m4_popdef([with_arg]) m4_popdef([description]) m4_popdef([def_arg]) ])dnl PKG_WITH_MODULES dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ----------------------------------------------- dnl dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES dnl check._[VARIABLE-PREFIX] is exported as make variable. AC_DEFUN([PKG_HAVE_WITH_MODULES], [ PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) AM_CONDITIONAL([HAVE_][$1], [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) ])dnl PKG_HAVE_WITH_MODULES dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, dnl [DESCRIPTION], [DEFAULT]) dnl ------------------------------------------------------ dnl dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make dnl and preprocessor variable. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], [ PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) ])dnl PKG_HAVE_DEFINE_WITH_MODULES # Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE="gmake" (or whatever is necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl m4_ifdef([_$0_ALREADY_INIT], [m4_fatal([$0 expanded multiple times ]m4_defn([_$0_ALREADY_INIT]))], [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) # Variables for tags utilities; see am/tags.am if test -z "$CTAGS"; then CTAGS=ctags fi AC_SUBST([CTAGS]) if test -z "$ETAGS"; then ETAGS=etags fi AC_SUBST([ETAGS]) if test -z "$CSCOPE"; then CSCOPE=cscope fi AC_SUBST([CSCOPE]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Copyright (C) 1998-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ([2.50])dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/R.m4]) m4_include([m4/ax_lapack.m4]) m4_include([m4/axx_blas.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltargz.m4]) m4_include([m4/ltdl.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) JAGS-4.3.2/Makefile.in0000644000175000017500000006555514400675235011260 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ COPYING ChangeLog INSTALL NEWS README compile config.guess \ config.sub depcomp install-sh ltmain.sh missing ylwrap DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip # Exists only to be overridden by the user if desired. AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = m4 libltdl src etc win doc test EXTRA_DIST = Doxyfile all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-zstd: distdir tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ *.tar.zst*) \ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr \ distclean-libtool distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile .PHONY: win32-install win64-install installer docs win32-install: make prefix=`pwd`/win/inst32 make install prefix=`pwd`/win/inst32 win64-install: make prefix=`pwd`/win/inst64 make install prefix=`pwd`/win/inst64 installer: (for f in `find win/runtime64 -name '*.dll' -print`; do \ ${INSTALL} $$f win/inst64/bin/; done;) (for f in `find win/runtime64 -name '*.dll.a' -print`; do \ ${INSTALL} $$f win/inst64/lib/; done;) (cd win && $(MAKE) $@) docs: FORCE -@(cd doc && $(MAKE) $@) FORCE: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/config.h.in0000664000175000017500000001503214400675245011222 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to dummy `main' function (if any) required to link to the Fortran libraries. */ #undef F77_DUMMY_MAIN /* Define to a macro mangling the given C identifier (in lower and upper case), which must not contain underscores, for linking with Fortran. */ #undef F77_FUNC /* As F77_FUNC, but for C identifiers containing underscores. */ #undef F77_FUNC_ /* Define if F77 and FC dummy `main' functions are identical. */ #undef FC_DUMMY_MAIN_EQ_F77 /* Define to 1 if you have the `argz_add' function. */ #undef HAVE_ARGZ_ADD /* Define to 1 if you have the `argz_append' function. */ #undef HAVE_ARGZ_APPEND /* Define to 1 if you have the `argz_count' function. */ #undef HAVE_ARGZ_COUNT /* Define to 1 if you have the `argz_create_sep' function. */ #undef HAVE_ARGZ_CREATE_SEP /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `argz_insert' function. */ #undef HAVE_ARGZ_INSERT /* Define to 1 if you have the `argz_next' function. */ #undef HAVE_ARGZ_NEXT /* Define to 1 if you have the `argz_stringify' function. */ #undef HAVE_ARGZ_STRINGIFY /* Define if you have a BLAS library. */ #undef HAVE_BLAS /* Define to 1 if you have the `closedir' function. */ #undef HAVE_CLOSEDIR /* Define to 1 if you have the declaration of `cygwin_conv_path', and to 0 if you don't. */ #undef HAVE_DECL_CYGWIN_CONV_PATH /* Define to 1 if you have the declaration of `isfinite', and to 0 if you don't. */ #undef HAVE_DECL_ISFINITE /* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. */ #undef HAVE_DECL_ISNAN /* Define to 1 if you have the header file. */ #undef HAVE_DIRENT_H /* Define if you have the GNU dld library. */ #undef HAVE_DLD /* Define to 1 if you have the header file. */ #undef HAVE_DLD_H /* Define to 1 if you have the `dlerror' function. */ #undef HAVE_DLERROR /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_DL_H /* Define if you have the _dyld_func_lookup function. */ #undef HAVE_DYLD /* Define to 1 if the system has the type `error_t'. */ #undef HAVE_ERROR_T /* Define to 1 if you have the header file. */ #undef HAVE_IEEEFP_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `isnan' function. */ #undef HAVE_ISNAN /* Define if you have LAPACK library. */ #undef HAVE_LAPACK /* Define if you have the libdl library or equivalent. */ #undef HAVE_LIBDL /* Define if libdlloader will be built on this platform */ #undef HAVE_LIBDLLOADER /* Define this if a modern libltdl is already installed */ #undef HAVE_LTDL /* Define to 1 if you have the header file. */ #undef HAVE_MACH_O_DYLD_H /* Define to 1 if you have the `opendir' function. */ #undef HAVE_OPENDIR /* Define if libtool can extract symbol lists from object files. */ #undef HAVE_PRELOADED_SYMBOLS /* Define to 1 if you have the `readdir' function. */ #undef HAVE_READDIR /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the header file. */ #undef HAVE_SYS_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* This value is set to 1 to indicate that the system argz facility works */ #undef HAVE_WORKING_ARGZ /* Define if finite() is correct for -Inf/NaN/Inf. */ #undef HAVE_WORKING_FINITE /* Define if isfinite() is correct for -Inf/NaN/Inf. */ #undef HAVE_WORKING_ISFINITE /* Mercurial Month and Dday */ #undef HG_MONTH_DAY /* Mercurial Version */ #undef HG_VERSION /* Mercurial Year */ #undef HG_YEAR /* Define if you have IEEE 754 floating point arithmetic. */ #undef IEEE_754 /* Major version of JAGS library */ #undef JAGS_MAJOR /* Minor version of JAGS library */ #undef JAGS_MINOR /* Patch level of JAGS */ #undef JAGS_PATCH /* Define if the OS needs help to load dependent libraries for dlopen(). */ #undef LTDL_DLOPEN_DEPLIBS /* Define to the system default library search path. */ #undef LT_DLSEARCH_PATH /* The archive extension */ #undef LT_LIBEXT /* The archive prefix */ #undef LT_LIBPREFIX /* Define to the extension used for runtime loadable modules, say, ".so". */ #undef LT_MODULE_EXT /* Define to the name of the environment variable that determines the run-time module search path. */ #undef LT_MODULE_PATH_VAR /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to the shared library suffix, say, ".dylib". */ #undef LT_SHARED_EXT /* Define to the shared archive member specification, say "(shr.o)". */ #undef LT_SHARED_LIB_MEMBER /* Define if dlsym() requires a leading underscore in symbol names. */ #undef NEED_USCORE /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define so that glibc/gnulib argp.h does not typedef error_t. */ #undef __error_t_defined /* Define to a type to use for 'error_t' if it is not otherwise available. */ #undef error_t JAGS-4.3.2/AUTHORS0000664000175000017500000000267214224052371010246 00000000000000This code is copyright (C) 2002-10 Martyn Plummer, with the following exceptions: The library JRmath is a version of the R math library from R version 2.10.1., copyright (C), 1998-2000 Ross Ihaka, Robert Gentleman, The R Core Development Team, The R Foundation, and Morten Welinder (see individual source files for details). Part of the R math library is also found in the file src/lib/rng/RmathRNG.cc The random number generators in the base module: - src/modules/base/rngs/MarsagliaRNG.cc - src/modules/base/rngs/MersenneTwiseterRNG.cc - src/modules/base/rngs/SuperDuperRNG.cc - src/modules/base/rngs/WichmannHillRNG.cc contain random number generators from the main R library which are Copyright (C) 1998 Ross Ihaka 2000-2009 and The R Core Development Team. The implementation of the Mersenne Twister generator is Copyright (C) 1997, 1999 Makoto Matsumo and Takuji Nishimura. The lecuyer module is adapted from code Copyright (C) Pierre L'Ecuyer 2001. The glm module contains a complete copy of the CSparse library, Copyright (C) Timothy A. Davis, 2006-2009, and the CHOLMOD library, Copyright (C) 2004-2009. Some portions of CHOLMOD are Copyright (C) Univ. of Florida. Others are Copyright (C) by their authors (T. A. Davis and W. Hager). The file LGMix.cc in the glm module contains code to approximate the negative log-gamma distribution by a mixture of normals, originally written by Rudolf Fruewirth and taken from the GMRFLib library by Havard Rue. JAGS-4.3.2/COPYING0000664000175000017500000004311014224052371010221 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 of the License, 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. JAGS-4.3.2/ChangeLog0000664000175000017500000000000014224052371010727 00000000000000JAGS-4.3.2/INSTALL0000644000175000017500000003662614071237055010237 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same timestamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. JAGS-4.3.2/NEWS0000664000175000017500000005574014224053504007700 00000000000000Changes in JAGS 4.3.1 The Windows installer has been updated to work with the new compiler for R >= 4.2.0. Changes in JAGS 4.3.0 Bug fixes ========= * Setting the RNG name and seed in a model with a data block caused a crash on exit. Thanks to Sourceforge user sathomasga. * Samplers in the GLM module would recalculate the entire design matrix on each iteration, including columns that are fixed from one iteration to the next. * There was a memory leak in the compiler which could create redundant constant nodes. * Models in which the nodes were defined in forward-sampling order could could compile very slowly. The compilation time is now much less dependent on the order in which the nodes are defined. * Parameter consistency checks are improved for bounded scalar stochastic nodes. * The sum function was incorrectly reporting itself as a scale-preserving function when used with multiple arguments. * Estimation of the deviance optimism pD was incorrect for the multinomial distribution. * The command line interface now parses data when the first argument to the structure() function has name '.Data'. New features ============ * New distribution dmnorm.vcov for the multivariate normal distribution parameterized by the mean and the variance-covariance matrix. Changes in JAGS 4.2.0 Bug fixes ========= * JAGS 4.1.0 did not compile under Solaris Studio 12.3 as it referenced some C99 functions that are not part of the C++98 standard (It did compile under Solaris Studio 12.4). * The non-central t distribution (dnt) was not inserted into the bugs module. * The likelihood for left-truncated nodes was not calculated correctly (This did not affect truncated nodes with no parents, only truncated outcome variables). Changes in JAGS 4.1.0 Bug fixes ========= * False positive warnings about unused variables in 4.0.0 and 4.0.1 are now fixed. * Using the same name for a counter as an integer vector supplied with the data could lead to a "dimension mismatch" error when compiling the model. * The compiler did not check that a subset expression was inside the range of a node array leading to a logic error. This is now checked in the Compiler::getRange function and a more informative compilation error message is generated. * Setting up a large number of predictive nodes to be monitored is now much faster. * The bugs::ConjugateNormal sample method did not work correctly with an exponential prior distribution. * Error messages for undefined nodes and directed cycles are improved, with less misclassification between the two diagnostic messages. * The configuration file jags.pc for pkg-config now gives the correct value for the variable moduledir. New features ============ * A new distribution "dsample" in the bugs module represents sampling without replacement. It has the same interface as "dmulti" (sampling with replacement). Library changes =============== * The JRmath library contains d-p-q-r functions for the Weibull distribution using the shape-rate parameterization of BUGS instead of the shape-scale parameterization of R. These are used by the DWeib distribution in the bugs module. * On Windows, the DLL of the JAGS library includes version information. * Compiler::constFromTable returns NULL if a counter with the same name is on the counter stack. * RScalarDist::randomSample has improved accuracy when sampling from the tails. * Methods of the Console class consistently return false when an error occurs. Internal changes in modules =========================== * base module - The restriction on the length of nodes that FiniteMethod can sample is reintroduced (it was removed in release 4.0.0) but is large (100 instead of 20) and does not apply to nodes with prior distribution dcat. * bugs module - Interval censored continuous variables can be sampled by the Censored method. Samplers are created by CensoredFactory. - New distribution DSample ("dsample") for sampling with replacement. - The bugs::Sum sampling method (SumMethod) now works when there are likelihood terms in addition to the sum constraint provided by the SumDist distribution. It can also handles the case when a SumDist node has only a single stochastic parent. Changes in JAGS 4.0.1 Internal changes in modules =========================== * The FLIBS flag is not passed to modules that use LAPACK and BLAS. This reverts a change in JAGS 4.0.0 that created an unwanted dependency on libgfortran on Mac OS X. Changes in JAGS 4.0.0 New features ============ * Deterministic relations can be defined with the equals sign `=` as well as the left arrow `<-` (Thanks to Merlise Clyde for the suggestion). * All distributions now have an associated function that calculates their normalized log density. If the name of the distribution is "dfoo" then the corresponding log density function is called "logdensity.foo". The first argument of the log density function is the value at which the density is to be evaluated, and the remaining arguments are the parameters of the distribution. * The sum and prod functions are now variadic, like their R equivalents and return respectively the sum and product over all arguments. * The sequence operator ":" can be used in any expression. If b < a then a:b returns a zero-length vector. * The compiler gives more detailed information about the graph. In addition to printing the total number of nodes, it gives the numbers of observed and unobserved stochastic nodes. * Vector indexing is now possible for Node arrays and arbitrary integer vectors are allowed for the counter in a for loop. * The generalized gamma distribution dgen.gamma now has alias "dggamma" for compatibility with OpenBUGS. The multinomial distribution has alias "dmultinom" for compatibility with R. * The function c() has been added to the bugs module. Like the R function c() it combines its arguments into a single vector. * New non-central t distribution "dnt" in the "bugs" module (from the R math library) * Variables that are not completely defined can now be monitored. The undefined elements are dropped from CODA output. * The compiler now gives a more informative error message when nodes cannot be resolved, and tries to distinguish between the two possible causes of an undefined node and a directed cycle. Bug fixes ========= * Unit tests for functions and distributions using CppUnit are now included and can be activated by "make check" * The qpar function in the bugs module was inverted. * The not function in the base module was inverted. * The ConjugateGamma sampler did not work correctly for the Chi Squared distribution * The parser accepts form feed as a white space character * Fixes for lack of reproducibility (due to arbitrary ordering of Nodes in a Graph) have been put in place. * The log-density functions for the multivariate normal (DMNorm) and Wishart (DWish) distributions now return zero for non-positive definite precision matrices, instead of throwing an exception. This allows flexible modelling of the precision matrix. * The Windows installer no longer allows the same version of JAGS to be installed in two different locations (leading to registry problems) * The qdexp function was incorrect. Library changes =============== * All C++ objects and functions are in the namespace jags * Automake 1.12.0 or above is required. The header file generated from C++ yacc source is *.hh, not *.h for automake 1.12 and above. This is incompatible with previous versions. * The GraphView API has changed: stochasticChildren now returns a vector of (non-const) pointers. This is necessary for collapsing in multi-level models. * The Graph interface is simplified as it now inherits from set * Names of functions in libjrmath are remapped to avoid namespace clashes with libR and libRmath. * The Module.h header is moved into the module sub-directory * The classes RScalarDist, DFunction, PFunction, QFunction are moved from the bugs module into the main library. * SingletonGraphView is a new subclass of GraphView to be used when a single node is being sampled. * Subclasses of Monitor no longer need to implement the reserve function. They should instead re-allocate memory during each update as necessary, ensuring that an update remains an amortized constant time operation. * The ParallelSampler class is renamed MutableSampler. Similarly, the SamplerMethod class is renamed MutableSampleMethod. The API of both classes is also modified as described below. * The MutableSampleMethod class does not need to implement the name method. The name of a MutableSampler is now defined in the constructor. (In many cases the SamplerFactory can pass its own name to the Samplers it constructs: this allows us to get rid of a redundant level of names). * A new class ImmutableSampler and corresponding class ImmutableSampleMethod are added to the library for samplers that have no internal state (e.g. base::FiniteSampler or bugs::ConjugateSampler). * StochasticNode has a new member function setData, which sets the value of the node to be the same across all chains and sets the status of the StochasticNode to observed. The setObserved member function is defunct. The change guarentees that observed StochasticNodes have the same value across all chains. The Compiler has been modified to use the new StochasticNode API. * The VectorFunction class has a new subclass ScalarVectorFunction for scalar-valued functions that take vector-valued arguments. * The length of the return value of a VectorFunction and the dimension of the value of an ArrayFunction may now depend on the values of the arguments and not just the lengths/dimensions of the arguments. * A new checkParameterDiscrete member function in the Function class allows Functions to check that some of the parameters are discrete. * A new checkParameterFixed member function in the Function class allows Functions to check that some of the parameters have fixed values. This check is necessary when creating a LogicalNode from a Function that has a variable-sized return value depending on the values of the arguments (and not just the dimensions of the arguments). We can only permit this if the node has fixed length, and hence if the relevant arguments are fixed. * The Range class now allows representation of arbitrary index ranges (e.g. indices that are not contiguous, nor increasing, or include repeats). This change is in support of vector indexing. The old Range class is now represented by a sub-class SimpleRange. * The interface of the NodeArray class is simplified. Member functions find and isEmpty are defunct. * The new NodeArraySubset class is introduced for use by Monitors. The BUGSModel::getNode and Model::addExtraNode functions are defunct. These functions were only needed by Monitors. * Calculation of Kullback-Leibler divergence is moved out of the dic module and into the library. * The Node destructor no longer removes "this" (the node being destroyed) from its parents' list of children. A new member function unlinkParents() is added for this purpose. * A new class of closed functions DNODE_ADDITIVE is added to the ClosedFuncClass enumeration, with new method Function#isAdditive to support LogicalNode#isClosed. An additive function can be expressed as f(x) = a + sum(x) and is fixed if a is fixed. * The test for valid initial values for Stochastic Nodes is moved out of the model class and replaced by calls to GraphView::checkFinite in the constructor of each sample method. This change enables samplers to correct initial values when they are not valid. Internal changes in modules =========================== * All module namespaces are nested inside namespace jags * The FLIBS flag is now passed to modules that use LAPACK and BLAS. This allows static linking to LAPACK. * base module - FiniteMethod no longer has a restriction on the length of the nodes that it can sample. - The sequence operator ":" is now defined as a function in the base module. Previously it was handled by the compiler. - The TraceMonitor and MeanMonitor classes take their values from a NodeArraySubset instead of a Node, allowing them to be constructed even when all elements of a NodeArray have not been defined. * bugs module - The ConjugateDirichlet sampler is now much faster for mixture models. This sampler contains some experimental features that may eventually be folded into the GraphView class. - The classes RScalarDist, DFunction, PFunction, QFunction are moved into the main library - The beta binomial distribution (DBetaBin) is moved to the mix module. - The logDensity function for the multivariate normal distribution (DMNorm) now includes the correct normalizing constant for PDF_FULL. This affects deviance statistics for multivariate normal nodes. - All VectorFunctions with scalar return values now inherit from the new ScalarVectorFunction class. - New distribution SumDist provides an "observable function" version of the sum function, and the associated sampling method SumMethodd provides a sampler for its stochastic parents. * glm module - Refactorization of samplers. The new Outcome class presents an abstract normal approximation to the GLM engine. * mix module - New sampler MixDirich for conjugate Dirichlet sampling in a mixture model. - New sampler LDA for Latent Dirichlet Allocation models. - The beta binomial distribution (DBetaBin) is moved from the bugs module. Changes in JAGS 3.4.0 ===================== New features ==================== * You can now set a monitor of type "mean" for any node, which records the running mean. * The order function in the bugs module returns a permutation that sorts its argument in ascending order (the inverse of the permutation provided by the rank function). * The Windows installer now offers a choice of personal or global installation for users with Admin access. * The negative binomial distribution is extended to allow parameters size=0 and probability=1. Bug fixes ========= * LogicalNode::isClosed could throw a logic_error due to a bug in the checkLinear function (Linear.cc) * Setting a monitor with thinning interval 0 prints an error message but no longer throws a logic_error exception. * The command line interface could print a spurious warning that ".RNG.seed" or ".RNG.state" was unused. * A function or distribution with zero arguments caused a segmentation fault. This now gives a compilation error. * The "dround" function (bugs module) was incorrectly calling fprec (round to n significant figures) when it should have been calling fround (round to n decimal places). * The sd() function divided by n (sample size) instead of (n-1). * The Windows uninstaller did not correctly uninstall personal installations for users with administrative access. Internal changes in modules =========================== * base module - The Pow function has alias "pow" so it can be invoked either as "a^b" or as "pow(a,b)" * bugs module - The Pow function has been removed: it was a duplicate of base::pow - The DSum distribution no longer throws an exception if the parameters are inconsistent with the value. This gives a more informative error message. Changes in JAGS 3.3.0 ===================== User-visible changes ==================== * JAGS now prints a warning about unused initial values * Failure to set a "pD" monitor from the "dic" module should produce a more informative error messages * The Windows installer no longer creates a shortcut in the start menu to the uninstaller. Use the Control Panel to uninstall JAGS on Windows. Bug fixes ========= * The inverse and logdet functions now work on scalars * NodeArray::setValue could overwrite values of observed nodes. At the user-interface level, one could change the value of a constant node by providing an initial value. * Underflow errors in the Weibull distribution are now caught. * The auxiliary mixture sampling method now works with binomial data that have a zero denominator. * The multinomial distribution now allows a zero size parameter. * The log-density of the uniform distribution was incorrect when doing likelihood calculations. * The ConjugateWishart distribution did not work correctly in mixture models. * The choose and lchoose functions in the JRmath library could go into an infinite recursion, overflowing the C stack and crashing JAGS. * The Poisson log-likelihood function did not return zero for non-integer values. This could lead to a crash in the glm module. * Multiple bug fixes in the IWLS sampler in the glm module. Internal changes in modules =========================== bugs module * The InProd and MatMult functions now use BLAS calls. glm module: * Cutoff for left and right expansions in Holmes-Held sampler is now optimal. * IWLS sampler only works with certain link functions. dic module * Faster Kullback-Leibler calculations for the Bernoulli distribution. -------------------------------------------------------------------------- Changes in JAGS 3.2.0 User-visible changes ==================== * New observable function "dround" may be used to represent data that have been rounded to a given number of decimal places. Bug fixes ========= * BaseRNGFactory did not recycle RNGs correctly. * DMState now declares itself to be a discrete-valued distribution. * Likelihood calculations were incorrect for the binomial distribution with unobserved size parameter. * The Holmes-Held sampler for logistic regression models with binary outcomes is now more numerically stable. Internal changes in modules =========================== * New ShiftedCount sampler samples nodes with a Poisson, binomial or negative binomial prior distribution that are used as the size parameter of a binomial distribution. * New ShiftedMultinomial sampler is a multivariate version of shiftedCount. It samples nodes with a multinomial prior distribution, elements of which are used as the size parameters of distinct binomial children. * Headers in the GLM module are properly documented. --------------------------------------------------------------------- Changes in JAGS 3.1.0 User-visible changes ==================== * Allow progress bar in batch mode if user gives "by" option to update or adapt. Bug fixes ========= * If a monitor is requested while the model is in adaptive mode, then adaptive mode is turned off, with a NOTE to the user, instead of throwing an exception. Library changes =============== * BUGSModel::setMonitor will return after the first error message is reported from a MonitorFactory. Internal changes in modules =========================== * dic - Improved error messages from PDTraceFactory in case a pD monitor cannot be generated. ----------------------------------------------------------------------- Changes in JAGS 3.0.0 User-visible changes ==================== * Functions and distributions may now have an alias, so that they can be referred to by more than one name. This allows compatibility with the naming conventions of OpenBUGS (e.g. ddirch vs ddirich) and of R (e.g. dbin vs dbinom). * Progress bar - The width of the progress bar is extended from 40 to 50 characters - In batch mode, the progress bar is not printed - Adaptive mode is always indicated by symbol "+" * In batch mode JAGS halts on the first error * New distributions in the bugs module - Non-central chi-square (dnchisqr) - Beta binomial (dbetabin) - Generalized gamma (dgen.gamma) * Separate messages are printed during compilation and initialization of the model. * The multinomial distribution (dmulti) can take a scalar probability parameter (like dcat) * A warning is printed if a user tries to initialize a model before it is compiled. This was previously silently ignored. * The user has more control over the adaptive phase. The adapt command does not automatically turn off the adaptive phase and so may be run sequentially until adaptation is complete. * When a monitor cannot be defined an attempt is made to return an informative error message. * A single installer for Windows contains both 32-bit and 64-bit versions of JAGS. Library changes =============== * logLikelihood function renamed to logDensity. This function now takes an argument allowing fast calculation of likelihoods and priors. * New error functions declared in the header module/ModuleError.h can be called from a module instead of throwing an exception. This allows safe handling when the library is statitically linked to the C++ runtime, as exceptions cannot be thrown across DLL boundaries in this case. * New subclasses of runtime_error for functions (FuncError), distributions (DistError) * Mixture nodes may share a common MixMap, with substantial memory savings. * Models with large multivariate nodes have been optimized for speed. Configuration changes ===================== * Use up-to-date m4 macros for blas and lapack from gnu autoconf archive * For modules, drop the -no-undefined linker flag except on Windows, where it is necessary. * On Solaris, the macro for detecting blas automatically has been updated to use new syntax -library=sunperf. Internal changes in modules =========================== * bugs - The base RNG factory only uses the time stamp once, during construction, to fix the random number seed. Use the bugs namespace consistently in the bugs module - Changed all instances of lgamma (C library) to lgamma_fn (R math) - The DSum sampler may be multi-level (i.e. it may sample two nodes, one of which is the descendant of the other) * glm - The HolmesHeld sampler has been (temporarily) suppressed as its numerical instability problems have not been solved. - The glm module now contains a copy of CHOLMOD, AMD, COLMOD * mix - The DNormMix sampler may be multi-level Bug fixes ========= * Fixed segfault in BUGSModel when requesting monitor for node with wrong dimensions * Fixed segfault in ConjugateMNormal * Fixed glm module in case of GLMs with mis-measured covariates - Holmes-Held method cannot work with such models - With Albert-Chib method we need to update all auxiliary data at the start of each iteration * The lexer now accepts floating point expressions when the exponent has no sign (e.g. 6.022E23 now accepted as well as 6.022E+23) * Corrected random number generation for - Pareto distribution - Multivariate T distribution - Hypergeometric distribution (seg fault) * The constructors for Vector- and ArrayStochasticNodes now check the number of parameters. * Fixed serious bug in NodeArray::find (It always returned 0 and led to the creation of spurious aggregate nodes). * More informative error messages in case of module loading failure * Random walk Metropolis sampler now copes with non-finite log-densities * CalKLExact was only returning half the correct value, with consequences for the pD and popt monitors. * The binomial distribution now allows a zero size parameter * Fixed bug in PDMonitorFactory that stopped Monitor objects being created when any node in the model is bounded. * The scanner throws an exception if it encounters the Unicode replacement charcter U+FFFD JAGS-4.3.2/README0000664000175000017500000000047514400710166010054 00000000000000This is JAGS (Just Another Gibbs Sampler), a program for analysis of Bayesian Graphical models by Gibbs Sampling. The functionality of JAGS is based on the BUGS program created by the MRC Biostatistics Unit (http://www.mrc-bsu.cam.ac.uk). JAGS is written in C++ and requires (since version 4.3.2) C++11 or above. JAGS-4.3.2/compile0000755000175000017500000001635014072725711010556 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: JAGS-4.3.2/config.guess0000755000175000017500000014120514272447404011520 00000000000000#!/usr/bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-05-25' # This file 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 3 of the License, 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __i386__ ABI=x86 #else #ifdef __ILP32__ ABI=x32 #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in x86) CPU=i686 ;; x32) LIBCABI=${LIBC}x32 ;; esac fi GUESS=$CPU-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; ppc:Haiku:*:*) # Haiku running on Apple PowerPC GUESS=powerpc-apple-haiku ;; *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) GUESS=$UNAME_MACHINE-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&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` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: JAGS-4.3.2/config.sub0000755000175000017500000010512114272447404011160 00000000000000#!/usr/bin/sh # Configuration validation subroutine script. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-03' # This file 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 3 of the License, 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, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: JAGS-4.3.2/depcomp0000755000175000017500000005602014072725711010553 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: JAGS-4.3.2/install-sh0000755000175000017500000003577613753651557011234 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: JAGS-4.3.2/ltmain.sh0000644000175000017500000121201014266326445011016 00000000000000#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.7 package_revision=2.4.7 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname (GNU libtool) 2.4.7 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" # Keeping compiler generated duplicates in $postdeps and $predeps is not # harmful, and is necessary in a majority of systems that use it to satisfy # symbol dependencies. opt_duplicate_compiler_generated_deps=: $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # 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+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. -pthread) case $host in *solaris2*) ;; *) case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac ;; esac continue ;; -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $func_quote_arg_result" func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $wl$func_quote_arg_result" func_append compiler_flags " $wl$func_quote_arg_result" func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xassembler) prev=xassembler continue ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_arg pretty "$arg" arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty "$var_value" relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done func_quote eval cd "`pwd`" func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty,unquoted "$var_value" relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. func_quote eval cd "`pwd`" relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote_arg pretty,unquoted "$relink_command" relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: JAGS-4.3.2/missing0000755000175000017500000001533614072725711010602 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: JAGS-4.3.2/ylwrap0000755000175000017500000001531414072725711010443 00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # Written by Tom Tromey . # # 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, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: JAGS-4.3.2/Doxyfile0000664000175000017500000014514114224052371010703 00000000000000# Doxyfile 1.5.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = JAGS # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = 3.1 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = doc/reference # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, # Italian, Japanese, Japanese-en (Japanese with English messages), Korean, # Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, # Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # This tag can be used to specify the encoding used in the generated output. # The encoding is not always determined by the language that is chosen, # but also whether or not the output is meant for Windows or non-Windows users. # In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES # forces the Windows encoding (this is the default for the Windows binary), # whereas setting the tag to NO uses a Unix-style encoding (the default for # all platforms other than Windows). USE_WINDOWS_ENCODING = NO # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to # include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from the # version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = src/include src/modules/glm # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py FILE_PATTERNS = *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = src/include/config.h # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentstion. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a caller dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected # functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_WIDTH = 1024 # The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height # (in pixels) of the graphs generated by dot. If a graph becomes larger than # this value, doxygen will try to truncate the graph, so that it fits within # the specified constraint. Beware that most browsers cannot cope with very # large images. MAX_DOT_GRAPH_HEIGHT = 1024 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that a graph may be further truncated if the graph's # image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH # and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), # the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO JAGS-4.3.2/libltdl/0000755000175000017500000000000014400711323010666 500000000000000JAGS-4.3.2/libltdl/libltdl/0000755000175000017500000000000014400711323012314 500000000000000JAGS-4.3.2/libltdl/libltdl/lt_system.h0000644000175000017500000001235414214520133014435 00000000000000/* lt_system.h -- system portability abstraction layer Copyright (C) 2004, 2007, 2010-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined LT_SYSTEM_H #define LT_SYSTEM_H 1 #include #include #include /* Some systems do not define EXIT_*, even with STDC_HEADERS. */ #if !defined EXIT_SUCCESS # define EXIT_SUCCESS 0 #endif #if !defined EXIT_FAILURE # define EXIT_FAILURE 1 #endif /* Just pick a big number... */ #define LT_FILENAME_MAX 2048 /* Saves on those hard to debug '\0' typos.... */ #define LT_EOS_CHAR '\0' /* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations, so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at the end of C declarations. */ #if defined __cplusplus # define LT_BEGIN_C_DECLS extern "C" { # define LT_END_C_DECLS } #else # define LT_BEGIN_C_DECLS /* empty */ # define LT_END_C_DECLS /* empty */ #endif /* LT_STMT_START/END are used to create macros that expand to a a single compound statement in a portable way. */ #if defined __GNUC__ && !defined __STRICT_ANSI__ && !defined __cplusplus # define LT_STMT_START (void)( # define LT_STMT_END ) #else # if (defined sun || defined __sun__) # define LT_STMT_START if (1) # define LT_STMT_END else (void)0 # else # define LT_STMT_START do # define LT_STMT_END while (0) # endif #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* Canonicalise Windows and Cygwin recognition macros. To match the values set by recent Cygwin compilers, make sure that if __CYGWIN__ is defined (after canonicalisation), __WINDOWS__ is NOT! */ #if defined __CYGWIN32__ && !defined __CYGWIN__ # define __CYGWIN__ __CYGWIN32__ #endif #if defined __CYGWIN__ # if defined __WINDOWS__ # undef __WINDOWS__ # endif #elif defined _WIN32 # define __WINDOWS__ _WIN32 #elif defined WIN32 # define __WINDOWS__ WIN32 #endif #if defined __CYGWIN__ && defined __WINDOWS__ # undef __WINDOWS__ #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #if !defined LT_SCOPE # if defined __WINDOWS__ || defined __CYGWIN__ # if defined DLL_EXPORT /* defined by libtool (if required) */ # define LT_SCOPE extern __declspec(dllexport) # endif # if defined LIBLTDL_DLL_IMPORT /* define if linking with this dll */ /* note: cygwin/mingw compilers can rely instead on auto-import */ # define LT_SCOPE extern __declspec(dllimport) # endif # endif # if !defined LT_SCOPE /* static linking or !__WINDOWS__ */ # define LT_SCOPE extern # endif #endif #if defined __WINDOWS__ /* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory separator when it is set. */ # define LT_DIRSEP_CHAR '\\' # define LT_PATHSEP_CHAR ';' #else # define LT_PATHSEP_CHAR ':' #endif #if defined _MSC_VER /* Visual Studio */ # define R_OK 4 #endif /* fopen() mode flags for reading a text file */ #undef LT_READTEXT_MODE #if defined __WINDOWS__ || defined __CYGWIN__ # define LT_READTEXT_MODE "rt" #else # define LT_READTEXT_MODE "r" #endif /* The extra indirection to the LT__STR and LT__CONC macros is required so that if the arguments to LT_STR() (or LT_CONC()) are themselves macros, they will be expanded before being quoted. */ #ifndef LT_STR # define LT__STR(arg) #arg # define LT_STR(arg) LT__STR(arg) #endif #ifndef LT_CONC # define LT__CONC(a, b) a##b # define LT_CONC(a, b) LT__CONC(a, b) #endif #ifndef LT_CONC3 # define LT__CONC3(a, b, c) a##b##c # define LT_CONC3(a, b, c) LT__CONC3(a, b, c) #endif #endif /*!defined LT_SYSTEM_H*/ JAGS-4.3.2/libltdl/libltdl/lt_error.h0000644000175000017500000000711214214520133014236 00000000000000/* lt_error.h -- error propagation interface Copyright (C) 1999-2001, 2004, 2007, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Only include this header file once. */ #if !defined LT_ERROR_H #define LT_ERROR_H 1 #include LT_BEGIN_C_DECLS /* Defining error strings alongside their symbolic names in a macro in this way allows us to expand the macro in different contexts with confidence that the enumeration of symbolic names will map correctly onto the table of error strings. \0 is appended to the strings to expilicitely initialize the string terminator. */ #define lt_dlerror_table \ LT_ERROR(UNKNOWN, "unknown error\0") \ LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available\0") \ LT_ERROR(INVALID_LOADER, "invalid loader\0") \ LT_ERROR(INIT_LOADER, "loader initialization failed\0") \ LT_ERROR(REMOVE_LOADER, "loader removal failed\0") \ LT_ERROR(FILE_NOT_FOUND, "file not found\0") \ LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found\0") \ LT_ERROR(NO_SYMBOLS, "no symbols defined\0") \ LT_ERROR(CANNOT_OPEN, "can't open the module\0") \ LT_ERROR(CANNOT_CLOSE, "can't close the module\0") \ LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found\0") \ LT_ERROR(NO_MEMORY, "not enough memory\0") \ LT_ERROR(INVALID_HANDLE, "invalid module handle\0") \ LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow\0") \ LT_ERROR(INVALID_ERRORCODE, "invalid errorcode\0") \ LT_ERROR(SHUTDOWN, "library already shutdown\0") \ LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module\0") \ LT_ERROR(INVALID_MUTEX_ARGS, "internal error (code withdrawn)\0")\ LT_ERROR(INVALID_POSITION, "invalid search path insert position\0")\ LT_ERROR(CONFLICTING_FLAGS, "symbol visibility can be global or local\0") /* Enumerate the symbolic error names. */ enum { #define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name), lt_dlerror_table #undef LT_ERROR LT_ERROR_MAX }; /* Should be max of the error string lengths above (plus one for C++) */ #define LT_ERROR_LEN_MAX (41) /* These functions are only useful from inside custom module loaders. */ LT_SCOPE int lt_dladderror (const char *diagnostic); LT_SCOPE int lt_dlseterror (int errorcode); LT_END_C_DECLS #endif /*!defined LT_ERROR_H*/ JAGS-4.3.2/libltdl/libltdl/lt_dlloader.h0000644000175000017500000000622614214520133014700 00000000000000/* lt_dlloader.h -- dynamic library loader interface Copyright (C) 2004, 2007-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined LT_DLLOADER_H #define LT_DLLOADER_H 1 #include LT_BEGIN_C_DECLS typedef void * lt_dlloader; typedef void * lt_module; typedef void * lt_user_data; typedef struct lt__advise * lt_dladvise; /* Function pointer types for module loader vtable entries: */ typedef lt_module lt_module_open (lt_user_data data, const char *filename, lt_dladvise advise); typedef int lt_module_close (lt_user_data data, lt_module module); typedef void * lt_find_sym (lt_user_data data, lt_module module, const char *symbolname); typedef int lt_dlloader_init (lt_user_data data); typedef int lt_dlloader_exit (lt_user_data data); /* Default priority is LT_DLLOADER_PREPEND if none is explicitly given. */ typedef enum { LT_DLLOADER_PREPEND = 0, LT_DLLOADER_APPEND } lt_dlloader_priority; /* This structure defines a module loader, as populated by the get_vtable entry point of each loader. */ typedef struct { const char * name; const char * sym_prefix; lt_module_open * module_open; lt_module_close * module_close; lt_find_sym * find_sym; lt_dlloader_init * dlloader_init; lt_dlloader_exit * dlloader_exit; lt_user_data dlloader_data; lt_dlloader_priority priority; } lt_dlvtable; LT_SCOPE int lt_dlloader_add (const lt_dlvtable *vtable); LT_SCOPE lt_dlloader lt_dlloader_next (const lt_dlloader loader); LT_SCOPE lt_dlvtable * lt_dlloader_remove (const char *name); LT_SCOPE const lt_dlvtable *lt_dlloader_find (const char *name); LT_SCOPE const lt_dlvtable *lt_dlloader_get (lt_dlloader loader); /* Type of a function to get a loader's vtable: */ typedef const lt_dlvtable *lt_get_vtable (lt_user_data data); #ifdef LT_DEBUG_LOADERS LT_SCOPE void lt_dlloader_dump (void); #endif LT_END_C_DECLS #endif /*!defined LT_DLLOADER_H*/ JAGS-4.3.2/libltdl/libltdl/lt__alloc.h0000644000175000017500000000422014214520133014333 00000000000000/* lt__alloc.h -- internal memory management interface Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined LT__ALLOC_H #define LT__ALLOC_H 1 #include "lt_system.h" LT_BEGIN_C_DECLS #define MALLOC(tp, n) (tp*) lt__malloc((n) * sizeof(tp)) #define REALLOC(tp, mem, n) (tp*) lt__realloc((mem), (n) * sizeof(tp)) #define FREE(mem) LT_STMT_START { \ free (mem); mem = NULL; } LT_STMT_END #define MEMREASSIGN(p, q) LT_STMT_START { \ if ((p) != (q)) { free (p); (p) = (q); (q) = 0; } \ } LT_STMT_END /* If set, this function is called when memory allocation has failed. */ LT_SCOPE void (*lt__alloc_die) (void); LT_SCOPE void *lt__malloc (size_t n); LT_SCOPE void *lt__zalloc (size_t n); LT_SCOPE void *lt__realloc (void *mem, size_t n); LT_SCOPE void *lt__memdup (void const *mem, size_t n); LT_SCOPE char *lt__strdup (const char *string); LT_END_C_DECLS #endif /*!defined LT__ALLOC_H*/ JAGS-4.3.2/libltdl/libltdl/lt__dirent.h0000644000175000017500000000475014214520133014536 00000000000000/* lt__dirent.h -- internal directory entry scanning interface Copyright (C) 2001, 2004, 2006, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2001 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined LT__DIRENT_H #define LT__DIRENT_H 1 #if defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #include "lt_system.h" #ifdef HAVE_DIRENT_H /* We have a fully operational dirent subsystem. */ # include # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) #elif defined __WINDOWS__ /* Use some wrapper code to emulate dirent on windows.. */ # define WINDOWS_DIRENT_EMULATION 1 # include # define D_NAMLEN(dirent) (strlen((dirent)->d_name)) # define dirent lt__dirent # define DIR lt__DIR # define opendir lt__opendir # define readdir lt__readdir # define closedir lt__closedir LT_BEGIN_C_DECLS struct dirent { char d_name[LT_FILENAME_MAX]; int d_namlen; }; typedef struct { HANDLE hSearch; WIN32_FIND_DATA Win32FindData; BOOL firsttime; struct dirent file_info; } DIR; LT_SCOPE DIR * opendir (const char *path); LT_SCOPE struct dirent *readdir (DIR *entry); LT_SCOPE void closedir (DIR *entry); LT_END_C_DECLS #else /* !defined __WINDOWS__*/ ERROR - cannot find dirent #endif /*!defined __WINDOWS__*/ #endif /*!defined LT__DIRENT_H*/ JAGS-4.3.2/libltdl/libltdl/lt__glibc.h0000644000175000017500000000541314214520133014326 00000000000000/* lt__glibc.h -- support for non glibc environments Copyright (C) 2004, 2006-2007, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined LT__GLIBC_H #define LT__GLIBC_H 1 #if defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #if !defined HAVE_ARGZ_H || !defined HAVE_WORKING_ARGZ /* Redefine any glibc symbols we reimplement to import the implementations into our lt__ namespace so we don't ever clash with the system library if our clients use argz_* from there in addition to libltdl. */ # undef argz_append # define argz_append lt__argz_append # undef argz_create_sep # define argz_create_sep lt__argz_create_sep # undef argz_insert # define argz_insert lt__argz_insert # undef argz_next # define argz_next lt__argz_next # undef argz_stringify # define argz_stringify lt__argz_stringify # include #else #ifdef __cplusplus extern "C" { #endif #include #ifdef __cplusplus } #endif #endif /*!defined HAVE_ARGZ_H || !defined HAVE_WORKING_ARGZ*/ # define slist_concat lt__slist_concat # define slist_cons lt__slist_cons # define slist_delete lt__slist_delete # define slist_remove lt__slist_remove # define slist_reverse lt__slist_reverse # define slist_sort lt__slist_sort # define slist_tail lt__slist_tail # define slist_nth lt__slist_nth # define slist_find lt__slist_find # define slist_length lt__slist_length # define slist_foreach lt__slist_foreach # define slist_box lt__slist_box # define slist_unbox lt__slist_unbox #include #endif /*!defined LT__GLIBC_H*/ JAGS-4.3.2/libltdl/libltdl/lt__private.h0000644000175000017500000001065114214520133014720 00000000000000/* lt__private.h -- internal apis for libltdl Copyright (C) 2004-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy con be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined LT__PRIVATE_H #define LT__PRIVATE_H 1 #if defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #include #include #include #include #include #if defined HAVE_UNISTD_H # include #endif /* Import internal interfaces... */ #include "lt__alloc.h" #include "lt__dirent.h" #include "lt__strl.h" #include "lt__glibc.h" /* ...and all exported interfaces. */ #include "ltdl.h" #if defined WITH_DMALLOC # include #endif /* DLL building support on win32 hosts; mostly to workaround their ridiculous implementation of data symbol exporting. */ #ifndef LT_GLOBAL_DATA # if defined __WINDOWS__ || defined __CYGWIN__ # if defined DLL_EXPORT /* defined by libtool (if required) */ # define LT_GLOBAL_DATA __declspec(dllexport) # endif # endif # ifndef LT_GLOBAL_DATA # define LT_GLOBAL_DATA /* static linking or !__WINDOWS__ */ # endif #endif #ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ # define __attribute__(x) # endif #endif #ifndef LT__UNUSED # define LT__UNUSED __attribute__ ((__unused__)) #endif LT_BEGIN_C_DECLS #if !defined errno extern int errno; #endif LT_SCOPE void lt__alloc_die_callback (void); /* For readability: */ #define STRNEQ(s1, s2) (strcmp((s1), (s2)) != 0) #define STREQ(s1, s2) (strcmp((s1), (s2)) == 0) /* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */ /* This type is used for the array of interface data sets in each handler. */ typedef struct { lt_dlinterface_id key; void * data; } lt_interface_data; struct lt__handle { lt_dlhandle next; const lt_dlvtable * vtable; /* dlopening interface */ lt_dlinfo info; /* user visible fields */ int depcount; /* number of dependencies */ lt_dlhandle * deplibs; /* dependencies */ lt_module module; /* system module handle */ void * system; /* system specific data */ lt_interface_data * interface_data; /* per caller associated data */ int flags; /* various boolean stats */ }; struct lt__advise { unsigned int try_ext:1; /* try system library extensions. */ unsigned int is_resident:1; /* module can't be unloaded. */ unsigned int is_symglobal:1; /* module symbols can satisfy subsequently loaded modules. */ unsigned int is_symlocal:1; /* module symbols are only available locally. */ unsigned int try_preload_only:1;/* only preloaded modules will be tried. */ }; /* --- ERROR HANDLING --- */ /* Extract the diagnostic strings from the error table macro in the same order as the enumerated indices in lt_error.h. */ #define LT__STRERROR(name) lt__error_string(LT_CONC(LT_ERROR_,name)) #define LT__GETERROR(lvalue) (lvalue) = lt__get_last_error() #define LT__SETERRORSTR(errormsg) lt__set_last_error(errormsg) #define LT__SETERROR(errorcode) LT__SETERRORSTR(LT__STRERROR(errorcode)) LT_SCOPE const char *lt__error_string (int errorcode); LT_SCOPE const char *lt__get_last_error (void); LT_SCOPE const char *lt__set_last_error (const char *errormsg); LT_END_C_DECLS #endif /*!defined LT__PRIVATE_H*/ JAGS-4.3.2/libltdl/libltdl/lt__strl.h0000644000175000017500000000372214214520133014233 00000000000000/* lt__strl.h -- size-bounded string copying and concatenation Copyright (C) 2004, 2006, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if !defined LT__STRL_H #define LT__STRL_H 1 #if defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #include #include "lt_system.h" #if !defined HAVE_STRLCAT # define strlcat(dst,src,dstsize) lt_strlcat(dst,src,dstsize) LT_SCOPE size_t lt_strlcat(char *dst, const char *src, const size_t dstsize); #endif /* !defined HAVE_STRLCAT */ #if !defined HAVE_STRLCPY # define strlcpy(dst,src,dstsize) lt_strlcpy(dst,src,dstsize) LT_SCOPE size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize); #endif /* !defined HAVE_STRLCPY */ #endif /*!defined LT__STRL_H*/ JAGS-4.3.2/libltdl/libltdl/slist.h0000644000175000017500000000625414214520133013552 00000000000000/* slist.h -- generalised singly linked lists Copyright (C) 2000, 2004, 2009, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* A generalised list. This is deliberately transparent so that you can make the NEXT field of all your chained data structures first, and then cast them to '(SList *)' so that they can be manipulated by this API. Alternatively, you can generate raw SList elements using slist_new(), and put the element data in the USERDATA field. Either way you get to manage the memory involved by yourself. */ #if !defined SLIST_H #define SLIST_H 1 #if defined LTDL # include # include #else # define LT_SCOPE #endif #include #if defined __cplusplus extern "C" { #endif typedef struct slist { struct slist *next; /* chain forward pointer*/ const void *userdata; /* for boxed 'SList' item */ } SList; typedef void * SListCallback (SList *item, void *userdata); typedef int SListCompare (const SList *item1, const SList *item2, void *userdata); LT_SCOPE SList *slist_concat (SList *head, SList *tail); LT_SCOPE SList *slist_cons (SList *item, SList *slist); LT_SCOPE SList *slist_delete (SList *slist, void (*delete_fct) (void *item)); LT_SCOPE SList *slist_remove (SList **phead, SListCallback *find, void *matchdata); LT_SCOPE SList *slist_reverse (SList *slist); LT_SCOPE SList *slist_sort (SList *slist, SListCompare *compare, void *userdata); LT_SCOPE SList *slist_tail (SList *slist); LT_SCOPE SList *slist_nth (SList *slist, size_t n); LT_SCOPE void * slist_find (SList *slist, SListCallback *find, void *matchdata); LT_SCOPE size_t slist_length (SList *slist); LT_SCOPE void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata); LT_SCOPE SList *slist_box (const void *userdata); LT_SCOPE void * slist_unbox (SList *item); #if defined __cplusplus } #endif #if !defined LTDL # undef LT_SCOPE #endif #endif /*!defined SLIST_H*/ JAGS-4.3.2/libltdl/libltdl/lt__argz_.h0000644000175000017500000000427614214520133014356 00000000000000/* lt__argz.h -- internal argz interface for non-glibc systems Copyright (C) 2004, 2007-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #if !defined LT__ARGZ_H #define LT__ARGZ_H 1 #include #define __need_error_t #include #include #if defined LTDL # include "lt__glibc.h" # include "lt_system.h" #else # define LT_SCOPE #endif #if defined __cplusplus extern "C" { #endif LT_SCOPE error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len); LT_SCOPE error_t argz_create_sep(const char *str, int delim, char **pargz, size_t *pargz_len); LT_SCOPE error_t argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry); LT_SCOPE char * argz_next (char *argz, size_t argz_len, const char *entry); LT_SCOPE void argz_stringify (char *argz, size_t argz_len, int sep); #if defined __cplusplus } #endif #if !defined LTDL # undef LT_SCOPE #endif #endif /*!defined LT__ARGZ_H*/ JAGS-4.3.2/libltdl/loaders/0000755000175000017500000000000014400711323012317 500000000000000JAGS-4.3.2/libltdl/loaders/dld_link.c0000644000175000017500000001074414214520133014171 00000000000000/* loader-dld_link.c -- dynamic linking with dld Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dld_link_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dld_link"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined HAVE_DLD_H # include #endif /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise LT__UNUSED) { lt_module module = lt__strdup (filename); if (module && dld_link (filename) != 0) { LT__SETERROR (CANNOT_OPEN); FREE (module); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; if (dld_unlink_by_file ((char*)(module), 1) != 0) { LT__SETERROR (CANNOT_CLOSE); ++errors; } else { FREE (module); } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module LT__UNUSED, const char *name) { void *address = dld_get_func (name); if (!address) { LT__SETERROR (SYMBOL_NOT_FOUND); } return address; } JAGS-4.3.2/libltdl/loaders/dlopen.c0000644000175000017500000001665414214520133013700 00000000000000/* loader-dlopen.c -- dynamic linking with dlopen/dlsym Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dlopen_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dlopen"; #if defined DLSYM_USCORE vtable->sym_prefix = "_"; #endif vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_PREPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined HAVE_DLFCN_H # include #endif #if defined HAVE_SYS_DL_H # include #endif /* We may have to define LT_LAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #if !defined LT_LAZY_OR_NOW # if defined RTLD_LAZY # define LT_LAZY_OR_NOW RTLD_LAZY # else # if defined DL_LAZY # define LT_LAZY_OR_NOW DL_LAZY # endif # endif /* !RTLD_LAZY */ #endif #if !defined LT_LAZY_OR_NOW # if defined RTLD_NOW # define LT_LAZY_OR_NOW RTLD_NOW # else # if defined DL_NOW # define LT_LAZY_OR_NOW DL_NOW # endif # endif /* !RTLD_NOW */ #endif #if !defined LT_LAZY_OR_NOW # define LT_LAZY_OR_NOW 0 #endif /* !LT_LAZY_OR_NOW */ /* We only support local and global symbols from modules for loaders that provide such a thing, otherwise the system default is used. */ #if !defined RTLD_GLOBAL # if defined DL_GLOBAL # define RTLD_GLOBAL DL_GLOBAL # endif #endif /* !RTLD_GLOBAL */ #if !defined RTLD_LOCAL # if defined DL_LOCAL # define RTLD_LOCAL DL_LOCAL # endif #endif /* !RTLD_LOCAL */ #if defined HAVE_DLERROR # define DLERROR(arg) dlerror () #else # define DLERROR(arg) LT__STRERROR (arg) #endif #define DL__SETERROR(errorcode) \ LT__SETERRORSTR (DLERROR (errorcode)) /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise) { int module_flags = LT_LAZY_OR_NOW; lt_module module; #ifdef RTLD_MEMBER int len = LT_STRLEN (filename); #endif if (advise) { #ifdef RTLD_GLOBAL /* If there is some means of asking for global symbol resolution, do so. */ if (advise->is_symglobal) module_flags |= RTLD_GLOBAL; #else /* Otherwise, reset that bit so the caller can tell it wasn't acted on. */ advise->is_symglobal = 0; #endif /* And similarly for local only symbol resolution. */ #ifdef RTLD_LOCAL if (advise->is_symlocal) module_flags |= RTLD_LOCAL; #else advise->is_symlocal = 0; #endif } #ifdef RTLD_MEMBER /* AIX */ if (len >= 4) /* at least "l(m)" */ { /* Advise loading an archive member only if the filename really contains both the opening and closing parent, and a member. */ if (filename[len-1] == ')') { const char *opening = strrchr(filename, '('); if (opening && opening < (filename+len-2) && strchr(opening+1, '/') == NULL) module_flags |= RTLD_MEMBER; } } #endif module = dlopen (filename, module_flags); #if defined RTLD_MEMBER && defined LT_SHARED_LIB_MEMBER if (!module && len && !(module_flags & RTLD_MEMBER) && errno == ENOEXEC) { /* Loading without a member specified failed with "Exec format error". So the file is there, but either has wrong bitwidth, or is an archive eventually containing the default shared archive member. Retry with default member, getting same error in worst case. */ const char *member = LT_SHARED_LIB_MEMBER; char *attempt = MALLOC (char, len + strlen (member) + 1); if (!attempt) { LT__SETERROR (NO_MEMORY); return module; } sprintf (attempt, "%s%s", filename, member); module = vm_open (loader_data, attempt, advise); FREE (attempt); return module; } #endif if (!module) { DL__SETERROR (CANNOT_OPEN); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; if (dlclose (module) != 0) { DL__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = dlsym (module, name); if (!address) { DL__SETERROR (SYMBOL_NOT_FOUND); } return address; } JAGS-4.3.2/libltdl/loaders/dyld.c0000644000175000017500000003247414214520133013351 00000000000000/* loader-dyld.c -- dynamic linking on darwin and OS X Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Peter O'Gorman, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable dyld_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_init (lt_user_data loader_data); static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_dyld"; vtable->sym_prefix = "_"; vtable->dlloader_init = vl_init; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined HAVE_MACH_O_DYLD_H # if !defined __APPLE_CC__ && !defined __MWERKS__ && !defined __private_extern__ /* Is this correct? Does it still function properly? */ # define __private_extern__ extern # endif # include #endif #include /* We have to put some stuff here that isn't in older dyld.h files */ #if !defined ENUM_DYLD_BOOL # define ENUM_DYLD_BOOL # undef FALSE # undef TRUE enum DYLD_BOOL { FALSE, TRUE }; #endif #if !defined LC_REQ_DYLD # define LC_REQ_DYLD 0x80000000 #endif #if !defined LC_LOAD_WEAK_DYLIB # define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD) #endif #if !defined NSADDIMAGE_OPTION_NONE # define NSADDIMAGE_OPTION_NONE 0x0 #endif #if !defined NSADDIMAGE_OPTION_RETURN_ON_ERROR # define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1 #endif #if !defined NSADDIMAGE_OPTION_WITH_SEARCHING # define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2 #endif #if !defined NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED # define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4 #endif #if !defined NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME # define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8 #endif #if !defined NSLOOKUPSYMBOLINIMAGE_OPTION_BIND # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0 #endif #if !defined NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1 #endif #if !defined NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY # define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2 #endif #if !defined NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR # define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4 #endif #define LT__SYMLOOKUP_OPTS (NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW \ | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) #if defined __BIG_ENDIAN__ # define LT__MAGIC MH_MAGIC #else # define LT__MAGIC MH_CIGAM #endif #define DYLD__SETMYERROR(errmsg) LT__SETERRORSTR (dylderror (errmsg)) #define DYLD__SETERROR(errcode) DYLD__SETMYERROR (LT__STRERROR (errcode)) typedef struct mach_header mach_header; typedef struct dylib_command dylib_command; static const char *dylderror (const char *errmsg); static const mach_header *lt__nsmodule_get_header (NSModule module); static const char *lt__header_get_instnam (const mach_header *mh); static const mach_header *lt__match_loadedlib (const char *name); static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh); static const mach_header *(*lt__addimage) (const char *image_name, unsigned long options) = 0; static NSSymbol (*lt__image_symbol) (const mach_header *image, const char *symbolName, unsigned long options) = 0; static enum DYLD_BOOL (*lt__image_symbol_p) (const mach_header *image, const char *symbolName) = 0; static enum DYLD_BOOL (*lt__module_export) (NSModule module) = 0; static int dyld_cannot_close = 0; /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; return 0; } /* A function called through the vtable to initialise this loader. */ static int vl_init (lt_user_data loader_data) { int errors = 0; if (! dyld_cannot_close) { if (!_dyld_present ()) { ++errors; } else { (void) _dyld_func_lookup ("__dyld_NSAddImage", (unsigned long*) <__addimage); (void) _dyld_func_lookup ("__dyld_NSLookupSymbolInImage", (unsigned long*)<__image_symbol); (void) _dyld_func_lookup ("__dyld_NSIsSymbolNameDefinedInImage", (unsigned long*) <__image_symbol_p); (void) _dyld_func_lookup ("__dyld_NSMakePrivateModulePublic", (unsigned long*) <__module_export); dyld_cannot_close = lt_dladderror ("can't close a dylib"); } } return errors; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise LT__UNUSED) { lt_module module = 0; NSObjectFileImage ofi = 0; if (!filename) { return (lt_module) -1; } switch (NSCreateObjectFileImageFromFile (filename, &ofi)) { case NSObjectFileImageSuccess: module = NSLinkModule (ofi, filename, NSLINKMODULE_OPTION_RETURN_ON_ERROR | NSLINKMODULE_OPTION_PRIVATE | NSLINKMODULE_OPTION_BINDNOW); NSDestroyObjectFileImage (ofi); if (module) { lt__module_export (module); } break; case NSObjectFileImageInappropriateFile: if (lt__image_symbol_p && lt__image_symbol) { module = (lt_module) lt__addimage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR); } break; case NSObjectFileImageFailure: case NSObjectFileImageArch: case NSObjectFileImageFormat: case NSObjectFileImageAccess: /*NOWORK*/ break; } if (!module) { DYLD__SETERROR (CANNOT_OPEN); } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data, lt_module module) { int errors = 0; if (module != (lt_module) -1) { const mach_header *mh = (const mach_header *) module; int flags = 0; if (mh->magic == LT__MAGIC) { lt_dlseterror (dyld_cannot_close); ++errors; } else { /* Currently, if a module contains c++ static destructors and it is unloaded, we get a segfault in atexit(), due to compiler and dynamic loader differences of opinion, this works around that. */ if ((const struct section *) NULL != getsectbynamefromheader (lt__nsmodule_get_header (module), "__DATA", "__mod_term_func")) { flags |= NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED; } #if defined __ppc__ flags |= NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES; #endif if (!NSUnLinkModule (module, flags)) { DYLD__SETERROR (CANNOT_CLOSE); ++errors; } } } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data, lt_module module, const char *name) { NSSymbol *nssym = 0; const mach_header *mh = (const mach_header *) module; char saveError[256] = "Symbol not found"; if (module == (lt_module) -1) { void *address, *unused; _dyld_lookup_and_bind (name, (unsigned long*) &address, &unused); return address; } if (mh->magic == LT__MAGIC) { if (lt__image_symbol_p && lt__image_symbol) { if (lt__image_symbol_p (mh, name)) { nssym = lt__image_symbol (mh, name, LT__SYMLOOKUP_OPTS); } } } else { nssym = NSLookupSymbolInModule (module, name); } if (!nssym) { strlcpy (saveError, dylderror (LT__STRERROR (SYMBOL_NOT_FOUND)), 255); saveError[255] = 0; if (!mh) { mh = (mach_header *)lt__nsmodule_get_header (module); } nssym = lt__linkedlib_symbol (name, mh); } if (!nssym) { LT__SETERRORSTR (saveError); } return nssym ? NSAddressOfSymbol (nssym) : 0; } /* --- HELPER FUNCTIONS --- */ /* Return the dyld error string, or the passed in error string if none. */ static const char * dylderror (const char *errmsg) { NSLinkEditErrors ler; int lerno; const char *file; const char *errstr; NSLinkEditError (&ler, &lerno, &file, &errstr); if (! (errstr && *errstr)) { errstr = errmsg; } return errstr; } /* There should probably be an apple dyld api for this. */ static const mach_header * lt__nsmodule_get_header (NSModule module) { int i = _dyld_image_count(); const char *modname = NSNameOfModule (module); const mach_header *mh = 0; if (!modname) return NULL; while (i > 0) { --i; if (strneq (_dyld_get_image_name (i), modname)) { mh = _dyld_get_image_header (i); break; } } return mh; } /* NSAddImage is also used to get the loaded image, but it only works if the lib is installed, for uninstalled libs we need to check the install_names against each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a different lib was loaded as a result. */ static const char * lt__header_get_instnam (const mach_header *mh) { unsigned long offset = sizeof(mach_header); const char* result = 0; int j; for (j = 0; j < mh->ncmds; j++) { struct load_command *lc; lc = (struct load_command*) (((unsigned long) mh) + offset); if (LC_ID_DYLIB == lc->cmd) { result=(char*)(((dylib_command*) lc)->dylib.name.offset + (unsigned long) lc); } offset += lc->cmdsize; } return result; } static const mach_header * lt__match_loadedlib (const char *name) { const mach_header *mh = 0; int i = _dyld_image_count(); while (i > 0) { const char *id; --i; id = lt__header_get_instnam (_dyld_get_image_header (i)); if (id && strneq (id, name)) { mh = _dyld_get_image_header (i); break; } } return mh; } /* Safe to assume our mh is good. */ static NSSymbol lt__linkedlib_symbol (const char *symname, const mach_header *mh) { NSSymbol symbol = 0; if (lt__image_symbol && NSIsSymbolNameDefined (symname)) { unsigned long offset = sizeof(mach_header); struct load_command *lc; int j; for (j = 0; j < mh->ncmds; j++) { lc = (struct load_command*) (((unsigned long) mh) + offset); if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd)) { unsigned long base = ((dylib_command *) lc)->dylib.name.offset; char *name = (char *) (base + (unsigned long) lc); const mach_header *mh1 = lt__match_loadedlib (name); if (!mh1) { /* Maybe NSAddImage can find it */ mh1 = lt__addimage (name, NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED | NSADDIMAGE_OPTION_WITH_SEARCHING | NSADDIMAGE_OPTION_RETURN_ON_ERROR); } if (mh1) { symbol = lt__image_symbol (mh1, symname, LT__SYMLOOKUP_OPTS); if (symbol) break; } } offset += lc->cmdsize; } } return symbol; } JAGS-4.3.2/libltdl/loaders/preopen.c0000644000175000017500000002314014214520133014053 00000000000000/* loader-preopen.c -- emulate dynamic linking using preloaded_symbols Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable preopen_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_init (lt_user_data loader_data); static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_preopen"; vtable->sym_prefix = 0; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_init = vl_init; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_PREPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ /* Wrapper type to chain together symbol lists of various origins. */ typedef struct symlist_chain { struct symlist_chain *next; const lt_dlsymlist *symlist; } symlist_chain; static int add_symlist (const lt_dlsymlist *symlist); static int free_symlists (void); /* The start of the symbol lists chain. */ static symlist_chain *preloaded_symlists = 0; /* A symbol list preloaded before lt_init() was called. */ static const lt_dlsymlist *default_preloaded_symbols = 0; /* A function called through the vtable to initialise this loader. */ static int vl_init (lt_user_data loader_data LT__UNUSED) { int errors = 0; preloaded_symlists = 0; if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } return errors; } /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; free_symlists (); return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise LT__UNUSED) { symlist_chain *lists; lt_module module = 0; if (!preloaded_symlists) { LT__SETERROR (NO_SYMBOLS); goto done; } /* Can't use NULL as the reflective symbol header, as NULL is used to mark the end of the entire symbol list. Self-dlpreopened symbols follow this magic number, chosen to be an unlikely clash with a real module name. */ if (!filename) { filename = "@PROGRAM@"; } for (lists = preloaded_symlists; lists; lists = lists->next) { const lt_dlsymlist *symbol; for (symbol= lists->symlist; symbol->name; ++symbol) { if (!symbol->address && STREQ (symbol->name, filename)) { /* If the next symbol's name and address is 0, it means the module just contains the originator and no symbols. In this case we pretend that we never saw the module and hope that some other loader will be able to load the module and have access to its symbols */ const lt_dlsymlist *next_symbol = symbol +1; if (next_symbol->address && next_symbol->name) { module = (lt_module) lists->symlist; goto done; } } } } LT__SETERROR (FILE_NOT_FOUND); done: return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module LT__UNUSED) { /* Just to silence gcc -Wall */ module = 0; return 0; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { lt_dlsymlist *symbol = (lt_dlsymlist*) module; if (symbol[1].name && STREQ (symbol[1].name, "@INIT@")) { symbol++; /* Skip optional init entry. */ } symbol +=2; /* Skip header (originator then libname). */ while (symbol->name) { if (STREQ (symbol->name, name)) { return symbol->address; } ++symbol; } LT__SETERROR (SYMBOL_NOT_FOUND); return 0; } /* --- HELPER FUNCTIONS --- */ /* The symbol lists themselves are not allocated from the heap, but we can unhook them and free up the chain of links between them. */ static int free_symlists (void) { symlist_chain *lists; lists = preloaded_symlists; while (lists) { symlist_chain *next = lists->next; FREE (lists); lists = next; } preloaded_symlists = 0; return 0; } /* Add a new symbol list to the global chain. */ static int add_symlist (const lt_dlsymlist *symlist) { symlist_chain *lists; int errors = 0; /* Search for duplicate entries: */ for (lists = preloaded_symlists; lists && lists->symlist != symlist; lists = lists->next) /*NOWORK*/; /* Don't add the same list twice: */ if (!lists) { symlist_chain *tmp = (symlist_chain *) lt__zalloc (sizeof *tmp); if (tmp) { tmp->symlist = symlist; tmp->next = preloaded_symlists; preloaded_symlists = tmp; if (symlist[1].name && STREQ (symlist[1].name, "@INIT@")) { void (*init_symlist)(void); *(void **)(&init_symlist) = symlist[1].address; (*init_symlist)(); } } else { ++errors; } } return errors; } /* --- PRELOADING API CALL IMPLEMENTATIONS --- */ /* Save a default symbol list for later. */ int lt_dlpreload_default (const lt_dlsymlist *preloaded) { default_preloaded_symbols = preloaded; return 0; } /* Add a symbol list to the global chain, or with a NULL argument, revert to just the default list. */ int lt_dlpreload (const lt_dlsymlist *preloaded) { int errors = 0; if (preloaded) { errors = add_symlist (preloaded); } else { free_symlists(); if (default_preloaded_symbols) { errors = lt_dlpreload (default_preloaded_symbols); } } return errors; } /* Open all the preloaded modules from the named originator, executing a callback for each one. If ORIGINATOR is NULL, then call FUNC for each preloaded module from the program itself. */ int lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func) { symlist_chain *list; int errors = 0; int found = 0; /* For each symlist in the chain... */ for (list = preloaded_symlists; list; list = list->next) { /* ...that was preloaded by the requesting ORIGINATOR... */ if ((originator && STREQ (list->symlist->name, originator)) || (!originator && STREQ (list->symlist->name, "@PROGRAM@"))) { const lt_dlsymlist *symbol; unsigned int idx = 0; ++found; /* ...load the symbols per source compilation unit: (we preincrement the index to skip over the originator entry) */ while ((symbol = &list->symlist[++idx])->name != 0) { if ((symbol->address == 0) && (STRNEQ (symbol->name, "@PROGRAM@"))) { lt_dlhandle handle = lt_dlopen (symbol->name); if (handle == 0) { ++errors; } else { errors += (*func) (handle); } } } } } if (!found) { LT__SETERROR(CANNOT_OPEN); ++errors; } return errors; } JAGS-4.3.2/libltdl/loaders/load_add_on.c0000644000175000017500000001127614214520133014635 00000000000000/* loader-load_add_on.c -- dynamic linking for BeOS Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable load_add_on_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_load_add_on"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #include /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise LT__UNUSED) { image_id image = 0; if (filename) { image = load_add_on (filename); } else { image_info info; int32 cookie = 0; if (get_next_image_info (0, &cookie, &info) == B_OK) image = load_add_on (info.name); } if (image <= 0) { LT__SETERROR (CANNOT_OPEN); image = 0; } return (lt_module) image; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; if (unload_add_on ((image_id) module) != B_OK) { LT__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = 0; image_id image = (image_id) module; if (get_image_symbol (image, name, B_SYMBOL_TYPE_ANY, address) != B_OK) { LT__SETERROR (SYMBOL_NOT_FOUND); address = 0; } return address; } JAGS-4.3.2/libltdl/loaders/loadlibrary.c0000644000175000017500000002513714214520133014717 00000000000000/* loader-loadlibrary.c -- dynamic linking for Win32 Copyright (C) 1998-2000, 2004-2008, 2010-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" #if defined __CYGWIN__ # include #endif /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable loadlibrary_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlinterface_id iface_id = 0; static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = (lt_dlvtable *) lt__zalloc (sizeof *vtable); iface_id = lt_dlinterface_register ("ltdl loadlibrary", NULL); } if (vtable && !vtable->name) { vtable->name = "lt_loadlibrary"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #include #define LOCALFREE(mem) LT_STMT_START { \ if (mem) { LocalFree ((void *)mem); mem = NULL; } } LT_STMT_END #define LOADLIB__SETERROR(errmsg) LT__SETERRORSTR (loadlibraryerror (errmsg)) #define LOADLIB_SETERROR(errcode) LOADLIB__SETERROR (LT__STRERROR (errcode)) static const char *loadlibraryerror (const char *default_errmsg); static DWORD WINAPI wrap_getthreaderrormode (void); static DWORD WINAPI fallback_getthreaderrormode (void); static BOOL WINAPI wrap_setthreaderrormode (DWORD mode, DWORD *oldmode); static BOOL WINAPI fallback_setthreaderrormode (DWORD mode, DWORD *oldmode); typedef DWORD (WINAPI getthreaderrormode_type) (void); typedef BOOL (WINAPI setthreaderrormode_type) (DWORD, DWORD *); static getthreaderrormode_type *getthreaderrormode = wrap_getthreaderrormode; static setthreaderrormode_type *setthreaderrormode = wrap_setthreaderrormode; static char *error_message = 0; /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; LOCALFREE (error_message); return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise LT__UNUSED) { lt_module module = 0; char *ext; char wpath[MAX_PATH]; size_t len; if (!filename) { /* Get the name of main module */ *wpath = 0; GetModuleFileName (NULL, wpath, sizeof (wpath)); filename = wpath; } else { len = LT_STRLEN (filename); if (len >= MAX_PATH) { LT__SETERROR (CANNOT_OPEN); return 0; } #if HAVE_DECL_CYGWIN_CONV_PATH if (cygwin_conv_path (CCP_POSIX_TO_WIN_A, filename, wpath, MAX_PATH)) { LT__SETERROR (CANNOT_OPEN); return 0; } len = 0; #elif defined __CYGWIN__ cygwin_conv_to_full_win32_path (filename, wpath); len = 0; #else strcpy(wpath, filename); #endif ext = strrchr (wpath, '.'); if (!ext) { /* Append a '.' to stop Windows from adding an implicit '.dll' extension. */ if (!len) len = strlen (wpath); if (len + 1 >= MAX_PATH) { LT__SETERROR (CANNOT_OPEN); return 0; } wpath[len] = '.'; wpath[len+1] = '\0'; } } { /* Silence dialog from LoadLibrary on some failures. */ DWORD errormode = getthreaderrormode (); DWORD last_error; setthreaderrormode (errormode | SEM_FAILCRITICALERRORS, NULL); module = LoadLibrary (wpath); /* Restore the error mode. */ last_error = GetLastError (); setthreaderrormode (errormode, NULL); SetLastError (last_error); } /* libltdl expects this function to fail if it is unable to physically load the library. Sadly, LoadLibrary will search the loaded libraries for a match and return one of them if the path search load fails. We check whether LoadLibrary is returning a handle to an already loaded module, and simulate failure if we find one. */ { lt_dlhandle cur = 0; while ((cur = lt_dlhandle_iterate (iface_id, cur))) { if (!cur->module) { cur = 0; break; } if (cur->module == module) { break; } } if (!module) LOADLIB_SETERROR (CANNOT_OPEN); else if (cur) { LT__SETERROR (CANNOT_OPEN); module = 0; } } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; if (FreeLibrary ((HMODULE) module) == 0) { LOADLIB_SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = (void *) GetProcAddress ((HMODULE) module, name); if (!address) { LOADLIB_SETERROR (SYMBOL_NOT_FOUND); } return address; } /* --- HELPER FUNCTIONS --- */ /* Return the windows error message, or the passed in error message on failure. */ static const char * loadlibraryerror (const char *default_errmsg) { size_t len; LOCALFREE (error_message); FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError (), 0, (char *) &error_message, 0, NULL); /* Remove trailing CRNL */ len = LT_STRLEN (error_message); if (len && error_message[len - 1] == '\n') error_message[--len] = LT_EOS_CHAR; if (len && error_message[len - 1] == '\r') error_message[--len] = LT_EOS_CHAR; return len ? error_message : default_errmsg; } /* A function called through the getthreaderrormode variable that checks if the system supports GetThreadErrorMode (or GetErrorMode) and arranges for it or a fallback implementation to be called directly in the future. The selected version is then called. */ static DWORD WINAPI wrap_getthreaderrormode (void) { HMODULE kernel32 = GetModuleHandleA ("kernel32.dll"); getthreaderrormode = (getthreaderrormode_type *) GetProcAddress (kernel32, "GetThreadErrorMode"); if (!getthreaderrormode) getthreaderrormode = (getthreaderrormode_type *) GetProcAddress (kernel32, "GetErrorMode"); if (!getthreaderrormode) getthreaderrormode = fallback_getthreaderrormode; return getthreaderrormode (); } /* A function called through the getthreaderrormode variable for cases where the system does not support GetThreadErrorMode or GetErrorMode */ static DWORD WINAPI fallback_getthreaderrormode (void) { /* Prior to Windows Vista, the only way to get the current error mode was to set a new one. In our case, we are setting a new error mode right after "getting" it while ignoring the error mode in effect when setting the new error mode, so that's fairly ok. */ return (DWORD) SetErrorMode (SEM_FAILCRITICALERRORS); } /* A function called through the setthreaderrormode variable that checks if the system supports SetThreadErrorMode and arranges for it or a fallback implementation to be called directly in the future. The selected version is then called. */ static BOOL WINAPI wrap_setthreaderrormode (DWORD mode, DWORD *oldmode) { HMODULE kernel32 = GetModuleHandleA ("kernel32.dll"); setthreaderrormode = (setthreaderrormode_type *) GetProcAddress (kernel32, "SetThreadErrorMode"); if (!setthreaderrormode) setthreaderrormode = fallback_setthreaderrormode; return setthreaderrormode (mode, oldmode); } /* A function called through the setthreaderrormode variable for cases where the system does not support SetThreadErrorMode. */ static BOOL WINAPI fallback_setthreaderrormode (DWORD mode, DWORD *oldmode) { /* Prior to Windows 7, there was no way to set the thread local error mode, so set the process global error mode instead. */ DWORD old = (DWORD) SetErrorMode (mode); if (oldmode) *oldmode = old; return TRUE; } JAGS-4.3.2/libltdl/loaders/shl_load.c0000644000175000017500000001506114214520133014173 00000000000000/* loader-shl_load.c -- dynamic linking with shl_load (HP-UX) Copyright (C) 1998-2000, 2004, 2006-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" /* Use the preprocessor to rename non-static symbols to avoid namespace collisions when the loader code is statically linked into libltdl. Use the "_LTX_" prefix so that the symbol addresses can be fetched from the preloaded symbol list by lt_dlsym(): */ #define get_vtable shl_load_LTX_get_vtable LT_BEGIN_C_DECLS LT_SCOPE lt_dlvtable *get_vtable (lt_user_data loader_data); LT_END_C_DECLS /* Boilerplate code to set up the vtable for hooking this loader into libltdl's loader list: */ static int vl_exit (lt_user_data loader_data); static lt_module vm_open (lt_user_data loader_data, const char *filename, lt_dladvise advise); static int vm_close (lt_user_data loader_data, lt_module module); static void * vm_sym (lt_user_data loader_data, lt_module module, const char *symbolname); static lt_dlvtable *vtable = 0; /* Return the vtable for this loader, only the name and sym_prefix attributes (plus the virtual function implementations, obviously) change between loaders. */ lt_dlvtable * get_vtable (lt_user_data loader_data) { if (!vtable) { vtable = lt__zalloc (sizeof *vtable); } if (vtable && !vtable->name) { vtable->name = "lt_shl_load"; vtable->module_open = vm_open; vtable->module_close = vm_close; vtable->find_sym = vm_sym; vtable->dlloader_exit = vl_exit; vtable->dlloader_data = loader_data; vtable->priority = LT_DLLOADER_APPEND; } if (vtable && (vtable->dlloader_data != loader_data)) { LT__SETERROR (INIT_LOADER); return 0; } return vtable; } /* --- IMPLEMENTATION --- */ #if defined HAVE_DL_H # include #endif /* some flags are missing on some systems, so we provide * harmless defaults. * * Mandatory: * BIND_IMMEDIATE - Resolve symbol references when the library is loaded. * BIND_DEFERRED - Delay code symbol resolution until actual reference. * * Optionally: * BIND_FIRST - Place the library at the head of the symbol search * order. * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all * unsatisfied symbols as fatal. This flag allows * binding of unsatisfied code symbols to be deferred * until use. * [Perl: For certain libraries, like DCE, deferred * binding often causes run time problems. Adding * BIND_NONFATAL to BIND_IMMEDIATE still allows * unresolved references in situations like this.] * BIND_NOSTART - Do not call the initializer for the shared library * when the library is loaded, nor on a future call to * shl_unload(). * BIND_VERBOSE - Print verbose messages concerning possible * unsatisfied symbols. * * hp9000s700/hp9000s800: * BIND_RESTRICTED - Restrict symbols visible by the library to those * present at library load time. * DYNAMIC_PATH - Allow the loader to dynamically search for the * library specified by the path argument. */ #if !defined DYNAMIC_PATH # define DYNAMIC_PATH 0 #endif #if !defined BIND_RESTRICTED # define BIND_RESTRICTED 0 #endif #define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH) /* A function called through the vtable when this loader is no longer needed by the application. */ static int vl_exit (lt_user_data loader_data LT__UNUSED) { vtable = NULL; return 0; } /* A function called through the vtable to open a module with this loader. Returns an opaque representation of the newly opened module for processing with this loader's other vtable functions. */ static lt_module vm_open (lt_user_data loader_data LT__UNUSED, const char *filename, lt_dladvise advise LT__UNUSED) { static shl_t self = (shl_t) 0; lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L); /* Since searching for a symbol against a NULL module handle will also look in everything else that was already loaded and exported with the -E compiler flag, we always cache a handle saved before any modules are loaded. */ if (!self) { void *address; shl_findsym (&self, "main", TYPE_UNDEFINED, &address); } if (!filename) { module = self; } else { module = shl_load (filename, LT_BIND_FLAGS, 0L); if (!module) { LT__SETERROR (CANNOT_OPEN); } } return module; } /* A function called through the vtable when a particular module should be unloaded. */ static int vm_close (lt_user_data loader_data LT__UNUSED, lt_module module) { int errors = 0; if (module && (shl_unload ((shl_t) (module)) != 0)) { LT__SETERROR (CANNOT_CLOSE); ++errors; } return errors; } /* A function called through the vtable to get the address of a symbol loaded from a particular module. */ static void * vm_sym (lt_user_data loader_data LT__UNUSED, lt_module module, const char *name) { void *address = 0; /* sys_shl_open should never return a NULL module handle */ if (module == (lt_module) 0) { LT__SETERROR (INVALID_HANDLE); } else if (!shl_findsym((shl_t*) &module, name, TYPE_UNDEFINED, &address)) { if (!address) { LT__SETERROR (SYMBOL_NOT_FOUND); } } return address; } JAGS-4.3.2/libltdl/Makefile.am0000664000175000017500000001222614223776730012667 00000000000000## ltdl.mk -- includable Makefile snippet ## ## Copyright (C) 2003-2005, 2007, 2011-2015 Free Software Foundation, ## Inc. ## Written by Gary V. Vaughan, 2003 ## ## NOTE: The canonical source of this file is maintained with the ## GNU Libtool package. Report bugs to bug-libtool@gnu.org. ## ## GNU Libltdl is free software; you can redistribute it and/or ## modify it under the terms of the GNU Lesser General Public ## License as published by the Free Software Foundation; either ## version 2 of the License, or (at your option) any later version. ## ## As a special exception to the GNU Lesser General Public License, ## if you distribute this file as part of a program or library that ## is built using GNU libtool, you may include this file under the ## same distribution terms that you use for the rest of that program. ## ## GNU Libltdl 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 Lesser General Public License for more details. ## ## You should have received a copy of the GNU LesserGeneral Public ## License along with GNU Libltdl; see the file COPYING.LIB. If not, a ## copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, ## or obtained by writing to the Free Software Foundation, Inc., ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ##### ACLOCAL_AMFLAGS = -I ../m4 AUTOMAKE_OPTIONS = foreign AM_CPPFLAGS = AM_LDFLAGS = BUILT_SOURCES = include_HEADERS = noinst_LTLIBRARIES = lib_LTLIBRARIES = EXTRA_LTLIBRARIES = EXTRA_DIST = CLEANFILES = MOSTLYCLEANFILES = # -I$(srcdir) is needed for user that built libltdl with a sub-Automake # (not as a sub-package!) using 'nostdinc': AM_CPPFLAGS += -DLT_CONFIG_H='<$(LT_CONFIG_H)>' \ -DLTDL -I. -I$(srcdir) -Ilibltdl \ -I$(srcdir)/libltdl AM_LDFLAGS += -no-undefined LTDL_VERSION_INFO = -version-info 10:1:3 noinst_LTLIBRARIES += $(LT_DLLOADERS) if INSTALL_LTDL ltdlincludedir = $(includedir)/libltdl ltdlinclude_HEADERS = libltdl/lt_system.h \ libltdl/lt_error.h \ libltdl/lt_dlloader.h include_HEADERS += ltdl.h lib_LTLIBRARIES += libltdl.la endif if CONVENIENCE_LTDL noinst_LTLIBRARIES += libltdlc.la endif libltdl_la_SOURCES = libltdl/lt__alloc.h \ libltdl/lt__dirent.h \ libltdl/lt__glibc.h \ libltdl/lt__private.h \ libltdl/lt__strl.h \ libltdl/lt_dlloader.h \ libltdl/lt_error.h \ libltdl/lt_system.h \ libltdl/slist.h \ loaders/preopen.c \ lt__alloc.c \ lt_dlloader.c \ lt_error.c \ ltdl.c \ ltdl.h \ slist.c EXTRA_DIST += lt__dirent.c \ lt__strl.c libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(ltdl_LTLIBOBJS) libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(ltdl_LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) libltdlc_la_DEPENDENCIES= $(libltdl_la_DEPENDENCIES) ## The loaders are preopened by libltdl, itself always built from ## pic-objects (either as a shared library, or a convenience library), ## so the loaders themselves must be made from pic-objects too. We ## use convenience libraries for that purpose: EXTRA_LTLIBRARIES += dlopen.la \ dld_link.la \ dyld.la \ load_add_on.la \ loadlibrary.la \ shl_load.la dlopen_la_SOURCES = loaders/dlopen.c dlopen_la_LDFLAGS = -module -avoid-version dlopen_la_LIBADD = $(LIBADD_DLOPEN) dld_link_la_SOURCES = loaders/dld_link.c dld_link_la_LDFLAGS = -module -avoid-version dld_link_la_LIBADD = -ldld dyld_la_SOURCES = loaders/dyld.c dyld_la_LDFLAGS = -module -avoid-version load_add_on_la_SOURCES = loaders/load_add_on.c load_add_on_la_LDFLAGS = -module -avoid-version loadlibrary_la_SOURCES = loaders/loadlibrary.c loadlibrary_la_LDFLAGS = -module -avoid-version shl_load_la_SOURCES = loaders/shl_load.c shl_load_la_LDFLAGS = -module -avoid-version shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) ## Make sure these will be cleaned even when they're not built by default: CLEANFILES += libltdl.la \ libltdlc.la \ libdlloader.la ## Automake-1.9.6 doesn't clean subdir AC_LIBOBJ compiled objects ## automatically: CLEANFILES += $(ltdl_LIBOBJS) $(ltdl_LTLIBOBJS) EXTRA_DIST += COPYING.LIB \ README ## --------------------------- ## ## Gnulib Makefile.am snippets ## ## --------------------------- ## BUILT_SOURCES += libltdl/$(LT_ARGZ_H) EXTRA_DIST += libltdl/lt__argz_.h \ lt__argz.c # We need the following in order to create an when the system # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): $(LT_ARGZ_H) libltdl/lt__argz.h: libltdl/lt__argz_.h $(AM_V_at)$(mkinstalldirs) . libltdl $(AM_V_GEN)cp $(srcdir)/libltdl/lt__argz_.h $@-t $(AM_V_at)mv $@-t $@ MOSTLYCLEANFILES += libltdl/lt__argz.h \ libltdl/lt__argz.h-t # Added by m4/ltdl.m4 but not distcleaned by automake distclean-local: rm -f ./$(DEPDIR)/lt__strl.Plo JAGS-4.3.2/libltdl/ltdl.h0000644000175000017500000001313014214520133011714 00000000000000/* ltdl.h -- generic dlopen functions Copyright (C) 1998-2000, 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Only include this header file once. */ #if !defined LTDL_H #define LTDL_H 1 #include #include #include LT_BEGIN_C_DECLS /* LT_STRLEN can be used safely on NULL pointers. */ #define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0) /* --- DYNAMIC MODULE LOADING API --- */ typedef struct lt__handle *lt_dlhandle; /* A loaded module. */ /* Initialisation and finalisation functions for libltdl. */ LT_SCOPE int lt_dlinit (void); LT_SCOPE int lt_dlexit (void); /* Module search path manipulation. */ LT_SCOPE int lt_dladdsearchdir (const char *search_dir); LT_SCOPE int lt_dlinsertsearchdir (const char *before, const char *search_dir); LT_SCOPE int lt_dlsetsearchpath (const char *search_path); LT_SCOPE const char *lt_dlgetsearchpath (void); LT_SCOPE int lt_dlforeachfile ( const char *search_path, int (*func) (const char *filename, void *data), void *data); /* User module loading advisors. */ LT_SCOPE int lt_dladvise_init (lt_dladvise *advise); LT_SCOPE int lt_dladvise_destroy (lt_dladvise *advise); LT_SCOPE int lt_dladvise_ext (lt_dladvise *advise); LT_SCOPE int lt_dladvise_resident (lt_dladvise *advise); LT_SCOPE int lt_dladvise_local (lt_dladvise *advise); LT_SCOPE int lt_dladvise_global (lt_dladvise *advise); LT_SCOPE int lt_dladvise_preload (lt_dladvise *advise); /* Portable libltdl versions of the system dlopen() API. */ LT_SCOPE lt_dlhandle lt_dlopen (const char *filename); LT_SCOPE lt_dlhandle lt_dlopenext (const char *filename); LT_SCOPE lt_dlhandle lt_dlopenadvise (const char *filename, lt_dladvise advise); LT_SCOPE void * lt_dlsym (lt_dlhandle handle, const char *name); LT_SCOPE const char *lt_dlerror (void); LT_SCOPE int lt_dlclose (lt_dlhandle handle); /* --- PRELOADED MODULE SUPPORT --- */ /* A preopened symbol. Arrays of this type comprise the exported symbols for a dlpreopened module. */ typedef struct { const char *name; void *address; } lt_dlsymlist; typedef int lt_dlpreload_callback_func (lt_dlhandle handle); LT_SCOPE int lt_dlpreload (const lt_dlsymlist *preloaded); LT_SCOPE int lt_dlpreload_default (const lt_dlsymlist *preloaded); LT_SCOPE int lt_dlpreload_open (const char *originator, lt_dlpreload_callback_func *func); #define lt_preloaded_symbols lt__PROGRAM__LTX_preloaded_symbols /* Ensure C linkage. */ extern LT_DLSYM_CONST lt_dlsymlist lt__PROGRAM__LTX_preloaded_symbols[]; #define LTDL_SET_PRELOADED_SYMBOLS() \ lt_dlpreload_default(lt_preloaded_symbols) /* --- MODULE INFORMATION --- */ /* Associating user data with loaded modules. */ typedef void * lt_dlinterface_id; typedef int lt_dlhandle_interface (lt_dlhandle handle, const char *id_string); LT_SCOPE lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface); LT_SCOPE void lt_dlinterface_free (lt_dlinterface_id key); LT_SCOPE void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data); LT_SCOPE void * lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle); /* Read only information pertaining to a loaded module. */ typedef struct { char * filename; /* file name */ char * name; /* module name */ int ref_count; /* number of times lt_dlopened minus number of times lt_dlclosed. */ unsigned int is_resident:1; /* module can't be unloaded. */ unsigned int is_symglobal:1; /* module symbols can satisfy subsequently loaded modules. */ unsigned int is_symlocal:1; /* module symbols are only available locally. */ } lt_dlinfo; LT_SCOPE const lt_dlinfo *lt_dlgetinfo (lt_dlhandle handle); LT_SCOPE lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place); LT_SCOPE lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name); LT_SCOPE int lt_dlhandle_map (lt_dlinterface_id iface, int (*func) (lt_dlhandle handle, void *data), void *data); /* Deprecated module residency management API. */ LT_SCOPE int lt_dlmakeresident (lt_dlhandle handle); LT_SCOPE int lt_dlisresident (lt_dlhandle handle); #define lt_ptr void * LT_END_C_DECLS #endif /*!defined LTDL_H*/ JAGS-4.3.2/libltdl/Makefile.in0000644000175000017500000014112614400675235012673 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ ##### VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @INSTALL_LTDL_TRUE@am__append_1 = ltdl.h @INSTALL_LTDL_TRUE@am__append_2 = libltdl.la @CONVENIENCE_LTDL_TRUE@am__append_3 = libltdlc.la subdir = libltdl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__include_HEADERS_DIST) \ $(am__ltdlinclude_HEADERS_DIST) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" \ "$(DESTDIR)$(ltdlincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) dld_link_la_DEPENDENCIES = am__dirstamp = $(am__leading_dot)dirstamp am_dld_link_la_OBJECTS = loaders/dld_link.lo dld_link_la_OBJECTS = $(am_dld_link_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = dld_link_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dld_link_la_LDFLAGS) $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = dlopen_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_dlopen_la_OBJECTS = loaders/dlopen.lo dlopen_la_OBJECTS = $(am_dlopen_la_OBJECTS) dlopen_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dlopen_la_LDFLAGS) $(LDFLAGS) -o $@ dyld_la_LIBADD = am_dyld_la_OBJECTS = loaders/dyld.lo dyld_la_OBJECTS = $(am_dyld_la_OBJECTS) dyld_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(dyld_la_LDFLAGS) $(LDFLAGS) -o $@ am_libltdl_la_OBJECTS = loaders/libltdl_la-preopen.lo \ libltdl_la-lt__alloc.lo libltdl_la-lt_dlloader.lo \ libltdl_la-lt_error.lo libltdl_la-ltdl.lo libltdl_la-slist.lo libltdl_la_OBJECTS = $(am_libltdl_la_OBJECTS) libltdl_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdl_la_LDFLAGS) $(LDFLAGS) -o $@ @INSTALL_LTDL_TRUE@am_libltdl_la_rpath = -rpath $(libdir) am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) am__objects_1 = loaders/libltdlc_la-preopen.lo \ libltdlc_la-lt__alloc.lo libltdlc_la-lt_dlloader.lo \ libltdlc_la-lt_error.lo libltdlc_la-ltdl.lo \ libltdlc_la-slist.lo am_libltdlc_la_OBJECTS = $(am__objects_1) libltdlc_la_OBJECTS = $(am_libltdlc_la_OBJECTS) libltdlc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libltdlc_la_LDFLAGS) $(LDFLAGS) -o $@ @CONVENIENCE_LTDL_TRUE@am_libltdlc_la_rpath = load_add_on_la_LIBADD = am_load_add_on_la_OBJECTS = loaders/load_add_on.lo load_add_on_la_OBJECTS = $(am_load_add_on_la_OBJECTS) load_add_on_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(load_add_on_la_LDFLAGS) $(LDFLAGS) -o \ $@ loadlibrary_la_LIBADD = am_loadlibrary_la_OBJECTS = loaders/loadlibrary.lo loadlibrary_la_OBJECTS = $(am_loadlibrary_la_OBJECTS) loadlibrary_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(loadlibrary_la_LDFLAGS) $(LDFLAGS) -o \ $@ shl_load_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_shl_load_la_OBJECTS = loaders/shl_load.lo shl_load_la_OBJECTS = $(am_shl_load_la_OBJECTS) shl_load_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(shl_load_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libltdl_la-lt__alloc.Plo \ ./$(DEPDIR)/libltdl_la-lt_dlloader.Plo \ ./$(DEPDIR)/libltdl_la-lt_error.Plo \ ./$(DEPDIR)/libltdl_la-ltdl.Plo \ ./$(DEPDIR)/libltdl_la-slist.Plo \ ./$(DEPDIR)/libltdlc_la-lt__alloc.Plo \ ./$(DEPDIR)/libltdlc_la-lt_dlloader.Plo \ ./$(DEPDIR)/libltdlc_la-lt_error.Plo \ ./$(DEPDIR)/libltdlc_la-ltdl.Plo \ ./$(DEPDIR)/libltdlc_la-slist.Plo \ loaders/$(DEPDIR)/dld_link.Plo loaders/$(DEPDIR)/dlopen.Plo \ loaders/$(DEPDIR)/dyld.Plo \ loaders/$(DEPDIR)/libltdl_la-preopen.Plo \ loaders/$(DEPDIR)/libltdlc_la-preopen.Plo \ loaders/$(DEPDIR)/load_add_on.Plo \ loaders/$(DEPDIR)/loadlibrary.Plo \ loaders/$(DEPDIR)/shl_load.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \ $(dyld_la_SOURCES) $(libltdl_la_SOURCES) \ $(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \ $(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES) DIST_SOURCES = $(dld_link_la_SOURCES) $(dlopen_la_SOURCES) \ $(dyld_la_SOURCES) $(libltdl_la_SOURCES) \ $(libltdlc_la_SOURCES) $(load_add_on_la_SOURCES) \ $(loadlibrary_la_SOURCES) $(shl_load_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__include_HEADERS_DIST = ltdl.h am__ltdlinclude_HEADERS_DIST = libltdl/lt_system.h libltdl/lt_error.h \ libltdl/lt_dlloader.h HEADERS = $(include_HEADERS) $(ltdlinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ COPYING.LIB README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I ../m4 AUTOMAKE_OPTIONS = foreign # -I$(srcdir) is needed for user that built libltdl with a sub-Automake # (not as a sub-package!) using 'nostdinc': AM_CPPFLAGS = -DLT_CONFIG_H='<$(LT_CONFIG_H)>' -DLTDL -I. -I$(srcdir) \ -Ilibltdl -I$(srcdir)/libltdl AM_LDFLAGS = -no-undefined BUILT_SOURCES = libltdl/$(LT_ARGZ_H) include_HEADERS = $(am__append_1) noinst_LTLIBRARIES = $(LT_DLLOADERS) $(am__append_3) lib_LTLIBRARIES = $(am__append_2) EXTRA_LTLIBRARIES = dlopen.la dld_link.la dyld.la load_add_on.la \ loadlibrary.la shl_load.la EXTRA_DIST = lt__dirent.c lt__strl.c COPYING.LIB README \ libltdl/lt__argz_.h lt__argz.c CLEANFILES = libltdl.la libltdlc.la libdlloader.la $(ltdl_LIBOBJS) \ $(ltdl_LTLIBOBJS) MOSTLYCLEANFILES = libltdl/lt__argz.h libltdl/lt__argz.h-t LTDL_VERSION_INFO = -version-info 10:1:3 @INSTALL_LTDL_TRUE@ltdlincludedir = $(includedir)/libltdl @INSTALL_LTDL_TRUE@ltdlinclude_HEADERS = libltdl/lt_system.h \ @INSTALL_LTDL_TRUE@ libltdl/lt_error.h \ @INSTALL_LTDL_TRUE@ libltdl/lt_dlloader.h libltdl_la_SOURCES = libltdl/lt__alloc.h \ libltdl/lt__dirent.h \ libltdl/lt__glibc.h \ libltdl/lt__private.h \ libltdl/lt__strl.h \ libltdl/lt_dlloader.h \ libltdl/lt_error.h \ libltdl/lt_system.h \ libltdl/slist.h \ loaders/preopen.c \ lt__alloc.c \ lt_dlloader.c \ lt_error.c \ ltdl.c \ ltdl.h \ slist.c libltdl_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN) $(AM_CPPFLAGS) libltdl_la_LDFLAGS = $(AM_LDFLAGS) $(LTDL_VERSION_INFO) $(LT_DLPREOPEN) libltdl_la_LIBADD = $(ltdl_LTLIBOBJS) libltdl_la_DEPENDENCIES = $(LT_DLLOADERS) $(ltdl_LTLIBOBJS) libltdlc_la_SOURCES = $(libltdl_la_SOURCES) libltdlc_la_CPPFLAGS = -DLTDLOPEN=$(LTDLOPEN)c $(AM_CPPFLAGS) libltdlc_la_LDFLAGS = $(AM_LDFLAGS) $(LT_DLPREOPEN) libltdlc_la_LIBADD = $(libltdl_la_LIBADD) libltdlc_la_DEPENDENCIES = $(libltdl_la_DEPENDENCIES) dlopen_la_SOURCES = loaders/dlopen.c dlopen_la_LDFLAGS = -module -avoid-version dlopen_la_LIBADD = $(LIBADD_DLOPEN) dld_link_la_SOURCES = loaders/dld_link.c dld_link_la_LDFLAGS = -module -avoid-version dld_link_la_LIBADD = -ldld dyld_la_SOURCES = loaders/dyld.c dyld_la_LDFLAGS = -module -avoid-version load_add_on_la_SOURCES = loaders/load_add_on.c load_add_on_la_LDFLAGS = -module -avoid-version loadlibrary_la_SOURCES = loaders/loadlibrary.c loadlibrary_la_LDFLAGS = -module -avoid-version shl_load_la_SOURCES = loaders/shl_load.c shl_load_la_LDFLAGS = -module -avoid-version shl_load_la_LIBADD = $(LIBADD_SHL_LOAD) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libltdl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libltdl/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } loaders/$(am__dirstamp): @$(MKDIR_P) loaders @: > loaders/$(am__dirstamp) loaders/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) loaders/$(DEPDIR) @: > loaders/$(DEPDIR)/$(am__dirstamp) loaders/dld_link.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) dld_link.la: $(dld_link_la_OBJECTS) $(dld_link_la_DEPENDENCIES) $(EXTRA_dld_link_la_DEPENDENCIES) $(AM_V_CCLD)$(dld_link_la_LINK) $(dld_link_la_OBJECTS) $(dld_link_la_LIBADD) $(LIBS) loaders/dlopen.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) dlopen.la: $(dlopen_la_OBJECTS) $(dlopen_la_DEPENDENCIES) $(EXTRA_dlopen_la_DEPENDENCIES) $(AM_V_CCLD)$(dlopen_la_LINK) $(dlopen_la_OBJECTS) $(dlopen_la_LIBADD) $(LIBS) loaders/dyld.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) dyld.la: $(dyld_la_OBJECTS) $(dyld_la_DEPENDENCIES) $(EXTRA_dyld_la_DEPENDENCIES) $(AM_V_CCLD)$(dyld_la_LINK) $(dyld_la_OBJECTS) $(dyld_la_LIBADD) $(LIBS) loaders/libltdl_la-preopen.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES) $(EXTRA_libltdl_la_DEPENDENCIES) $(AM_V_CCLD)$(libltdl_la_LINK) $(am_libltdl_la_rpath) $(libltdl_la_OBJECTS) $(libltdl_la_LIBADD) $(LIBS) loaders/libltdlc_la-preopen.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) libltdlc.la: $(libltdlc_la_OBJECTS) $(libltdlc_la_DEPENDENCIES) $(EXTRA_libltdlc_la_DEPENDENCIES) $(AM_V_CCLD)$(libltdlc_la_LINK) $(am_libltdlc_la_rpath) $(libltdlc_la_OBJECTS) $(libltdlc_la_LIBADD) $(LIBS) loaders/load_add_on.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) load_add_on.la: $(load_add_on_la_OBJECTS) $(load_add_on_la_DEPENDENCIES) $(EXTRA_load_add_on_la_DEPENDENCIES) $(AM_V_CCLD)$(load_add_on_la_LINK) $(load_add_on_la_OBJECTS) $(load_add_on_la_LIBADD) $(LIBS) loaders/loadlibrary.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) loadlibrary.la: $(loadlibrary_la_OBJECTS) $(loadlibrary_la_DEPENDENCIES) $(EXTRA_loadlibrary_la_DEPENDENCIES) $(AM_V_CCLD)$(loadlibrary_la_LINK) $(loadlibrary_la_OBJECTS) $(loadlibrary_la_LIBADD) $(LIBS) loaders/shl_load.lo: loaders/$(am__dirstamp) \ loaders/$(DEPDIR)/$(am__dirstamp) shl_load.la: $(shl_load_la_OBJECTS) $(shl_load_la_DEPENDENCIES) $(EXTRA_shl_load_la_DEPENDENCIES) $(AM_V_CCLD)$(shl_load_la_LINK) $(shl_load_la_OBJECTS) $(shl_load_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f loaders/*.$(OBJEXT) -rm -f loaders/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt__alloc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt_dlloader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-lt_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-ltdl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdl_la-slist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt__alloc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt_dlloader.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-lt_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-ltdl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libltdlc_la-slist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/dld_link.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/dlopen.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/dyld.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/libltdl_la-preopen.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/libltdlc_la-preopen.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/load_add_on.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/loadlibrary.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@loaders/$(DEPDIR)/shl_load.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< loaders/libltdl_la-preopen.lo: loaders/preopen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT loaders/libltdl_la-preopen.lo -MD -MP -MF loaders/$(DEPDIR)/libltdl_la-preopen.Tpo -c -o loaders/libltdl_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) loaders/$(DEPDIR)/libltdl_la-preopen.Tpo loaders/$(DEPDIR)/libltdl_la-preopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loaders/preopen.c' object='loaders/libltdl_la-preopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o loaders/libltdl_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c libltdl_la-lt__alloc.lo: lt__alloc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt__alloc.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt__alloc.Tpo -c -o libltdl_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdl_la-lt__alloc.Tpo $(DEPDIR)/libltdl_la-lt__alloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt__alloc.c' object='libltdl_la-lt__alloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c libltdl_la-lt_dlloader.lo: lt_dlloader.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt_dlloader.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt_dlloader.Tpo -c -o libltdl_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdl_la-lt_dlloader.Tpo $(DEPDIR)/libltdl_la-lt_dlloader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt_dlloader.c' object='libltdl_la-lt_dlloader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c libltdl_la-lt_error.lo: lt_error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-lt_error.lo -MD -MP -MF $(DEPDIR)/libltdl_la-lt_error.Tpo -c -o libltdl_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdl_la-lt_error.Tpo $(DEPDIR)/libltdl_la-lt_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt_error.c' object='libltdl_la-lt_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c libltdl_la-ltdl.lo: ltdl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-ltdl.lo -MD -MP -MF $(DEPDIR)/libltdl_la-ltdl.Tpo -c -o libltdl_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdl_la-ltdl.Tpo $(DEPDIR)/libltdl_la-ltdl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ltdl.c' object='libltdl_la-ltdl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c libltdl_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdl_la-slist.lo -MD -MP -MF $(DEPDIR)/libltdl_la-slist.Tpo -c -o libltdl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdl_la-slist.Tpo $(DEPDIR)/libltdl_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='slist.c' object='libltdl_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdl_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdl_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c loaders/libltdlc_la-preopen.lo: loaders/preopen.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT loaders/libltdlc_la-preopen.lo -MD -MP -MF loaders/$(DEPDIR)/libltdlc_la-preopen.Tpo -c -o loaders/libltdlc_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) loaders/$(DEPDIR)/libltdlc_la-preopen.Tpo loaders/$(DEPDIR)/libltdlc_la-preopen.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='loaders/preopen.c' object='loaders/libltdlc_la-preopen.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o loaders/libltdlc_la-preopen.lo `test -f 'loaders/preopen.c' || echo '$(srcdir)/'`loaders/preopen.c libltdlc_la-lt__alloc.lo: lt__alloc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt__alloc.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt__alloc.Tpo -c -o libltdlc_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdlc_la-lt__alloc.Tpo $(DEPDIR)/libltdlc_la-lt__alloc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt__alloc.c' object='libltdlc_la-lt__alloc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt__alloc.lo `test -f 'lt__alloc.c' || echo '$(srcdir)/'`lt__alloc.c libltdlc_la-lt_dlloader.lo: lt_dlloader.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt_dlloader.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt_dlloader.Tpo -c -o libltdlc_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdlc_la-lt_dlloader.Tpo $(DEPDIR)/libltdlc_la-lt_dlloader.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt_dlloader.c' object='libltdlc_la-lt_dlloader.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt_dlloader.lo `test -f 'lt_dlloader.c' || echo '$(srcdir)/'`lt_dlloader.c libltdlc_la-lt_error.lo: lt_error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-lt_error.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-lt_error.Tpo -c -o libltdlc_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdlc_la-lt_error.Tpo $(DEPDIR)/libltdlc_la-lt_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lt_error.c' object='libltdlc_la-lt_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-lt_error.lo `test -f 'lt_error.c' || echo '$(srcdir)/'`lt_error.c libltdlc_la-ltdl.lo: ltdl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-ltdl.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-ltdl.Tpo -c -o libltdlc_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdlc_la-ltdl.Tpo $(DEPDIR)/libltdlc_la-ltdl.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ltdl.c' object='libltdlc_la-ltdl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-ltdl.lo `test -f 'ltdl.c' || echo '$(srcdir)/'`ltdl.c libltdlc_la-slist.lo: slist.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libltdlc_la-slist.lo -MD -MP -MF $(DEPDIR)/libltdlc_la-slist.Tpo -c -o libltdlc_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libltdlc_la-slist.Tpo $(DEPDIR)/libltdlc_la-slist.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='slist.c' object='libltdlc_la-slist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libltdlc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libltdlc_la-slist.lo `test -f 'slist.c' || echo '$(srcdir)/'`slist.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf loaders/.libs loaders/_libs install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-ltdlincludeHEADERS: $(ltdlinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(ltdlincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(ltdlincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(ltdlincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(ltdlincludedir)" || exit $$?; \ done uninstall-ltdlincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(ltdlinclude_HEADERS)'; test -n "$(ltdlincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(ltdlincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) install-EXTRALTLIBRARIES: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(ltdlincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f loaders/$(DEPDIR)/$(am__dirstamp) -rm -f loaders/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libltdl_la-lt__alloc.Plo -rm -f ./$(DEPDIR)/libltdl_la-lt_dlloader.Plo -rm -f ./$(DEPDIR)/libltdl_la-lt_error.Plo -rm -f ./$(DEPDIR)/libltdl_la-ltdl.Plo -rm -f ./$(DEPDIR)/libltdl_la-slist.Plo -rm -f ./$(DEPDIR)/libltdlc_la-lt__alloc.Plo -rm -f ./$(DEPDIR)/libltdlc_la-lt_dlloader.Plo -rm -f ./$(DEPDIR)/libltdlc_la-lt_error.Plo -rm -f ./$(DEPDIR)/libltdlc_la-ltdl.Plo -rm -f ./$(DEPDIR)/libltdlc_la-slist.Plo -rm -f loaders/$(DEPDIR)/dld_link.Plo -rm -f loaders/$(DEPDIR)/dlopen.Plo -rm -f loaders/$(DEPDIR)/dyld.Plo -rm -f loaders/$(DEPDIR)/libltdl_la-preopen.Plo -rm -f loaders/$(DEPDIR)/libltdlc_la-preopen.Plo -rm -f loaders/$(DEPDIR)/load_add_on.Plo -rm -f loaders/$(DEPDIR)/loadlibrary.Plo -rm -f loaders/$(DEPDIR)/shl_load.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-local distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-includeHEADERS install-ltdlincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libltdl_la-lt__alloc.Plo -rm -f ./$(DEPDIR)/libltdl_la-lt_dlloader.Plo -rm -f ./$(DEPDIR)/libltdl_la-lt_error.Plo -rm -f ./$(DEPDIR)/libltdl_la-ltdl.Plo -rm -f ./$(DEPDIR)/libltdl_la-slist.Plo -rm -f ./$(DEPDIR)/libltdlc_la-lt__alloc.Plo -rm -f ./$(DEPDIR)/libltdlc_la-lt_dlloader.Plo -rm -f ./$(DEPDIR)/libltdlc_la-lt_error.Plo -rm -f ./$(DEPDIR)/libltdlc_la-ltdl.Plo -rm -f ./$(DEPDIR)/libltdlc_la-slist.Plo -rm -f loaders/$(DEPDIR)/dld_link.Plo -rm -f loaders/$(DEPDIR)/dlopen.Plo -rm -f loaders/$(DEPDIR)/dyld.Plo -rm -f loaders/$(DEPDIR)/libltdl_la-preopen.Plo -rm -f loaders/$(DEPDIR)/libltdlc_la-preopen.Plo -rm -f loaders/$(DEPDIR)/load_add_on.Plo -rm -f loaders/$(DEPDIR)/loadlibrary.Plo -rm -f loaders/$(DEPDIR)/shl_load.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-ltdlincludeHEADERS .MAKE: all check install install-am install-exec install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-local distclean-tags distdir dvi dvi-am html html-am \ info info-am install install-am install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-includeHEADERS \ install-info install-info-am install-libLTLIBRARIES \ install-ltdlincludeHEADERS install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-includeHEADERS \ uninstall-libLTLIBRARIES uninstall-ltdlincludeHEADERS .PRECIOUS: Makefile # We need the following in order to create an when the system # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): $(LT_ARGZ_H) libltdl/lt__argz.h: libltdl/lt__argz_.h $(AM_V_at)$(mkinstalldirs) . libltdl $(AM_V_GEN)cp $(srcdir)/libltdl/lt__argz_.h $@-t $(AM_V_at)mv $@-t $@ # Added by m4/ltdl.m4 but not distcleaned by automake distclean-local: rm -f ./$(DEPDIR)/lt__strl.Plo # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/libltdl/COPYING.LIB0000644000175000017500000006364214214520216012263 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! JAGS-4.3.2/libltdl/README0000644000175000017500000000130314214520133011463 00000000000000This is GNU libltdl, a system independent dlopen wrapper for GNU libtool. It supports the following dlopen interfaces: * dlopen (POSIX) * shl_load (HP-UX) * LoadLibrary (Win16 and Win32) * load_add_on (BeOS) * GNU DLD (emulates dynamic linking for static libraries) * dyld (darwin/Mac OS X) * libtool's dlpreopen -- Copyright (C) 1999, 2003, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 This file is part of GNU Libtool. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. JAGS-4.3.2/libltdl/lt__alloc.c0000644000175000017500000000440514214520133012705 00000000000000/* lt__alloc.c -- internal memory management interface Copyright (C) 2004, 2006-2007, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include #include "lt__alloc.h" static void alloc_die_default (void); void (*lt__alloc_die) (void) = alloc_die_default; /* Unless overridden, exit on memory failure. */ static void alloc_die_default (void) { fprintf (stderr, "Out of memory.\n"); exit (EXIT_FAILURE); } void * lt__malloc (size_t n) { void *mem; if (! (mem = malloc (n))) (*lt__alloc_die) (); return mem; } void * lt__zalloc (size_t n) { void *mem; if ((mem = lt__malloc (n))) memset (mem, 0, n); return mem; } void * lt__realloc (void *mem, size_t n) { if (! (mem = realloc (mem, n))) (*lt__alloc_die) (); return mem; } void * lt__memdup (void const *mem, size_t n) { void *newmem; if ((newmem = lt__malloc (n))) return memcpy (newmem, mem, n); return 0; } char * lt__strdup (const char *string) { return (char *) lt__memdup (string, strlen (string) +1); } JAGS-4.3.2/libltdl/lt_dlloader.c0000644000175000017500000001403314214520133013240 00000000000000/* lt_dlloader.c -- dynamic library loader interface Copyright (C) 2004, 2007-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_dlloader.h" #define RETURN_SUCCESS 0 #define RETURN_FAILURE 1 static void * loader_callback (SList *item, void *userdata); /* A list of all the dlloaders we know about, each stored as a boxed SList item: */ static SList *loaders = 0; /* Return NULL, unless the loader in this ITEM has a matching name, in which case we return the matching item so that its address is passed back out (for possible freeing) by slist_remove. */ static void * loader_callback (SList *item, void *userdata) { const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata; const char * name = (const char *) userdata; assert (vtable); return STREQ (vtable->name, name) ? (void *) item : NULL; } /* Hook VTABLE into our global LOADERS list according to its own PRIORITY field value. */ int lt_dlloader_add (const lt_dlvtable *vtable) { SList *item; if ((vtable == 0) /* diagnose invalid vtable fields */ || (vtable->module_open == 0) || (vtable->module_close == 0) || (vtable->find_sym == 0) || ((vtable->priority != LT_DLLOADER_PREPEND) && (vtable->priority != LT_DLLOADER_APPEND))) { LT__SETERROR (INVALID_LOADER); return RETURN_FAILURE; } item = slist_box (vtable); if (!item) { (*lt__alloc_die) (); /* Let the caller know something went wrong if lt__alloc_die doesn't abort. */ return RETURN_FAILURE; } if (vtable->priority == LT_DLLOADER_PREPEND) { loaders = slist_cons (item, loaders); } else { assert (vtable->priority == LT_DLLOADER_APPEND); loaders = slist_concat (loaders, item); } return RETURN_SUCCESS; } #ifdef LT_DEBUG_LOADERS static void * loader_dump_callback (SList *item, void *userdata) { const lt_dlvtable *vtable = (const lt_dlvtable *) item->userdata; fprintf (stderr, ", %s", (vtable && vtable->name) ? vtable->name : "(null)"); return 0; } void lt_dlloader_dump (void) { fprintf (stderr, "loaders: "); if (!loaders) { fprintf (stderr, "(empty)"); } else { const lt_dlvtable *head = (const lt_dlvtable *) loaders->userdata; fprintf (stderr, "%s", (head && head->name) ? head->name : "(null)"); if (slist_tail (loaders)) slist_foreach (slist_tail (loaders), loader_dump_callback, NULL); } fprintf (stderr, "\n"); } #endif /* An iterator for the global loader list: if LOADER is NULL, then return the first element, otherwise the following element. */ lt_dlloader lt_dlloader_next (lt_dlloader loader) { SList *item = (SList *) loader; return (lt_dlloader) (item ? item->next : loaders); } /* Non-destructive unboxing of a loader. */ const lt_dlvtable * lt_dlloader_get (lt_dlloader loader) { return (const lt_dlvtable *) (loader ? ((SList *) loader)->userdata : NULL); } /* Return the contents of the first item in the global loader list with a matching NAME after removing it from that list. If there was no match, return NULL; if there is an error, return NULL and set an error for lt_dlerror; do not set an error if only resident modules need this loader; in either case, the loader list is not changed if NULL is returned. */ lt_dlvtable * lt_dlloader_remove (const char *name) { const lt_dlvtable * vtable = lt_dlloader_find (name); static const char id_string[] = "lt_dlloader_remove"; lt_dlinterface_id iface; lt_dlhandle handle = 0; int in_use = 0; int in_use_by_resident = 0; if (!vtable) { LT__SETERROR (INVALID_LOADER); return 0; } /* Fail if there are any open modules that use this loader. */ iface = lt_dlinterface_register (id_string, NULL); if (!iface) /* No memory, error is already set. */ return 0; while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; if (cur->vtable == vtable) { in_use = 1; if (lt_dlisresident (handle)) in_use_by_resident = 1; } } lt_dlinterface_free (iface); if (in_use) { if (!in_use_by_resident) LT__SETERROR (REMOVE_LOADER); return 0; } /* Call the loader finalisation function. */ if (vtable && vtable->dlloader_exit) { if ((*vtable->dlloader_exit) (vtable->dlloader_data) != 0) { /* If there is an exit function, and it returns non-zero then it must set an error, and we will not remove it from the list. */ return 0; } } /* If we got this far, remove the loader from our global list. */ return (lt_dlvtable *) slist_unbox ((SList *) slist_remove (&loaders, loader_callback, (void *) name)); } const lt_dlvtable * lt_dlloader_find (const char *name) { return lt_dlloader_get (slist_find (loaders, loader_callback, (void *) name)); } JAGS-4.3.2/libltdl/lt_error.c0000644000175000017500000000564214214520133012611 00000000000000/* lt_error.c -- error propagation interface Copyright (C) 1999-2001, 2004-2005, 2007, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1999 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_error.h" static const char *last_error = 0; static const char error_strings[LT_ERROR_MAX][LT_ERROR_LEN_MAX + 1] = { #define LT_ERROR(name, diagnostic) diagnostic, lt_dlerror_table #undef LT_ERROR }; static const char **user_error_strings = 0; static int errorcount = LT_ERROR_MAX; int lt_dladderror (const char *diagnostic) { int errindex = 0; int result = -1; const char **temp = (const char **) 0; assert (diagnostic); errindex = errorcount - LT_ERROR_MAX; temp = REALLOC (const char *, user_error_strings, 1 + errindex); if (temp) { user_error_strings = temp; user_error_strings[errindex] = diagnostic; result = errorcount++; } return result; } int lt_dlseterror (int errindex) { int errors = 0; if (errindex >= errorcount || errindex < 0) { /* Ack! Error setting the error message! */ LT__SETERROR (INVALID_ERRORCODE); ++errors; } else if (errindex < LT_ERROR_MAX) { /* No error setting the error message! */ LT__SETERRORSTR (error_strings[errindex]); } else { /* No error setting the error message! */ LT__SETERRORSTR (user_error_strings[errindex - LT_ERROR_MAX]); } return errors; } const char * lt__error_string (int errorcode) { assert (errorcode >= 0); assert (errorcode < LT_ERROR_MAX); return error_strings[errorcode]; } const char * lt__get_last_error (void) { return last_error; } const char * lt__set_last_error (const char *errormsg) { return last_error = errormsg; } JAGS-4.3.2/libltdl/ltdl.c0000644000175000017500000015404714214520133011724 00000000000000/* ltdl.c -- system independent dlopen wrapper Copyright (C) 1998-2000, 2004-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include "lt_system.h" #include "lt_dlloader.h" /* --- MANIFEST CONSTANTS --- */ /* Standard libltdl search path environment variable name */ #undef LTDL_SEARCHPATH_VAR #define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH" /* Standard libtool archive file extension. */ #undef LT_ARCHIVE_EXT #define LT_ARCHIVE_EXT ".la" /* max. filename length */ #if !defined LT_FILENAME_MAX # define LT_FILENAME_MAX 1024 #endif #if !defined LT_LIBEXT # define LT_LIBEXT "a" #endif #if !defined LT_LIBPREFIX # define LT_LIBPREFIX "lib" #endif /* This is the maximum symbol size that won't require malloc/free */ #undef LT_SYMBOL_LENGTH #define LT_SYMBOL_LENGTH 128 /* This accounts for the _LTX_ separator */ #undef LT_SYMBOL_OVERHEAD #define LT_SYMBOL_OVERHEAD 5 /* Various boolean flags can be stored in the flags field of an lt_dlhandle... */ #define LT_DLIS_RESIDENT(handle) ((handle)->info.is_resident) #define LT_DLIS_SYMGLOBAL(handle) ((handle)->info.is_symglobal) #define LT_DLIS_SYMLOCAL(handle) ((handle)->info.is_symlocal) static const char objdir[] = LT_OBJDIR; static const char archive_ext[] = LT_ARCHIVE_EXT; static const char libext[] = LT_LIBEXT; static const char libprefix[] = LT_LIBPREFIX; #if defined LT_MODULE_EXT static const char shlib_ext[] = LT_MODULE_EXT; #endif /* If the loadable module suffix is not the same as the linkable * shared library suffix, this will be defined. */ #if defined LT_SHARED_EXT static const char shared_ext[] = LT_SHARED_EXT; #endif #if defined LT_DLSEARCH_PATH static const char sys_dlsearch_path[] = LT_DLSEARCH_PATH; #endif /* --- DYNAMIC MODULE LOADING --- */ /* The type of a function used at each iteration of foreach_dirinpath(). */ typedef int foreach_callback_func (char *filename, void *data1, void *data2); /* foreachfile_callback itself calls a function of this type: */ typedef int file_worker_func (const char *filename, void *data); static int foreach_dirinpath (const char *search_path, const char *base_name, foreach_callback_func *func, void *data1, void *data2); static int find_file_callback (char *filename, void *data1, void *data2); static int find_handle_callback (char *filename, void *data, void *ignored); static int foreachfile_callback (char *filename, void *data1, void *data2); static int canonicalize_path (const char *path, char **pcanonical); static int argzize_path (const char *path, char **pargz, size_t *pargz_len); static FILE *find_file (const char *search_path, const char *base_name, char **pdir); static lt_dlhandle *find_handle (const char *search_path, const char *base_name, lt_dlhandle *handle, lt_dladvise advise); static int find_module (lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed, lt_dladvise advise); static int has_library_ext (const char *filename); static int load_deplibs (lt_dlhandle handle, char *deplibs); static int trim (char **dest, const char *str); static int try_dlopen (lt_dlhandle *handle, const char *filename, const char *ext, lt_dladvise advise); static int tryall_dlopen (lt_dlhandle *handle, const char *filename, lt_dladvise padvise, const lt_dlvtable *vtable); static int unload_deplibs (lt_dlhandle handle); static int lt_argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry); static int lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry); static int lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp); static int lt_dlpath_insertdir (char **ppath, char *before, const char *dir); static int list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len); static int file_not_found (void); #ifdef HAVE_LIBDLLOADER static int loader_init_callback (lt_dlhandle handle); #endif /* HAVE_LIBDLLOADER */ static int loader_init (lt_get_vtable *vtable_func, lt_user_data data); static char *user_search_path= 0; static lt_dlhandle handles = 0; static int initialized = 0; /* Our memory failure callback sets the error message to be passed back up to the client, so we must be careful to return from mallocation callers if allocation fails (as this callback returns!!). */ void lt__alloc_die_callback (void) { LT__SETERROR (NO_MEMORY); } #ifdef HAVE_LIBDLLOADER /* This function is called to initialise each preloaded module loader, and hook it into the list of loaders to be used when attempting to dlopen an application module. */ static int loader_init_callback (lt_dlhandle handle) { lt_get_vtable *vtable_func = (lt_get_vtable *) lt_dlsym (handle, "get_vtable"); return loader_init (vtable_func, 0); } #endif /* HAVE_LIBDLLOADER */ static int loader_init (lt_get_vtable *vtable_func, lt_user_data data) { const lt_dlvtable *vtable = 0; int errors = 0; if (vtable_func) { vtable = (*vtable_func) (data); } /* lt_dlloader_add will LT__SETERROR if it fails. */ errors += lt_dlloader_add (vtable); assert (errors || vtable); if ((!errors) && vtable->dlloader_init) { if ((*vtable->dlloader_init) (vtable->dlloader_data)) { LT__SETERROR (INIT_LOADER); ++errors; } } return errors; } /* Bootstrap the loader loading with the preopening loader. */ #define get_vtable preopen_LTX_get_vtable #define preloaded_symbols LT_CONC3(lt_, LTDLOPEN, _LTX_preloaded_symbols) LT_BEGIN_C_DECLS LT_SCOPE const lt_dlvtable * get_vtable (lt_user_data data); LT_END_C_DECLS #ifdef HAVE_LIBDLLOADER extern LT_DLSYM_CONST lt_dlsymlist preloaded_symbols[]; #endif /* Initialize libltdl. */ int lt_dlinit (void) { int errors = 0; /* Initialize only at first call. */ if (++initialized == 1) { lt__alloc_die = lt__alloc_die_callback; handles = 0; user_search_path = 0; /* empty search path */ /* First set up the statically loaded preload module loader, so we can use it to preopen the other loaders we linked in at compile time. */ errors += loader_init (get_vtable, 0); /* Now open all the preloaded module loaders, so the application can use _them_ to lt_dlopen its own modules. */ #ifdef HAVE_LIBDLLOADER if (!errors) { errors += lt_dlpreload (preloaded_symbols); } if (!errors) { errors += lt_dlpreload_open (LT_STR(LTDLOPEN), loader_init_callback); } #endif /* HAVE_LIBDLLOADER */ } #ifdef LT_DEBUG_LOADERS lt_dlloader_dump(); #endif return errors; } int lt_dlexit (void) { /* shut down libltdl */ lt_dlloader *loader = 0; lt_dlhandle handle = handles; int errors = 0; if (!initialized) { LT__SETERROR (SHUTDOWN); ++errors; goto done; } /* shut down only at last call. */ if (--initialized == 0) { int level; while (handles && LT_DLIS_RESIDENT (handles)) { handles = handles->next; } /* close all modules */ for (level = 1; handle; ++level) { lt_dlhandle cur = handles; int saw_nonresident = 0; while (cur) { lt_dlhandle tmp = cur; cur = cur->next; if (!LT_DLIS_RESIDENT (tmp)) { saw_nonresident = 1; if (tmp->info.ref_count <= level) { if (lt_dlclose (tmp)) { ++errors; } /* Make sure that the handle pointed to by 'cur' still exists. lt_dlclose recursively closes dependent libraries, which removes them from the linked list. One of these might be the one pointed to by 'cur'. */ if (cur) { for (tmp = handles; tmp; tmp = tmp->next) if (tmp == cur) break; if (! tmp) cur = handles; } } } } /* done if only resident modules are left */ if (!saw_nonresident) break; } /* When removing loaders, we can only find out failure by testing the error string, so avoid a spurious one from an earlier failed command. */ if (!errors) LT__SETERRORSTR (0); /* close all loaders */ for (loader = (lt_dlloader *) lt_dlloader_next (NULL); loader;) { lt_dlloader *next = (lt_dlloader *) lt_dlloader_next (loader); lt_dlvtable *vtable = (lt_dlvtable *) lt_dlloader_get (loader); if ((vtable = lt_dlloader_remove ((char *) vtable->name))) { FREE (vtable); } else { /* ignore errors due to resident modules */ const char *err; LT__GETERROR (err); if (err) ++errors; } loader = next; } FREE(user_search_path); } done: return errors; } /* Try VTABLE or, if VTABLE is NULL, all available loaders for FILENAME. If the library is not successfully loaded, return non-zero. Otherwise, the dlhandle is stored at the address given in PHANDLE. */ static int tryall_dlopen (lt_dlhandle *phandle, const char *filename, lt_dladvise advise, const lt_dlvtable *vtable) { lt_dlhandle handle = handles; const char * saved_error = 0; int errors = 0; #ifdef LT_DEBUG_LOADERS fprintf (stderr, "tryall_dlopen (%s, %s)\n", filename ? filename : "(null)", vtable ? vtable->name : "(ALL)"); #endif LT__GETERROR (saved_error); /* check whether the module was already opened */ for (;handle; handle = handle->next) { if ((handle->info.filename == filename) /* dlopen self: 0 == 0 */ || (handle->info.filename && filename && STREQ (handle->info.filename, filename))) { break; } } if (handle) { ++handle->info.ref_count; *phandle = handle; goto done; } handle = *phandle; if (filename) { /* Comment out the check of file permissions using access. This call seems to always return -1 with error EACCES. */ /* We need to catch missing file errors early so that file_not_found() can detect what happened. if (access (filename, R_OK) != 0) { LT__SETERROR (FILE_NOT_FOUND); ++errors; goto done; } */ handle->info.filename = lt__strdup (filename); if (!handle->info.filename) { ++errors; goto done; } } else { handle->info.filename = 0; } { lt_dlloader loader = lt_dlloader_next (0); const lt_dlvtable *loader_vtable; do { if (vtable) loader_vtable = vtable; else loader_vtable = lt_dlloader_get (loader); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "Calling %s->module_open (%s)\n", (loader_vtable && loader_vtable->name) ? loader_vtable->name : "(null)", filename ? filename : "(null)"); #endif handle->module = (*loader_vtable->module_open) (loader_vtable->dlloader_data, filename, advise); #ifdef LT_DEBUG_LOADERS if (!handle->module) { char *error; LT__GETERROR(error); fprintf (stderr, " Result: Failed\n" " Error message << %s >>\n", error ? error : "(null)"); } else { fprintf (stderr, " Result: Success\n"); } #endif if (handle->module != 0) { if (advise) { handle->info.is_resident = advise->is_resident; handle->info.is_symglobal = advise->is_symglobal; handle->info.is_symlocal = advise->is_symlocal; } break; } } while (!vtable && (loader = lt_dlloader_next (loader))); /* If VTABLE was given but couldn't open the module, or VTABLE wasn't given but we exhausted all loaders without opening the module, bail out! */ if ((vtable && !handle->module) || (!vtable && !loader)) { FREE (handle->info.filename); ++errors; goto done; } handle->vtable = loader_vtable; } LT__SETERRORSTR (saved_error); done: return errors; } static int tryall_dlopen_module (lt_dlhandle *handle, const char *prefix, const char *dirname, const char *dlname, lt_dladvise advise) { int error = 0; char *filename = 0; size_t filename_len = 0; size_t dirname_len = LT_STRLEN (dirname); assert (handle); assert (dirname); assert (dlname); #if defined LT_DIRSEP_CHAR /* Only canonicalized names (i.e. with DIRSEP chars already converted) should make it into this function: */ assert (strchr (dirname, LT_DIRSEP_CHAR) == 0); #endif if (dirname_len > 0) if (dirname[dirname_len -1] == '/') --dirname_len; filename_len = dirname_len + 1 + LT_STRLEN (dlname); /* Allocate memory, and combine DIRNAME and MODULENAME into it. The PREFIX (if any) is handled below. */ filename = MALLOC (char, filename_len + 1); if (!filename) return 1; sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); /* Now that we have combined DIRNAME and MODULENAME, if there is also a PREFIX to contend with, simply recurse with the arguments shuffled. Otherwise, attempt to open FILENAME as a module. */ if (prefix) { error += tryall_dlopen_module (handle, (const char *) 0, prefix, filename, advise); } else if (tryall_dlopen (handle, filename, advise, 0) != 0) { ++error; } FREE (filename); return error; } static int find_module (lt_dlhandle *handle, const char *dir, const char *libdir, const char *dlname, const char *old_name, int installed, lt_dladvise advise) { /* Try to open the old library first; if it was dlpreopened, we want the preopened version of it, even if a dlopenable module is available. */ if (old_name && tryall_dlopen (handle, old_name, advise, lt_dlloader_find ("lt_preopen") ) == 0) { return 0; } /* Try to open the dynamic library. */ if (dlname) { /* try to open the installed module */ if (installed && libdir) { if (tryall_dlopen_module (handle, (const char *) 0, libdir, dlname, advise) == 0) return 0; } /* try to open the not-installed module */ if (!installed) { if (tryall_dlopen_module (handle, dir, objdir, dlname, advise) == 0) return 0; } /* maybe it was moved to another directory */ { if (dir && (tryall_dlopen_module (handle, (const char *) 0, dir, dlname, advise) == 0)) return 0; } } return 1; } static int canonicalize_path (const char *path, char **pcanonical) { char *canonical = 0; assert (path && *path); assert (pcanonical); canonical = MALLOC (char, 1+ LT_STRLEN (path)); if (!canonical) return 1; { size_t dest = 0; size_t src; for (src = 0; path[src] != LT_EOS_CHAR; ++src) { /* Path separators are not copied to the beginning or end of the destination, or if another separator would follow immediately. */ if (path[src] == LT_PATHSEP_CHAR) { if ((dest == 0) || (path[1+ src] == LT_PATHSEP_CHAR) || (path[1+ src] == LT_EOS_CHAR)) continue; } /* Anything other than a directory separator is copied verbatim. */ if ((path[src] != '/') #if defined LT_DIRSEP_CHAR && (path[src] != LT_DIRSEP_CHAR) #endif ) { canonical[dest++] = path[src]; } /* Directory separators are converted and copied only if they are not at the end of a path -- i.e. before a path separator or NULL terminator. */ else if ((path[1+ src] != LT_PATHSEP_CHAR) && (path[1+ src] != LT_EOS_CHAR) #if defined LT_DIRSEP_CHAR && (path[1+ src] != LT_DIRSEP_CHAR) #endif && (path[1+ src] != '/')) { canonical[dest++] = '/'; } } /* Add an end-of-string marker at the end. */ canonical[dest] = LT_EOS_CHAR; } /* Assign new value. */ *pcanonical = canonical; return 0; } static int argzize_path (const char *path, char **pargz, size_t *pargz_len) { error_t error; assert (path); assert (pargz); assert (pargz_len); if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len))) { switch (error) { case ENOMEM: LT__SETERROR (NO_MEMORY); break; default: LT__SETERROR (UNKNOWN); break; } return 1; } return 0; } /* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns non-zero or all elements are exhausted. If BASE_NAME is non-NULL, it is appended to each SEARCH_PATH element before FUNC is called. */ static int foreach_dirinpath (const char *search_path, const char *base_name, foreach_callback_func *func, void *data1, void *data2) { int result = 0; size_t filenamesize = 0; size_t lenbase = LT_STRLEN (base_name); size_t argz_len = 0; char *argz = 0; char *filename = 0; char *canonical = 0; if (!search_path || !*search_path) { LT__SETERROR (FILE_NOT_FOUND); goto cleanup; } if (canonicalize_path (search_path, &canonical) != 0) goto cleanup; if (argzize_path (canonical, &argz, &argz_len) != 0) goto cleanup; { char *dir_name = 0; while ((dir_name = argz_next (argz, argz_len, dir_name))) { size_t lendir = LT_STRLEN (dir_name); if (1+ lendir + lenbase >= filenamesize) { FREE (filename); filenamesize = 1+ lendir + 1+ lenbase; /* "/d" + '/' + "f" + '\0' */ filename = MALLOC (char, filenamesize); if (!filename) goto cleanup; } assert (filenamesize > lendir); strcpy (filename, dir_name); if (base_name && *base_name) { if (filename[lendir -1] != '/') filename[lendir++] = '/'; strcpy (filename +lendir, base_name); } if ((result = (*func) (filename, data1, data2))) { break; } } } cleanup: FREE (argz); FREE (canonical); FREE (filename); return result; } /* If FILEPATH can be opened, store the name of the directory component in DATA1, and the opened FILE* structure address in DATA2. Otherwise DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */ static int find_file_callback (char *filename, void *data1, void *data2) { char **pdir = (char **) data1; FILE **pfile = (FILE **) data2; int is_done = 0; assert (filename && *filename); assert (pdir); assert (pfile); if ((*pfile = fopen (filename, LT_READTEXT_MODE))) { char *dirend = strrchr (filename, '/'); if (dirend > filename) *dirend = LT_EOS_CHAR; FREE (*pdir); *pdir = lt__strdup (filename); is_done = (*pdir == 0) ? -1 : 1; } return is_done; } static FILE * find_file (const char *search_path, const char *base_name, char **pdir) { FILE *file = 0; foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file); return file; } static int find_handle_callback (char *filename, void *data, void *data2) { lt_dlhandle *phandle = (lt_dlhandle *) data; int notfound = access (filename, R_OK); lt_dladvise advise = (lt_dladvise) data2; /* Bail out if file cannot be read... */ if (notfound) return 0; /* Try to dlopen the file, but do not continue searching in any case. */ if (tryall_dlopen (phandle, filename, advise, 0) != 0) *phandle = 0; return 1; } /* If HANDLE was found return it, otherwise return 0. If HANDLE was found but could not be opened, *HANDLE will be set to 0. */ static lt_dlhandle * find_handle (const char *search_path, const char *base_name, lt_dlhandle *phandle, lt_dladvise advise) { if (!search_path) return 0; if (!foreach_dirinpath (search_path, base_name, find_handle_callback, phandle, advise)) return 0; return phandle; } #if !defined LTDL_DLOPEN_DEPLIBS static int load_deplibs (lt_dlhandle handle, char * deplibs LT__UNUSED) { handle->depcount = 0; return 0; } #else /* defined LTDL_DLOPEN_DEPLIBS */ static int load_deplibs (lt_dlhandle handle, char *deplibs) { char *p, *save_search_path = 0; int depcount = 0; int i; char **names = 0; int errors = 0; handle->depcount = 0; if (!deplibs) { return errors; } ++errors; if (user_search_path) { save_search_path = lt__strdup (user_search_path); if (!save_search_path) goto cleanup; } /* extract search paths and count deplibs */ p = deplibs; while (*p) { if (!isspace ((unsigned char) *p)) { char *end = p+1; while (*end && !isspace((unsigned char) *end)) { ++end; } if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0) { char save = *end; *end = 0; /* set a temporary string terminator */ if (lt_dladdsearchdir(p+2)) { goto cleanup; } *end = save; } else { ++depcount; } p = end; } else { ++p; } } if (!depcount) { errors = 0; goto cleanup; } names = MALLOC (char *, depcount); if (!names) goto cleanup; /* now only extract the actual deplibs */ depcount = 0; p = deplibs; while (*p) { if (isspace ((unsigned char) *p)) { ++p; } else { char *end = p+1; while (*end && !isspace ((unsigned char) *end)) { ++end; } if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0) { char *name; char save = *end; *end = 0; /* set a temporary string terminator */ if (strncmp(p, "-l", 2) == 0) { size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2); name = MALLOC (char, 1+ name_len); if (name) sprintf (name, "lib%s", p+2); } else name = lt__strdup(p); if (!name) goto cleanup_names; names[depcount++] = name; *end = save; } p = end; } } /* load the deplibs (in reverse order) At this stage, don't worry if the deplibs do not load correctly, they may already be statically linked into the loading application for instance. There will be a more enlightening error message later on if the loaded module cannot resolve all of its symbols. */ if (depcount) { lt_dlhandle cur = handle; int j = 0; cur->deplibs = MALLOC (lt_dlhandle, depcount); if (!cur->deplibs) goto cleanup_names; for (i = 0; i < depcount; ++i) { cur->deplibs[j] = lt_dlopenext(names[depcount-1-i]); if (cur->deplibs[j]) { ++j; } } cur->depcount = j; /* Number of successfully loaded deplibs */ errors = 0; } cleanup_names: for (i = 0; i < depcount; ++i) { FREE (names[i]); } cleanup: FREE (names); /* restore the old search path */ if (save_search_path) { MEMREASSIGN (user_search_path, save_search_path); } return errors; } #endif /* defined LTDL_DLOPEN_DEPLIBS */ static int unload_deplibs (lt_dlhandle handle) { int i; int errors = 0; lt_dlhandle cur = handle; if (cur->depcount) { for (i = 0; i < cur->depcount; ++i) { if (!LT_DLIS_RESIDENT (cur->deplibs[i])) { errors += lt_dlclose (cur->deplibs[i]); } } FREE (cur->deplibs); } return errors; } static int trim (char **dest, const char *str) { /* remove the leading and trailing "'" from str and store the result in dest */ const char *end = strrchr (str, '\''); size_t len = LT_STRLEN (str); char *tmp; FREE (*dest); if (!end || end == str) return 1; if (len > 3 && str[0] == '\'') { tmp = MALLOC (char, end - str); if (!tmp) return 1; memcpy(tmp, &str[1], (end - str) - 1); tmp[(end - str) - 1] = LT_EOS_CHAR; *dest = tmp; } else { *dest = 0; } return 0; } /* Read the .la file FILE. */ static int parse_dotla_file(FILE *file, char **dlname, char **libdir, char **deplibs, char **old_name, int *installed) { int errors = 0; size_t line_len = LT_FILENAME_MAX; char * line = MALLOC (char, line_len); if (!line) { LT__SETERROR (FILE_NOT_FOUND); return 1; } while (!feof (file)) { line[line_len-2] = '\0'; if (!fgets (line, (int) line_len, file)) { break; } /* Handle the case where we occasionally need to read a line that is longer than the initial buffer size. Behave even if the file contains NUL bytes due to corruption. */ while (line[line_len-2] != '\0' && line[line_len-2] != '\n' && !feof (file)) { line = REALLOC (char, line, line_len *2); if (!line) { ++errors; goto cleanup; } line[line_len * 2 - 2] = '\0'; if (!fgets (&line[line_len -1], (int) line_len +1, file)) { break; } line_len *= 2; } if (line[0] == '\n' || line[0] == '#') { continue; } #undef STR_DLNAME #define STR_DLNAME "dlname=" if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0) { errors += trim (dlname, &line[sizeof (STR_DLNAME) - 1]); } #undef STR_OLD_LIBRARY #define STR_OLD_LIBRARY "old_library=" else if (strncmp (line, STR_OLD_LIBRARY, sizeof (STR_OLD_LIBRARY) - 1) == 0) { errors += trim (old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]); } /* Windows native tools do not understand the POSIX paths we store in libdir. */ #undef STR_LIBDIR #define STR_LIBDIR "libdir=" else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0) { errors += trim (libdir, &line[sizeof(STR_LIBDIR) - 1]); #ifdef __WINDOWS__ /* Disallow following unix-style paths on MinGW. */ if (*libdir && (**libdir == '/' || **libdir == '\\')) **libdir = '\0'; #endif } #undef STR_DL_DEPLIBS #define STR_DL_DEPLIBS "dependency_libs=" else if (strncmp (line, STR_DL_DEPLIBS, sizeof (STR_DL_DEPLIBS) - 1) == 0) { errors += trim (deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]); } else if (STREQ (line, "installed=yes\n")) { *installed = 1; } else if (STREQ (line, "installed=no\n")) { *installed = 0; } #undef STR_LIBRARY_NAMES #define STR_LIBRARY_NAMES "library_names=" else if (!*dlname && strncmp (line, STR_LIBRARY_NAMES, sizeof (STR_LIBRARY_NAMES) - 1) == 0) { char *last_libname; errors += trim (dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]); if (!errors && *dlname && (last_libname = strrchr (*dlname, ' ')) != 0) { last_libname = lt__strdup (last_libname + 1); if (!last_libname) { ++errors; goto cleanup; } MEMREASSIGN (*dlname, last_libname); } } if (errors) break; } cleanup: FREE (line); return errors; } /* Try to open FILENAME as a module. */ static int try_dlopen (lt_dlhandle *phandle, const char *filename, const char *ext, lt_dladvise advise) { const char * saved_error = 0; char * archive_name = 0; char * canonical = 0; char * base_name = 0; char * dir = 0; char * name = 0; char * attempt = 0; int errors = 0; lt_dlhandle newhandle; assert (phandle); assert (*phandle == 0); #ifdef LT_DEBUG_LOADERS fprintf (stderr, "try_dlopen (%s, %s)\n", filename ? filename : "(null)", ext ? ext : "(null)"); #endif LT__GETERROR (saved_error); /* dlopen self? */ if (!filename) { *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) return 1; newhandle = *phandle; /* lt_dlclose()ing yourself is very bad! Disallow it. */ newhandle->info.is_resident = 1; if (tryall_dlopen (&newhandle, 0, advise, 0) != 0) { FREE (*phandle); return 1; } goto register_handle; } assert (filename && *filename); if (ext) { attempt = MALLOC (char, LT_STRLEN (filename) + LT_STRLEN (ext) + 1); if (!attempt) return 1; sprintf(attempt, "%s%s", filename, ext); } else { attempt = lt__strdup (filename); if (!attempt) return 1; } /* Doing this immediately allows internal functions to safely assume only canonicalized paths are passed. */ if (canonicalize_path (attempt, &canonical) != 0) { ++errors; goto cleanup; } /* If the canonical module name is a path (relative or absolute) then split it into a directory part and a name part. */ base_name = strrchr (canonical, '/'); if (base_name) { size_t dirlen = (1+ base_name) - canonical; dir = MALLOC (char, 1+ dirlen); if (!dir) { ++errors; goto cleanup; } strlcpy (dir, canonical, dirlen); dir[dirlen] = LT_EOS_CHAR; ++base_name; } else MEMREASSIGN (base_name, canonical); assert (base_name && *base_name); ext = strrchr (base_name, '.'); if (!ext) { ext = base_name + LT_STRLEN (base_name); } /* extract the module name from the file name */ name = MALLOC (char, ext - base_name + 1); if (!name) { ++errors; goto cleanup; } /* canonicalize the module name */ { int i; for (i = 0; i < ext - base_name; ++i) { if (isalnum ((unsigned char)(base_name[i]))) { name[i] = base_name[i]; } else { name[i] = '_'; } } name[ext - base_name] = LT_EOS_CHAR; } /* Before trawling through the file system in search of a module, check whether we are opening a preloaded module. */ if (!dir) { const lt_dlvtable *vtable = lt_dlloader_find ("lt_preopen"); if (vtable) { /* libprefix + name + "." + libext + NULL */ archive_name = MALLOC (char, strlen (libprefix) + LT_STRLEN (name) + strlen (libext) + 2); *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if ((*phandle == NULL) || (archive_name == NULL)) { ++errors; goto cleanup; } newhandle = *phandle; /* Preloaded modules are always named according to their old archive name. */ if (strncmp(name, "lib", 3) == 0) { sprintf (archive_name, "%s%s.%s", libprefix, name + 3, libext); } else { sprintf (archive_name, "%s.%s", name, libext); } if (tryall_dlopen (&newhandle, archive_name, advise, vtable) == 0) { goto register_handle; } /* If we're still here, there was no matching preloaded module, so put things back as we found them, and continue searching. */ FREE (*phandle); newhandle = NULL; } } /* If we are allowing only preloaded modules, and we didn't find anything yet, give up on the search here. */ if (advise && advise->try_preload_only) { goto cleanup; } /* Check whether we are opening a libtool module (.la extension). */ if (ext && STREQ (ext, archive_ext)) { /* this seems to be a libtool module */ FILE * file = 0; char * dlname = 0; char * old_name = 0; char * libdir = 0; char * deplibs = 0; /* if we can't find the installed flag, it is probably an installed libtool archive, produced with an old version of libtool */ int installed = 1; /* Now try to open the .la file. If there is no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if (!dir) { const char *search_path = user_search_path; if (search_path) file = find_file (user_search_path, base_name, &dir); if (!file) { search_path = getenv (LTDL_SEARCHPATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #if defined LT_MODULE_PATH_VAR if (!file) { search_path = getenv (LT_MODULE_PATH_VAR); if (search_path) file = find_file (search_path, base_name, &dir); } #endif #if defined LT_DLSEARCH_PATH if (!file && *sys_dlsearch_path) { file = find_file (sys_dlsearch_path, base_name, &dir); } #endif } else { file = fopen (attempt, LT_READTEXT_MODE); } /* If we didn't find the file by now, it really isn't there. Set the status flag, and bail out. */ if (!file) { LT__SETERROR (FILE_NOT_FOUND); ++errors; goto cleanup; } /* read the .la file */ if (parse_dotla_file(file, &dlname, &libdir, &deplibs, &old_name, &installed) != 0) ++errors; fclose (file); /* allocate the handle */ *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) ++errors; if (errors) { FREE (dlname); FREE (old_name); FREE (libdir); FREE (deplibs); FREE (*phandle); goto cleanup; } assert (*phandle); if (load_deplibs (*phandle, deplibs) == 0) { newhandle = *phandle; /* find_module may replace newhandle */ if (find_module (&newhandle, dir, libdir, dlname, old_name, installed, advise)) { unload_deplibs (*phandle); ++errors; } } else { ++errors; } FREE (dlname); FREE (old_name); FREE (libdir); FREE (deplibs); if (errors) { FREE (*phandle); goto cleanup; } if (*phandle != newhandle) { unload_deplibs (*phandle); } } else { /* not a libtool module */ *phandle = (lt_dlhandle) lt__zalloc (sizeof (struct lt__handle)); if (*phandle == 0) { ++errors; goto cleanup; } newhandle = *phandle; /* If the module has no directory name component, try to find it first in user_search_path and then other prescribed paths. Otherwise (or in any case if the module was not yet found) try opening just the module name as passed. */ if ((dir || (!find_handle (user_search_path, base_name, &newhandle, advise) && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name, &newhandle, advise) #if defined LT_MODULE_PATH_VAR && !find_handle (getenv (LT_MODULE_PATH_VAR), base_name, &newhandle, advise) #endif #if defined LT_DLSEARCH_PATH && !find_handle (sys_dlsearch_path, base_name, &newhandle, advise) #endif ))) { if (tryall_dlopen (&newhandle, attempt, advise, 0) != 0) { newhandle = NULL; } } if (!newhandle) { FREE (*phandle); ++errors; goto cleanup; } } register_handle: MEMREASSIGN (*phandle, newhandle); if ((*phandle)->info.ref_count == 0) { (*phandle)->info.ref_count = 1; MEMREASSIGN ((*phandle)->info.name, name); (*phandle)->next = handles; handles = *phandle; } LT__SETERRORSTR (saved_error); cleanup: FREE (dir); FREE (attempt); FREE (name); if (!canonical) /* was MEMREASSIGNed */ FREE (base_name); FREE (canonical); FREE (archive_name); return errors; } /* If the last error message stored was 'FILE_NOT_FOUND', then return non-zero. */ static int file_not_found (void) { const char *error = 0; LT__GETERROR (error); if (error == LT__STRERROR (FILE_NOT_FOUND)) return 1; return 0; } /* Unless FILENAME already bears a suitable library extension, then return 0. */ static int has_library_ext (const char *filename) { const char * ext = 0; assert (filename); ext = strrchr (filename, '.'); if (ext && ((STREQ (ext, archive_ext)) #if defined LT_MODULE_EXT || (STREQ (ext, shlib_ext)) #endif #if defined LT_SHARED_EXT || (STREQ (ext, shared_ext)) #endif )) { return 1; } return 0; } /* Initialise and configure a user lt_dladvise opaque object. */ int lt_dladvise_init (lt_dladvise *padvise) { lt_dladvise advise = (lt_dladvise) lt__zalloc (sizeof (struct lt__advise)); *padvise = advise; return (advise ? 0 : 1); } int lt_dladvise_destroy (lt_dladvise *padvise) { if (padvise) FREE(*padvise); return 0; } int lt_dladvise_ext (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->try_ext = 1; return 0; } int lt_dladvise_resident (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_resident = 1; return 0; } int lt_dladvise_local (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_symlocal = 1; return 0; } int lt_dladvise_global (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->is_symglobal = 1; return 0; } int lt_dladvise_preload (lt_dladvise *padvise) { assert (padvise && *padvise); (*padvise)->try_preload_only = 1; return 0; } /* Libtool-1.5.x interface for loading a new module named FILENAME. */ lt_dlhandle lt_dlopen (const char *filename) { return lt_dlopenadvise (filename, NULL); } /* If FILENAME has an ARCHIVE_EXT or MODULE_EXT extension, try to open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT, and if a file is still not found try again with MODULE_EXT appended instead. */ lt_dlhandle lt_dlopenext (const char *filename) { lt_dlhandle handle = 0; lt_dladvise advise; if (!lt_dladvise_init (&advise) && !lt_dladvise_ext (&advise)) handle = lt_dlopenadvise (filename, advise); lt_dladvise_destroy (&advise); return handle; } lt_dlhandle lt_dlopenadvise (const char *filename, lt_dladvise advise) { lt_dlhandle handle = 0; int errors = 0; const char * saved_error = 0; LT__GETERROR (saved_error); /* Can't have symbols hidden and visible at the same time! */ if (advise && advise->is_symlocal && advise->is_symglobal) { LT__SETERROR (CONFLICTING_FLAGS); return 0; } if (!filename || !advise || !advise->try_ext || has_library_ext (filename)) { /* Just incase we missed a code path in try_dlopen() that reports an error, but forgot to reset handle... */ if (try_dlopen (&handle, filename, NULL, advise) != 0) return 0; return handle; } else if (filename && *filename) { /* First try appending ARCHIVE_EXT. */ errors += try_dlopen (&handle, filename, archive_ext, advise); /* If we found FILENAME, stop searching -- whether we were able to load the file as a module or not. If the file exists but loading failed, it is better to return an error message here than to report FILE_NOT_FOUND when the alternatives (foo.so etc) are not in the module search path. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #if defined LT_MODULE_EXT /* Try appending SHLIB_EXT. */ LT__SETERRORSTR (saved_error); errors = try_dlopen (&handle, filename, shlib_ext, advise); /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #endif #if defined LT_SHARED_EXT /* Try appending SHARED_EXT. */ LT__SETERRORSTR (saved_error); errors = try_dlopen (&handle, filename, shared_ext, advise); /* As before, if the file was found but loading failed, return now with the current error message. */ if (handle || ((errors > 0) && !file_not_found ())) return handle; #endif } /* Still here? Then we really did fail to locate any of the file names we tried. */ LT__SETERROR (FILE_NOT_FOUND); return 0; } static int lt_argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry) { error_t error; /* Prior to Sep 8, 2005, newlib had a bug where argz_insert(pargz, pargz_len, NULL, entry) failed with EINVAL. */ if (before) error = argz_insert (pargz, pargz_len, before, entry); else error = argz_append (pargz, pargz_len, entry, 1 + strlen (entry)); if (error) { switch (error) { case ENOMEM: LT__SETERROR (NO_MEMORY); break; default: LT__SETERROR (UNKNOWN); break; } return 1; } return 0; } static int lt_argz_insertinorder (char **pargz, size_t *pargz_len, const char *entry) { char *before = 0; assert (pargz); assert (pargz_len); assert (entry && *entry); if (*pargz) while ((before = argz_next (*pargz, *pargz_len, before))) { int cmp = strcmp (entry, before); if (cmp < 0) break; if (cmp == 0) return 0; /* No duplicates! */ } return lt_argz_insert (pargz, pargz_len, before, entry); } static int lt_argz_insertdir (char **pargz, size_t *pargz_len, const char *dirnam, struct dirent *dp) { char *buf = 0; size_t buf_len = 0; char *end = 0; size_t end_offset = 0; size_t dir_len = 0; int errors = 0; assert (pargz); assert (pargz_len); assert (dp); dir_len = LT_STRLEN (dirnam); end = dp->d_name + D_NAMLEN(dp); /* Ignore version numbers. */ { char *p; for (p = end; p -1 > dp->d_name; --p) if (strchr (".0123456789", p[-1]) == 0) break; if (*p == '.') end = p; } /* Ignore filename extension. */ { char *p; for (p = end -1; p > dp->d_name; --p) if (*p == '.') { end = p; break; } } /* Prepend the directory name. */ end_offset = end - dp->d_name; buf_len = dir_len + 1+ end_offset; buf = MALLOC (char, 1+ buf_len); if (!buf) return ++errors; assert (buf); strcpy (buf, dirnam); strcat (buf, "/"); strncat (buf, dp->d_name, end_offset); buf[buf_len] = LT_EOS_CHAR; /* Try to insert (in order) into ARGZ/ARGZ_LEN. */ if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0) ++errors; FREE (buf); return errors; } static int list_files_by_dir (const char *dirnam, char **pargz, size_t *pargz_len) { DIR *dirp = 0; int errors = 0; assert (dirnam && *dirnam); assert (pargz); assert (pargz_len); assert (dirnam[LT_STRLEN(dirnam) -1] != '/'); dirp = opendir (dirnam); if (dirp) { struct dirent *dp = 0; while ((dp = readdir (dirp))) if (dp->d_name[0] != '.') if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp)) { ++errors; break; } closedir (dirp); } else ++errors; return errors; } /* If there are any files in DIRNAME, call the function passed in DATA1 (with the name of each file and DATA2 as arguments). */ static int foreachfile_callback (char *dirname, void *data1, void *data2) { file_worker_func *func = *(file_worker_func **) data1; int is_done = 0; char *argz = 0; size_t argz_len = 0; if (list_files_by_dir (dirname, &argz, &argz_len) != 0) goto cleanup; if (!argz) goto cleanup; { char *filename = 0; while ((filename = argz_next (argz, argz_len, filename))) if ((is_done = (*func) (filename, data2))) break; } cleanup: FREE (argz); return is_done; } /* Call FUNC for each unique extensionless file in SEARCH_PATH, along with DATA. The filenames passed to FUNC would be suitable for passing to lt_dlopenext. The extensions are stripped so that individual modules do not generate several entries (e.g. libfoo.la, libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL, then the same directories that lt_dlopen would search are examined. */ int lt_dlforeachfile (const char *search_path, int (*func) (const char *filename, void *data), void *data) { int is_done = 0; file_worker_func **fpptr = &func; if (search_path) { /* If a specific path was passed, search only the directories listed in it. */ is_done = foreach_dirinpath (search_path, 0, foreachfile_callback, fpptr, data); } else { /* Otherwise search the default paths. */ is_done = foreach_dirinpath (user_search_path, 0, foreachfile_callback, fpptr, data); if (!is_done) { is_done = foreach_dirinpath (getenv(LTDL_SEARCHPATH_VAR), 0, foreachfile_callback, fpptr, data); } #if defined LT_MODULE_PATH_VAR if (!is_done) { is_done = foreach_dirinpath (getenv(LT_MODULE_PATH_VAR), 0, foreachfile_callback, fpptr, data); } #endif #if defined LT_DLSEARCH_PATH if (!is_done && *sys_dlsearch_path) { is_done = foreach_dirinpath (sys_dlsearch_path, 0, foreachfile_callback, fpptr, data); } #endif } return is_done; } int lt_dlclose (lt_dlhandle handle) { lt_dlhandle cur, last; int errors = 0; /* check whether the handle is valid */ last = cur = handles; while (cur && handle != cur) { last = cur; cur = cur->next; } if (!cur) { LT__SETERROR (INVALID_HANDLE); ++errors; goto done; } cur = handle; cur->info.ref_count--; /* Note that even with resident modules, we must track the ref_count correctly incase the user decides to reset the residency flag later (even though the API makes no provision for that at the moment). */ if (cur->info.ref_count <= 0 && !LT_DLIS_RESIDENT (cur)) { lt_user_data data = cur->vtable->dlloader_data; if (cur != handles) { last->next = cur->next; } else { handles = cur->next; } errors += cur->vtable->module_close (data, cur->module); errors += unload_deplibs (handle); /* It is up to the callers to free the data itself. */ FREE (cur->interface_data); FREE (cur->info.filename); FREE (cur->info.name); FREE (cur); goto done; } if (LT_DLIS_RESIDENT (handle)) { LT__SETERROR (CLOSE_RESIDENT_MODULE); ++errors; } done: return errors; } void * lt_dlsym (lt_dlhandle place, const char *symbol) { size_t lensym; char lsym[LT_SYMBOL_LENGTH]; char *sym; void *address; lt_user_data data; lt_dlhandle handle; if (!place) { LT__SETERROR (INVALID_HANDLE); return 0; } handle = place; if (!symbol) { LT__SETERROR (SYMBOL_NOT_FOUND); return 0; } lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->vtable->sym_prefix) + LT_STRLEN (handle->info.name); if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH) { sym = lsym; } else { sym = MALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1); if (!sym) { LT__SETERROR (BUFFER_OVERFLOW); return 0; } } data = handle->vtable->dlloader_data; if (handle->info.name) { const char *saved_error; LT__GETERROR (saved_error); /* this is a libtool module */ if (handle->vtable->sym_prefix) { strcpy(sym, handle->vtable->sym_prefix); strcat(sym, handle->info.name); } else { strcpy(sym, handle->info.name); } strcat(sym, "_LTX_"); strcat(sym, symbol); /* try "modulename_LTX_symbol" */ address = handle->vtable->find_sym (data, handle->module, sym); if (address) { if (sym != lsym) { FREE (sym); } return address; } LT__SETERRORSTR (saved_error); } /* otherwise try "symbol" */ if (handle->vtable->sym_prefix) { strcpy(sym, handle->vtable->sym_prefix); strcat(sym, symbol); } else { strcpy(sym, symbol); } address = handle->vtable->find_sym (data, handle->module, sym); if (sym != lsym) { FREE (sym); } return address; } const char * lt_dlerror (void) { const char *error; LT__GETERROR (error); LT__SETERRORSTR (0); return error; } static int lt_dlpath_insertdir (char **ppath, char *before, const char *dir) { int errors = 0; char *canonical = 0; char *argz = 0; size_t argz_len = 0; assert (ppath); assert (dir && *dir); if (canonicalize_path (dir, &canonical) != 0) { ++errors; goto cleanup; } assert (canonical && *canonical); /* If *PPATH is empty, set it to DIR. */ if (*ppath == 0) { assert (!before); /* BEFORE cannot be set without PPATH. */ assert (dir); /* Without DIR, don't call this function! */ *ppath = lt__strdup (dir); if (*ppath == 0) ++errors; goto cleanup; } assert (ppath && *ppath); if (argzize_path (*ppath, &argz, &argz_len) != 0) { ++errors; goto cleanup; } /* Convert BEFORE into an equivalent offset into ARGZ. This only works if *PPATH is already canonicalized, and hence does not change length with respect to ARGZ. We canonicalize each entry as it is added to the search path, and don't call this function with (uncanonicalized) user paths, so this is a fair assumption. */ if (before) { assert (*ppath <= before); assert ((int) (before - *ppath) <= (int) strlen (*ppath)); before = before - *ppath + argz; } if (lt_argz_insert (&argz, &argz_len, before, dir) != 0) { ++errors; goto cleanup; } argz_stringify (argz, argz_len, LT_PATHSEP_CHAR); MEMREASSIGN(*ppath, argz); cleanup: FREE (argz); FREE (canonical); return errors; } int lt_dladdsearchdir (const char *search_dir) { int errors = 0; if (search_dir && *search_dir) { if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0) ++errors; } return errors; } int lt_dlinsertsearchdir (const char *before, const char *search_dir) { int errors = 0; if (before) { if ((before < user_search_path) || (before >= user_search_path + LT_STRLEN (user_search_path))) { LT__SETERROR (INVALID_POSITION); return 1; } } if (search_dir && *search_dir) { if (lt_dlpath_insertdir (&user_search_path, (char *) before, search_dir) != 0) { ++errors; } } return errors; } int lt_dlsetsearchpath (const char *search_path) { int errors = 0; FREE (user_search_path); if (!search_path || !LT_STRLEN (search_path)) { return errors; } if (canonicalize_path (search_path, &user_search_path) != 0) ++errors; return errors; } const char * lt_dlgetsearchpath (void) { const char *saved_path; saved_path = user_search_path; return saved_path; } int lt_dlmakeresident (lt_dlhandle handle) { int errors = 0; if (!handle) { LT__SETERROR (INVALID_HANDLE); ++errors; } else { handle->info.is_resident = 1; } return errors; } int lt_dlisresident (lt_dlhandle handle) { if (!handle) { LT__SETERROR (INVALID_HANDLE); return -1; } return LT_DLIS_RESIDENT (handle); } /* --- MODULE INFORMATION --- */ typedef struct { char *id_string; lt_dlhandle_interface *iface; } lt__interface_id; lt_dlinterface_id lt_dlinterface_register (const char *id_string, lt_dlhandle_interface *iface) { lt__interface_id *interface_id = (lt__interface_id *) lt__malloc (sizeof *interface_id); /* If lt__malloc fails, it will LT__SETERROR (NO_MEMORY), which can then be detected with lt_dlerror() if we return 0. */ if (interface_id) { interface_id->id_string = lt__strdup (id_string); if (!interface_id->id_string) FREE (interface_id); else interface_id->iface = iface; } return (lt_dlinterface_id) interface_id; } void lt_dlinterface_free (lt_dlinterface_id key) { lt__interface_id *interface_id = (lt__interface_id *)key; FREE (interface_id->id_string); FREE (interface_id); } void * lt_dlcaller_set_data (lt_dlinterface_id key, lt_dlhandle handle, void *data) { int n_elements = 0; void *stale = (void *) 0; lt_dlhandle cur = handle; int i; if (cur->interface_data) while (cur->interface_data[n_elements].key) ++n_elements; for (i = 0; i < n_elements; ++i) { if (cur->interface_data[i].key == key) { stale = cur->interface_data[i].data; break; } } /* Ensure that there is enough room in this handle's interface_data array to accept a new element (and an empty end marker). */ if (i == n_elements) { lt_interface_data *temp = REALLOC (lt_interface_data, cur->interface_data, 2+ n_elements); if (!temp) { stale = 0; goto done; } cur->interface_data = temp; /* We only need this if we needed to allocate a new interface_data. */ cur->interface_data[i].key = key; cur->interface_data[1+ i].key = 0; } cur->interface_data[i].data = data; done: return stale; } void * lt_dlcaller_get_data (lt_dlinterface_id key, lt_dlhandle handle) { void *result = (void *) 0; lt_dlhandle cur = handle; /* Locate the index of the element with a matching KEY. */ if (cur->interface_data) { int i; for (i = 0; cur->interface_data[i].key; ++i) { if (cur->interface_data[i].key == key) { result = cur->interface_data[i].data; break; } } } return result; } const lt_dlinfo * lt_dlgetinfo (lt_dlhandle handle) { if (!handle) { LT__SETERROR (INVALID_HANDLE); return 0; } return &(handle->info); } lt_dlhandle lt_dlhandle_iterate (lt_dlinterface_id iface, lt_dlhandle place) { lt_dlhandle handle = place; lt__interface_id *iterator = (lt__interface_id *) iface; assert (iface); /* iface is a required argument */ if (!handle) handle = handles; else handle = handle->next; /* advance while the interface check fails */ while (handle && iterator->iface && ((*iterator->iface) (handle, iterator->id_string) != 0)) { handle = handle->next; } return handle; } lt_dlhandle lt_dlhandle_fetch (lt_dlinterface_id iface, const char *module_name) { lt_dlhandle handle = 0; assert (iface); /* iface is a required argument */ while ((handle = lt_dlhandle_iterate (iface, handle))) { lt_dlhandle cur = handle; if (cur && cur->info.name && STREQ (cur->info.name, module_name)) break; } return handle; } int lt_dlhandle_map (lt_dlinterface_id iface, int (*func) (lt_dlhandle handle, void *data), void *data) { lt__interface_id *iterator = (lt__interface_id *) iface; lt_dlhandle cur = handles; assert (iface); /* iface is a required argument */ while (cur) { int errorcode = 0; /* advance while the interface check fails */ while (cur && iterator->iface && ((*iterator->iface) (cur, iterator->id_string) != 0)) { cur = cur->next; } if ((errorcode = (*func) (cur, data)) != 0) return errorcode; } return 0; } JAGS-4.3.2/libltdl/slist.c0000644000175000017500000002316114214520133012113 00000000000000/* slist.c -- generalised singly linked lists Copyright (C) 2000, 2004, 2007-2009, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2000 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include "slist.h" #include static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata); /* Call DELETE repeatedly on each element of HEAD. CAVEAT: If you call this when HEAD is the start of a list of boxed items, you must remember that each item passed back to your DELETE function will be a boxed item that must be slist_unbox()ed before operating on its contents. e.g. void boxed_delete (void *item) { item_free (slist_unbox (item)); } ... slist = slist_delete (slist, boxed_delete); ... */ SList * slist_delete (SList *head, void (*delete_fct) (void *item)) { assert (delete_fct); while (head) { SList *next = head->next; (*delete_fct) (head); head = next; } return 0; } /* Call FIND repeatedly with MATCHDATA and each item of *PHEAD, until FIND returns non-NULL, or the list is exhausted. If a match is found the matching item is destructively removed from *PHEAD, and the value returned by the matching call to FIND is returned. CAVEAT: To avoid memory leaks, unless you already have the address of the stale item, you should probably return that from FIND if it makes a successful match. Don't forget to slist_unbox() every item in a boxed list before operating on its contents. */ SList * slist_remove (SList **phead, SListCallback *find, void *matchdata) { SList *stale = 0; void *result = 0; assert (find); if (!phead || !*phead) return 0; /* Does the head of the passed list match? */ result = (*find) (*phead, matchdata); if (result) { stale = *phead; *phead = stale->next; } /* what about the rest of the elements? */ else { SList *head; for (head = *phead; head->next; head = head->next) { result = (*find) (head->next, matchdata); if (result) { stale = head->next; head->next = stale->next; break; } } } return (SList *) result; } /* Call FIND repeatedly with each element of SLIST and MATCHDATA, until FIND returns non-NULL, or the list is exhausted. If a match is found the value returned by the matching call to FIND is returned. */ void * slist_find (SList *slist, SListCallback *find, void *matchdata) { void *result = 0; assert (find); for (; slist; slist = slist->next) { result = (*find) (slist, matchdata); if (result) break; } return result; } /* Return a single list, composed by destructively concatenating the items in HEAD and TAIL. The values of HEAD and TAIL are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_concat (slist1, slist2); */ SList * slist_concat (SList *head, SList *tail) { SList *last; if (!head) { return tail; } last = head; while (last->next) last = last->next; last->next = tail; return head; } /* Return a single list, composed by destructively appending all of the items in SLIST to ITEM. The values of ITEM and SLIST are undefined after calling this function. CAVEAT: Don't mix boxed and unboxed items in a single list. e.g. slist1 = slist_cons (slist_box (data), slist1); */ SList * slist_cons (SList *item, SList *slist) { if (!item) { return slist; } assert (!item->next); item->next = slist; return item; } /* Return a list starting at the second item of SLIST. */ SList * slist_tail (SList *slist) { return slist ? slist->next : NULL; } /* Return a list starting at the Nth item of SLIST. If SLIST is less than N items long, NULL is returned. Just to be confusing, list items are counted from 1, to get the 2nd element of slist: e.g. shared_list = slist_nth (slist, 2); */ SList * slist_nth (SList *slist, size_t n) { for (;n > 1 && slist; n--) slist = slist->next; return slist; } /* Return the number of items in SLIST. We start counting from 1, so the length of a list with no items is 0, and so on. */ size_t slist_length (SList *slist) { size_t n; for (n = 0; slist; ++n) slist = slist->next; return n; } /* Destructively reverse the order of items in SLIST. The value of SLIST is undefined after calling this function. CAVEAT: You must store the result of this function, or you might not be able to get all the items except the first one back again. e.g. slist = slist_reverse (slist); */ SList * slist_reverse (SList *slist) { SList *result = 0; SList *next; while (slist) { next = slist->next; slist->next = result; result = slist; slist = next; } return result; } /* Call FOREACH once for each item in SLIST, passing both the item and USERDATA on each call. */ void * slist_foreach (SList *slist, SListCallback *foreach, void *userdata) { void *result = 0; assert (foreach); while (slist) { SList *next = slist->next; result = (*foreach) (slist, userdata); if (result) break; slist = next; } return result; } /* Destructively merge the items of two ordered lists LEFT and RIGHT, returning a single sorted list containing the items of both -- Part of the quicksort algorithm. The values of LEFT and RIGHT are undefined after calling this function. At each iteration, add another item to the merged list by taking the lowest valued item from the head of either LEFT or RIGHT, determined by passing those items and USERDATA to COMPARE. COMPARE should return less than 0 if the head of LEFT has the lower value, greater than 0 if the head of RIGHT has the lower value, otherwise 0. */ static SList * slist_sort_merge (SList *left, SList *right, SListCompare *compare, void *userdata) { SList merged, *insert; insert = &merged; while (left && right) { if ((*compare) (left, right, userdata) <= 0) { insert = insert->next = left; left = left->next; } else { insert = insert->next = right; right = right->next; } } insert->next = left ? left : right; return merged.next; } /* Perform a destructive quicksort on the items in SLIST, by repeatedly calling COMPARE with a pair of items from SLIST along with USERDATA at every iteration. COMPARE is a function as defined above for slist_sort_merge(). The value of SLIST is undefined after calling this function. e.g. slist = slist_sort (slist, compare, 0); */ SList * slist_sort (SList *slist, SListCompare *compare, void *userdata) { SList *left, *right; if (!slist) return slist; /* Be sure that LEFT and RIGHT never contain the same item. */ left = slist; right = slist->next; if (!right) return left; /* Skip two items with RIGHT and one with SLIST, until RIGHT falls off the end. SLIST must be about half way along. */ while (right && (right = right->next)) { if (!right || !(right = right->next)) break; slist = slist->next; } right = slist->next; slist->next = 0; /* Sort LEFT and RIGHT, then merge the two. */ return slist_sort_merge (slist_sort (left, compare, userdata), slist_sort (right, compare, userdata), compare, userdata); } /* Aside from using the functions above to manage chained structures of any type that has a NEXT pointer as its first field, SLISTs can be comprised of boxed items. The boxes are chained together in that case, so there is no need for a NEXT field in the item proper. Some care must be taken to slist_box and slist_unbox each item in a boxed list at the appropriate points to avoid leaking the memory used for the boxes. It us usually a very bad idea to mix boxed and non-boxed items in a single list. */ /* Return a 'boxed' freshly mallocated 1 element list containing USERDATA. */ SList * slist_box (const void *userdata) { SList *item = (SList *) malloc (sizeof *item); if (item) { item->next = 0; item->userdata = userdata; } return item; } /* Return the contents of a 'boxed' ITEM, recycling the box itself. */ void * slist_unbox (SList *item) { void *userdata = 0; if (item) { /* Strip the const, because responsibility for this memory passes to the caller on return. */ userdata = (void *) item->userdata; free (item); } return userdata; } JAGS-4.3.2/libltdl/lt__dirent.c0000644000175000017500000000572414214520133013105 00000000000000/* lt__dirent.c -- internal directory entry scanning interface Copyright (C) 2001, 2004, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2001 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "lt__private.h" #include #include "lt__dirent.h" #if defined __WINDOWS__ void closedir (DIR *entry) { assert (entry != (DIR *) NULL); FindClose (entry->hSearch); free (entry); } DIR * opendir (const char *path) { char file_spec[LT_FILENAME_MAX]; DIR *entry; assert (path != (char *) 0); if (lt_strlcpy (file_spec, path, sizeof file_spec) >= sizeof file_spec || lt_strlcat (file_spec, "\\", sizeof file_spec) >= sizeof file_spec) return (DIR *) 0; entry = (DIR *) malloc (sizeof(DIR)); if (entry != (DIR *) 0) { entry->firsttime = TRUE; entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData); if (entry->hSearch == INVALID_HANDLE_VALUE) { if (lt_strlcat (file_spec, "\\*.*", sizeof file_spec) < sizeof file_spec) { entry->hSearch = FindFirstFile (file_spec, &entry->Win32FindData); } if (entry->hSearch == INVALID_HANDLE_VALUE) { entry = (free (entry), (DIR *) 0); } } } return entry; } struct dirent * readdir (DIR *entry) { int status; if (entry == (DIR *) 0) return (struct dirent *) 0; if (!entry->firsttime) { status = FindNextFile (entry->hSearch, &entry->Win32FindData); if (status == 0) return (struct dirent *) 0; } entry->firsttime = FALSE; if (lt_strlcpy (entry->file_info.d_name, entry->Win32FindData.cFileName, sizeof entry->file_info.d_name) >= sizeof entry->file_info.d_name) return (struct dirent *) 0; entry->file_info.d_namlen = strlen (entry->file_info.d_name); return &entry->file_info; } #endif /*defined __WINDOWS__*/ JAGS-4.3.2/libltdl/lt__strl.c0000644000175000017500000000705014214520133012576 00000000000000/* lt__strl.c -- size-bounded string copying and concatenation Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Bob Friesenhahn, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include #include #include "lt__strl.h" /* lt_strlcat appends the NULL-terminated string src to the end of dst. It will append at most dstsize - strlen(dst) - 1 bytes, NULL-terminating the result. The total length of the string that would have been created given sufficient buffer size (may be longer than dstsize) is returned. This function substitutes for strlcat(), which is available under NetBSD, FreeBSD and Solaris 9. Buffer overflow can be checked as follows: if (lt_strlcat(dst, src, dstsize) >= dstsize) return -1; */ #if !defined HAVE_STRLCAT size_t lt_strlcat(char *dst, const char *src, const size_t dstsize) { size_t length; char *p; const char *q; assert(dst != NULL); assert(src != (const char *) NULL); assert(dstsize >= 1); length=strlen(dst); /* Copy remaining characters from src while constraining length to size - 1. */ for ( p = dst + length, q = src; (*q != 0) && (length < dstsize - 1); length++, p++, q++ ) *p = *q; dst[length]='\0'; /* Add remaining length of src to length. */ while (*q++) length++; return length; } #endif /* !defined HAVE_STRLCAT */ /* lt_strlcpy copies up to dstsize - 1 characters from the NULL-terminated string src to dst, NULL-terminating the result. The total length of the string that would have been created given sufficient buffer size (may be longer than dstsize) is returned. This function substitutes for strlcpy(), which is available under OpenBSD, FreeBSD and Solaris 9. Buffer overflow can be checked as follows: if (lt_strlcpy(dst, src, dstsize) >= dstsize) return -1; */ #if !defined HAVE_STRLCPY size_t lt_strlcpy(char *dst, const char *src, const size_t dstsize) { size_t length=0; char *p; const char *q; assert(dst != NULL); assert(src != (const char *) NULL); assert(dstsize >= 1); /* Copy src to dst within bounds of size-1. */ for ( p=dst, q=src, length=0; (*q != 0) && (length < dstsize-1); length++, p++, q++ ) *p = *q; dst[length]='\0'; /* Add remaining length of src to length. */ while (*q++) length++; return length; } #endif /* !defined HAVE_STRLCPY */ JAGS-4.3.2/libltdl/lt__argz.c0000644000175000017500000001342314214520133012556 00000000000000/* lt__argz.c -- argz implementation for non-glibc systems Copyright (C) 2004, 2006-2008, 2011-2019, 2021-2022 Free Software Foundation, Inc. Written by Gary V. Vaughan, 2004 NOTE: The canonical source of this file is maintained with the GNU Libtool package. Report bugs to bug-libtool@gnu.org. GNU Libltdl is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. As a special exception to the GNU Lesser General Public License, if you distribute this file as part of a program or library that is built using GNU Libtool, you may include this file under the same distribution terms that you use for the rest of that program. GNU Libltdl 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with GNU Libltdl; see the file COPYING.LIB. If not, a copy can be downloaded from http://www.gnu.org/licenses/lgpl.html, or obtained by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #if defined LTDL && defined LT_CONFIG_H # include LT_CONFIG_H #else # include #endif #include #include #include #include #include #include #define EOS_CHAR '\0' error_t argz_append (char **pargz, size_t *pargz_len, const char *buf, size_t buf_len) { size_t argz_len; char *argz; assert (pargz); assert (pargz_len); assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len)); /* If nothing needs to be appended, no more work is required. */ if (buf_len == 0) return 0; /* Ensure there is enough room to append BUF_LEN. */ argz_len = *pargz_len + buf_len; argz = (char *) realloc (*pargz, argz_len); if (!argz) return ENOMEM; /* Copy characters from BUF after terminating '\0' in ARGZ. */ memcpy (argz + *pargz_len, buf, buf_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } error_t argz_create_sep (const char *str, int delim, char **pargz, size_t *pargz_len) { size_t argz_len; char *argz = 0; assert (str); assert (pargz); assert (pargz_len); /* Make a copy of STR, but replacing each occurrence of DELIM with '\0'. */ argz_len = 1+ strlen (str); if (argz_len) { const char *p; char *q; argz = (char *) malloc (argz_len); if (!argz) return ENOMEM; for (p = str, q = argz; *p != EOS_CHAR; ++p) { if (*p == delim) { /* Ignore leading delimiters, and fold consecutive delimiters in STR into a single '\0' in ARGZ. */ if ((q > argz) && (q[-1] != EOS_CHAR)) *q++ = EOS_CHAR; else --argz_len; } else *q++ = *p; } /* Copy terminating EOS_CHAR. */ *q = *p; } /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */ if (!argz_len) argz = (free (argz), (char *) 0); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; return 0; } error_t argz_insert (char **pargz, size_t *pargz_len, char *before, const char *entry) { assert (pargz); assert (pargz_len); assert (entry && *entry); /* No BEFORE address indicates ENTRY should be inserted after the current last element. */ if (!before) return argz_append (pargz, pargz_len, entry, 1+ strlen (entry)); /* This probably indicates a programmer error, but to preserve semantics, scan back to the start of an entry if BEFORE points into the middle of it. */ while ((before > *pargz) && (before[-1] != EOS_CHAR)) --before; { size_t entry_len = 1+ strlen (entry); size_t argz_len = *pargz_len + entry_len; size_t offset = before - *pargz; char *argz = (char *) realloc (*pargz, argz_len); if (!argz) return ENOMEM; /* Make BEFORE point to the equivalent offset in ARGZ that it used to have in *PARGZ incase realloc() moved the block. */ before = argz + offset; /* Move the ARGZ entries starting at BEFORE up into the new space at the end -- making room to copy ENTRY into the resulting gap. */ memmove (before + entry_len, before, *pargz_len - offset); memcpy (before, entry, entry_len); /* Assign new values. */ *pargz = argz; *pargz_len = argz_len; } return 0; } char * argz_next (char *argz, size_t argz_len, const char *entry) { assert ((argz && argz_len) || (!argz && !argz_len)); if (entry) { /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address within the ARGZ vector. */ assert ((!argz && !argz_len) || ((argz <= entry) && (entry < (argz + argz_len)))); /* Move to the char immediately after the terminating '\0' of ENTRY. */ entry = 1+ strchr (entry, EOS_CHAR); /* Return either the new ENTRY, or else NULL if ARGZ is exhausted. */ return (entry >= argz + argz_len) ? 0 : (char *) entry; } else { /* This should probably be flagged as a programmer error, since starting an argz_next loop with the iterator set to ARGZ is safer. To preserve semantics, handle the NULL case by returning the start of ARGZ (if any). */ if (argz_len > 0) return argz; else return 0; } } void argz_stringify (char *argz, size_t argz_len, int sep) { assert ((argz && argz_len) || (!argz && !argz_len)); if (sep) { --argz_len; /* don't stringify the terminating EOS */ while (--argz_len > 0) { if (argz[argz_len] == EOS_CHAR) argz[argz_len] = sep; } } } JAGS-4.3.2/src/0000755000175000017500000000000014400711327010033 500000000000000JAGS-4.3.2/src/Makefile.am0000664000175000017500000000005614224052371012013 00000000000000SUBDIRS = include lib jrmath modules terminal JAGS-4.3.2/src/Makefile.in0000644000175000017500000004625014400675235012036 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = include lib jrmath modules terminal all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/0000755000175000017500000000000014400711324011453 500000000000000JAGS-4.3.2/src/include/Makefile.am0000664000175000017500000000024614224052514013436 00000000000000pkginclude_HEADERS = Console.h JRmath.h version.h SUBDIRS = compiler distribution function graph model sampler sarray \ rng util module noinst_HEADERS = testlib.h JAGS-4.3.2/src/include/testlib.h0000664000175000017500000000146714224052371013230 00000000000000#ifndef TEST_LIB_H_ #define TEST_LIB_H_ #include //A mix-in class for test fixtures that provides some useful constants class JAGSFixture { public: JAGSFixture(); protected: //tolerance for equality tests double tol; //Logical vectors of length 1 std::vector F; //False std::vector T; //True //Logical vectors of length 2 std::vector FF; //False, False std::vector FT; std::vector TF; std::vector TT; //Logical vectors of length 3 std::vector FFF; //False, False, False std::vector FFT; std::vector FTF; std::vector FTT; std::vector TFF; std::vector TFT; std::vector TTF; std::vector TTT; }; #endif /* TEST_LIB_H */ JAGS-4.3.2/src/include/Console.h0000664000175000017500000001674514224052514013170 00000000000000 #ifndef CONSOLE_H_ #define CONSOLE_H_ #include #include #include #include #include #include #include namespace jags { class BUGSModel; class ParseTree; struct RNG; class Module; /** * @short Flags for the function Console#dumpState */ enum DumpType {DUMP_DATA, DUMP_PARAMETERS, DUMP_ALL}; /** * @short Enumerates factory types in a model */ enum FactoryType {SAMPLER_FACTORY, MONITOR_FACTORY, RNG_FACTORY}; /** * @short Interface to the JAGS library */ class Console { std::ostream &_out; std::ostream &_err; BUGSModel *_model; ParseTree *_pdata; ParseTree *_prelations; std::vector *_pvariables; std::vector _array_names; static unsigned int &rngSeed(); public: /** * Constructor * * @param out Output stream to which information messages will be printed. * * @param err Output stream to which error messages will be printed. * */ Console(std::ostream &out, std::ostream &err); ~Console(); /** * Checks syntactic correctness of model * * @param file containing BUGS-language description of the model * * @return true on success or false on error. */ bool checkModel(std::FILE *file); /** * Compiles the model. * * @param data_table Map relating the names of the observed variables * to their values. * * @param nchain Number of chains in the model. * * @param gendata Boolean flag indicating whether the data generation * sub-model should be run, if there is one. * * @return true on success or false on error. */ bool compile(std::map &data_table, unsigned int nchain, bool gendata); /** * @short Sets the parameters (unobserved variables) of the model. * * This is normally done to supply initial values to the model but * may also be done at any point in the chain. * * @param param_table Map relating the names of the parameters to * their values * * @param chain Number of chain (starting from 1) to apply parameter * values to * * @return true on success, false on failure. */ bool setParameters(std::map const ¶m_table, unsigned int chain); /** * Sets the name of the RNG for the given chain. The Console searches * through all loaded RNGFactories to find one that will generate an * RNG object with the given name. * * @return true on success, false on failure. */ bool setRNGname(std::string const &name, unsigned int chain); /** * @short Initializes the model. * * Any uninitialized parameters are given values by deterministic forward * sampling. Then default RNGs are chosen for all chains that have not * already had their RNG set, based on the list of RNGFactory objects. * Finally, the samplers are chosen based for the unobserved * stochastic nodes based on the list of sampler factories. * * @returns true on success, false on failure. * * @see Model#samplerFactories, Model#rngFactories */ bool initialize(); /** * @short Updates the Markov chain generated by the model. * * @param n Number of iterations of the Markov chain. * * @returns true on success, false on failure. */ bool update (unsigned int n); /** * Sets a monitor for a subset of the given node array * * @param name Name of array containing nodes to be monitored * * @param range Range describing subset of named array to monitor. * A NULL range may be given, in which case, the whole array is * monitored. * * @param thin Thinning interval for the monitor * * @param type Name of the monitor type. * */ bool setMonitor(std::string const &name, Range const &range, unsigned int thin, std::string const &type); /** * @short Clears a monitor. * * The arguments name, range and type must correspond exactly to * a previous call to setMonitor. */ bool clearMonitor(std::string const &name, Range const &range, std::string const &type); /** * @short Dumps the state of the model. * * Writes the current values of the variables to the data table. * * @param data_table Data table to receive values. This must be * initially empty. * * @param rng_name String which will be overwritten with the name * of the RNG for this chain. * * @param type Flag describing which values in the model to dump. * DUMP_DATA dumps the observed stochastic nodes, DUMP_PARAMETERS * dumps the unobserved stochastic nodes, and DUMP_ALL, dumps the values * of all named nodes in the model. * * @param chain Number of the chain for which to dump values (starting * from 1). */ bool dumpState(std::map &data_table, std::string &rng_name, DumpType type, unsigned int chain); /** * Returns the iteration number of the model. */ unsigned int iter() const; /** * Returns a vector of variable names used by the model. This vector * excludes any counters used by the model within a for loop. */ std::vector const &variableNames() const; /** * Dump the contants of monitored node in CODA format * * @param node Vector of monitored nodes to be dumped, each node * is described by the variable name and index range. If the vector * is empty then ALL monitored nodes will be dumped. * * @param prefix Prefix to be prepended to the output file names */ bool coda(std::vector > const &nodes, std::string const &prefix); bool coda(std::string const &prefix); BUGSModel const *model(); unsigned int nchain() const; bool dumpMonitors(std::map &data_table, std::string const &type, bool flat); bool dumpSamplers(std::vector > &sampler_list); /** Turns off adaptive mode of the model */ bool adaptOff(); /** Checks whether adaptation is complete */ bool checkAdaptation(bool &status); /** Indicates whether model is in adaptive mode */ bool isAdapting() const; /** Clears the model */ void clearModel(); /** * Loads a module by name */ static bool loadModule(std::string const &name); /** * Unloads a module by name */ static bool unloadModule(std::string const &name); /** * Returns a vector containing the names of loaded modules */ static std::vector listModules(); /** * Returns a vector containing the names of currently loaded factories * and whether or not they are active. */ static std::vector > listFactories(FactoryType type); /** * Sets a factory to be active or inactive */ static bool setFactoryActive(std::string const &name, FactoryType type, bool active); /** * Sets the seed for all RNG factories. * * Sets the seed for all currently loaded RNGFactory objects, * including the ones that are currently active. After a call to * setSeed, all RNGFactory objects in subsequently loaded Modules * will have their seeds set to the given value. * * @param seed Unsigned integer giving a random seed. The seed must * be positive: a zero seed will have no effect. * * @see RNGFactory#setSeed */ static void setRNGSeed(unsigned int seed); }; } /* namespace jags */ #endif /* CONSOLE_H_ */ JAGS-4.3.2/src/include/JRmath.h0000664000175000017500000004166314224052371012751 00000000000000/* This is MODIFIED version of R's Mathlib */ /* -*- C -*- * Mathlib : A C Library of Special Functions * Copyright (C) 1998-2013 The R Core Team * Copyright (C) 2004 The R Foundation * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, a copy is available at * http://www.r-project.org/Licenses/ * * Rmath.h should contain ALL headers from R's C code in `src/nmath' ------- such that ``the Math library'' can be used by simply ``#include '' and nothing else. It is part of the API and supports 'standalone Rmath'. */ #ifndef RMATH_H #define RMATH_H /* Note that on some systems we need to include math.h before the defines below. */ #ifndef NO_C_HEADERS # define __STDC_WANT_IEC_60559_TYPES_EXT__ 1 # include #endif #define R_VERSION_STRING "3.1.1" /* Undo SGI Madness */ #ifdef __sgi # ifdef ftrunc # undef ftrunc # endif # ifdef qexp # undef qexp # endif # ifdef qgamma # undef qgamma # endif #endif /* ----- The following constants and entry points are part of the R API ---- */ /* 30 Decimal-place constants */ /* Computed with bc -l (scale=32; proper round) */ /* SVID & X/Open Constants */ /* Names from Solaris math.h */ #ifndef M_E #define M_E 2.718281828459045235360287471353 /* e */ #endif #ifndef M_LOG2E #define M_LOG2E 1.442695040888963407359924681002 /* log2(e) */ #endif #ifndef M_LOG10E #define M_LOG10E 0.434294481903251827651128918917 /* log10(e) */ #endif #ifndef M_LN2 #define M_LN2 0.693147180559945309417232121458 /* ln(2) */ #endif #ifndef M_LN10 #define M_LN10 2.302585092994045684017991454684 /* ln(10) */ #endif #ifndef M_PI #define M_PI 3.141592653589793238462643383280 /* pi */ #endif #ifndef M_2PI #define M_2PI 6.283185307179586476925286766559 /* 2*pi */ #endif #ifndef M_PI_2 #define M_PI_2 1.570796326794896619231321691640 /* pi/2 */ #endif #ifndef M_PI_4 #define M_PI_4 0.785398163397448309615660845820 /* pi/4 */ #endif #ifndef M_1_PI #define M_1_PI 0.318309886183790671537767526745 /* 1/pi */ #endif #ifndef M_2_PI #define M_2_PI 0.636619772367581343075535053490 /* 2/pi */ #endif #ifndef M_2_SQRTPI #define M_2_SQRTPI 1.128379167095512573896158903122 /* 2/sqrt(pi) */ #endif #ifndef M_SQRT2 #define M_SQRT2 1.414213562373095048801688724210 /* sqrt(2) */ #endif #ifndef M_SQRT1_2 #define M_SQRT1_2 0.707106781186547524400844362105 /* 1/sqrt(2) */ #endif /* R-Specific Constants */ #ifndef M_SQRT_3 #define M_SQRT_3 1.732050807568877293527446341506 /* sqrt(3) */ #endif #ifndef M_SQRT_32 #define M_SQRT_32 5.656854249492380195206754896838 /* sqrt(32) */ #endif #ifndef M_LOG10_2 #define M_LOG10_2 0.301029995663981195213738894724 /* log10(2) */ #endif #ifndef M_SQRT_PI #define M_SQRT_PI 1.772453850905516027298167483341 /* sqrt(pi) */ #endif #ifndef M_1_SQRT_2PI #define M_1_SQRT_2PI 0.398942280401432677939946059934 /* 1/sqrt(2pi) */ #endif #ifndef M_SQRT_2dPI #define M_SQRT_2dPI 0.797884560802865355879892119869 /* sqrt(2/pi) */ #endif #ifndef M_LN_2PI #define M_LN_2PI 1.837877066409345483560659472811 /* log(2*pi) */ #endif #ifndef M_LN_SQRT_PI #define M_LN_SQRT_PI 0.572364942924700087071713675677 /* log(sqrt(pi)) == log(pi)/2 */ #endif #ifndef M_LN_SQRT_2PI #define M_LN_SQRT_2PI 0.918938533204672741780329736406 /* log(sqrt(2*pi)) == log(2*pi)/2 */ #endif #ifndef M_LN_SQRT_PId2 #define M_LN_SQRT_PId2 0.225791352644727432363097614947 /* log(sqrt(pi/2)) == log(pi/2)/2 */ #endif # ifndef R_EXT_BOOLEAN_H_ /* "copy-paste" R_ext/Boolean.h if not already included: */ #define R_EXT_BOOLEAN_H_ #undef FALSE #undef TRUE typedef enum { FALSE = 0, TRUE } Rboolean; # endif #define bessel_i jags_bessel_i #define bessel_j jags_bessel_j #define bessel_k jags_bessel_k #define bessel_y jags_bessel_y #define bessel_i_ex jags_bessel_i_ex #define bessel_j_ex jags_bessel_j_ex #define bessel_k_ex jags_bessel_k_ex #define bessel_y_ex jags_bessel_y_ex #define beta jags_beta #define choose jags_choose #define dbeta jags_dbeta #define dbinom jags_dbinom #define dcauchy jags_dcauchy #define dchisq jags_dchisq #define dexp jags_dexp #define dF jags_dF #define dgamma jags_dgamma #define dgeom jags_dgeom #define dhyper jags_dhyper #define digamma jags_digamma #define dlnorm jags_dlnorm #define dlogis jags_dlogis #define dnbeta jags_dnbeta #define dnbinom jags_dnbinom #define dnbinom_mu jags_dnbinom_mu #define dnchisq jags_dnchisq #define dnf jags_dnf #define dnorm4 jags_dnorm4 #define dnt jags_dnt #define dpois jags_dpois #define dpsifn jags_dpsifn #define dsignrank jags_dsignrank #define dt jags_dt #define dtukey jags_dtukey #define dunif jags_dunif #define dweibull jags_dweibull #define dweibull2 jags_dweibull2 #define dwilcox jags_dwilcox #define fmax2 jags_fmax2 #define fmin2 jags_fmin2 #define fprec jags_fprec #define fround jags_fround #define ftrunc jags_ftrunc #define fsign jags_fsign #define gammafn jags_gammafn #define imax2 jags_imax2 #define imin2 jags_imin2 #define lbeta jags_lbeta #define lchoose jags_lchoose #define lgammafn jags_lgammafn #define lgammafn_sign jags_lgammafn_sign #define lgamma1p jags_lgamma1p #define log1pmx jags_log1pmx #define logspace_add jags_logspace_add #define logspace_sub jags_logspace_sub #define pbeta jags_pbeta #define pbeta_raw jags_pbeta_raw #define pbinom jags_pbinom #define pcauchy jags_pcauchy #define pchisq jags_pchisq #define pentagamma jags_pentagamma #define pexp jags_pexp #define pF jags_pF #define pgamma jags_pgamma #define pgeom jags_pgeom #define phyper jags_phyper #define plnorm jags_plnorm #define plogis jags_plogis #define pnbeta jags_pnbeta #define pnbinom jags_pnbinom #define pnbinom_mu jags_pnbinom_mu #define pnchisq jags_pnchisq #define pnf jags_pnf #define pnorm5 jags_pnorm5 #define pnorm_both jags_pnorm_both #define pnt jags_pnt #define ppois jags_ppois #define psignrank jags_psignrank #define psigamma jags_psigamma #define pt jags_pt #define ptukey jags_ptukey #define punif jags_punif #define pythag jags_pythag #define pweibull jags_pweibull #define pweibull2 jags_pweibull2 #define pwilcox jags_pwilcox #define qbeta jags_qbeta #define qbinom jags_qbinom #define qcauchy jags_qcauchy #define qchisq jags_qchisq #define qchisq_appr jags_qchisq_appr #define qexp jags_qexp #define qF jags_qF #define qgamma jags_qgamma #define qgeom jags_qgeom #define qhyper jags_qhyper #define qlnorm jags_qlnorm #define qlogis jags_qlogis #define qnbeta jags_qnbeta #define qnbinom jags_qnbinom #define qnbinom_mu jags_qnbinom_mu #define qnchisq jags_qnchisq #define qnf jags_qnf #define qnorm5 jags_qnorm5 #define qnt jags_qnt #define qpois jags_qpois #define qsignrank jags_qsignrank #define qt jags_qt #define qtukey jags_qtukey #define qunif jags_qunif #define qweibull jags_qweibull #define qweibull2 jags_qweibull2 #define qwilcox jags_qwilcox #define rbeta jags_rbeta #define rbinom jags_rbinom #define rcauchy jags_rcauchy #define rchisq jags_rchisq #define rexp jags_rexp #define rF jags_rF #define rgamma jags_rgamma #define rgeom jags_rgeom #define rhyper jags_rhyper #define rlnorm jags_rlnorm #define rlogis jags_rlogis #define rnbeta jags_rnbeta #define rnbinom jags_rnbinom #define rnchisq jags_rnchisq #define rnf jags_rnf #define rnorm jags_rnorm #define rnt jags_rnt #define rpois jags_rpois #define rsignrank jags_rsignrank #define rt jags_rt #define rtukey jags_rtukey #define runif jags_runif #define rweibull jags_rweibull #define rweibull2 jags_rweibull2 #define rwilcox jags_rwilcox #define sign jags_sign #define tetragamma jags_tetragamma #define trigamma jags_trigamma #define dnorm dnorm4 #define pnorm pnorm5 #define qnorm qnorm5 #ifdef __cplusplus namespace jags { struct RNG; } typedef jags::RNG JRNG; extern "C" { #else typedef struct JRNG JRNG; #endif /* R's versions with !R_FINITE checks */ double JR_pow(double x, double y); double JR_pow_di(double, int); /* Random Number Generators */ double norm_rand(JRNG*); double unif_rand(JRNG*); double exp_rand(JRNG*); /* Normal Distribution */ double dnorm(double, double, double, int); double pnorm(double, double, double, int, int); double qnorm(double, double, double, int, int); double rnorm(double, double, JRNG*); void pnorm_both(double, double *, double *, int, int);/* both tails */ /* Uniform Distribution */ double dunif(double, double, double, int); double punif(double, double, double, int, int); double qunif(double, double, double, int, int); double runif(double, double, JRNG*); /* Gamma Distribution */ double dgamma(double, double, double, int); double pgamma(double, double, double, int, int); double qgamma(double, double, double, int, int); double rgamma(double, double, JRNG*); double log1pmx(double); double log1pexp(double); // <-- ../nmath/plogis.c double lgamma1p(double); double logspace_add(double, double); double logspace_sub(double, double); /* Beta Distribution */ double dbeta(double, double, double, int); double pbeta(double, double, double, int, int); double qbeta(double, double, double, int, int); double rbeta(double, double, JRNG*); /* Lognormal Distribution */ double dlnorm(double, double, double, int); double plnorm(double, double, double, int, int); double qlnorm(double, double, double, int, int); double rlnorm(double, double, JRNG*); /* Chi-squared Distribution */ double dchisq(double, double, int); double pchisq(double, double, int, int); double qchisq(double, double, int, int); double rchisq(double, JRNG*); /* Non-central Chi-squared Distribution */ double dnchisq(double, double, double, int); double pnchisq(double, double, double, int, int); double qnchisq(double, double, double, int, int); double rnchisq(double, double, JRNG*); /* F Distibution */ double dF(double, double, double, int); double pF(double, double, double, int, int); double qF(double, double, double, int, int); double rF(double, double, JRNG*); /* Student t Distibution */ double dt(double, double, int); double pt(double, double, int, int); double qt(double, double, int, int); double rt(double, JRNG*); /* Binomial Distribution */ double dbinom(double, double, double, int); double pbinom(double, double, double, int, int); double qbinom(double, double, double, int, int); double rbinom(double, double, JRNG*); /* Multnomial Distribution */ void rmultinom(int, double*, int, int*, JRNG*); /* Cauchy Distribution */ double dcauchy(double, double, double, int); double pcauchy(double, double, double, int, int); double qcauchy(double, double, double, int, int); double rcauchy(double, double, JRNG*); /* Exponential Distribution */ double dexp(double, double, int); double pexp(double, double, int, int); double qexp(double, double, int, int); double rexp(double, JRNG*); /* Geometric Distribution */ double dgeom(double, double, int); double pgeom(double, double, int, int); double qgeom(double, double, int, int); double rgeom(double, JRNG*); /* Hypergeometric Distibution */ double dhyper(double, double, double, double, int); double phyper(double, double, double, double, int, int); double qhyper(double, double, double, double, int, int); double rhyper(double, double, double, JRNG*); /* Negative Binomial Distribution */ double dnbinom(double, double, double, int); double pnbinom(double, double, double, int, int); double qnbinom(double, double, double, int, int); double rnbinom(double, double, JRNG*); double dnbinom_mu(double, double, double, int); double pnbinom_mu(double, double, double, int, int); double qnbinom_mu(double, double, double, int, int); double rnbinom_mu(double, double, JRNG*); /* Poisson Distribution */ double dpois(double, double, int); double ppois(double, double, int, int); double qpois(double, double, int, int); double rpois(double, JRNG*); /* Weibull Distribution with shape-scale parameterization */ double dweibull(double, double, double, int); double pweibull(double, double, double, int, int); double qweibull(double, double, double, int, int); double rweibull(double, double, JRNG*); /* Weibull Distribution with shape-rate parameterization */ double dweibull2(double, double, double, int); double pweibull2(double, double, double, int, int); double qweibull2(double, double, double, int, int); double rweibull2(double, double, JRNG*); /* Logistic Distribution */ double dlogis(double, double, double, int); double plogis(double, double, double, int, int); double qlogis(double, double, double, int, int); double rlogis(double, double, JRNG*); /* Non-central Beta Distribution */ double dnbeta(double, double, double, double, int); double pnbeta(double, double, double, double, int, int); double qnbeta(double, double, double, double, int, int); double rnbeta(double, double, double, JRNG*); /* Non-central F Distribution */ double dnf(double, double, double, double, int); double pnf(double, double, double, double, int, int); double qnf(double, double, double, double, int, int); /* Non-central Student t Distribution */ double dnt(double, double, double, int); double pnt(double, double, double, int, int); double qnt(double, double, double, int, int); /* Studentized Range Distribution */ double ptukey(double, double, double, double, int, int); double qtukey(double, double, double, double, int, int); /* Wilcoxon Rank Sum Distribution */ double dwilcox(double, double, double, int); double pwilcox(double, double, double, int, int); double qwilcox(double, double, double, int, int); double rwilcox(double, double, JRNG*); /* Wilcoxon Signed Rank Distribution */ double dsignrank(double, double, int); double psignrank(double, double, int, int); double qsignrank(double, double, int, int); double rsignrank(double, JRNG*); /* Gamma and Related Functions */ double gammafn(double); double lgammafn(double); double lgammafn_sign(double, int*); void dpsifn(double, int, int, int, double*, int*, int*); double psigamma(double, double); double digamma(double); double trigamma(double); double tetragamma(double); double pentagamma(double); double beta(double, double); double lbeta(double, double); double choose(double, double); double lchoose(double, double); /* Bessel Functions */ double bessel_i(double, double, double); double bessel_j(double, double); double bessel_k(double, double, double); double bessel_y(double, double); double bessel_i_ex(double, double, double, double *); double bessel_j_ex(double, double, double *); double bessel_k_ex(double, double, double, double *); double bessel_y_ex(double, double, double *); /* General Support Functions */ //double pythag(double, double); int imax2(int, int); int imin2(int, int); double fmax2(double, double); double fmin2(double, double); double sign(double); double fprec(double, double); double fround(double, double); double fsign(double, double); double ftrunc(double); double log1pmx(double); /* Accurate log(1+x) - x, {care for small x} */ double lgamma1p(double);/* accurate log(gamma(x+1)), small x (0 < x < 0.5) */ /* More accurate cos(pi*x), sin(pi*x), tan(pi*x) In future these declarations could clash with system headers if someone had already included math.h with __STDC_WANT_IEC_60559_TYPES_EXT__ defined. We can add a check for that via the value of __STDC_IEC_60559_FUNCS__ (>= 201ymmL, exact value not yet known). */ double cospi(double); double sinpi(double); double tanpi(double); /* Compute the log of a sum or difference from logs of terms, i.e., * * log (exp (logx) + exp (logy)) * or log (exp (logx) - exp (logy)) * * without causing overflows or throwing away too much accuracy: */ double logspace_add(double logx, double logy); double logspace_sub(double logx, double logy); /* ----------------- Private part of the header file ------------------- */ /* old-R Compatibility */ #ifdef OLD_RMATH_COMPAT # define snorm norm_rand # define sunif unif_rand # define sexp exp_rand #endif #if !defined(MATHLIB_PRIVATE_H) /* defined by nmath.h */ /* If isnan is a macro, as C99 specifies, the C++ math header will undefine it. This happens on OS X */ # ifdef __cplusplus int JR_isnancpp(double); /* in mlutils.c */ # define ISNAN(x) JR_isnancpp(x) # else # define ISNAN(x) (isnan(x)!=0) # endif # define R_FINITE(x) JR_finite(x) int JR_finite(double); # ifdef _WIN32 /* not Win32 as no config information */ # ifdef RMATH_DLL # define R_EXTERN extern __declspec(dllimport) # else # define R_EXTERN extern # endif R_EXTERN double NA_REAL; R_EXTERN double R_PosInf; R_EXTERN double R_NegInf; R_EXTERN int N01_kind; # undef R_EXTERN #else extern int N01_kind; # endif #endif /* MATHLIB_PRIVATE_H */ #ifdef __cplusplus } #endif #endif /* RMATH_H */ JAGS-4.3.2/src/include/version.h0000664000175000017500000000022414224052514013234 00000000000000#ifndef JAGS_VERSION_H_ #define JAGS_VERSION_H_ #define JAGS_MAJOR 4 extern "C" { char const * jags_version(); } #endif /* JAGS_VERSION_H_ */ JAGS-4.3.2/src/include/Makefile.in0000644000175000017500000005322714400675235013463 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(pkginclude_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgincludedir)" HEADERS = $(noinst_HEADERS) $(pkginclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ pkginclude_HEADERS = Console.h JRmath.h version.h SUBDIRS = compiler distribution function graph model sampler sarray \ rng util module noinst_HEADERS = testlib.h all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgincludeHEADERS: $(pkginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ done uninstall-pkgincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgincludeHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgincludeHEADERS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgincludeHEADERS \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/compiler/0000755000175000017500000000000014400711323013264 500000000000000JAGS-4.3.2/src/include/compiler/Makefile.am0000664000175000017500000000027014224052371015246 00000000000000compilerincludedir = $(pkgincludedir)/compiler compilerinclude_HEADERS = Compiler.h LogicalFactory.h ParseTree.h \ Counter.h CounterTab.h MixtureFactory.h NodeFactory.h ObsFuncTab.h JAGS-4.3.2/src/include/compiler/Compiler.h0000664000175000017500000001063514224052514015142 00000000000000#ifndef COMPILER_H_ #define COMPILER_H_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace jags { class ParseTree; class SymTab; class FuncTab; class DistTab; class NodeAlias; class SimpleRange; class Compiler; typedef void (Compiler::*CompilerMemFn) (ParseTree const *); /** * @short Creates a BUGSModel from a ParseTree */ class Compiler { BUGSModel &_model; CounterTab _countertab; std::map const &_data_table; std::map > _constant_mask; unsigned int _n_resolved, _n_relations; std::vector _is_resolved; int _resolution_level; int _index_expression; std::vector _index_nodes; LogicalFactory _logicalfactory; MixtureFactory _mixfactory1; MixtureFactory _mixfactory2; std::map > _node_array_bounds; std::map, std::set > _umap; std::set _lhs_vars; std::map, std::vector >, ConstantNode *> _cnode_map; Node *getArraySubset(ParseTree const *t); SimpleRange VariableSubsetRange(ParseTree const *var); Range CounterRange(ParseTree const *var); Node* VarGetNode(ParseTree const *var); Range getRange(ParseTree const *var, SimpleRange const &default_range); void traverseTree(ParseTree const *relations, CompilerMemFn fun, bool resetcounter=true, bool reverse=false); void allocate(ParseTree const *rel); Node * allocateStochastic(ParseTree const *stoch_rel); Node * allocateLogical(ParseTree const *dtrm_rel); void setConstantMask(ParseTree const *rel); void writeConstantData(ParseTree const *rel); Node *getLength(ParseTree const *p, SymTab const &symtab); Node *getDim(ParseTree const *p, SymTab const &symtab); void getArrayDim(ParseTree const *p); bool getParameterVector(ParseTree const *t, std::vector &parents); Node * constFromTable(ParseTree const *p); void addDevianceNode(); Node *getConstant(double value, unsigned int nchain, bool observed); Node *getConstant(std::vector const &dim, std::vector const &value, unsigned int nchain, bool observed); void getLHSVars(ParseTree const *rel); public: bool indexExpression(ParseTree const *t, std::vector &value); BUGSModel &model() const; Node * getParameter(ParseTree const *t); /** * @param model Model to be created by the compiler. * * @param datatab Data table, mapping a variable name onto a * multi-dimensional array of values. This is required since some * constant expressions in the BUGS language may depend on data * values. */ Compiler(BUGSModel &model, std::map const &data_table); /** * Adds variables to the symbol table. * * @param pvariables vector of ParseTree pointers, each one corresponding * to a parsed variable declaration. */ void declareVariables(std::vector const &pvariables); /** * Adds variables without an explicit declaration to the symbol * table. Variables supplied in the data table are added, then * any variables that appear on the left hand side of a relation * * @param prelations ParseTree corresponding to a parsed model block */ void undeclaredVariables(ParseTree const *prelations); /** * Traverses the ParseTree creating nodes. * * @param prelations ParseTree corresponding to a parsed model block */ void writeRelations(ParseTree const *prelations); /** * The function table used by the compiler to look up functions by * name. It is shared by all Compiler objects. * * @see Module */ static FuncTab &funcTab(); /** * The distribution table used by the compiler to look up * distributions by name. It is shared by all Compiler objects. * * @see Module */ static DistTab &distTab(); /** * The table for observable functions used by the compiler to substitute * a logical node for a stochastic node when required */ static ObsFuncTab &obsFuncTab(); MixtureFactory &mixtureFactory1(); MixtureFactory &mixtureFactory2(); }; } /* namespace jags */ #endif /* COMPILER_H_ */ JAGS-4.3.2/src/include/compiler/LogicalFactory.h0000664000175000017500000000412014224052371016263 00000000000000#ifndef LOGICAL_FACTORY_H_ #define LOGICAL_FACTORY_H_ #include #include #include #include #include #include namespace jags { class Function; class Node; class Model; class LogicalNode; /** * A "logical pair", consisting of a function and a vector of arguments, * uniquely defines a logical node. */ typedef std::pair > LogicalPair; /** * @short "Less than" function for LogicalPair objects. * * Two LogicalPairs A and B are considered to be equivalent * (i.e. lt(A,B) and lt(B,A) are both false) if they have the same * function, and the same vector of parameters. Observed parameters * are considered equal if they have the same value (within a certain * numerical tolerance). * * For non-equivalent LogicalPairs, the ordering is unique, but * arbitrary. The only use of this function is for the STL map class * with LogicalPair as key. */ bool lt(LogicalPair const &arg1, LogicalPair const &arg2); /** * @short Factory object for logical nodes * * The value of a logical node is determined uniquely by its function * and its parameters. The purpose of a LogicalFactory is to avoid * unnecessary duplication of logical nodes by having a factory object * for them that will create and/or lookup logical nodes based on * these arguments. */ class LogicalFactory { std::map > _logicalmap; public: /** * Get a logical node with a given function and given parameters. * The results are cached, so if a request is repeated, the same * node will be returned. If a newly allocated node is returned, * it is also added to the given Model. */ Node *getNode(FunctionPtr const &func, std::vector const ¶m, Model &model); /** * Returns a newly allocated LogicalNode. */ static LogicalNode* newNode(FunctionPtr const &func, std::vector const &parents, unsigned int nchain); }; } /* namespace jags */ #endif /* LOGICAL_FACTORY_H_ */ JAGS-4.3.2/src/include/compiler/ParseTree.h0000664000175000017500000000566414224052514015270 00000000000000#ifndef PARSE_TREE_H_ #define PARSE_TREE_H_ #include #include namespace jags { enum TreeClass { P_VAR, P_RANGE, P_BOUNDS, P_DENSITY, P_LINK, P_COUNTER, P_VALUE, P_STOCHREL, P_DETRMREL, P_FOR, P_FUNCTION, P_RELATIONS, P_VECTOR, P_ARRAY, P_DIM, P_LENGTH, P_SUBSET, P_INTERVAL }; /** * @short Represents a model described in the BUGS language * * ParseTree objects are used to represent a BUGS model description * after it has been processed by the parser. * * ParseTree objects form a tree structure in which the parameters of * the node are its children. In order to enforce a valid tree * structure certain restrictions are placed on the setParameters * function. * * ParseTree objects are designed to be dynamically allocated. A * ParseTree object takes ownership of its parameters and deletes them * when it is deleted. Hence you only need to delete the top-level * ParseTree object. * */ class ParseTree { TreeClass const _tclass; std::vector _parameters; ParseTree const *_parent; std::string _name; double _value; int _line; public: /** * Constructor, which sets the treeClass of the ParseTree node. The * treeClass cannot be changed. When a ParseTree node is first constructed, * it has no parent, the vector of parameters is empty, the name is an * empty string, the value is set to 0 and the operator is OP_NONE. */ ParseTree(TreeClass tclass, int line = 0); /** * Destructor. This deletes the parameters. */ ~ParseTree(); /** * Sets the name, which can later be queried with ParseTree#name. * The treeClass of the ParseTree node must be one of P_VAR, * P_COUNTER, P_FUNCTION, P_DISTRIBUTION, P_LINK, or P_ARRAY */ void setName(std::string const &name); /** * Sets the value, which can later be queried with ParseTree::value(). * The treeClass of the ParseTree node must be P_VALUE. */ void setValue(double value); /** * Sets the parameters. As a side effect, "this" becomes the parent * node of each of the parameters. * * Certain restrictions are required to enforce a valid tree * structure: "this" must not have a parent; none of the parameters * may have parents; "this" may not be a parameter of itself. * * NULL parameters are allowed. */ void setParameters(std::vector const ¶meters); /** * Returns the parameters of the ParseTree node. */ std::vector const ¶meters() const; /** * Returns the tree class of the ParseTree node */ TreeClass treeClass() const; /** * Returns the name for a ParseTree with treeClass P_VAR, P_COUNTER, * P_FUNCTION, P_LINK, P_DISTRIBUTION, or P_ARRAY */ std::string const &name() const; /** * Returns the value for a ParseTree with treeClass P_VALUE. */ double value() const; /** * Returns the line number. */ int line() const; }; } /* namespace jags */ #endif /* PARSE_TREE_H_ */ JAGS-4.3.2/src/include/compiler/Counter.h0000664000175000017500000000120614224052514015001 00000000000000#ifndef COUNTER_H_ #define COUNTER_H_ #include namespace jags { /** * @short Mutable index that traverses a BUGS-language "for" loop * * The Counter class is used to represent counters in "for" loops in the * BUGS language. A Counter is a scalar RangeIterator. * *
 * for (i in 1:N) {
 * }
 * 
*/ class Counter : public RangeIterator { public: /** * Create a counter * @param range Scalar range. i.e., Range having ndim(false) == 1 */ Counter(Range const &range); /** Increments the value of the counter by 1 */ Counter &next(); }; } /* namespace jags */ #endif /* COUNTER_H_ */ JAGS-4.3.2/src/include/compiler/CounterTab.h0000664000175000017500000000217114224052514015432 00000000000000#ifndef COUNTERTAB_H_ #define COUNTERTAB_H_ #include #include #include #include #include namespace jags { /** * @short Counter table * * The CounterTab class stores counters in the BUGS language * representation of the model. Counters are only required during * compilation of the model. * * @see NodeArray * @see Counter */ class CounterTab { std::vector > _table; public: CounterTab(); ~CounterTab(); /** * Pushes a counter onto the internal counter stack and returns * a pointer to it. * @param name Name of the counter * @param range Range over which the counter will vary */ Counter * pushCounter(std::string const &name, Range const &range); /** * Pops the top counter off the counter stack, freeing the associated * memory in the process. */ void popCounter(); /** * Returns a pointer associated with the given name, or a NULL * pointer if there is no such Counter */ Counter *getCounter(std::string const &name) const; }; } /* namespace jags */ #endif /* COUNTERTAB_H_ */ JAGS-4.3.2/src/include/compiler/MixtureFactory.h0000664000175000017500000000363014224052514016352 00000000000000#ifndef MIXTURE_FACTORY_H_ #define MIXTURE_FACTORY_H_ #include #include #include #include namespace jags { class NodeArray; class Model; /** * A "mixture pair" uniquely indexes a mixture node. The first element * is a vector of (discrete-valued) index nodes. The second element is * a vector of parent nodes from which the mixture node copies its * value. * * It is implicit in the mixture pair definition that the index nodes * take a range of possible values. If these values are calculated and * sorted, then ther there is a one-to-one correspondence between the * sorted index values and the vector of parent nodes. * * The reason this vector of possible index values is not used is * because it is not necessary to uniquely define a mixture node. */ typedef std::pair, std::vector > MixPair; /** * @short Factory for MixtureNode objects * * The purpose of a MixtureFactory is to avoid unnecessary duplication * of mixture nodes by having a container class and factory object * that will create and/or lookup mixture nodes. */ class MixtureFactory { std::map _mix_node_map; public: /** * Get a mixture node. The results are cached, so if a request is * repeated, the same node will be returned. * * @param index Vector of discrete-valued Nodes that index the * possible parameters * * @param parameters Vector of pairs. The first element of the pair * shows a possible value of the index vector and the second element * shows the corresponding parent from which the mixture node copies * its value. * * @param graph Model to which newly allocated mixturenodes are added. * */ MixtureNode *getMixtureNode(std::vector const &index, MixMap const ¶meters, Model &model); }; } /* namespace jags */ #endif /* MIXTURE_FACTORY_H_ */ JAGS-4.3.2/src/include/compiler/NodeFactory.h0000664000175000017500000000377014224052514015607 00000000000000#ifndef NODE_FACTORY_H_ #define NODE_FACTORY_H_ #include #include namespace jags { class Node; /** * @short Fuzzy less than function for doubles * * Gives an ordering for doubles allowing for some numerical * tolerance. Values that are "nearly equal" are considered to be * equal. */ inline bool lt(double value1, double value2) { return value1 < value2 - 16 * DBL_EPSILON; } /** * @short Fuzzy less than function for arrays of doubles * * Gives an ordering for two arrays of doubles of the same length. * Values that are numerically "nearly equal" are considered to * be equal. */ bool lt(double const *value1, double const *value2, unsigned int length); /** * @short Fuzzy less than function for Nodes * * Gives an ordering for Nodes that is arbitrary, but reproducible * within the same process. This is all that is required by the * various Node factories. * * In this ordering fixed nodes come before non-fixed nodes. Fixed * nodes are ordered within themselves using the fuzzy less than * operator for their values. Non-fixed nodes are sorted by their * pointer values (which gives an arbitrary, but strict ordering). */ bool lt(Node const *node1, Node const *node2); /** * @short Fuzzy less than function for vectors of Nodes * * Extends the fuzzy less than operator for Nodes to vectors of * Nodes. Vectors are first sorted by length, then an element-wise * comparison of each Node in the vector. */ bool lt(std::vector const &par1, std::vector const &par2); /** * Template that constructs a function object from any of the * above less than functions. */ template struct fuzzy_less { bool operator()(T const &arg1, T const &arg2) const { return lt(arg1, arg2); } }; } /* namespace jags */ #endif /* NODE_FACTORY_H_ */ JAGS-4.3.2/src/include/compiler/ObsFuncTab.h0000664000175000017500000000354514224052371015361 00000000000000#ifndef OBS_FUNC_TAB_H_ #define OBS_FUNC_TAB_H_ #include #include #include #include namespace jags { /** * @short Look-up table for observable functions * * Obs functions may behave like either a distribution or a * function, depending on the context, so must be represented by both * a Distribution object and a Function object. * * The ObsFuncTab class provides a means of storing these * Distribution/Function pairs and looking up Functions from their * matching distribution. * * @see FuncTab DistTab */ class ObsFuncTab { std::list > _flist; FunctionPtr const _nullfun; public: /** * Constructs a new empty table */ ObsFuncTab(); /** * Inserts an observable function into the table. The distribution * and function must have the same name in the BUGS language. A * given pair can only be inserted into the table once * * @param dist Polymorphic distribution pointer * @param func Polymorphic function pointer */ void insert(DistPtr const &dist, FunctionPtr const &func); /** * Finds a Function from its matching Distribution. If a * Distribution matches more than one Function, then the Function * corresponding to the last pair inserted into the table is * returned. * * @return a polymorphic function pointer. If the function cannot * be found, then the pointer is a null FunctionPtr object. */ FunctionPtr const &find(DistPtr const &dist) const; /** * Removes a distribution/function pair from the table. * * @param dist Polymorphic distribution pointer * @param func Polymorphic function pointer */ void erase(DistPtr const &dist, FunctionPtr const &func); }; } /* namespace jags */ #endif /* OBS_FUNC_TAB_H_ */ JAGS-4.3.2/src/include/compiler/Makefile.in0000644000175000017500000004302114400675235015264 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/compiler ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(compilerinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(compilerincludedir)" HEADERS = $(compilerinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ compilerincludedir = $(pkgincludedir)/compiler compilerinclude_HEADERS = Compiler.h LogicalFactory.h ParseTree.h \ Counter.h CounterTab.h MixtureFactory.h NodeFactory.h ObsFuncTab.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/compiler/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/compiler/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-compilerincludeHEADERS: $(compilerinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(compilerinclude_HEADERS)'; test -n "$(compilerincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(compilerincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(compilerincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(compilerincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(compilerincludedir)" || exit $$?; \ done uninstall-compilerincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(compilerinclude_HEADERS)'; test -n "$(compilerincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(compilerincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(compilerincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-compilerincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-compilerincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-compilerincludeHEADERS install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-compilerincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/distribution/0000755000175000017500000000000014400711323014171 500000000000000JAGS-4.3.2/src/include/distribution/Makefile.am0000664000175000017500000000026114224052371016153 00000000000000distribincludedir = $(pkgincludedir)/distribution distribinclude_HEADERS = Distribution.h ScalarDist.h VectorDist.h \ ArrayDist.h DistPtr.h DistTab.h DistError.h RScalarDist.h JAGS-4.3.2/src/include/distribution/Distribution.h0000664000175000017500000001264614224052514016760 00000000000000#ifndef DISTRIBUTION_H_ #define DISTRIBUTION_H_ #include #include namespace jags { struct RNG; /** * Specifies different ways of calculating the log probability density * function. Typically we are only interested in calculating ratios of * probability density functions. When some terms in the log density * are constant (and therefore cancel out when taking ratios) they may * optionally be omitted from the calculations for improved * efficiency. * * PDF_FULL is used when neither the sampled values nor the * pararameters are constant. This implies full evaluation of the log * density. * * PDF_PRIOR is used when the parameters are constant. Terms that * depend only on the parameters may be omitted from the log density. * * PDF_LIKELIHOOD is used when the sampled value is constant. Terms * that depend only on the sampled value may be omitted from the log * density. * * Note that any function taking a PDFType argument is free to ignore * it and can always calculate the full density function. */ enum PDFType {PDF_FULL, PDF_PRIOR, PDF_LIKELIHOOD}; /** * @short Distribution of a random variable * * Distribution objects contain only constant data members and all * member functions are constant. Hence only one object needs to be * instantiated for each subclass. * * The DistTab class provides a convenient way of storing Distribution * objects and referencing them by name. * * @see DistTab */ class Distribution { const std::string _name; const unsigned int _npar; public: /** * Constructor. * @param name name of the distribution as used in the BUGS language * @param npar number of parameters, excluding upper and lower bounds */ Distribution(std::string const &name, unsigned int npar); virtual ~Distribution(); /** * @returns the BUGS language name of the distribution */ std::string const &name() const; /** * Returns an alternate name for the distribution. The default * implementation returns an empty string. However, this function * may be overridden to return a non-empty string giving an * alternate name for the distribution. */ virtual std::string alias() const; /** * Indicates whether the support of the distribution is fixed. * * @param fixmask Boolean vector indicating which parameters have * fixed values. */ virtual bool isSupportFixed(std::vector const &fixmask) const = 0; /** * Returns the number of parameters of the distribution */ unsigned int npar() const; /** * Some distributions require some of the parameters to be discrete * valued. As most distributions do not require discrete valued paremeters, * a default implementation is provided which always returns true. * * @param mask Boolean vector indicating which parameters are * discrete valued. */ virtual bool checkParameterDiscrete(std::vector const &mask) const; /** * Returns true if the distribution has support on the integers.The * default implementation returns false, so this must be overridden * for discrete-valued distributions. * * @param mask Vector indicating whether parameters are discrete * or not. Most implementations will ignore this argument, as a * distribution normally has support either on the real line or on * the integers. However, this argument is required in order to * support observable functions, for which the support may depend * on the arguments. * * @see Function#isDiscreteValued */ virtual bool isDiscreteValued(std::vector const &mask) const; /** * Tests for a location parameter. A parameter of a distribution * is considered to be a location parameter if, when it's value is * incremented by X, the whole distribution is shifted by X, * indpendently of the other parameter values. * * This is a virtual function, for which the default implementation * always returns false. Distributions with location parameters must * overload this function. * * @param index Index number (starting from 0) of the parameter to be * tested. */ virtual bool isLocationParameter(unsigned int index) const; /** * Tests for a scale parameter. A parameter of a distribution is * considered to be a scale parameter if, when it's value is * multiplied by X, the whole distribution multiplied by X, * indpendently of the other parameter values. * * Note that this definition excludes "location-scale" models: * i.e. if the density of y takes the form (1/b)*f((y-a)/b) then b * is not considered a scale parameter. * * This is a virtual function, for which the default * implementation always returns false. Distributions with scale * parameters must overload this function. * * @param index Index number (starting from 0) of the parameter to * be tested. */ virtual bool isScaleParameter(unsigned int index) const; /** * Indicates whether the distribution can be bounded. The default * implementation returns false. */ virtual bool canBound() const; }; /** * Checks that the distribution accepts npar parameters */ inline bool checkNPar(Distribution const *dist, unsigned int npar) { return (dist->npar() == 0 && npar > 0) || dist->npar() == npar; } } /* namespace jags */ #endif /* DISTRIBUTION_H_ */ JAGS-4.3.2/src/include/distribution/ScalarDist.h0000664000175000017500000001171614224052514016327 00000000000000#ifndef SCALAR_DIST_H_ #define SCALAR_DIST_H_ #include namespace jags { struct RNG; /** * Enumerates three possible ranges of support for a scalar random * variable. * * DIST_UNBOUNDED for support on the whole real line * * DIST_POSITIVE for support on values > 0 * * DIST_PROPORTION for support on values in [0,1] * * DIST_SPECIAL for other distributions, e.g. distributions where the * support depends on the parameter values. */ enum Support {DIST_UNBOUNDED, DIST_POSITIVE, DIST_PROPORTION, DIST_SPECIAL}; /** * @short Scalar distributions * * The ScalarDist class represents distributions that are scalar-valued * and for which the parameters are also scalars. */ class ScalarDist : public Distribution { const Support _support; public: /** * Constructor * * @param name BUGS language name of distribution * * @param npar Number of parameters, excluding upper and lower bound * * @param support Support of distribution * * @param discrete Logical flag indicating whether the distribution * is discrete-valued. */ ScalarDist(std::string const &name, unsigned int npar, Support support); /** * This implementation should be used for distributions with * Support DIST_UNBOUNDED, DIST_POSITIVE and DIST_PROPORTION. If * the Support is DIST_SPECIAL, this must be overloaded. */ bool isSupportFixed(std::vector const &fixmask) const; /** * Lower limit of distribution, given parameters. If the * distribution has no lower limit, this should return JAGS_NEGINF. * * The default implementation should be used for distributions with * Support DIST_UNBOUNDED, DIST_POSITIVE and DIST_PROPORTION. If * the Support is DIST_SPECIAL, this must be overloaded. */ virtual double l(std::vector const ¶meters) const; /** * Upper limit of distribution, given parameters. If the * distribution has no upper limit, this should return JAGS_POSINF. * * The default implementation should be used for distributions with * Support DIST_UNBOUNDED, DIST_POSITIVE and DIST_PROPORTION. If * the Support is DIST_SPECIAL, this must be overloaded. */ virtual double u(std::vector const ¶meters) const; /** * Calculates log probability density of the distribution */ virtual double logDensity(double x, PDFType type, std::vector const ¶meters, double const *lbound, double const *ubound) const = 0; /** * Draws a random sample */ virtual double randomSample(std::vector const ¶meters, double const *lbound, double const *ubound, RNG *rng) const = 0; /** * Generate a deterministic value with reasonably high density * (e.g. mean, median, mode ...) */ virtual double typicalValue(std::vector const ¶meters, double const *lbound, double const *ubound) const = 0; /** * Checks whether the parameter values are valid */ virtual bool checkParameterValue(std::vector const ¶ms) const = 0; /** * Returns the number of degrees of freedom of the distribution. * By default this is 1. For scalar distributions that are * deterministic functions of the parameters, this must be overridden. */ virtual unsigned int df() const; /** * Returns a Monte Carlo estimate of the Kullback-Leibler divergence * between distributions with two different parameter values. This * is done by drawing random samples from the distribution with the * first set of parameters and then calculating the log-likelihood * ratio with respect to the second set of parameters. * * Only one lower and one upper bound is required, which is assumed * common to both sets of parameters. This is because the * Kullback-Leibler divergence is infinite between two bounded * distributions if they do not share the same bounds. * * @param par1 First set of parameters * @param par2 Second set of parameter values * @param lower Pointer to lower bound (NULL if there is no lower bound) * @param upper Pointer to upper bound (NULL if there is no upper bound) * @param rng Random number generator * @param nrep Number of replicates on which to base the estimate */ double KL(std::vector const &par1, std::vector const &par2, double const *lower, double const *upper, RNG *rng, unsigned int nrep) const; /** * Returns the Kullback-Leibler divergence between distributions * with two different parameter values. * * This is a virtual function that must be overloaded for any * distribution that allows exact Kullback-Leibler divergence * calculations. The default method returns JAGS_NA, indicating that * the method is not implemented. */ virtual double KL(std::vector const &par1, std::vector const &par2) const; }; } /* namespace jags */ #endif /* SCALAR_DIST_H_ */ JAGS-4.3.2/src/include/distribution/VectorDist.h0000664000175000017500000001614114224052514016361 00000000000000#ifndef VECTOR_DIST_H_ #define VECTOR_DIST_H_ #include #include #include namespace jags { struct RNG; /** * @short Vector-valued Distribution * * The VectorDist class represents distributions for which either the * value or the parameters are vectors. */ class VectorDist : public Distribution { public: /** * Constructor. * @param name name of the distribution as used in the BUGS language * @param npar number of parameters, excluding upper and lower bounds */ VectorDist(std::string const &name, unsigned int npar); /** * @param x Value at which to evaluate the density. * * @param length Size of the array x. * * @param type Indicates whether the full probability density * function is required (PDF_FULL) or whether partial calculations * are permitted (PDF_PRIOR, PDF_LIKELIHOOD). See PDFType for * details. * * @param parameters Vector of parameter values of the * distribution. * * @param lengths Vector of parameter lengths corresponding to the * parameter vector. * * @returns the log probability density. If the density should be * zero because x is inconsistent with the parameters then -Inf is * returned. If the parameters are invalid * (i.e. checkParameterValue returns false), then the return value * is undefined. * */ virtual double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector const &lengths, double const *lbound, double const *ubound) const = 0; /** * Draws a random sample from the distribution. * * @param x Array to which the sample values are written * * @param length Size of the array x. * * @param parameters Vector of parameter values at which * to evaluate the likelihood. This vector should be of length * npar(). * * @param lengths Vector of lengths of the arrays in the argument * "parameters". * * @param rng pseudo-random number generator to use. * * @exception length_error */ virtual void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lbound, double const *ubound, RNG *rng) const = 0; /** * Returns a typical value from the distribution. The meaning of * this will depend on the distribution, but it will normally be a * mean, median or mode. * * @param x Array to which the sample values are written * * @param length Size of the array x. * * @param parameters Vector of parameter values at which * to evaluate the likelihood. This vector should be of length * npar(). * * @param lengths Vector of parameters lengths. * * @param lbound Lower bound for truncated distributions, or a NULL * pointer if the distribution is not truncated. * * @param ubound Upper bound for truncated distributions, or a NULL * pointer if the distribution is not truncated. * * @exception length_error */ virtual void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lbound, double const *ubound) const = 0; /** * Returns the support of an unbounded distribution */ virtual void support(double *lower, double *upper, unsigned int length, std::vector const ¶ms, std::vector const &lengths) const = 0; /** * Indicates whether the support of the distribution is fixed. * * @param fixmask Boolean vector of length npar() indicating which * parameters have fixed values. */ virtual bool isSupportFixed(std::vector const &fixmask) const = 0; /** * Checks that lengths of the parameters are correct. */ virtual bool checkParameterLength (std::vector const ¶meters) const = 0; /** * Checks that the values of the parameters are consistent with * the distribution. For example, some distributions require * than certain parameters are positive, or lie in a given * range. * * This function assumes that checkParameterLength returns true. */ virtual bool checkParameterValue(std::vector const ¶meters, std::vector const &lengths) const = 0; /** * Calculates what the length of a sampled value should be, based * on the lengths of the parameters. * * @param par vector of lengths of the parameters. */ virtual unsigned int length (std::vector const &par) const = 0; /** * Returns the number of degrees of freedom of the distribution * given the parameter lengths. By default this is the same as * VectorDist#length. However, some distributions are constrained: * and the support occupies a lower dimensional subspace. In this * case, the df member function must be overrideen. */ virtual unsigned int df(std::vector const &lengths) const; /** * Returns a Monte Carlo estimate of the Kullback-Leibler * divergence between distributions with two different parameter * values. This is done by drawing random samples from the * distribution with the first set of parameters and then * calculating the log-likelihood ratio with respect to the second * set of parameters. * * Only one lower and one upper bound is required, which is * assumed common to both sets of parameters. This is because the * Kullback-Leibler divergence is infinite between two bounded * distributions if they do not share the same bounds. * * @param par1 First set of parameters * @param par2 Second set of parameter values * @param lengths Vector of parameter lengths, common to both par1 and par2 * @param lower Pointer to lower bound (NULL if unbounded) * @param upper Pointer to upper bound (NULL if unbounded) * @param rng Random number generator * @param nrep Number of replicates on which to base the estimate */ double KL(std::vector const &par1, std::vector const &par2, std::vector const &lengths, double const *lower, double const *upper, RNG *rng, unsigned int nrep) const; /** * Returns the Kullback-Leibler divergence between distributions * with two different parameter values. * * This is a virtual function that must be overloaded for any * distribution that allows exact Kullback-Leibler divergence * calculations. The default method returns JAGS_NA, indicating that * the method is not implemented. */ virtual double KL(std::vector const &par1, std::vector const &par2, std::vector const &lengths) const; }; } /* namespace jags */ #endif /* VECTOR_DISTRIBUTION_H_ */ JAGS-4.3.2/src/include/distribution/ArrayDist.h0000664000175000017500000001575314224052514016205 00000000000000#ifndef ARRAY_DIST_H_ #define ARRAY_DIST_H_ #include #include #include namespace jags { struct RNG; /** * @short Matrix- or array-valued distribution * * This is the most general sub-class for distributions and is used * whenever a distribution takes values in a matrix or * higher-dimensional array (e.g. Wishart) or has parameters that are * array-valued (e.g. multivariate normal). */ class ArrayDist : public Distribution { public: /** * Constructor. * @param name name of the distribution as used in the BUGS language * @param npar number of parameters, excluding upper and lower bounds */ ArrayDist(std::string const &name, unsigned int npar); /** * @param x Value at which to evaluate the density. * * @param type Indicates whether the full probability density * function is required (PDF_FULL) or whether partial calculations * are permitted (PDF_PRIOR, PDF_LIKELIHOOD). See PDFType for * details. * * @param length Size of the array x. * * @param parameters Vector of parameter values of the * distribution. * * @param dims Dimensions of the parameters. * * @returns The log probability density. If the density should be * zero because x is inconsistent with the parameters then -Inf is * returned. If the parameters are invalid * (i.e. checkParameterValue returns false), then the return value * is undefined. */ virtual double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector > const &dims, double const *lbound, double const *ubound) const = 0; /** * Draws a random sample from the distribution. * * @param x Array to which the sample values are written * * @param length Size of the array x. * * @param parameters Parameters for the distribution. This vector * should be of length npar(). Each element is a pointer to the * start of an array containing the parameters. The size of the * array should correspond to the dims parameter. * * @param dims Dimensions of the parameters * * @param lbound pointer to array containing the lower boundary of * the distribution. This should be of size length or may be NULL if * there is no lower boundary. * * @param lbound pointer to array containing the upper boundary of * the distribution. This should be of size length or may be NULL if * there is no upper boundary. * * @param rng pseudo-random number generator to use. * * @exception length_error */ virtual void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lbound, double const *ubound, RNG *rng) const = 0; /** * Returns a typical value from the distribution. The meaning of * this will depend on the distribution, but it will normally be a * mean, median or mode. * * @param x Array to which the sample values are written * * @param length Size of the array x. * * @param parameters Vector of parameter values for the distribution. * This vector should be of length npar(). * * @param dims Vector of parameter dimensions. * * @exception length_error */ virtual void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lbound, double const *ubound) const = 0; /** * Checks that dimensions of the parameters are correct. */ virtual bool checkParameterDim (std::vector > const ¶meters) const = 0; /** * Checks that the values of the parameters are consistent with * the distribution. For example, some distributions require than * certain parameters are positive, or lie in a given range. * * This function assumes that checkParameterDim returns true. */ virtual bool checkParameterValue(std::vector const ¶meters, std::vector > const &dims) const = 0; /** * Calculates what the dimension of the distribution should be, * based on the dimensions of its parameters. */ virtual std::vector dim (std::vector > const &args) const = 0; /** * Returns the number of degrees of freedom of the distribution * given the dimensions of the parameters. By default this is the * product of the elements of the dimension vector returned by * ArrayDist#dim. However, some distributions are constrained: and * the support occupies a lower dimensional subspace. In this * case, the df member function must be overrideen. */ virtual unsigned int df(std::vector > const &dims) const; /** * Returns the support of an unbounded distribution */ virtual void support(double *lower, double *upper, unsigned int length, std::vector const &support, std::vector > const &dims) const = 0; /** * Returns a Monte Carlo estimate of the Kullback-Leibler * divergence between distributions with two different parameter * values. This is done by drawing random samples from the * distribution with the first set of parameters and then * calculating the log-likelihood ratio with respect to the second * set of parameters. * * A subclass of ArrayDist can overload this function if the * Kullback-Leibler divergence for the distribution it represents * can be expressed in closed form. * * @param par1 First set of parameters * @param par2 Second set of parameter values * @param dims Vector of parameter dimensions, common to both par1 and par2 * @param rng Random number generator * @param nrep Number of replicates on which to base the estimate */ double KL(std::vector const &par1, std::vector const &par2, std::vector > const &dims, double const *lower, double const *upper, RNG *rng, unsigned int nrep) const; /** * Returns the Kullback-Leibler divergence between distributions * with two different parameter values. * * This is a virtual function that must be overloaded for any * distribution that allows exact Kullback-Leibler divergence * calculations. The default method returns JAGS_NA, indicating that * the method is not implemented. */ virtual double KL(std::vector const &par1, std::vector const &par2, std::vector > const &dims) const; }; } /* namespace jags */ #endif /* ARRAY_DIST_H_ */ JAGS-4.3.2/src/include/distribution/DistPtr.h0000664000175000017500000000201314224052514015655 00000000000000#ifndef DIST_POINTER_H_ #define DIST_POINTER_H_ #include #include #include namespace jags { /** * @short Polymorphic pointer to Distribution * * A DistPtr holds a pointer to one of the three sub-classes of * Distribution: ScalarDist, VectorDist, or ArrayDist. The pointers * can be extracted using the extractor functions SCALAR, VECTOR, and * ARRAY, respectively . */ class DistPtr { ScalarDist const * sdist; VectorDist const * vdist; ArrayDist const * adist; public: DistPtr(); DistPtr(ScalarDist const *); DistPtr(VectorDist const *); DistPtr(ArrayDist const *); bool operator==(DistPtr const &rhs) const; std::string const &name() const; friend ScalarDist const *SCALAR(DistPtr const &p); friend VectorDist const *VECTOR(DistPtr const &p); friend ArrayDist const *ARRAY(DistPtr const &p); friend bool isNULL(DistPtr const &p); }; } /* namespace jags */ #endif /* DIST_POINTER_H_ */ JAGS-4.3.2/src/include/distribution/DistTab.h0000664000175000017500000000161714224052514015627 00000000000000#ifndef DIST_TAB_H_ #define DIST_TAB_H_ #include #include #include namespace jags { /** * @short Look-up table for Distribution objects * * The DistTab class provides a means of looking up Distributions by * their name in the BUGS language. * * @see Dist DistTab */ class DistTab { std::list _dlist; DistPtr const _nulldist; public: DistTab(); /** * Inserts a dist into the table. */ void insert (DistPtr const &dist); /** * Finds a distribution by name. * * @return a polymorphic dist pointer. If the distribution cannot * be found, then the pointer is a null DistPtr object. */ DistPtr const &find(std::string const &name) const; /** * Removes a distribution from the table. */ void erase(DistPtr const &dist); }; } /* namespace jags */ #endif /* DIST_TAB_H_ */ JAGS-4.3.2/src/include/distribution/DistError.h0000664000175000017500000000102314224052371016202 00000000000000#ifndef DIST_ERROR_H_ #define DIST_ERROR_H_ #include #include namespace jags { class Distribution; /** * @short Exception class for Distributions * * This is a convenience class used when throwing a runtime error that * concerns a Distribution object. The error message is synthesized * with the name of the distribution. */ class DistError : public std::runtime_error { public: DistError(Distribution const *dist, std::string const &msg); }; } /* namespace jags */ #endif /* DIST_ERROR_H_ */ JAGS-4.3.2/src/include/distribution/RScalarDist.h0000664000175000017500000000765214224052514016455 00000000000000#ifndef R_SCALAR_DIST_H_ #define R_SCALAR_DIST_H_ #include namespace jags { struct RNG; /** * @short Scalar Distribution using R math library infrastructure. * * A subclass of RScalarDist has to implement the d,p,q, and r virtual * member functions. These are based on the d-p-q-r functions provided * by libRmath. * * The JAGS versions of most (but not all) scalar distributions extend * the distribution families in libRmath by allowing the distribution * to be bounded. */ class RScalarDist : public ScalarDist { const bool _discrete; double calPlower(double, std::vector const &) const; double calPupper(double, std::vector const &) const; public: /** * Constructor * * @param name BUGS language name of distribution * * @param npar Number of parameters, excluding upper and lower bound * * @param support Support of distribution * * @param discrete Boolean flag indicating whether the distribution is * discrete valued. */ RScalarDist(std::string const &name, unsigned int npar, Support support, bool discrete=false); double logDensity(double x, PDFType type, std::vector const ¶meters, double const *lower, double const *upper) const; double randomSample(std::vector const ¶meters, double const *lower, double const *upper, RNG *rng) const; /** * Returns the median. Note that this function can be overloaded * by a subclass if necessary. */ double typicalValue(std::vector const ¶meters, double const *lower, double const *upper) const; /** * Density function, ignoring bounds * @param x value at which to evaluate the density * @param type Type of density calculation required. * @param parameters Array of parameters * @param give_log Indicates whether to return log density. */ virtual double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const = 0; /** * Distribution function, ignoring bounds * @param x quantile at which to evaluate the distribution function * @param parameters Array of parameters * @param lower If true, return value is P[X <= x]. Otherwise * P[X > x] * @param give_log Indicates whether to return log probabability */ virtual double p(double x, std::vector const ¶meters, bool lower, bool give_log) const = 0; /** * Quantile function, ignoring bounds * @param p probability for which to evaluate quantile * @param parameters Array of parameters * @param log_p Indicates whether p is given as log(p). */ virtual double q(double p, std::vector const ¶meters, bool lower, bool log_p) const = 0; /** * Random number generation, ignoring bounds * @param parameters Array of parameters */ virtual double r(std::vector const ¶meters, RNG *rng) const = 0; /** * All RScalarDist distributions can be bounded */ bool canBound() const; /** * RScalarDist distributions are defined to have support on the integers * or on the real line by the constructor */ bool isDiscreteValued(std::vector const &mask) const; /** * Alternative function for determining whether the distribution is * discrete-valued. */ bool discrete() const; }; /** * Convenience function that calculates x * log(0) as the limit of * x * log(p) as p tends to zero. This is required for calculation * of some density functions. * * @param x coefficient of log(0) * @param give_log logical flag. If true then the limit of x*log(p) * is returned, otherwise the limit of p^x. */ double xlog0(double x, bool give_log); } #endif /* SCALAR_DIST_RMATH_H_ */ JAGS-4.3.2/src/include/distribution/Makefile.in0000644000175000017500000004300314400675235016171 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/distribution ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(distribinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(distribincludedir)" HEADERS = $(distribinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ distribincludedir = $(pkgincludedir)/distribution distribinclude_HEADERS = Distribution.h ScalarDist.h VectorDist.h \ ArrayDist.h DistPtr.h DistTab.h DistError.h RScalarDist.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/distribution/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/distribution/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-distribincludeHEADERS: $(distribinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(distribinclude_HEADERS)'; test -n "$(distribincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(distribincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(distribincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(distribincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(distribincludedir)" || exit $$?; \ done uninstall-distribincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(distribinclude_HEADERS)'; test -n "$(distribincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(distribincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(distribincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-distribincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-distribincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-distribincludeHEADERS \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-distribincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/function/0000755000175000017500000000000014400711323013277 500000000000000JAGS-4.3.2/src/include/function/Makefile.am0000664000175000017500000000053114224052371015261 00000000000000funcincludedir = $(pkgincludedir)/function funcinclude_HEADERS = FuncTab.h Function.h ScalarFunction.h \ VectorFunction.h ArrayFunction.h LinkFunction.h FunctionPtr.h \ FuncError.h DPQFunction.h DFunction.h PFunction.h QFunction.h \ ScalarLogDensity.h VectorLogDensity.h ArrayLogDensity.h \ ScalarVectorFunction.h noinst_HEADERS = testfun.h JAGS-4.3.2/src/include/function/FuncTab.h0000664000175000017500000000237314224052514014725 00000000000000#ifndef FUNC_TAB_H_ #define FUNC_TAB_H_ #include #include #include namespace jags { /** * @short Look-up table for Function objects * * The FuncTab class provides a means of looking up Functions by their * name in the BUGS language. * * @see Function DistTab */ class FuncTab { std::list _flist; FunctionPtr const _nullfun; public: /** * Constructs a new empty FuncTab */ FuncTab(); /** * Inserts a function into the table. */ void insert (FunctionPtr const &func); /** * Finds the inverse of a link function by name * * @parameter name Name of the link function * * @return Pointer to the inverse link function or a NULL pointer * if it was not found. */ LinkFunction const *findLink (std::string const &name) const; /** * Finds a function by name. * * @return a polymorphic function pointer. If the function cannot be * found, then the pointer is a null FunctionPtr object. */ FunctionPtr const &find(std::string const &name) const; /** * Removes a function from the table. */ void erase(FunctionPtr const &func); }; } /* namespace jags */ #endif /* FUNC_TAB_H_ */ JAGS-4.3.2/src/include/function/Function.h0000664000175000017500000001372114224052514015167 00000000000000#ifndef FUNCTION_H_ #define FUNCTION_H_ #include #include namespace jags { class Range; /** * Base class for functions. * * Function objects contain only constant data members and all member * functions are constant. Hence only one object needs to be * instantiated for each subclass. * * The FuncTab class provides a convenient way of storing Function * objects and referencing them by name. * * @see FuncTab * @short BUGS-language function or operator */ class Function { const std::string _name; const unsigned int _npar; public: /** * Constructor. * @param name name of the function as used in the BUGS language * @param npar number of parameters. If npar == 0 then the function * takes a variable number of parameters. */ Function(std::string const &name, unsigned int npar); virtual ~Function (); /** * Returns the BUGS language name of the function */ std::string const &name () const; /** * Returns an alternate name for the function. The default * implementation returns an empty string. However, this function * may be overridden to return a non-empty string giving an * alternate name for the function. */ virtual std::string alias() const; /** * Returns the number of parameters. A variadic function returns 0. */ unsigned int npar() const; /** * Returns true if the function returns integer values. The * default implementation returns false. A function that returns * integer values will need to overload this. * * @param mask Vector indicating whether parameters are discrete * or not. */ virtual bool isDiscreteValued(std::vector const &mask) const; /** * Checks whether the required arguments are discrete-valued. * Most functions do not require discrete-valued arguments, so * a default implementation is provided which always returns true. * * @param mask Boolean vector indicating which parameters are * discrete valued. */ virtual bool checkParameterDiscrete(std::vector const &mask) const; /** * Tests whether the function preserves scale transformations, i.e. * it can be represented element-wise in the form f(x)[i] = B[i] * x[i]. * * It is permitted for the isScale function to return false * negatives, i.e. to return false when the function does preserve * scale transformations. Since most functions are not scale * transformations, the default method returns false. * * @param mask boolean vector of length equal to the number of * parameters. The mask indicates a subset of parameters (those * with value true) that are themselves scale transformations of * x. The others are not functions of x. At least one element of * mask must be true. * * @param isfixed boolean vector. This may be empty, in which case * it is ignored. A non-empty vector must have length equal to * mask, and denotes the parameters whose values are fixed. In * this case the test is more restrictive, and returns true only * if the coefficient B[i] is fixed for all i, assuming that the * parameters for which mask is true are themselves fixed scale * transformations. * * @see DeterministicNode#isClosed */ virtual bool isScale(std::vector const &mask, std::vector const &isfixed) const; /** * Tests whether the function preserves linear transformations, i.e. * a function of the form f(x) = A + B %*% x. * * All scale functions are linear functions. Therefore, the * default method calls isScale. It only needs to be overridden * for linear functions that are not scale functions. * * @see Function#isScale */ virtual bool isLinear(std::vector const &mask, std::vector const &isfixed) const; /** * Tests whether the function preserves power transformations, * i.e. can be expressed as f(x) = a*b^x for some value of a,b, * where a,b, and x are all scalar. * * The default method returns false. */ virtual bool isPower(std::vector const &mask, std::vector const &isfixed) const; /** * Tests whether the function is additive, i.e. a function of the * form f(x) = A + sum(x) where sum(x) is the sum of all elements of x. * * The default method returns false */ virtual bool isAdditive(std::vector const &mask, std::vector const &isfixed) const; /** * Returns a BUGS-language expression representing the function call. * The default behaviour for a function named "foo" is to return * "foo(arg1,arg2)". Functions that are represented as prefix or infix * operators need to override this function. * * @param par Vector of parameter names for the function */ virtual std::string deparse(std::vector const &par) const; /** * Checks that the required parameters are fixed. Most functions * do not require any fixed parameters, so the default * implementation returns true. However, for some ArrayFunctions * the dimension of the return value depends on the values of some of * the parameters. These parameters must be fixed so that the * dimension can be determined at compile time. Hence the default * function must be overridden for any function with a return * value whose dimension cannot be determined purely from the * dimensions of its arguments. * * @param mask Boolean vector indicating which parameters have * fixed values */ virtual bool checkParameterFixed(std::vector const &mask) const; }; /** * Checks that a vector of parameters of length npar is consistent * with the function. */ inline bool checkNPar(Function const *func, unsigned int npar) { return (func->npar() == 0 && npar > 0) || func->npar() == npar; } } /* namespace jags */ #endif /* FUNCTION_H_ */ JAGS-4.3.2/src/include/function/ScalarFunction.h0000664000175000017500000000270114224052514016311 00000000000000#ifndef SCALAR_FUNCTION_H_ #define SCALAR_FUNCTION_H_ #include namespace jags { /** * @short Scalar-valued Function with scalar arguments * * ScalarFunction represents scalar-valued functions whose parameters are * also scalars. */ class ScalarFunction : public Function { public: ScalarFunction(std::string const &name, unsigned int npar); /** * Evaluates the function and returns the result * * @param args Vector of arguments */ virtual double evaluate(std::vector const &args) const = 0; /** * Checks that the argument values are in the domain of the function. */ virtual bool checkParameterValue(std::vector const &args) const; /** * Tests whether the function preserves power transformations, * i.e. can be expressed as f(x) = a*b^x for some value of a,b, * where a,b, and x are all scalar. * * The default method returns true if the ScalarFunction preserves * scale transformations AND only one element of mask is true. * Such functions also preserve fixed power transformations. * * Note that if a > 0 then a power function is a linear function on * the log scale: log(f(x)) = log(a) + log(b) * x. * * @see Function#isPower */ bool isPower(std::vector const &mask, std::vector const &isfixed) const; }; } /* namespace jags */ #endif /* SCALAR_FUNCTION_H_ */ JAGS-4.3.2/src/include/function/VectorFunction.h0000664000175000017500000000417214224052514016352 00000000000000#ifndef VECTOR_FUNCTION_H_ #define VECTOR_FUNCTION_H_ #include namespace jags { /** * @short Vector-valued function with vector arguments * * VectorFunction represents vector-valued functions whose parameters are * also vectors. */ class VectorFunction : public Function { public: VectorFunction(std::string const &name, unsigned int npar); /** * Evaluates the function and writes the result into the given * array * * @param value Array of doubles which will contain the result on exit. * @param args Vector of arguments * @param lengths Vector of argument lengths: the length of the array * of doubles pointed to by args[i] is lengths[i]. */ virtual void evaluate(double *value, std::vector const &args, std::vector const &lengths) const = 0; /** * Calculates the length of the return value based on the arguments. * * @param arglengths Vector of argument lengths. This must return * true when passed to checkParameterLength * * @param argvalues Vector of pointers to argument values. * */ virtual unsigned int length(std::vector const &arglengths, std::vector const &argvalues) const = 0; /** * Checks that the lengths of all the arguments are consistent. * The default implementation returns true if all the arguments * have non-zero length. * * This should be overridden by any sub-class that either has * additional restrictions on the lengths of the arguments, or may * allow zero-length arguments. */ virtual bool checkParameterLength(std::vector const &args) const; /** * Checks that the values of the arguments are in the domain of * the function. The default implementation always returns true * (i.e. assumes there are no restrictions on parameters). */ virtual bool checkParameterValue(std::vector const &args, std::vector const &lengths) const; }; } /* namespace jags */ #endif /* VECTOR_FUNCTION_H_ */ JAGS-4.3.2/src/include/function/ArrayFunction.h0000664000175000017500000000412614224052514016165 00000000000000#ifndef ARRAY_FUNCTION_H_ #define ARRAY_FUNCTION_H_ #include #include #include namespace jags { /** * @short Matrix- or array-valued function * * Array-valued functions are the most general class of function. The * arguments of an array-valued function, and the value may be a * scalar, vector, or array. * */ class ArrayFunction : public Function { public: /** * Constructor. */ ArrayFunction(std::string const &name, unsigned int npar); /** * Evaluates the function. * * @param value array of doubles which contains the result of * the evaluation on exit * @param args Vector of arguments. * @param dims Respective dimensions of each element of args. */ virtual void evaluate(double *value, std::vector const &args, std::vector > const &dims) const = 0; /** * Checks whether dimensions of the function parameters are correct. * * @param dims Vector of length npar denoting the dimensions of * the parameters, with any redundant dimensions dropped. */ virtual bool checkParameterDim(std::vector > const &dims) const = 0; /** * Checks whether the parameter values lie in the domain of the * function. The default implementation returns true. */ virtual bool checkParameterValue(std::vector const &args, std::vector > const &dims) const; /** * Calculates what the dimension of the return value should be, * based on the arguments. * * @param dims Vector of Indices denoting the dimensions of the * parameters. This vector must return true when passed to * checkParameterDim. * * @param values Vector of pointers to parameter values. */ virtual std::vector dim(std::vector > const &dims, std::vector const &values) const = 0; }; } /* namespace jags */ #endif /* ARRAY_FUNCTION_H_ */ JAGS-4.3.2/src/include/function/LinkFunction.h0000664000175000017500000000231114224052514015776 00000000000000#ifndef LINK_FUNCTION_H_ #define LINK_FUNCTION_H_ #include namespace jags { /** * @short Inverse link functions. * * An inverse link function is a continuous differentiable scalar function * with range (-Inf,Inf). * * Link functions may be expressed in the BUGS language using an * S-style replacement function notation. For example the log link may * be expressed as log(y) <- a + b*x or as y <- exp(a + b*x). * In this case, the name of the inverse link function is "exp" * and its link name is "log". */ class LinkFunction : public Function { const std::string _link; public: /** * Constructor * @param name Function name * @param link Name used by replacement-function notation. */ LinkFunction (std::string const &name, std::string const &link); /** Returns the name of the link function */ std::string const &linkName () const; /** Inverse of link function */ virtual double inverseLink(double eta) const = 0; /** Link function */ virtual double link(double mu) const = 0; /** Gradient of the inverse link function */ virtual double grad(double eta) const = 0; }; } /* namespace jags */ #endif /* LINK_FUNCTION_H_ */ JAGS-4.3.2/src/include/function/FunctionPtr.h0000664000175000017500000000253314224052514015654 00000000000000#ifndef FUNCTION_POINTER_H_ #define FUNCTION_POINTER_H_ #include #include #include #include namespace jags { /** * @short Polymorphic pointer to Function * * A FunctionPtr holds a pointer to one of the four sub-classes of * Function: LinkFunction, ScalarFunction, VectorFunction, or * ArrayFunction. The pointers can be extracted using the extractor * functions LINK, SCALAR, VECTOR, and ARRAY, respectively . */ class FunctionPtr { LinkFunction const * lfunc; ScalarFunction const * sfunc; VectorFunction const * vfunc; ArrayFunction const * afunc; public: FunctionPtr(); FunctionPtr(ScalarFunction const *); FunctionPtr(VectorFunction const *); FunctionPtr(ArrayFunction const *); FunctionPtr(LinkFunction const *); bool operator==(FunctionPtr const &rhs) const; std::string const &name() const; friend LinkFunction const *LINK(FunctionPtr const &p); friend ScalarFunction const *SCALAR(FunctionPtr const &p); friend VectorFunction const *VECTOR(FunctionPtr const &p); friend ArrayFunction const *ARRAY(FunctionPtr const &p); friend Function const *FUNC(FunctionPtr const &p); friend bool isNULL(FunctionPtr const &p); }; } /* namespace jags */ #endif /* FUNCTION_POINTER_H_ */ JAGS-4.3.2/src/include/function/FuncError.h0000664000175000017500000000077714224052371015317 00000000000000#ifndef FUNC_ERROR_H_ #define FUNC_ERROR_H_ #include #include namespace jags { class Function; /** * @short Exception class for Functions * * This is a convenience class used when throwing a runtime error that * concerns a Function object. The error message is synthesized * with the name of the function. */ class FuncError : public std::runtime_error { public: FuncError(Function const *func, std::string const &msg); }; } /* namespace jags */ #endif /* FUNC_ERROR_H_ */ JAGS-4.3.2/src/include/function/DPQFunction.h0000664000175000017500000000233414224052514015532 00000000000000#ifndef DPQ_FUNCTION_H_ #define DPQ_FUNCTION_H_ #include namespace jags { class RScalarDist; /** * @short Functions derived from R Scalar distributions * * The DPQFunction class exposes member functions of the class * RScalarDist as BUGS functions so that they can be called by the * user. These are the density (D), cumulative probability (P), * and quantile (Q) functions. * * D-P-Q functions are generated automatically when an * RScalarFunction is inserted into the Module. * * @seealso Module#insert */ class DPQFunction : public ScalarFunction { RScalarDist const *_dist; public: DPQFunction(std::string const &name, RScalarDist const *dist); /** * Returns the distribution from which the function is derived */ RScalarDist const *dist() const; /** * If an RScalarDist has m parameters, then a DPQFunction * derived from it will have (m+1) arguments. To check the * validity of the arguments, we strip off the first one and * then pass the rest to ScalarDist#checkParameterValue */ bool checkArgs(std::vector const &args) const; }; } #endif /* DPQ_FUNCTION_H_ */ JAGS-4.3.2/src/include/function/DFunction.h0000664000175000017500000000066714224052514015300 00000000000000#ifndef D_FUNCTION_H_ #define D_FUNCTION_H_ #include "DPQFunction.h" namespace jags { /** * @short Density function for an R Scalar Distribution */ class DFunction : public DPQFunction { public: DFunction(RScalarDist const *dist); bool checkParameterValue(std::vector const &args) const; double evaluate(std::vector const &args) const; }; } #endif /* D_FUNCTION_H_ */ JAGS-4.3.2/src/include/function/PFunction.h0000664000175000017500000000070714224052514015307 00000000000000#ifndef P_FUNCTION_H_ #define P_FUNCTION_H_ #include "DPQFunction.h" namespace jags { /** * @short Cumulative distribution function for an R Scalar distribution */ class PFunction : public DPQFunction { public: PFunction(RScalarDist const *dist); bool checkParameterValue(std::vector const &args) const; double evaluate(std::vector const &args) const; }; } #endif /* P_FUNCTION_H_ */ JAGS-4.3.2/src/include/function/QFunction.h0000664000175000017500000000067014224052514015307 00000000000000#ifndef Q_FUNCTION_H_ #define Q_FUNCTION_H_ #include "DPQFunction.h" namespace jags { /** * @short Quantile function for an R Scalar Distribution */ class QFunction : public DPQFunction { public: QFunction(RScalarDist const *dist); bool checkParameterValue(std::vector const &args) const; double evaluate(std::vector const &args) const; }; } #endif /* Q_FUNCTION_H_ */ JAGS-4.3.2/src/include/function/ScalarLogDensity.h0000664000175000017500000000104414224052514016604 00000000000000#ifndef SCALAR_LOG_DENSITY_H_ #define SCALAR_LOG_DENSITY_H_ #include namespace jags { class ScalarDist; /** * @short Log density function for a scalar-valued Distribution */ class ScalarLogDensity : public ScalarFunction { ScalarDist const *_dist; public: ScalarLogDensity(ScalarDist const *dist); bool checkParameterValue(std::vector const &args) const; double evaluate(std::vector const &args) const; }; } #endif /* SCALAR_LOG_DENSITY_H_ */ JAGS-4.3.2/src/include/function/VectorLogDensity.h0000664000175000017500000000153114224052514016642 00000000000000#ifndef VECTOR_LOG_DENSITY_H_ #define VECTOR_LOG_DENSITY_H_ #include namespace jags { class VectorDist; /** * @short Log density function for a vector-valued Distribution */ class VectorLogDensity : public VectorFunction { VectorDist const *_dist; public: VectorLogDensity(VectorDist const *dist); unsigned int length(std::vector const &lengths, std::vector const &values) const; bool checkParameterLength(std::vector const &lens) const; bool checkParameterValue(std::vector const &args, std::vector const &lens) const; void evaluate(double *value, std::vector const &args, std::vector const &lens) const; }; } #endif /* VECTOR_LOG_DENSITY_H_ */ JAGS-4.3.2/src/include/function/ArrayLogDensity.h0000664000175000017500000000163314224052514016461 00000000000000#ifndef ARRAY_LOG_DENSITY_H_ #define ARRAY_LOG_DENSITY_H_ #include namespace jags { class ArrayDist; /** * @short Log density function for an array-valued Distribution */ class ArrayLogDensity : public ArrayFunction { ArrayDist const *_dist; public: ArrayLogDensity(ArrayDist const *dist); std::vector dim( std::vector > const &dims, std::vector const &values) const; bool checkParameterDim( std::vector > const &dims) const; bool checkParameterValue( std::vector const &args, std::vector > const &dims) const; void evaluate( double *value, std::vector const &args, std::vector > const &dims) const; }; } #endif /* ARRAY_LOG_DENSITY_H_ */ JAGS-4.3.2/src/include/function/ScalarVectorFunction.h0000664000175000017500000000244014224052514017474 00000000000000#ifndef SCALAR_VECTOR_FUNCTION_H_ #define SCALAR_VECTOR_FUNCTION_H_ #include namespace jags { /** * @short Scalar-valued function with vector arguments * * ScalarVectorFunction represents scalar-valued functions whose * parameters are vectors. */ class ScalarVectorFunction : public VectorFunction { public: ScalarVectorFunction(std::string const &name, unsigned int npar); /** * Evaluates the function and returns the scalar result * @param args Vector of arguments * @param lengths Vector of argument lengths: the length of the array * of doubles pointed to by args[i] is lengths[i]. */ virtual double scalarEval (std::vector const &args, std::vector const &lengths) const = 0; /** * Implements VectorFunction#evaluate in terms of * ScalarVectorFunction#eval. */ void evaluate(double *value, std::vector const &args, std::vector const &lengths) const; /** * Implements VectorFunction#length, returning the value 1 */ unsigned int length(std::vector const &arglengths, std::vector const &argvalues) const; }; } /* namespace jags */ #endif /* SCALAR_VECTOR_FUNCTION_H_ */ JAGS-4.3.2/src/include/function/testfun.h0000664000175000017500000001346114224052514015073 00000000000000#ifndef FUNC_TEST_H_ #define FUNC_TEST_H_ #include "ScalarFunction.h" #include "VectorFunction.h" /* Function in JAGS are set up to take vectors of pointers as arguments, with additional arguments for lengths or dimensions of the arguments when necessary. This is not a good choice for the testing framework. These are wrappers to the members of Function and its subclasses that take care of setting up the arguments in the right way. We use these to simplify the testing framework. The most important functions are "eval" and "veval" for functions returning a scalar and a vector, respectively. The eval function can be used to test a ScalarFunction taking from 1 to 3 arguments. It takes doubles as arguments and returns a double. The veval function can be used to test a VectorFunction taking from 1 to 4 arguments. Through the use of templates, veval accepts as arguments any of the following: an STL vector of doubles, a double, or a static array of doubles. The eval function is also overlaoded to allow evaluation of a VectorFunction returning a scalar value. */ /* Testing functions valid for all functions */ //Check all possible values of mask using a predicate (see below) bool isdiscrete(jags::Function const *f, unsigned int npar, bool (*predicate) (std::vector const &)); //suitable predicates for isdiscrete bool always(std::vector const &); //returns true bool never(std::vector const &); //returns false bool all(std::vector const &); //returns true if all arguments are true bool any(std::vector const &); //returns true if any argyments are true //Returns true if f is never an additive function bool neveradditive(jags::Function const *f, unsigned int npar); //Returns true if f is never a scale function bool neverscale(jags::Function const *f, unsigned int npar); //Returns true if f is never a linear function bool neverlinear(jags::Function const *f, unsigned int npar); //Returns true if f is never a power function bool neverpow(jags::Function const *f, unsigned int npar); //Returns true if f is never an additive, linear, scale, or power function bool neverclosed(jags::Function const *f, unsigned int npar); /* Tests for scalar functions */ //Check that the limits of a scalar function are valid void checkLimits(jags::ScalarFunction const *f, double lower, double upper); //Evaluate a scalar function taking a single argument. double eval(jags::ScalarFunction const *f, const double x); //Evaluate a scalar function taking two arguments double eval(jags::ScalarFunction const *f, double x, double y); //Evaluate a scalare function taking three arguments double eval(jags::ScalarFunction const *f, double x, double y, double z); /* Tests for vector functions */ //Convert a double to a vector of length 1 inline std::vector mkVec(double const &x) { return std::vector(1, x); } //Convert a static array of length N to a vector of length N template std::vector mkVec(double const (&x)[N]) { std::vector y(N); copy(x, x + N, y.begin()); return y; } //An apparently trivial conversion function that allows us to mix STL //vectors with scalars and static arrays as arguments inline std::vector mkVec(std::vector const &x) { return x; } //Safely evaluate a vector function taking a single argument std::vector veval(jags::VectorFunction const *f, std::vector const &x); //Templated version that allows you to pass any argument that can be //coerced to an STL vector via mkVec template std::vector veval(jags::VectorFunction const *f, T const &x) { return veval(f, mkVec(x)); } //Safely evaluate a vector function taking two arguments std::vector veval(jags::VectorFunction const *f, std::vector const &x, std::vector const &y); //Templated version template std::vector veval(jags::VectorFunction const *f, T const &x, U const &y) { return veval(f, mkVec(x), mkVec(y)); } //Three arguments std::vector veval(jags::VectorFunction const *f, std::vector const &x, std::vector const &y, std::vector const &z); //Three arguments, template template std::vector veval(jags::VectorFunction const *f, T const &x, U const &y, V const &z) { return veval(f, mkVec(x), mkVec(y), mkVec(z)); } //Four arguments std::vector veval(jags::VectorFunction const *f, std::vector const &x, std::vector const &y, std::vector const &z, std::vector const &w); //Four arguments, template template std::vector veval(jags::VectorFunction const *f, T1 const &x1, T2 const &x2, T3 const &x3, T4 const &x4) { return veval(f, mkVec(x1), mkVec(x2), mkVec(x3), mkVec(x4)); } /* Vector functions returning a scalar */ //Single argument double eval(jags::VectorFunction const *f, std::vector const &x); //Template version template double eval(jags::VectorFunction const *f, T const &x) { return eval(f, mkVec(x)); } //Two arguments double eval(jags::VectorFunction const *f, std::vector const &x, std::vector const &y); //Template version template double eval(jags::VectorFunction const *f, T const &x, U const &y) { return eval(f, mkVec(x), mkVec(y)); } //Three arguments double eval(jags::VectorFunction const *f, std::vector const &x, std::vector const &y, std::vector const &z); //Template version template double eval(jags::VectorFunction const *f, T const &x, U const &y, V const &z) { return eval(f, mkVec(x), mkVec(y), mkVec(z)); } #endif /* FUNC_TEST_H_ */ JAGS-4.3.2/src/include/function/Makefile.in0000644000175000017500000004320614400675235015304 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/function ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(funcinclude_HEADERS) \ $(noinst_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(funcincludedir)" HEADERS = $(funcinclude_HEADERS) $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ funcincludedir = $(pkgincludedir)/function funcinclude_HEADERS = FuncTab.h Function.h ScalarFunction.h \ VectorFunction.h ArrayFunction.h LinkFunction.h FunctionPtr.h \ FuncError.h DPQFunction.h DFunction.h PFunction.h QFunction.h \ ScalarLogDensity.h VectorLogDensity.h ArrayLogDensity.h \ ScalarVectorFunction.h noinst_HEADERS = testfun.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/function/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/function/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-funcincludeHEADERS: $(funcinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(funcinclude_HEADERS)'; test -n "$(funcincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(funcincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(funcincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(funcincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(funcincludedir)" || exit $$?; \ done uninstall-funcincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(funcinclude_HEADERS)'; test -n "$(funcincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(funcincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(funcincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-funcincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-funcincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-funcincludeHEADERS \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-funcincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/graph/0000755000175000017500000000000014400711323012553 500000000000000JAGS-4.3.2/src/include/graph/Makefile.am0000664000175000017500000000060514224052514014536 00000000000000graphincludedir = $(pkgincludedir)/graph graphinclude_HEADERS = AggNode.h MixtureNode.h MixTab.h Node.h \ ConstantNode.h LogicalNode.h StochasticNode.h Graph.h \ DeterministicNode.h GraphMarks.h NodeError.h ScalarLogicalNode.h \ VectorLogicalNode.h ArrayLogicalNode.h LinkNode.h VSLogicalNode.h \ ScalarStochasticNode.h VectorStochasticNode.h ArrayStochasticNode.h \ ParentError.h JAGS-4.3.2/src/include/graph/AggNode.h0000664000175000017500000000561414224052514014164 00000000000000#ifndef AGGREGATE_NODE_H_ #define AGGREGATE_NODE_H_ #include #include namespace jags { /** * @short Aggregate Node combining values from other nodes * * An aggregate Node copies its values directly from its parents: it can * be used to aggregate several small nodes into a larger one, or to take * a subset of a larger node, or some combination of the two. * */ class AggNode : public DeterministicNode { std::vector _offsets; std::vector _parent_values; bool _discrete; /* Forbid copying */ AggNode(AggNode const &orig); AggNode &operator=(AggNode const &rhs); public: /** * The value vector of an AggNode satisfies the equality. *
     * value(chain)[i] == parents[i]->value(chain)[offsets[i]]
     * 
* * @param dim Dimension of the Node. * * @param nchain Number of chains * * @param parents Vector of parent Nodes. This vector should have * the same size as the value array of the AggNode to be * constructed (or a length_error exception is thrown). Each * element of the parents vector gives the source of the value to * be copied. A node may appear several times in this vector. * * @param offsets Vector of offsets. The offsets vector must have * the same size as the value array of the AggNode to be * constructed (or a length_error exception is thrown). Each * element gives the element of the value vector of the * corresponding parent node to be copied. If the offset is greater * than the length of the corresponding parent, an out_of_range * exception is thrown. * * @exception length_error out_of_range */ AggNode(std::vector const &dim, unsigned int nchain, std::vector const &parents, std::vector const &offsets); ~AggNode(); /** * Copies values from parents. */ void deterministicSample(unsigned int chain); /** * An aggregate node is discrete valued if all of its parents are. */ bool isDiscreteValued() const; /** * Aggregate nodes are closed under all classes and are always fixed. */ bool isClosed(std::set const &ancestors, ClosedFuncClass fc, bool fixed) const; /** * An AggNode places no restrictions on its parents' values. Therefore * this function always returns true. */ bool checkParentValues(unsigned int chain) const; /** * An aggregate node is named after its first and last parents */ std::string deparse(std::vector const &parents) const; /** * Returns the vector of offsets */ std::vector const &offsets() const; //DeterministicNode *clone(std::vector const &parents) const; }; } /* namespace jags */ #endif /* AGGREGATE_NODE_H */ JAGS-4.3.2/src/include/graph/MixtureNode.h0000664000175000017500000000664114224052514015124 00000000000000#ifndef MIXTURE_NODE_H_ #define MIXTURE_NODE_H_ #include #include #include namespace jags { class Node; class MixTab; /** * A MixMap is an STL map that associates an index value (a vector * of unsigned integers) with a node. */ typedef std::map, Node const *> MixMap; /** * @short Node for mixture models. * * A mixture node copies its value from one of several parents, based * on the current value of a vector of index nodes. * * In the BUGS language, mixture nodes are represented using nested * indexing. For example, in the deterministic relation * *
y[i] <- x[ind[i]]
* * y[i] is a mixture node if ind[i] is unobserved. If the possible * values of ind[i] are 1...M, then the parents of y[i] are ind[i], * x[1], ... x[M]. */ class MixtureNode : public DeterministicNode { MixTab const *_table; unsigned int _Nindex; bool _discrete; std::vector _active_parents; void updateActive(unsigned int chain); public: /** * Constructs a MixtureNode. * * @param index Vector of index nodes. These must be discrete-valued, * scalar, and unobserved. * * @param nchain Number of chains * * @param map a MixMap object which associates each possible value * of the index nodes with a single parent. */ MixtureNode(std::vector const &index, unsigned int nchain, MixMap const &mixmap); ~MixtureNode(); /** * Copies the value of the active parent */ void deterministicSample(unsigned int chain); /** * Returns a pointer to the currently active parent (i.e. the one * determined by the current index values) in the given chain. */ Node const *activeParent(unsigned int chain) const; /** * Returns the number of index nodes. */ unsigned int index_size() const; /** * Returns a pointer to the MixTab */ MixTab const *mixTab() const; /** * A MixtureNode is discrete valued if all of its possible * parents are discrete */ bool isDiscreteValued() const; /** * A MixtureNode preserves all closed classes if none of its index * nodes are descendants of X. It is never fixed */ bool isClosed(std::set const &ancestors, ClosedFuncClass fc, bool fixed) const; /** * This function always returns true. It ignores possible errors * in the index nodes. This is because the deterministicSample * member function already checks that the index value is valid * and will throw an runtime error if it is not. Repeating these * calculations in the checkParentValues function would therefore * be redundant. */ bool checkParentValues(unsigned int chain) const; /** * Creates a name for the mixture node of the form. * *
mixture(index=[p,q], parents=X[1,1,4]...X[2,3,4])
* * Only the first and last parent nodes are listed to save space. * * Exceptionally, the name of a mixture node is not a reconstruction * of its BUGS-language definition. */ std::string deparse(std::vector const &parents) const; //DeterministicNode *clone(std::vector const &parents) const; }; bool isMixture(Node const *); MixtureNode const * asMixture(Node const *); } /* namespace jags */ #endif /* MIXTURE_NODE_H_ */ JAGS-4.3.2/src/include/graph/MixTab.h0000664000175000017500000000174014224052514014040 00000000000000#ifndef MIX_MAP_H_ #define MIX_MAP_H_ #include #include #include namespace jags { class Node; /** * @short Helper class for MixtureNode * * Evaluation of a MixtureNode uses a MixTab, which takes the * current map value (a vector of integers) and returns a * pointer to the parent node from which the MixtureNode takes its * current value. */ class MixTab { const SimpleRange _range; std::vector _nodes; public: /** * Constructs a MixTab from a MixMap */ MixTab(std::map, Node const *> const &mixmap); /** * Returns a pointer to the node corresponding to the given * index. If there is no node matching the index, a NULL * pointer is returned. */ Node const * getNode(std::vector const &index) const; /** * Returns the range covered by the indices */ Range const &range() const; }; } /* namespace jags */ #endif /* MIX_MAP_H_ */ JAGS-4.3.2/src/include/graph/Node.h0000664000175000017500000001260714224052514013545 00000000000000#ifndef NODE_H_ #define NODE_H_ #include #include #include namespace jags { struct RNG; class StochasticNode; class DeterministicNode; class Graph; /** * @short Random variable status of nodes * * This enumeration is used by Node#randomVariableStatus to classify * nodes into one of three categories. * * Some nodes are considered as random variables, and among those that * are, they may be observed or unobserved. Conversely, a node that is * not a random variable may not be observed. */ enum RVStatus {RV_FALSE, RV_TRUE_UNOBSERVED, RV_TRUE_OBSERVED}; /** * @short Node in a directed acyclic graph */ class Node { std::vector _parents; std::list *_stoch_children; std::list *_dtrm_children; /* Forbid copying of Node objects */ Node(Node const &orig); Node &operator=(Node const &rhs); protected: std::vector const &_dim; const unsigned int _length; const unsigned int _nchain; double *_data; public: /** * Constucts a Node with no parents. * @param dim Dimension of new Node. * @param nchain Number of chains that the Node will contain data on. */ Node(std::vector const &dim, unsigned int nchain); /** * Constructs a node with parents. Each parent must contain data on * the same number of chains. Subclasses of Node may give specific * meaning to the ordering of the parents. * * @param dim Dimension of new Node. * * @param parents vector of parent nodes. A node may not be its own * parent. */ Node(std::vector const &dim, unsigned int nchain, std::vector const &parents); /** * Destructor. */ virtual ~Node(); /** * Number of chains. */ unsigned int nchain() const; /** * Vector of parents. */ std::vector const &parents() const; /** * Draws a random sample from the node's prior distribution. * @param rng Pointer to random number generator * @param chain Number of chain from which to draw sample */ virtual void randomSample(RNG *rng, unsigned int chain) = 0; /** * Calculates a value for the node based on its parents' values. * @param chain Number of chain from which to draw sample */ virtual void deterministicSample(unsigned int chain) = 0; /** * Checks whether the parents of the Node have valid values. */ virtual bool checkParentValues(unsigned int chain) const = 0; /** * Returns the stochastic children of the node */ std::list const *stochasticChildren(); /** * Returns the deterministic children of the node */ std::list const *deterministicChildren(); /** * Initializes the node for the given chain. The value array of a * newly constructed Node consists of missing values (denoted by * the special value JAGS_NA). This function sets the value of * the node by forward sampling from its parents. If the Node has * previously had its value set, the function will do nothing and * return the value true. Initialization will fail if any of the * parent nodes is uninitialized, and in this case the return * value is false. * * @param chain Index number of chain to initialize. * * @returns a logical value indicating success */ bool initialize(unsigned int chain); /** * Returns the BUGS-language representation of the node, based on the * names of its parents * * @param parents Vector of names of parent nodes */ virtual std::string deparse(std::vector const &parents) const = 0; /** * Returns the random variable status of a node. */ virtual RVStatus randomVariableStatus() const = 0; /** * Indicates whether the value of the node is fixed. */ virtual bool isFixed() const = 0; /** * Sets the value of the node for a given chain * @param value Array of values to be assigned * @param length Length of the value array * @param chain number of chain (starting from zero) to modify * * @see SArray#setValue */ void setValue(double const *value, unsigned int length, unsigned int chain); /** * Indicates whether a node is discrete-valued or not. * @see SArray#isDiscreteValued */ virtual bool isDiscreteValued() const = 0; /** * Returns a pointer to the start of the array of values for * the given chain. */ double const *value(unsigned int chain) const; /** * Returns the length of the value array */ unsigned int length() const; /** * Returns the dimensions of the Node */ std::vector const &dim() const; /** * Swaps the values in the given chains */ void swapValue(unsigned int chain1, unsigned int chain2); void addChild(StochasticNode *node) const; void removeChild(StochasticNode *node) const; void addChild(DeterministicNode *node) const; void removeChild(DeterministicNode *node) const; virtual void unlinkParents() = 0; }; /** * Calculate the number of chains of parameter vector. Returns 0 * if the parameters are inconsistent */ unsigned int countChains(std::vector const ¶meters); } /* namespace jags */ #endif /* NODE_H_ */ JAGS-4.3.2/src/include/graph/ConstantNode.h0000664000175000017500000000464714224052514015264 00000000000000#ifndef CONSTANT_NODE_H_ #define CONSTANT_NODE_H_ #include namespace jags { /** * @short Top-level Node with constant value * * Constant nodes are the top-level nodes in any directed acyclic * graph (i.e. they have no parents). They have a fixed value that is * defined when they are constructed and which is shared across all * chains. * * JAGS distinguishes between two classes of ConstantNode. Those * defined explicitly as constants in the BUGS language description of * the model are constructed with the parameter observed=false, and * are not considered random variables. Constant nodes that are * implicitly defined (i.e. they only appear on the left hand side of * any relation and their values are determined by the user-supplied * data) are constructed with the parameter observed=true and are * considered to represent observed randmo variables. */ class ConstantNode : public Node { const bool _observed; public: /** * Constructs a scalar constant node and sets its value. The value * is fixed and is shared between all chains. */ ConstantNode(double value, unsigned int nchain, bool observed); /** * Constructs a multi-dimensional constant node */ ConstantNode(std::vector const &dim, std::vector const &value, unsigned int nchain, bool observed); /** * Indicates whether a ConstantNode is discrete-valued */ bool isDiscreteValued() const; /** * This function does nothing. It exists only so that objects * inheriting from ConstantNode can be instantiated. */ void deterministicSample(unsigned int); /** * This function does nothing. The value of the constant node is * not changed and the state of the RNG remains the same. */ void randomSample(RNG*, unsigned int); /** * Constant nodes have no parents. This function always returns true. */ bool checkParentValues(unsigned int) const; /** * A constant node is named after its value */ std::string deparse(std::vector const &parents) const; /** * A constant node is always fixed. */ bool isFixed() const; /** * The RVStatus of a ConstantNode is determined by the parameter * "observed" passed to the constructor. */ RVStatus randomVariableStatus() const; void unlinkParents(); }; } /* namespace jags */ #endif /* CONSTANT_NODE_H_ */ JAGS-4.3.2/src/include/graph/LogicalNode.h0000664000175000017500000000265414224052514015041 00000000000000#ifndef LOGICAL_NODE_H_ #define LOGICAL_NODE_H_ #include #include namespace jags { class Function; /** * @short Node defined by the BUGS-language operator <- * * A LogicalNode is a type of DeterministicNode that is defined by a * function, and a vector of parents as parameters. In the BUGS * language the function may be represented as an operator. */ class LogicalNode : public DeterministicNode { Function const * const _func; bool _discrete; protected: const std::vector > _parameters; public: /** * A logical node is defined by a function (which may be an inline * operator in the BUGS language) and its parameters. */ LogicalNode(std::vector const &dim, unsigned int nchain, std::vector const ¶meters, Function const *func); /** * A LogicalNode may be discrete valued if its parents are. * @see Function##isDiscreteValued */ bool isDiscreteValued() const; /** * A LogicalNode belongs to a closed class if its function * preserves that class. * * @see Function#isLinear, Function#isScale, Function#isPower */ bool isClosed(std::set const &ancestors, ClosedFuncClass fc, bool fixed) const; std::string deparse(std::vector const &) const; }; } /* namespace jags */ #endif /* LOGICAL_NODE_H_ */ JAGS-4.3.2/src/include/graph/StochasticNode.h0000664000175000017500000001655014224052514015573 00000000000000#ifndef STOCHASTIC_NODE_H_ #define STOCHASTIC_NODE_H_ #include #include namespace jags { struct RNG; /** * @short Node defined by the BUGS-language operator ~ * * Stochastic nodes represent the random variables that are the * fundamental building blocks of a Bayesian hierarchical model. In * the BUGS language, they are defined on the left hand side of a * stochastic relation. For example, the relation * *
y ~ dnorm(mu, tau) T(L, U)
* * defines y to be a normally distributed random variable with parameters * mu, tau, L, and U (mean, precision, lower bound, upper bound). The * last two parameters, defined by the T(,) construct, are optional. If * they are supplied, then the distribution of the node is truncated * to lie in the range (L, U). Not all distributions can be truncated. * Distributions that are only bounded on one side may be specified by * T(L,) or T(,U). * * JAGS allows you to define stochastic nodes that are, in fact, not * random at all, but are deterministic functions of their parameters. * A common example is the dinterval distribution * *
group[i] ~ dinterval(true[i], cutpoints[1:N])
* * where the value of group[i] is determined by where the value of * true[i] falls in the vector of supplied cutpoints. In this case, * the stochastic node leads a double life. If it is observed, then it * is considered a random variable, and generates a likelihood for its * stochastic parents. If it is unobserved then it is treated as a * deterministic function of its parents, just as if it were a * LogicalNode. * * @see Distribution */ class StochasticNode : public Node { Distribution const * const _dist; Node const * const _lower; Node const * const _upper; bool _observed; const bool _discrete; virtual void sp(double *lower, double *upper, unsigned int length, unsigned int chain) const = 0; protected: std::vector > _parameters; public: /** * Constructs a new StochasticNode * * @param dim Dimensions of the node * @param nchain Number of chains * @param dist Pointer to the distribution * @param parameters Vector of parameters * @param lower Pointer to node defining the lower bound. A NULL * pointer denotes no lower bound. * @param upper Pointer to node defining the lower bound. A NULL * pointer denotes no upper bound. */ StochasticNode(std::vector const &dim, unsigned int nchain, Distribution const *dist, std::vector const ¶meters, Node const *lower, Node const *upper); ~StochasticNode(); /** * Returns a pointer to the Distribution. */ Distribution const *distribution() const; /** * Returns the log of the prior density of the StochasticNode * given the current parameter values. * * @param chain Number of chain (starting from zero) for which * to evaluate log density. * * @param type Indicates whether the full probability density * function is required (PDF_FULL) or whether partial calculations * are permitted (PDF_PRIOR, PDF_LIKELIHOOD). See PDFType for * details. */ virtual double logDensity(unsigned int chain, PDFType type) const = 0; /** * Draws a random sample from the prior distribution of the node * given the current values of it's parents, and sets the Node * to that value. * * @param rng Random Number Generator object * @param chain Index umber of chain to modify */ virtual void randomSample(RNG *rng, unsigned int chain) = 0; /** * Draws a truncated random sample from the prior distribution of * the node. The lower and upper parameters are pointers to arrays * that are assumed to be of the correct size, or NULL pointers if * there is no bound * * @param lower Optional lower bound * @param upper Optional upper bound */ virtual void truncatedSample(RNG *rng, unsigned int chain, double const *lower=0, double const *upper=0) = 0; /** * A deterministic sample for a stochastic node sets it to a * "typical" value of the prior distribution, given the current * values of its parents. The exact behaviour depends on the * Distribution used to define the StochasticNode, but it will * usually be the prior mean, median, or mode. */ virtual void deterministicSample(unsigned int chain) = 0; /** * Stochastic nodes always represent random variables in the model. */ bool isRandomVariable() const; /** * Writes the lower and upper limits of the support of a given * stochastic node to the supplied arrays. If the node has upper and * lower bounds then their values are taken into account in the * calculation. * * @param lower pointer to start of an array that will hold the lower * limit of the support * * @param lower pointer to start of an array that will hold the upper * limit of the support * * @param length size of the lower and upper arrays. * * @param chain Index number of chain to query */ void support(double *lower, double *upper, unsigned int length, unsigned int chain) const; double const *lowerLimit(unsigned int chain) const; double const *upperLimit(unsigned int chain) const; std::string deparse(std::vector const ¶meters) const; bool isDiscreteValued() const; /** * A stochastic node is fixed if the setData member function * has been called. */ bool isFixed() const; /** * Sets the value of the node to be the same in all chains. * After setData is called, the stochastic node is considered * observed. * * @param data Pointer to an array of data values. * * @param length Length of the array containing the data values. * * @see Node#setValue */ void setData(double const *value, unsigned int length); /** * A stochastic node is always a random variable, and is observed * if its value has been set with setData. */ RVStatus randomVariableStatus() const; Node const *lowerBound() const; Node const *upperBound() const; /* * Creates a copy of the stochastic node. Supplying the parents * of this node as the argument creates an identical copy. * * @param parents Parents of the cloned node. StochasticNode * clone(std::vector const &parents) const; virtual StochasticNode * clone(std::vector const ¶meters, Node const *lower, Node const *upper) const = 0; */ virtual unsigned int df() const = 0; virtual double KL(unsigned int chain1, unsigned int chain2, RNG *rng, unsigned int nrep) const = 0; void unlinkParents(); }; /** * Returns true if the upper and lower limits of the support of * the stochastic node are fixed. Upper and lower bounds are taken * into account. */ bool isSupportFixed(StochasticNode const *snode); /** * Indicates whether the distribution of the node is bounded * either above or below. */ bool isBounded(StochasticNode const *node); /** * For stochastic nodes, this is a synonym of isFixed */ inline bool isObserved(StochasticNode const *s) { return s->isFixed(); } } /* namespace jags */ #endif /* STOCHASTIC_NODE_H_ */ JAGS-4.3.2/src/include/graph/Graph.h0000664000175000017500000000130314224052371013711 00000000000000#ifndef GRAPH_H_ #define GRAPH_H_ #include #include namespace jags { class Node; /** * A graph is a container class for (pointers to) Nodes. A Node may * belong to several Graphs. Further, if Node N is in graph G, then * there is no requirement that the parents or children of N lie in G. * * @short Container class for nodes */ class Graph : public std::set { /* forbid copying */ Graph(Graph const &orig); Graph &operator=(Graph const &rhs); public: /** * Creates an empty graph */ Graph(); /** * Checks to see whether the node is contained in the Graph. */ bool contains(Node const *node) const; }; } /* namespace jags */ #endif /* GRAPH_H_ */ JAGS-4.3.2/src/include/graph/DeterministicNode.h0000664000175000017500000001000114224052514016253 00000000000000#ifndef DETERMINISTIC_NODE_H_ #define DETERMINISTIC_NODE_H_ #include #include namespace jags { /** * @short Closed classes of deterministic nodes * * A deterministic node may be considered as a function of any of its * deterministic ancestors. Some classes of function are closed under * composition: if g() and f() both belong to the class, then so does * g(f()). This property is used by some Samplers to determine whether * a node, or block of nodes, can be sampled. * * DNODE_ADDITIVE denotes a function f of the single ancestor nodes X * such that sum(f(X)) = a + sum(X), where sum() denotes the sum of * all the elements of the given node. * * DNODE_LINEAR denotes a linear function of the ancestor nodes X = * (X1, ... XN). A linear function takes the form A + B %*% X1 + B2 * %*% X2 + ... * + BN %*% * XN. * * DNODE_SCALE denotes a scale function of the single ancestor node X. * This is a function of the form B %*% X. * * DNODE_SCALE_MIX denotes a generalization of the scale function * class used in mixture models. Scale mixture functions are linear * functions of the form A + B %*% X, where at least one of * A or B is zero. * * DNODE_POWER denotes a power function of the single ancestor node X. * This is a function of the form Y = A * X^B. Power * functions are linear functions on a log scale: i.e. if Y=A*X^B and * A > 0, then log(Y) is a linear function of log(X). * * A function is considered to be a fixed function if the coefficient * B, or coefficients B=(B1...BN) is fixed. * * @see DeterministicNode#isClosed */ enum ClosedFuncClass {DNODE_ADDITIVE, DNODE_LINEAR, DNODE_SCALE, DNODE_SCALE_MIX, DNODE_POWER}; /** * @short Base class for deterministic Nodes * * The value of a deterministic node is determined exactly by the * values of its parents. */ class DeterministicNode : public Node { bool _fixed; public: DeterministicNode(std::vector const &dim, unsigned int nchain, std::vector const &parents); ~DeterministicNode(); /** * Random samples from a Deterministic node are not random. * This function simply calculates the value of the node from its * parent values and leaves the RNG object untouched. */ void randomSample(RNG*, unsigned int nchain); /** * Deterministic nodes are not random variables. */ RVStatus randomVariableStatus() const; /** * A deterministic node is fixed if all its parents are fixed. */ bool isFixed() const; /** * Tests whether the node belongs to a closed class when * considered as a function of a given ancestor node X, or nodes * X1 ... Xn. * * False negative responses are permitted: i.e. the value false * may be returned when the node is, in fact, in the closed class, * but false positives are not allowed. * * A pre-condition is that all nodes on the path from the ancestor * node X to the current node must be in the closed class. Thus, * the isClosed function should be called iteratively, and if it * returns false for any ancestor then you can infer that this * node is not in the closed class without calling the isClosed * function. * * @param ancestors Set containing all ancestors of the test node * that are in the closed class. * * @param fc Closed class to be tested. * * @param fixed When true, the closed class is restricted to the * sub-class of functions that are considered fixed. */ virtual bool isClosed(std::set const &ancestors, ClosedFuncClass fc, bool fixed) const = 0; /* * Creates a copy of the deterministic node. Supplying the parents * of this node as the argument creates an identical copy. * * @param parents Parents of the cloned node. * virtual DeterministicNode * clone(std::vector const &parents) const = 0; */ void unlinkParents(); }; } /* namespace jags */ #endif /* DETERMINISTIC_NODE_H_ */ JAGS-4.3.2/src/include/graph/GraphMarks.h0000664000175000017500000000364314224052514014717 00000000000000#ifndef GRAPH_MARKS_H_ #define GRAPH_MARKS_H_ #include #include #include namespace jags { class Node; class Graph; enum LogicalMark {MARK_NULL=0, MARK_TRUE=1, MARK_FALSE=2}; /** * @short Annotates the Nodes in a Graph with integer values. * * A GraphMarks object associates each node in the graph with an * integer mark. It is used by algorithms that traverse a graph, * and which need to keep track of previously visited nodes. * * For all member functions of the GraphMarks class that take a Node * as an argument, the supplied node must belong to the marked graph, * or a logic_error exception is thrown. * * @see Graph */ class GraphMarks { Graph const &_graph; std::map _marks; public: /** * Constructor. Each node in the graph initially has mark zero */ GraphMarks(Graph const &graph); ~GraphMarks(); /** * Returns a reference to the marked graph */ Graph const &graph() const; /** * Sets the mark of a given node to m. */ void mark(Node const *node, int m); /** * Returns the mark of a given node. */ int mark(Node const *node) const; /** * Resets the mark of all nodes in the graph to zero. */ void clear(); /** * Sets the mark of all parents of the given node in the graph to * m. */ void markParents(Node const *node, int m); /** * Marks the parents of a node in the graph obtained by * marginalizing over all nodes for which the test function * returns false. */ void markParents(Node const *node, bool (*test)(Node const*), int m); /** * Marks the ancestors of the node in the graph, i.e. every node N * for which there is a directed path from N to node within the * graph. */ void markAncestors(std::vector const &nodes, int m); }; } /* namespace jags */ #endif /* GRAPH_MARKS_H_ */ JAGS-4.3.2/src/include/graph/NodeError.h0000664000175000017500000000071314224052371014553 00000000000000#ifndef NODE_ERROR_H_ #define NODE_ERROR_H_ #include #include namespace jags { class Node; class SymTab; /** * @short Exception class for Nodes */ class NodeError : public std::runtime_error { Node const * _node; public: NodeError(Node const *node, std::string const &msg); void printMessage(std::ostream &out, SymTab const &symtab) const; }; } /* namespace jags */ #endif /* NODE_ERROR_H_ */ JAGS-4.3.2/src/include/graph/ScalarLogicalNode.h0000664000175000017500000000214714224052514016164 00000000000000#ifndef SCALAR_LOGICAL_NODE_H_ #define SCALAR_LOGICAL_NODE_H_ #include #include namespace jags { class ScalarFunction; /** * @short Scalar Node defined by the BUGS-language operator <- * * A ScalarLogicalNode is a logical node that uses a ScalarFunction as * the defining function and is not vectorized. */ class ScalarLogicalNode : public LogicalNode { ScalarFunction const * const _func; public: /** * A scalar logical node is defined by a scalar function (which * may be an inline operator in the BUGS language) and its * parameters. */ ScalarLogicalNode(ScalarFunction const *func, unsigned int nchain, std::vector const ¶meters); /** * Calculates the value of the node based on the parameters. */ void deterministicSample(unsigned int chain); /** * @see ScalarFunction#checkParameterValue. */ bool checkParentValues(unsigned int chain) const; //DeterministicNode *clone(std::vector const &parents) const; }; } /* namespace jags */ #endif /* SCALAR_LOGICAL_NODE_H_ */ JAGS-4.3.2/src/include/graph/VectorLogicalNode.h0000664000175000017500000000231314224052514016214 00000000000000#ifndef VECTOR_LOGICAL_NODE_H_ #define VECTOR_LOGICAL_NODE_H_ #include #include namespace jags { class VectorFunction; /** * @short Vector-valued Node defined by the BUGS-language operator <- * * A LogicalNode is a type of DeterministicNode that is defined by a * function, and a vector of parents as parameters. In the BUGS * language the function may be represented as an operator. */ class VectorLogicalNode : public LogicalNode { VectorFunction const * const _func; std::vector _lengths; public: /** * A logical node is defined by a function (which may be an inline * operator in the BUGS language) and its parameters. */ VectorLogicalNode(VectorFunction const *func, unsigned int nchain, std::vector const ¶meters); /** * Calculates the value of the node based on the parameters. */ void deterministicSample(unsigned int chain); /** * @see VectorFunction#checkParameterValue. */ bool checkParentValues(unsigned int chain) const; //DeterministicNode *clone(std::vector const &parents) const; }; } /* namespace jags */ #endif /* VECTOR_LOGICAL_NODE_H_ */ JAGS-4.3.2/src/include/graph/ArrayLogicalNode.h0000664000175000017500000000200714224052514016030 00000000000000#ifndef ARRAY_LOGICAL_NODE_H_ #define ARRAY_LOGICAL_NODE_H_ #include #include namespace jags { class ArrayFunction; /** * @short Array-valued Node defined by the BUGS-language operator <- */ class ArrayLogicalNode : public LogicalNode { ArrayFunction const * const _func; std::vector > _dims; public: /** * A logical node is defined by a function (which may be an inline * operator in the BUGS language) and its parameters. */ ArrayLogicalNode(ArrayFunction const *func, unsigned int nchain, std::vector const ¶meters); /** * Calculates the value of the node based on the parameters. */ void deterministicSample(unsigned int chain); /** * @see ArrayFunction#checkParameterValue. */ bool checkParentValues(unsigned int chain) const; //DeterministicNode *clone(std::vector const &parents) const; }; } /* namespace jags */ #endif /* ARRAY_LOGICAL_NODE_H_ */ JAGS-4.3.2/src/include/graph/LinkNode.h0000664000175000017500000000243314224052514014357 00000000000000#ifndef LINK__NODE_H_ #define LINK__NODE_H_ #include #include namespace jags { class LinkFunction; /** * @short Scalar Node representing link function from a GLM */ class LinkNode : public LogicalNode { LinkFunction const * const _func; public: /** * A link node is defined by an inverse link function and a single * parent node, which must be scalar */ LinkNode(LinkFunction const *func, unsigned int nchain, std::vector const &parents); /** * Calculates the value of the node based on the parameters. */ void deterministicSample(unsigned int chain); /** * Returns true. An inverse link function should accept every * value in the range [-Inf, Inf]. */ bool checkParentValues(unsigned int chain) const; /** * Returns the linear predictor */ double eta(unsigned int chain) const; /** * Returns the gradient of the inverse link function * @see LinkFunction#grad */ double grad(unsigned int chain) const; /** * Returns the name of the link function */ std::string const &linkName() const; //DeterministicNode *clone(std::vector const &parents) const; }; } /* namespace jags */ #endif /* LINK_NODE_H_ */ JAGS-4.3.2/src/include/graph/VSLogicalNode.h0000664000175000017500000000216214224052514015304 00000000000000#ifndef V_SCALAR_LOGICAL_NODE_H_ #define V_SCALAR_LOGICAL_NODE_H_ #include #include namespace jags { class ScalarFunction; /** * @short Vectorized node using a scalar function * * A VSLogicalNode is a logical node that uses a ScalarFunction as * the defining function. The node is vectorized. */ class VSLogicalNode : public LogicalNode { ScalarFunction const * const _func; std::vector _isvector; public: /** * A scalar logical node is defined by a scalar function (which * may be an inline operator in the BUGS language) and its * parameters. */ VSLogicalNode(ScalarFunction const *func, unsigned int nchain, std::vector const ¶meters); /** * Calculates the value of the node based on the parameters. */ void deterministicSample(unsigned int chain); /** * @see ScalarFunction#checkParameterValue. */ bool checkParentValues(unsigned int chain) const; //DeterministicNode *clone(std::vector const &parents) const; }; } /* namespace jags */ #endif /* V_SCALAR_LOGICAL_NODE_H_ */ JAGS-4.3.2/src/include/graph/ScalarStochasticNode.h0000664000175000017500000000235414224052514016716 00000000000000#ifndef SCALAR_STOCHASTIC_NODE_H_ #define SCALAR_STOCHASTIC_NODE_H_ #include namespace jags { class ScalarDist; /** * @short Scalar Node defined by the BUGS-language operator ~ */ class ScalarStochasticNode : public StochasticNode { ScalarDist const * const _dist; void sp(double *lower, double *upper, unsigned int length, unsigned int chain) const; public: /** * Constructs a new ScalarStochasticNode */ ScalarStochasticNode(ScalarDist const *dist, unsigned int nchain, std::vector const ¶meters, Node const *lower, Node const *upper); double logDensity(unsigned int chain, PDFType type) const; void randomSample(RNG *rng, unsigned int chain); void truncatedSample(RNG *rng, unsigned int chain, double const *lower, double const *upper); void deterministicSample(unsigned int chain); bool checkParentValues(unsigned int chain) const; //StochasticNode *clone(std::vector const &parents, //Node const *lower, Node const *upper) const; unsigned int df() const; double KL(unsigned int ch1, unsigned int ch2, RNG *rng, unsigned int nrep) const; }; } /* namespace jags */ #endif /* SCALAR_STOCHASTIC_NODE_H_ */ JAGS-4.3.2/src/include/graph/VectorStochasticNode.h0000664000175000017500000000262014224052514016747 00000000000000#ifndef VECTOR_STOCHASTIC_NODE_H_ #define VECTOR_STOCHASTIC_NODE_H_ #include namespace jags { class VectorDist; /** * @short Vector-valued Node defined by the BUGS-language operator ~ */ class VectorStochasticNode : public StochasticNode { VectorDist const * const _dist; std::vector _lengths; void sp(double *lower, double *upper, unsigned int length, unsigned int chain) const; public: /** * Constructs a new StochasticNode given a vector distribution and * a vector of parent nodes, considered as parameters to the * distribution. */ VectorStochasticNode(VectorDist const *dist, unsigned int nchain, std::vector const ¶meters, Node const *lower, Node const *upper); double logDensity(unsigned int chain, PDFType type) const; void randomSample(RNG *rng, unsigned int chain); void truncatedSample(RNG *rng, unsigned int chain, double const *lower, double const *upper); void deterministicSample(unsigned int chain); bool checkParentValues(unsigned int chain) const; //StochasticNode *clone(std::vector const &parents, //Node const *lower, Node const *upper) const; unsigned int df() const; double KL(unsigned int chain1, unsigned int chain2, RNG *rng, unsigned int nrep) const; }; } /* namespace jags */ #endif /* VECTOR_STOCHASTIC_NODE_H_ */ JAGS-4.3.2/src/include/graph/ArrayStochasticNode.h0000664000175000017500000000262514224052514016570 00000000000000#ifndef ARRAY_STOCHASTIC_NODE_H_ #define ARRAY_STOCHASTIC_NODE_H_ #include namespace jags { class ArrayDist; /** * @short Array-valued Node defined by the BUGS-language operator ~ */ class ArrayStochasticNode : public StochasticNode { ArrayDist const * const _dist; std::vector > _dims; void sp(double *lower, double *upper, unsigned int length, unsigned int chain) const; public: /** * Construct * distribution and an array of parent nodes, considered as * parameters to the distribution. */ ArrayStochasticNode(ArrayDist const *dist, unsigned int nchain, std::vector const ¶meters, Node const *lower, Node const *upper, double const *data=0, unsigned int length=0); double logDensity(unsigned int chain, PDFType type) const; void randomSample(RNG *rng, unsigned int chain); void truncatedSample(RNG *rng, unsigned int chain, double const *lower, double const *upper); void deterministicSample(unsigned int chain); bool checkParentValues(unsigned int chain) const; //StochasticNode *clone(std::vector const &parents, //Node const *lower, Node const *upper) const; unsigned int df() const; double KL(unsigned int chain1, unsigned int chain2, RNG *rng, unsigned int nrep) const; }; } /* namespace jags */ #endif /* ARRAY_STOCHASTIC_NODE_H_ */ JAGS-4.3.2/src/include/graph/ParentError.h0000664000175000017500000000076714224052514015127 00000000000000#ifndef PARENT_ERROR_H_ #define PARENT_ERROR_H_ #include #include namespace jags { class Node; class SymTab; /** * @short Exception class for invalid parent values */ class ParentError : public std::runtime_error { Node const * _node; unsigned int _chain; public: ParentError(Node const *node, unsigned int chain); void printMessage(std::ostream &out, SymTab const &symtab) const; }; } /* namespace jags */ #endif /* PARENT_ERROR_H_ */ JAGS-4.3.2/src/include/graph/Makefile.in0000644000175000017500000004323214400675235014557 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/graph ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(graphinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(graphincludedir)" HEADERS = $(graphinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ graphincludedir = $(pkgincludedir)/graph graphinclude_HEADERS = AggNode.h MixtureNode.h MixTab.h Node.h \ ConstantNode.h LogicalNode.h StochasticNode.h Graph.h \ DeterministicNode.h GraphMarks.h NodeError.h ScalarLogicalNode.h \ VectorLogicalNode.h ArrayLogicalNode.h LinkNode.h VSLogicalNode.h \ ScalarStochasticNode.h VectorStochasticNode.h ArrayStochasticNode.h \ ParentError.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/graph/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/graph/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-graphincludeHEADERS: $(graphinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(graphinclude_HEADERS)'; test -n "$(graphincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(graphincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(graphincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(graphincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(graphincludedir)" || exit $$?; \ done uninstall-graphincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(graphinclude_HEADERS)'; test -n "$(graphincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(graphincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(graphincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-graphincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-graphincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-graphincludeHEADERS \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-graphincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/model/0000755000175000017500000000000014400711323012552 500000000000000JAGS-4.3.2/src/include/model/Makefile.am0000664000175000017500000000027614224052514014541 00000000000000modelincludedir = $(pkgincludedir)/model modelinclude_HEADERS = SymTab.h NodeArray.h Model.h Monitor.h \ BUGSModel.h MonitorFactory.h MonitorControl.h MonitorInfo.h \ NodeArraySubset.h JAGS-4.3.2/src/include/model/SymTab.h0000664000175000017500000000714614224052514014060 00000000000000#ifndef SYMTAB_H_ #define SYMTAB_H_ #include #include #include #include #include namespace jags { /** * @short Associates a NodeArray object with a BUGS-language name * * The SymTab class stores the names of variables used in the BUGS * language representation of the model. * * @see NodeArray */ class SymTab { Model *_model; std::map _varTable; std::map _names; public: /** * Constructs an empty symbol table * * @param model Model to which newly allocated nodes are added. * */ SymTab(Model *model); ~SymTab(); /** * Adds an array variable to the symbol table. This creates a * NodeArray object of the given dimension and associates it * with the name, so it can be retrieved with a call to getVariable. * If no dimension is given, the variable is assumed to be scalar. */ void addVariable(std::string const &name, std::vector const &dim); /** * Returns a pointer to the NodeArray associated with the given * name, or a NULL pointer if there is no such NodeArray. */ NodeArray *getVariable(std::string const &name) const; /** * Inserts a node into the symbol table with the given name * (which must correspond to a previously added variable) * and range (which must be a valid sub-range for the variable). */ void insertNode(Node *node, std::string const &name, Range const &range); /** * Creates constant nodes in all the arrays of the symbol table * taking values from the given data table. * * @param data_table Data table from which values will be read. * * @see NodeArray#setData */ void writeData(std::map const &data_table); /** * Write values from the data table to the arrays in the symbol * table with the same name. Unlike the writeData function, the * Nodes are not permanently set to the supplied values, and values * are only written to the given chain. * * @param data_table Data table from which values will be read * * @param chain Index number of chain to which values are written. * * @see NodeArray#setValue */ void writeValues(std::map const &data_table, unsigned int chain); /** * Reads the current value of selected nodes in the symbol table and * writes the result to the data table. The selection is based on * a given boolean function that returns true for the selected nodes. * * @param data_table Data table to which results will be written. * New entries will be created for the selected nodes. However, a * new entry is not created if, in the symbol table, all nodes * corresponding to the selection are missing. Existing entries in * the data table will be overwritten. * * @param condition Function that returns true if the values of a * Node are to be read, and false otherwise. */ void readValues(std::map &data_table, unsigned int chain, bool (*condition)(Node const *)) const; /** * Returns the number of variables in the symbol table */ unsigned int size() const; /** * Deletes all the variables in the symbol table */ void clear(); /** * Gets the BUGS language name of the node if it belongs to * any of the NodeArrays in the symbol table. Special rules for nested * indexing also allow the names of Mixture Nodes to be calculated. * If the node name is not found, an empty string is returned */ std::string getName(Node const *node) const; }; } /* namespace jags */ #endif /* SYMTAB_H_ */ JAGS-4.3.2/src/include/model/NodeArray.h0000664000175000017500000000745614224052514014551 00000000000000#ifndef NODE_ARRAY_H_ #define NODE_ARRAY_H_ #include #include #include #include namespace jags { class SArray; class Model; class AggNode; /** * @short Multi-dimensional array that can be tiled with Node objects * * A NodeArray is a container class for nodes. A NodeArray may * represent a scalar, vector, matrix or multi-dimensional container * that can be tiled with Nodes using the insert member function. * Subsets of the NodeArray can be retrieved with the getSubset * function. */ class NodeArray { friend class NodeArraySubset; std::string _name; SimpleRange _range; Graph _member_graph; unsigned int _nchain; std::vector _node_pointers; std::vector _offsets; std::map _mv_nodes; std::map _generated_nodes; /* Forbid copying */ NodeArray(NodeArray const &orig); NodeArray &operator=(NodeArray const &rhs); public: /** * Constructor. Creates a NodeArray with the given name and dimension */ NodeArray(std::string const &name, std::vector const &dim, unsigned int nchain); /** * Inserts a node into the subset of the NodeArray defined by range. * The dimension of the node must conform with the given range. * The given range must not overlap any previously inserted node. * Repeated indices in the given range are not allowed. * * The node is added to an internal graph. * * @exception runtime_error */ void insert(Node *node, Range const &range); /** * Returns a subset of the NodeArray. If the range corresponds to a * previously inserted node, this will be returned. Otherwise, an * aggregate node will be generated, and it will be added to the * given model. Generated nodes are cached so a future call to * getSubset will return the same node. If the range is not * completely covered by inserted nodes, a NULL pointer will be * returned. */ Node* getSubset(Range const &range, Model &model); /** * Sets the values of the nodes in the array. * * @param value SArray containing values to be used. The value * vector of the SArray may contain missing values. If so, then the * part of the value vector corresponding to each inserted node must be * either completely missing (in which no action is taken) or * contain no missing values. * * @param value array with dimensions matching the NodeArray containing * values. * * @param chain Index number of chain to which to apply values. */ void setValue(SArray const &value, unsigned int chain); /** * Gets the values of selected nodes that have been inserted into * the array. * * @param value SArray to which values should be written. * * @param chain Index number of chain to read. * * @param condition. Boolean function that returns true for nodes * whose values are to be read. */ void getValue(SArray &value, unsigned int chain, bool (*condition)(Node const *)) const; /** * Set data, creating a constant node for any non-missing value. An * exception is thrown if any of the non-missing values corresponds * to an existing node in the array. */ void setData(SArray const &value, Model *model); /** * Returns the name of the node array */ std::string const &name() const; /** * Returns the range of indices covered by the NodeArray */ SimpleRange const &range() const; /** * Returns the range corresponding to the given node, if it * belongs to the graph associated with the NodeArray. If it is * not in the graph, a NULL Range is returned. */ Range getRange(Node const *node) const; /** * Returns the number of chains of the nodes stored in the array */ unsigned int nchain() const; }; } /* namespace jags */ #endif /* NODE_ARRAY_H */ JAGS-4.3.2/src/include/model/Model.h0000664000175000017500000001362014224052514013713 00000000000000#ifndef MODEL_H_ #define MODEL_H_ #include #include #include #include namespace jags { class Sampler; class SamplerFactory; struct RNG; class RNGFactory; class MonitorFactory; class Node; class StochasticNode; class DeterministicNode; class ConstantNode; /** * @short Graphical model * * The purpose of the model class is to collect together all the * elements necessary to run an MCMC sampler on a graphical model. */ class Model { protected: std::vector _samplers; private: unsigned int _nchain; std::vector _rng; unsigned int _iteration; std::vector _nodes; std::vector _extra_nodes; std::vector _sampled_extra; std::list _monitors; std::vector _stochastic_nodes; bool _is_initialized; bool _adapt; bool _data_gen; void initializeNodes(); void chooseRNGs(); void chooseSamplers(); void setSampledExtra(); public: /** * @param nchain Number of parallel chains in the model. */ Model(unsigned int nchain); virtual ~Model(); /** * Initializes the model. Initialization takes place in three steps. * * Firstly, random number generators are assigned to any chain that * doesn not already have an RNG. * * Secondly, all nodes in the graph are initialized in forward * sampling order. * * Finally, samplers are chosen for informative nodes in the graph. * * @param datagen Boolean flag indicating whether the model should * be considered a data generating model. If false, then * non-informative nodes will not be updated unless they are being * monitored. This makes sampling more efficient by avoiding * redundant updates. If true, then all nodes in the graph will be * updated in each iteration. * * @see Node#initialize, Model#rngFactories */ void initialize(bool datagen); /** Returns true if the model has been initialized */ bool isInitialized(); /** * Updates the model by the given number of iterations. A * logic_error is thrown if the model is uninitialized. * * @param niter Number of iterations to run */ void update(unsigned int niter); /** * Returns the current iteration number */ unsigned int iteration() const; /** * Adds a monitor to the model so that it will be updated at each * iteration. This can only be done if Model#adaptOff has been * successfully called. Otherwise, a logic_error is thrown. */ void addMonitor(Monitor *monitor, unsigned int thin); /** * Clears the monitor from the model, so that it will no longer * be updated. If the monitor has not previously been added to the * model, this function has no effect. */ void removeMonitor(Monitor *monitor); /** * Returns the list of Monitors */ std::list const &monitors() const; /** * Adds a stochastic node to the model. The node must be * dynamically allocated. The model is responsible for memory * management of the added node and will delete the node when it is * destroyed. */ void addNode(StochasticNode *node); /** * Adds a deterministc node to the model. The node must be * dynamically allocated. The model is responsible for memory * management of the added node and will delete the node when it is * destroyed. */ void addNode(DeterministicNode *node); /** * Adds a constant node to the model. The node must be dynamically * allocated. The model is responsible for memory management of the * added node and will delete the node when it is destroyed. */ void addNode(ConstantNode *node); /** * Access the list of sampler factories, which is common to all * models. This is used during initialization to choose samplers. * Each sampler factory is paired with a boolean flag which is used * to determine whether the factory is active or not */ static std::list > &samplerFactories(); /** * Access the list of RNG factories, which is common to all models. * Each factory is paired with a boolean flag which is used to determine * whether the factory is active or not. */ static std::list > &rngFactories(); /** * Access the list of monitor factories, which is commmon to all models * Each factory is paired with a boolean flag which is used to determine * whether the factory is active or not. */ static std::list > &monitorFactories(); /** * Returns the number of chains in the model */ unsigned int nchain() const; /** * Returns the RNG object associated with the given chain. If no RNG * has been assigned, then a NULL pointer is returned. */ RNG *rng(unsigned int nchain) const; /** * Assigns a new RNG object to the given chain. The list of * RNGFactory objects is traversed and each factory is requested to * generate a new RNG object of the given name. * * @return success indicator. */ bool setRNG(std::string const &name, unsigned int chain); /** * Assigns an existing RNG object to the given chain * * @return success indicator */ bool setRNG(RNG *rng, unsigned int chain); /** * Tests whether all samplers in adaptive mode have passed the * efficiency test that allows adaptive mode to be switched off * * @see Sampler#checkAdaptation */ bool checkAdaptation() const; /** * Turns off adaptive phase of all samplers. * * @see Sampler#adaptOff */ void adaptOff(); /** * Indicates whether the model is in adaptive mode (before the * adaptOff function has been called). */ bool isAdapting() const; /** * Returns a vector of all stochastic nodes in the model */ std::vector const &stochasticNodes() const; /** * Returns a vector of all nodes in the model */ std::vector const &nodes() const; }; } /* namespace jags */ #endif /* MODEL_H_ */ JAGS-4.3.2/src/include/model/Monitor.h0000664000175000017500000000577414224052514014315 00000000000000#ifndef MONITOR_H_ #define MONITOR_H_ #include #include #include namespace jags { class Node; /** * @short Analyze sampled values * * This is an abstract class for objects that analyze and/or store sampled * values from a given node. */ class Monitor { std::string _type; std::vector _nodes; std::string _name; std::vector _elt_names; public: Monitor(std::string const &type, std::vector const &nodes); Monitor(std::string const &type, Node const *node); virtual ~Monitor(); /** * Updates the monitor. * * Updating should be an ammortized constant time operation. * Failure to guarantee this may cause long MCMC runs to slow down * dramatically. This is particularly important if the monitor * needs to allocate new memory for stored samples. */ virtual void update() = 0; /** * Returns the vector of nodes from which the monitor's value is * derived. */ std::vector const &nodes() const; /** * The type of monitor. Each subclass must have a unique type, * which is common to all Monitors of that class. The type is used * by the user-interface to identify the subclass of Monitor. */ std::string const &type() const; /** * Returns true if the monitor has a single value for multiple chains */ virtual bool poolChains() const = 0; /** * Returns true if the monitor has a single value for multiple iterations */ virtual bool poolIterations() const = 0; /** * Returns the dimension of a single monitored value, which may * be replicated over chains and over iterations */ virtual std::vector dim() const = 0; /** * The vector of monitored values for the given chain */ virtual std::vector const &value(unsigned int chain) const = 0; /** * Dumps the monitored values to an SArray. * * The SArray will have informative dimnames. In particular, the * dimnames "iteration" and "chain" are used if there are * distinct values for each iteration and each chain, * respectively. * * @param flat Indicates whether value should be flattened, so * that the value for a single iteration and single chain is a * vector. */ SArray dump(bool flat = false) const; /** * Returns the name of the monitor */ std::string const &name() const; /** * Sets the name of the monitor */ void setName(std::string const &name); /** * Returns the names of individual elements */ std::vector const &elementNames() const; /** * Sets the element names. The length of the string must be * conform to the dimensions of the monitor, as returned by the * dim1 member function. */ void setElementNames(std::vector const &names); }; } /* namespace jags */ #endif // MONITOR_H_ JAGS-4.3.2/src/include/model/BUGSModel.h0000664000175000017500000001132514224052514014374 00000000000000#ifndef BUGS_MODEL_H_ #define BUGS_MODEL_H_ #include #include #include #include #include #include #include namespace jags { /** * @short Model with symbol table * * A BUGS model is a subclass of Model that contains a symbol table * which is used to store certain nodes in arrays. The array format * gives a convenient way of looking up nodes by name. */ class BUGSModel : public Model { SymTab _symtab; //std::map > _node_map; std::list _bugs_monitors; public: BUGSModel(unsigned int nchain); ~BUGSModel(); /** * Returns the symbol table of the BUGSModel. */ SymTab &symtab(); /** * Writes out selected monitors in CODA format. * * @param nodes Vector of nodes to write out. Each node is * described by a pair consisting of a name and a range of * indices. If a node is not being monitored, then it is ignored. * * @param prefix String giving prefix to be prepened to the output * file names. * * @param warn String that will contain any warning messages on * exit. It is cleared on entry. * * @exception logic_error */ void coda(std::vector > const &nodes, std::string const &prefix, std::string &warn); /** * Write out all monitors in CODA format */ void coda(std::string const &prefix, std::string &warn); /** * Sets the state of the RNG, and the values of the unobserved * stochastic nodes in the model, for a given chain. * * @param param_table STL map, in which each entry relates a * variable name to an SArray. If the name is ".RNG.state" or * ".RNG.seed", then the SArray is used to set the state of the RNG. * Otherwise the SArray value is used to set the unobserved * stochastic nodes in the model. Each SArray must have the same * dimensions as the NodeArray in the symbol table with the * corresponding name. Elements of the SArray must be set to the * missing value, JAGS_NA, unless they correspond to an element of * an unobserved StochasticNode. * * @param chain Number of chain (starting from zero) for which * parameter values should be set. * * @see RNG#init RNG#setState * @exception runtime_error */ void setParameters(std::map const ¶m_table, unsigned int chain); /** * Creates a new Monitor. The BUGSModel is responsible for the * memory management of any monitor created this way. It is not * possible to create two monitors with the same name, range and * type. * * @param name Name of the node array * * @param range Subset of indices of the node array defining hte * node to be monitored. * * @param thin Thinning interval for monitor * * @param type Type of monitor to create * * @param msg User-friendly error message that may be given if no * monitor can be created. * * @return True if the monitor was created. */ bool setMonitor(std::string const &name, Range const &range, unsigned int thin, std::string const &type, std::string &msg); /** * Deletes a Monitor that has been previously created with a call * to setMonitor. * * @return True if the monitor was deleted. */ bool deleteMonitor(std::string const &name, Range const &range, std::string const &type); /** * Traverses the list of monitor factories requesting default * monitors of the given type. The function returns true after the * first monitor factory has added at least one node to the monitor * list. If none of the available monitor factories can create * default monitors of the given type, the return value is false. * * @see MonitorFactory#addDefaultMonitors */ bool setDefaultMonitors(std::string const &type, unsigned int thin); /** * Removes all Monitors of the given type. */ void clearMonitors(std::string const &type); /** * Writes the names of the samplers, and the corresponding * sampled nodes vectors to the given vector. * * @param sampler_names vector that is modified during the call On * exit it will contain an element for each Sampler in the model. * Each element is a vector of strings: the first string is the * name of the sampler, and the remaining strings are the names of * the nodes sampled by that Sampler. */ void samplerNames(std::vector > &sampler_names) const; }; } /* namespace jags */ #endif /* BUGS_MODEL_H_ */ JAGS-4.3.2/src/include/model/MonitorFactory.h0000664000175000017500000000307014224052514015630 00000000000000#ifndef MONITOR_FACTORY_H_ #define MONITOR_FACTORY_H_ #include #include namespace jags { class Monitor; class Node; class BUGSModel; class Model; class Range; /** * @short Factory for Monitor objects */ class MonitorFactory { public: virtual ~MonitorFactory(); /** * Creates a monitor of the given type by name and range. If a * monitor cannot be created, then a null pointer is returned. * * @param name Name of the monitored object. This is typically a * node array. * * @param range Range describing the subset, if any, to be monitored. * A NULL range is used to monitor the whole object * * @param model Pointer to a BUGSModel * * @param type String indicating what type of monitor is requested * * @param msg An error message may be written to this argument on * exit if the monitor cannot be created due to an error. It is * not necessary to write an error message if the request for the * monitor lies outside the scope of the factory (e.g. the factory * cannot create monitors of the requested type). This is not considered * an error as all factories will be interrogated in turn until one * returns the requested monitor. */ virtual Monitor *getMonitor(std::string const &name, Range const &range, BUGSModel *model, std::string const &type, std::string &msg) = 0; /** * Returns the name of the monitor factory */ virtual std::string name() const = 0; }; } /* namespace jags */ #endif /* MONITOR_FACTORY_H_ */ JAGS-4.3.2/src/include/model/MonitorControl.h0000664000175000017500000000313014224052371015637 00000000000000#ifndef MONITOR_CONTROL_H_ #define MONITOR_CONTROL_H_ #include namespace jags { class Monitor; /** * @short Control a monitor */ class MonitorControl { Monitor * _monitor; unsigned int _start; unsigned int _thin; unsigned int _niter; public: /** * Constructor * @param monitor Monitor that will be under control * @param start First iteration to be monitored * @param thin Thinning interval for monitor */ MonitorControl(Monitor *monitor, unsigned int start, unsigned int thin); /** * Updates the monitor. If the iteration number coincides with * the thinning interval, then the update function of the Monitor * is called function is called. * * @param iteration The current iteration number. */ void update(unsigned int iteration); /** * Reserves enough memory for a further niter iterations, taking * account of the thinning interval of the monitor. * @see Monitor#reserve */ void reserve(unsigned int niter); /** * Returns the monitor under control. */ Monitor const *monitor() const; /** * First iteration monitored */ unsigned int start() const; /** * Last iteration monitored */ unsigned int end() const; /** * Thinning interval of monitor */ unsigned int thin() const; /** * Number of iterations */ unsigned int niter() const; /** * Equality operator */ bool operator==(MonitorControl const &rhs) const; }; } /* namespace jags */ #endif /* MONITOR_CONTROL_H_ */ JAGS-4.3.2/src/include/model/MonitorInfo.h0000664000175000017500000000125114224052371015114 00000000000000#ifndef MONITOR_INFO_H_ #define MONITOR_INFO_H_ #include #include namespace jags { class Monitor; /** * @short Info a monitor */ class MonitorInfo { Monitor * _monitor; std::string _name; Range _range; std::string _type; public: /** * Constructor * @param monitor Monitor */ MonitorInfo(Monitor *monitor, std::string const &name, Range const &range, std::string const &type); Monitor *monitor() const; std::string const &name() const; std::string const &type() const; Range const &range() const; bool operator==(MonitorInfo const &rhs) const; }; } #endif /* MONITOR_INFO_H_ */ JAGS-4.3.2/src/include/model/NodeArraySubset.h0000664000175000017500000000241314224052514015723 00000000000000#ifndef NODE_ARRAY_SUBSET_H_ #define NODE_ARRAY_SUBSET_H_ #include #include namespace jags { class Node; class NodeArray; class Range; /** * @short Subset of a NodeArray * */ class NodeArraySubset { std::vector _dim; unsigned int _nchain; std::vector _node_pointers; std::vector _offsets; public: /** * Constructor. Creates a NodeArraySubset from a NodeArray * and a given range */ NodeArraySubset(NodeArray const *array, Range const &range); /** * Returns the values of the nodes in the range covered by the * NodeArraySubset in column major order. * * @param chain Index number of chain to read. */ std::vector value(unsigned int chain) const; /** * Returns the dimension of the subset */ std::vector const &dim() const; /** * Returns a vector containing the nodes that contribute * values to the NodeArraySubset. Repeated values are removed. */ std::vector nodes() const; /** * Returns the number of chains */ unsigned int nchain() const; /** * Returns the number of values in the subset */ unsigned int length() const; }; } /* namespace jags */ #endif /* NODE_ARRAY_SUBSET_H */ JAGS-4.3.2/src/include/model/Makefile.in0000644000175000017500000004272314400675235014562 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/model ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(modelinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(modelincludedir)" HEADERS = $(modelinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ modelincludedir = $(pkgincludedir)/model modelinclude_HEADERS = SymTab.h NodeArray.h Model.h Monitor.h \ BUGSModel.h MonitorFactory.h MonitorControl.h MonitorInfo.h \ NodeArraySubset.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/model/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/model/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-modelincludeHEADERS: $(modelinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(modelinclude_HEADERS)'; test -n "$(modelincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(modelincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(modelincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(modelincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(modelincludedir)" || exit $$?; \ done uninstall-modelincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(modelinclude_HEADERS)'; test -n "$(modelincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(modelincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(modelincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-modelincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-modelincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-modelincludeHEADERS install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-modelincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/sampler/0000755000175000017500000000000014400711324013116 500000000000000JAGS-4.3.2/src/include/sampler/Makefile.am0000664000175000017500000000053114224052371015077 00000000000000samplerincludedir = $(pkgincludedir)/sampler samplerinclude_HEADERS = Sampler.h SamplerFactory.h \ SingletonFactory.h Slicer.h Metropolis.h RWMetropolis.h Linear.h \ GraphView.h StepAdapter.h TemperedMetropolis.h SampleMethodNoAdapt.h \ SingletonGraphView.h MutableSampleMethod.h ImmutableSampleMethod.h \ MutableSampler.h ImmutableSampler.h JAGS-4.3.2/src/include/sampler/Sampler.h0000664000175000017500000000532714224052514014626 00000000000000#ifndef SAMPLER_H_ #define SAMPLER_H_ #include #include #include namespace jags { struct RNG; class StochasticNode; class GraphView; /** * @short Updates a set of stochastic nodes * * A sampler updates a set of stochastic nodes at each iteration. * In addition, the sampler is responsible for updating the immediate * deterministic descendants of the sampled nodes. * * The Sampler class is designed to be as abstract as possible to give * maximum freedom in implementing samplers. In practice, all the * Samplers in the modules distributed with JAGS are implementations * of one of two subclasses -- MutableSampler or ImmutableSampler -- * depending on whether the Sampler does or does not have a state that * it must preserve between iterations. */ class Sampler { GraphView *_gv; public: /** * Constructor * * @param gv GraphView providing a view of the sampling graph for * the sampler. This should be dynamically allocated by the * SamplerFactory: the Sampler takes ownership of the GraphView * and deletes it when the destructor is called. */ Sampler(GraphView *gv); virtual ~Sampler(); /** * Returns the vector of stochastic nodes sampled by the Sampler */ std::vector const &nodes() const; /** * Every sampler must update the vector of nodes and its immediate * deterministic descendants using the update function. * * @param rng vector of Pseudo-random number generator functions. */ virtual void update(std::vector const &rng) = 0; /** * When a sampler is constructed, it may be in adaptive mode, which * allows it to adapt its behaviour for increased * efficiency. However, a sampler in adaptive mode may not converge * to the correct target distribution. This function turns off * adaptive mode, so that valid samples can be collected from the * sampler. */ virtual void adaptOff() = 0; /** * The adaptOff function may be called at any time. Premature * ending of adaptive mode may result in an extremely inefficient * sampler. Therefore the checkAdaptation function implements an * efficiency test that returns true if it is safe to call the * adaptOff function. Samplers that have no adaptive mode should * simply return true. */ virtual bool checkAdaptation() const = 0; /** * Indicates whether the sampler has an adaptive mode. */ virtual bool isAdaptive() const = 0; /** * Returns a name for the sampler which should describe the method * it uses to update the nodes. */ virtual std::string name() const = 0; }; } /* namespace jags */ #endif /* SAMPLER_H_ */ JAGS-4.3.2/src/include/sampler/SamplerFactory.h0000664000175000017500000000150114224052514016144 00000000000000#ifndef SAMPLER_FACTORY_H_ #define SAMPLER_FACTORY_H_ #include #include #include namespace jags { class Sampler; class StochasticNode; class Graph; /** * @short Factory for Sampler objects */ class SamplerFactory { public: virtual ~SamplerFactory(); /** * Finds nodes in the list of stochastic nodes that can be sampled * within the given graph, and returns a vector of newly allocated * samplers for them. If no sampler can be created, an empty * vector is returned. */ virtual std::vector makeSamplers(std::list const &nodes, Graph const &graph) const = 0; /** * Returns the name of the sampler factory */ virtual std::string name() const = 0; }; } /* namespace jags */ #endif /* SAMPLER_FACTORY_H_ */ JAGS-4.3.2/src/include/sampler/SingletonFactory.h0000664000175000017500000000240214224052514016504 00000000000000#ifndef SINGLETON_FACTORY_H_ #define SINGLETON_FACTORY_H_ #include namespace jags { /** * @short Factory object for a Sampler that samples a single node * * Many Sampler objects update a singe StochasticNode (and its * deterministic descendants). This is a convenience class designed * to make it easier to create a factory object for such samplers. */ class SingletonFactory : public SamplerFactory { public: /** * Determines whether the factory can produce a Sampler for the * given node, within the given graph. This function is called * by SingletonFactory#makeSamplers */ virtual bool canSample(StochasticNode *node, Graph const &graph) const = 0; /** * Returns a dynamically allocated Sampler for a given node. This * function is called by SingletonFactory#makeSamplers. */ virtual Sampler *makeSampler(StochasticNode *node, Graph const &graph) const = 0; /** * This traverses the list of available nodes, creating a Sampler, * when possible, for each individual StochasticNode. */ std::vector makeSamplers(std::list const &nodes, Graph const &graph) const; }; } /* namespace jags */ #endif /* SINGLETON_FACTORY_H */ JAGS-4.3.2/src/include/sampler/Slicer.h0000664000175000017500000000632014224052514014436 00000000000000#ifndef SLICER_H_ #define SLICER_H_ #include namespace jags { /** * Enumerates different states of the sampler, SLICER_OK means there has * been no error, SLICER_POSINF means that the Slicer is stuck at a * point of infinite density. SLICER_NEGINF means that current value of * the slicer has zero density (or -Inf on the log scale). */ enum SlicerState {SLICER_OK, SLICER_POSINF, SLICER_NEGINF}; /** * @short Slice Sampling method * * The slice sampler is defined by Neal R (2003) Slice Sampling, * Ann. Statist. 31; 3: 705-767. * * This class provides basic infrastructure for slice sampling. * * The Slicer class provides no update method. A subclass must provide * an update method that calls either updateStep or updateDouble, * depending on whether the "stepping out" or "doubling" method is * used. The subclass must also provide member functions value, * setValue, getLimits and logDensity. */ class Slicer : public MutableSampleMethod { double _width; bool _adapt; unsigned int _max; double _sumdiff; unsigned int _iter; SlicerState _state; bool accept(double xold, double xnew, double z, double L, double R, double lower, double upper); public: /** * Constructor for Slice Sampler * * @param width Initial width of slice * * @param max Maximum number of times initial width of slice will * increase at each iteration. */ Slicer(double width, unsigned int max); /** * Update the current value using the "stepping" method. A Sampler * that uses a Slicer can implement Sampler#update by calling this * function. * * @return Success indicator. If the return value is false, then * the slicer state is set to show the error that occurred. */ bool updateStep(RNG *rng); /** * Update the current value using the "doubling" method. A Sampler * that uses a Slicer can implement Sampler#update by calling this * function. * * @return Success indicator. If the return value is false, then * the Slicer state is set to show the error that occurred. */ bool updateDouble(RNG *rng); /** * Returns the current value of the Slicer. */ virtual double value() const = 0; /** * Sets the value of the Slicer. * * @param x value to set */ virtual void setValue(double x) = 0; /** * Gets the lowest and highest possible values of the Slicer */ virtual void getLimits(double *lower, double *upper) const = 0; /** * Turns off adaptive mode. */ void adaptOff(); /** * The current adaptation test is very basic, and will return true * if a minimum number of iterations (50) have taken place. */ bool checkAdaptation() const; /** * The slicer method is adaptive. The step size adapts to the * mean distance between consecutive updates */ bool isAdaptive() const; /** * Returns the log probability density function of the target * distribution. */ virtual double logDensity() const = 0; /** * Returns the state of the sampler. */ SlicerState state() const; }; } /* namespace jags */ #endif /* SLICER_H_ */ JAGS-4.3.2/src/include/sampler/Metropolis.h0000664000175000017500000000433014224052514015351 00000000000000#ifndef METROPOLIS_H_ #define METROPOLIS_H_ #include #include namespace jags { class StochasticNode; /** * @short Metropolis-Hastings sampling method * * This class is used by Metropolis Hastings samplers. It provides * only basic infrastructure. * * The Metropolis class provides no update member function. A subclass * of Metropolis must provide this. It should contain one or more * calls to Metropolis#setValue, calculate the acceptance probability, * and then call the function Metropolis#accept. */ class Metropolis : public MutableSampleMethod { std::vector _last_value; bool _adapt; Metropolis(Metropolis const &); Metropolis &operator=(Metropolis const &); public: Metropolis(std::vector const &value); ~Metropolis(); /** * Gets the current value array of the Metropolis object. */ virtual void getValue(std::vector &value) const = 0; /** * Sets the value of the Metropolis object. * * @param value Vector of values */ virtual void setValue(std::vector const &value) = 0; /** * Accept current value with probabilty prob. If the current value * is not accepted, the Metropolis object reverts to the value at * the last successful call to accept. * * @param rng Random number generator. * * @param prob Probability of accepting the current value. * * @returns success indicator */ bool accept(RNG *rng, double prob); /** * Rescales the proposal distribution. This function is called by * Metropolis#accept when the sampler is in adaptive * mode. Rescaling may depend on the acceptance probability. * * @param prob Acceptance probability */ virtual void rescale(double prob) = 0; /** * The Metropolis-Hastings method is adaptive. The process of * adaptation is specific to each subclass and is defined by the * rescale member function */ bool isAdaptive() const; /** * Turns off adaptive mode */ void adaptOff(); /** * length of the value vector */ unsigned int length() const; }; } /* namespace jags */ #endif /* METROPOLIS_H_ */ JAGS-4.3.2/src/include/sampler/RWMetropolis.h0000664000175000017500000000531514224052514015626 00000000000000#ifndef RW_METROPOLIS_H_ #define RW_METROPOLIS_H_ #include #include namespace jags { /** * @short Random Walk Metropolis-Hastings sampling method * * This class provides an update function which modifies the current * value by a random walk. This step size is adapted to achieve the * target acceptance rate using a noisy gradient algorithm. */ class RWMetropolis : public Metropolis { StepAdapter _step_adapter; double _pmean; unsigned int _niter; public: /** * Constructor. * * @param value Initial value vector. * @param step Initial step size for the random walk updates. * @param prob Target acceptance probability. The default seems to * be a fairly robust optimal value. */ RWMetropolis(std::vector const &value, double step, double prob = 0.234); ~RWMetropolis(); /** * Updates the current value by adding a random increment. */ void update(RNG *rng); /** * Modifies the step size to achieve the target acceptance * probability using a noisy gradient algorithm * * @param prob acceptance probability at current update */ void rescale(double prob); /** * The RWMetropolis method keeps a running mean of the acceptance * probabilities, which is updated every time the rescale function * is called. The checkAdaptation function returns true if the logit * of the running mean is within 0.50 of the target. */ bool checkAdaptation() const; /** * Modifies the given value vector in place by adding an * independent normal increment to each element. It can be * overridden to provide non-normal increments, or a random walk * on some transformed scale (but see RMetropolis#logJacobian). * * Note that this function does not modify the value of the * RWMetropolis object. * */ virtual void step(std::vector &value, double s, RNG *rng) const; /** * If the random walk takes place on a transformed scale * (e.g. log, logistic), then the log density of the target * distribution must be penalized by the log Jacobian of the * transformation. * * This function calculates the log Jacobian at the given value. * By default, the random walk takes place on the original scale * and therefore the penalty is zero. */ virtual double logJacobian(std::vector const &value) const; /** * Returns the log of the probability density function of the target * distribution at the current value. */ virtual double logDensity() const = 0; }; } /* namespace jags */ #endif /* RW_METROPOLIS_H_ */ JAGS-4.3.2/src/include/sampler/Linear.h0000664000175000017500000000502114224052371014425 00000000000000#ifndef LINEAR_H_ #define LINEAR_H_ #include namespace jags { class GraphView; class SingletonGraphView; class Graph; class StochasticNode; /** * Helper function to check additivity. The function returns true if * all deterministic descendants within the given SingletonGraphView * are additive functions of the sampled node. * * @param gv GraphView to be tested. * * @param fixed Boolean flag. If true, the function checks for * additive functions with a fixed intercept. * * @see Node#isClosed */ bool checkAdditive(SingletonGraphView const *gv, bool fixed); /** * Helper function to check additivity. The function returns true if * all deterministic descendants of the nodes within the graph are * additive functions. * * @param snodes Vector of nodes to be tested. * * @param graph Enclosing graph for gv * * @param fixed Boolean flag. If true, the function checks for * additive functions with a fixed intercept. * * @see Node#isClosed */ bool checkAdditive(std::vector const &snodes, Graph const &graph, bool fixed); /** * Helper function to check linearity. The function returns true if * all deterministic descendants within the given GraphView are linear * functions. * * @param gv GraphView to be tested. * * @param fixed Boolean flag. If true, the function checks for fixed * linear functions. * * @param link Boolean flag. If true, then the function tests for a * generalized linear model, allowing the last deterministic * descendants (i.e. those with no deterministic children) to be link * functions. * * @see Node#isClosed */ bool checkLinear(GraphView const *gv, bool fixed, bool link=false); /** * Helper function to check for scale transformations. The function * returns true if all deterministic children within the given * GraphView are scale transformations or scale-mixture * transformations. * * @param gv GraphView to be tested. * * @param fixed Boolean flag. If true, the function checks for fixed * scale transformations. * * @see Node#isClosed */ bool checkScale(GraphView const *gv, bool fixed); /** * Helper function to check for power transformations. The function * returns true if all deterministic descendants of the given node * (within the given graph) are power transformations. * * @param gv GraphView to be tested. * * @param fixed Boolean flag. If true, the function checks for fixed * power transformations. * * @see Node#isClosed */ bool checkPower(GraphView const *gv, bool fixed); } /* namespace jags */ #endif /* LINEAR_H_ */ JAGS-4.3.2/src/include/sampler/GraphView.h0000664000175000017500000001272714224052514015121 00000000000000#ifndef GRAPH_VIEW_H_ #define GRAPH_VIEW_H_ #include #include #include namespace jags { class StochasticNode; class DeterministicNode; class Node; class Graph; struct RNG; /** * @short Interface to a graph for Samplers. * * The GraphView class is a helper class used by a Sampler. It allows * new values to be assigned to a vector of stochastic nodes. When * new values are assigned, it also updates the immediate * deterministic descendants of those nodes (see below for a * definition). Sampling takes place in the context of a Graph, * which must contain the sampled nodes. Any descendents of these * nodes outside of the Graph are ignored when updating. * * Some terminology: * * The "immediate deterministic descendants" of a set of stochastic * nodes S are the descendants of S in the graph where all stochastic * nodes except those in S have been removed. * * The "marginal stochastic children" of a set of stochastic nodes S * are the children of S in the graph where all deterministic nodes * have been marginalized out. * * A vector of nodes in an acyclic Graph is in topological order if * node B always appears after node A when there is a path from A to * B. Note that topological order is not uniquely determined. */ class GraphView { unsigned int _length; std::vector _nodes; std::vector _stoch_children; std::vector _determ_children; bool _multilevel; void classifyChildren(std::vector const &nodes, Graph const &graph, std::vector &stoch_nodes, std::vector &dtrm_nodes, bool allow_multilevel); public: /** * Constructs a GraphView for the given vector of nodes. * * @param nodes Vector of Nodes to be sampled * * @param graph Graph within which sampling is to take place. It is * an error if this Graph does not contain all of the Nodes * to be sampled. * * @param allow_multilevel Indicates whether the GraphView may be * multilevel, i.e. some sampled nodes are stochastic * children of other sampled nodes. Many update methods do * not work with multi-level models so this parameter is false * by default. If an attempt is made to create a multi-level graph * view when the multilevel is false, a logic_error is thrown. */ GraphView(std::vector const &nodes, Graph const &graph, bool allow_multilevel=false); /** * Returns the vector of sampled nodes. */ std::vector const &nodes() const; /** * Sets the values of the sampled nodes. Their immediate * deterministic descendants are automatically updated. * * @param value Array of concatenated values to be applied to the * sampled nodes. * * @param length Length of the value array. This must be equal to the * sum of the lengths of the sampled nodes. * * @param chain Number of the chain (starting from zero) to be modified. */ void setValue(double const * value, unsigned int length, unsigned int chain) const; void setValue(std::vector const &value, unsigned int chain) const; void getValue(std::vector &value, unsigned int chain) const; /** * Returns the total length of the sampled nodes. */ unsigned int length() const; /** * Returns the marginal stochastic children of the sampled nodes. */ std::vector const &stochasticChildren() const; /** * Returns the immediate deterministic descendendants of the sampled * nodes, in topological order */ std::vector const &deterministicChildren() const; /** * Tests whether the node depends deterministically on any of the * sampled nodes. This function may be used by SamplerFactory * objects to test the validity of sampling methods. For example, we * may need to check that the mean, but not the variance of a * stochastic child depends on the sampled nodes. * * @param node Node to test * * @return true if node is in either the vector of sampled nodes or the * vector of deterministic children, false otherwise. */ bool isDependent(Node const *node) const; /** * Calculates the log conditional density of the sampled nodes, * given all other nodes in the graph that was supplied to the * constructor, plus the parents of the nodes (which may be outside * the graph). The log full conditional is calculated up to an * additive constant. * * @param chain Number of the chain (starting from zero) to query. */ double logFullConditional(unsigned int chain) const; /** * Calculates the log prior density of the sampled nodes, i.e. the * density conditioned only on the parents. */ double logPrior(unsigned int chain) const; /** * Calculates the log likelihood, which is added to the log prior * to give the log full conditional density */ double logLikelihood(unsigned int chain) const; /** * Checks that the log density is finite for all sampled nodes and * all stochastic children. If any log density value is negative * infinite a NodeError exception is thrown. * * This utility function should be called by the constructor of any * sample method that needs to ensure the graph is in a valid state * before sampling. */ void checkFinite(unsigned int chain) const; }; unsigned int nchain(GraphView const *gv); } /* namespace jags */ #endif /* GRAPH_VIEW_H_ */ JAGS-4.3.2/src/include/sampler/StepAdapter.h0000664000175000017500000000221214224052371015426 00000000000000#ifndef STEP_ADAPTER_H_ #define STEP_ADAPTER_H_ #include namespace jags { /** * @short Step size for Random Walk Metropolis-Hastings * * Uses a noisy gradient algorithm to adapt the step size of a random * walk Metropolis-Hastings algorithm to reach the target acceptance * probability. */ class StepAdapter { const double _prob; double _lstep; bool _p_over_target; unsigned int _n; public: /** * Constructor. * * @param step Initial step size for the random walk updates. * @param prob Target acceptance probability. The default seems to * be a fairly robust optimal value. */ StepAdapter(double step, double prob = 0.234); /** * Recalculates the step size. * @param p acceptance probability */ void rescale(double p); /** * Returns the current step size */ double stepSize() const; /** * Returns the distance, on a logistic scale, between the argument * p and the target acceptance probability. */ double logitDeviation(double p) const; }; } /* namespace jags */ #endif /* STEP_ADAPTER_H_ */ JAGS-4.3.2/src/include/sampler/TemperedMetropolis.h0000664000175000017500000001142614224052514017043 00000000000000#ifndef MIX_METHOD_H_ #define MIX_METHOD_H_ #include #include #include namespace jags { class StepAdapter; /** * @short Metropolis-Hastings sampling method with tempered transitions * * TemperedMetropolis implements a random-walk Metropolis-Hastings * method with tempered transitions (Neal, R. Sampling from multimodal * distributions using tempered transitions, Statistics and Computing, * vol 6, pp 353-355, 1996). * * A tempered log density at temperature T is derived from the target * log density L by replacing L with L/T. For large T, the tempered * density is flattened, converging to the prior density as T tends to * infinity. * * In a tempered transition, a new Metropolis-Hasting proposal is * generated by a sequence of Metropolis-Hastings updates that are * stationary with respect to a tempered density. In this sequence, T * starts close to 1 increases to a maximum (e.g. 1000) and then * decreases to 1 again. Tempering allows the proposal to jump to a * new local mode of the target density by tunnelling, at high * temperature, through a region of low density. * * Three elements are essential for successful tempered updates. The * first is a sufficiently high maximum temperature. Without this, * tunnelling can never occur between well-separated modes of the * target density. The second element is a sufficiently small * temperature increment between levels. If the increase is too * large, then the proposal generated by the tempered updates has a * low acceptance probability. The third element is a sufficient * number of replicates at each temperature level. In * TemperedMetropolis the updates at each level are tuned to have an * acceptance probability converging to 0.234. Several replicate * updates are therefore required to guarantee that a M-H jump takes * place. Without this, the proposal risks getting stuck in a region * of low probability. These elements are controlled by the parameters * max_level, max_temp, and nrep respectively. */ class TemperedMetropolis : public Metropolis { const int _max_level; const unsigned int _nrep; const std::vector _pwr; int _t; int _tmax; std::vector _step_adapter; double _pmean; unsigned int _niter; void temperedUpdate(RNG *rng, double &log_prior0, double &log_likelihood0, std::vector &value0); public: /** * Constructor. * * @param nlevel Number of levels between minimum and maximum temperature * * @param max_temp Maximum temperature * * @param nrep Number of Metropolis-Hastings updates to do at each * level */ TemperedMetropolis(std::vector const &value, int nlevel, double max_temp, unsigned int nrep); ~TemperedMetropolis(); /** * Updates the current value using tempered transitions. */ void update(RNG *rng); /** * Modifies the step size at each temperature level to achieve the * target acceptance probability using a noisy gradient algorithm * * When the mean acceptance probability is within the target * range, the temperature is increased up to max_temp. * * @param prob acceptance probability at current update */ void rescale(double prob); /** * Checks whether the maximum temperature has been reached. */ bool checkAdaptation() const; /** * The target density is assumed to be the product of a prior density * and a likelihood. Only the likelihood part of the density is * tempered. This may be necessary in order to ensure that the * tempered distribution can be normalized. * * This function returns the log of the prior density function. */ virtual double logPrior() const = 0; /** * Returns the log of the likelihood. */ virtual double logLikelihood() const = 0; /** * Modifies the given value vector in place by adding an * independent normal increment to each element. It can be * overridden to provide non-normal increments, or a random walk * on some transformed scale (but see RMetropolis#logJacobian). * * Note that this function does not modify the value of the * RWMetropolis object. */ virtual void step(std::vector &value, double s, RNG *rng) const; /** * If the random walk takes place on a transformed scale * (e.g. log, logistic), then the log density of the target * distribution must be penalized by the log Jacobian of the * transformation. * * This function calculates the log Jacobian at the given value. */ virtual double logJacobian(std::vector const &value) const; }; } /* namespace jags */ #endif /* MIX_METHOD_H_ */ JAGS-4.3.2/src/include/sampler/SampleMethodNoAdapt.h0000664000175000017500000000114714224052514017050 00000000000000#ifndef SAMPLE_METHOD_NO_ADAPT_H_ #define SAMPLE_METHOD_NO_ADAPT_H_ #include namespace jags { /** * @short Sampling methods with no adaptive phase * * Provides trivial implementations of member functions concerned * with adaptation for sample methods that have no adaptive phase. */ class SampleMethodNoAdapt : public MutableSampleMethod { public: bool isAdaptive() const { return false; }; void adaptOff() {}; bool checkAdaptation() const { return true; }; }; } /* namespace jags */ #endif /* SAMPLE_METHOD_NON_ADAPT_H_ */ JAGS-4.3.2/src/include/sampler/SingletonGraphView.h0000664000175000017500000000215614224052371017000 00000000000000#ifndef SINGLETON_GRAPH_VIEW_H_ #define SINGLETON_GRAPH_VIEW_H_ #include namespace jags { /** * @short GraphView for a single stochastic node. * * The SingletonGraphView class provides a simplified interface to * the GraphView class when there is only a single node to be * sampled. It should be used in preference to GraphView by any * Sampler that acts on a single node. * * Note that this class is not just syntactic sugar: it provides a * compile-time guarantee that only one StochasticNode is being * sampled. */ class SingletonGraphView : public GraphView { public: /** * Constructor * * @param node Node to be sampled * * @param graph Graph within which sampling is to take place. */ SingletonGraphView(StochasticNode * node, Graph const &graph) : GraphView(std::vector(1, node), graph, false) {} /** * Returns the sampled node. */ inline StochasticNode * node() const { return nodes()[0]; } }; } /* namespace jags */ #endif /* SINGLETON_GRAPH_VIEW_H_ */ JAGS-4.3.2/src/include/sampler/MutableSampleMethod.h0000664000175000017500000000130114224052514017103 00000000000000#ifndef MUTABLE_SAMPLE_METHOD_H_ #define MUTABLE_SAMPLE_METHOD_H_ namespace jags { struct RNG; /** * @short Abstract class for mutable sampling methods */ class MutableSampleMethod { public: virtual ~MutableSampleMethod(); /** * Draws another sample from the target distribution */ virtual void update(RNG *rng) = 0; /** * Indicates whether the sample method has an adaptive mode. */ virtual bool isAdaptive() const = 0; /** * Turns off adaptive mode */ virtual void adaptOff() = 0; /** * Checks adaptation */ virtual bool checkAdaptation() const = 0; }; } /* namespace jags */ #endif /* MUTABLE_SAMPLE_METHOD_H_ */ JAGS-4.3.2/src/include/sampler/ImmutableSampleMethod.h0000664000175000017500000000073014224052514017436 00000000000000#ifndef IMMUTABLE_SAMPLE_METHOD_H_ #define IMMUTABLE_SAMPLE_METHOD_H_ namespace jags { struct RNG; /** * @short Abstract class for immutable sampling methods */ class ImmutableSampleMethod { public: virtual ~ImmutableSampleMethod(); /** * Draws another sample from the target distribution */ virtual void update(unsigned int chain, RNG *rng) const = 0; }; } /* namespace jags */ #endif /* IMMUTABLE_SAMPLE_METHOD_H_ */ JAGS-4.3.2/src/include/sampler/MutableSampler.h0000664000175000017500000000257614224052514016143 00000000000000#ifndef MUTABLE_SAMPLER_H_ #define MUTABLE_SAMPLER_H_ #include namespace jags { struct RNG; class MutableSampleMethod; /** * @short Samples multiple chains in parallel * * A vector of MutableSampleMethod objects is used to update each * chain in parallel. */ class MutableSampler : public Sampler { std::vector _methods; const std::string _name; public: /** * Constructor. * * @param gv View of the sample graph, passed directly to the * parent class Sampler, which takes ownership of it * * @param methods Vector of pointers to MutableSampleMethod * objects, of length equal to the number of chains. These * must be dynamically allocated, as the * MutableSampler will take ownership of them, and * will delete them when its destructor is called * * @param name The name of the sampler, which will be returned * by the member function name. */ MutableSampler(GraphView *gv, std::vector const &methods, std::string const &name); ~MutableSampler(); void update(std::vector const &rngs); bool isAdaptive() const; void adaptOff(); bool checkAdaptation() const; /** * Returns the name of the sampler, as given to the constructor */ std::string name() const; }; } /* namespace jags */ #endif /* MUTABLE_SAMPLER_H_ */ JAGS-4.3.2/src/include/sampler/ImmutableSampler.h0000664000175000017500000000315014224052514016456 00000000000000#ifndef IMMUTABLE_SAMPLER_H_ #define IMMUTABLE_SAMPLER_H_ #include namespace jags { struct RNG; class ImmutableSampleMethod; /** * @short Samples multiple chains in parallel * * Uses an ImmutableSampleMethod object to update each chain * independently. * * In contrast to the MutableSampler, only one sample * method is required to update all chains. */ class ImmutableSampler : public Sampler { ImmutableSampleMethod const * const _method; const unsigned int _nchain; const std::string _name; public: /** * Constructor. * * @param gv View of the sample graph, passed directly to the * parent class Sampler. * * @param methods Pointer to an ImmutableSampleMethod This * must be dynamically allocated, as the * ImmutableSampler will take ownership of it, and * will delete it when the destructor is called. * * @param name Name of the sampler, which will be returned * by the member function name. */ ImmutableSampler(GraphView *gv, ImmutableSampleMethod* method, std::string const &name); ~ImmutableSampler(); /** * Updates all chains in parallel using the update method * provided to the constructor */ void update(std::vector const &rngs); /** * The sampler is not adaptive */ bool isAdaptive() const; /** * This does nothing */ void adaptOff(); /** * This always returns true */ bool checkAdaptation() const; /** * Returns the name of the sampler, as given to the constructor.b */ std::string name() const; }; } /* namespace jags */ #endif /* IMMUTABLE_SAMPLER_H_ */ JAGS-4.3.2/src/include/sampler/Makefile.in0000644000175000017500000004323414400675235015123 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/sampler ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(samplerinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(samplerincludedir)" HEADERS = $(samplerinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ samplerincludedir = $(pkgincludedir)/sampler samplerinclude_HEADERS = Sampler.h SamplerFactory.h \ SingletonFactory.h Slicer.h Metropolis.h RWMetropolis.h Linear.h \ GraphView.h StepAdapter.h TemperedMetropolis.h SampleMethodNoAdapt.h \ SingletonGraphView.h MutableSampleMethod.h ImmutableSampleMethod.h \ MutableSampler.h ImmutableSampler.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/sampler/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/sampler/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-samplerincludeHEADERS: $(samplerinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(samplerinclude_HEADERS)'; test -n "$(samplerincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(samplerincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(samplerincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(samplerincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(samplerincludedir)" || exit $$?; \ done uninstall-samplerincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(samplerinclude_HEADERS)'; test -n "$(samplerincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(samplerincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(samplerincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-samplerincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-samplerincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am \ install-samplerincludeHEADERS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-samplerincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/sarray/0000755000175000017500000000000014400711324012754 500000000000000JAGS-4.3.2/src/include/sarray/Makefile.am0000664000175000017500000000016514224052371014740 00000000000000sarrayincludedir = $(pkgincludedir)/sarray sarrayinclude_HEADERS = RangeIterator.h SArray.h Range.h SimpleRange.h JAGS-4.3.2/src/include/sarray/RangeIterator.h0000664000175000017500000000354014224052514015622 00000000000000#ifndef RANGE_ITERATOR_H_ #define RANGE_ITERATOR_H_ #include #include namespace jags { /** * @short Mutable index that traverses a Range * * A RangeIterator is a numeric vector that traverses a given * Range in row- or column-major order. * * @see Range */ class RangeIterator : public std::vector { std::vector > _scope; std::vector _dim; std::vector _index; unsigned int _atend; //Forbid assignment RangeIterator &operator=(std::vector const &); public: /** * Constructor. The initial value of a RangeIterator is the * beginning of the range. * * It is not possible to construct a RangeIterator if any of * the dimensions of the Range are zero because there can be * no index value corresponding to a zero dimension. In this * case a logic_error is thrown. * * @param range. Range to traverse */ RangeIterator(Range const &range); /** * Goes to the next index in column-major order, (i.e. moving * the left hand index fastest). If the RangeIterator reaches * the end of the Range, then a call to nextLeft will move it * to the beginning again. * * @return reference to self after incrementation * @see nextRight */ RangeIterator &nextLeft(); /** * Goes to the next index in row-major order (i.e. moving the * right hand index fastest) but otherwise behaves like * nextLeft. * * @return reference to self after incrementation * @see nextLeft */ RangeIterator &nextRight(); /** * Returns a numeric counter of the number of times the * RangeIterator has gone past the end of the Range (and * returned to the beginning) in a call to nexLeft or * nextRight. The initial value is zero. */ unsigned int atEnd() const; }; } /* namespace jags */ #endif /* RANGE_ITERATOR_H_ */ JAGS-4.3.2/src/include/sarray/SArray.h0000664000175000017500000000750014224052514014255 00000000000000#ifndef SARRAY_H_ #define SARRAY_H_ #include #include #include namespace jags { /** * @short multi-dimensional real-valued array * * An SArray represents a multi-dimensional array of double precision values. */ class SArray { const SimpleRange _range; std::vector _value; bool _discrete; std::vector > _s_dimnames; std::vector _dimnames; SArray &operator=(SArray const &rhs); public: /** * Constructor for SArrays. * * On construction, the elements of the value array are all equal to * JAGS_NA. * * @param dim Dimension of SArray to be constructed */ SArray(std::vector const &dim); /** * Copy constructor. * * Note that the assignment operator of the SArray class is * declared private, and so cannot be used. An SArray can only be * copied by a constructor. This ensures that, once constructed, * an SArray cannot change its length or dimension. */ SArray(SArray const &orig); /** * Sets the value of an SArray. * * @param value vector of values to be assigned. The size of this * vector must match the length of the SArray or a length_error * exception will be thrown. * * @exception length_error */ void setValue(std::vector const &value); /** * Sets the value of an SArray to an integer vector */ void setValue(std::vector const &value); /** * Sets the value of a single element of SArray * * @param value Scalar value to be assigned * * @param offset Distance along the value array */ void setValue(double value, unsigned int offset); /** * The value of the SArray . * * Values are given in column-major order (i.e. with the left hand * index moving fastest), like the S language and Fortran. * * @return A reference to a vector of values. */ std::vector const &value() const; /** * Indicates whether the SArray should contain integer-values or * real values. */ bool isDiscreteValued() const; /** * Returns the range associated with the SArray. */ SimpleRange const &range() const; /** * Returns the names of the dimensions. A newly created SArray has * no dimension names and this function returns an empty vector. */ std::vector const &dimNames() const; /** * Sets the names of the dimensions. * * @param names A vector of names that is either empty, or of size * equal to the number of dimensions. */ void setDimNames(std::vector const &names); /** * Returns the names of one of dimensions, corresponding to * dimnames()[i+1] in the S language. A newly created SArray has * no dimnames and so this function returns an empty vector. * * @param i Requested dimension. */ std::vector const &getSDimNames(unsigned int i) const; /** * Sets the names of the ith dimension, corresponding to dimnames()[i+1] * in the S language. * * @param names A vector of names of size equal to the ith dimension * value vector, or zero. * @param i Requested dimension */ void setSDimNames(std::vector const &names, unsigned int i); /** * It is convenient to inline these functions so that an SArray * can be thought of as having some of the dimension attributes of * its associated range. */ unsigned int length() const { return range().length(); } unsigned int ndim(bool drop) const { return range().ndim(drop); } std::vector const & dim(bool drop) const { return range().dim(drop); } }; } /* namespace jags */ #endif /* SARRAY_H_ */ JAGS-4.3.2/src/include/sarray/Range.h0000664000175000017500000001130414224052514014105 00000000000000#ifndef RANGE_H_ #define RANGE_H_ #include #include namespace jags { /** * @short Represents a collection of array indices * * A Range object represents a subset of indices in a multi * dimensional array. For example, A[1:2,4,4:6] is a subset of the * 3-dimensional array A defined by the range [1:2,4,4:6]. This range * is itself defined as the outer product of 3 integer vectors: * c(1,2), 4, and c(4,5,6) in the first, second, and third dimensions, * respectively. * * A Range may contain indices in any order and may include repeat * indices. A Range is "simple" if its component vectors consist of * contiguous elements in increasing order. For example, the Range * given above is Simple. However, the Range [c(2,1,1,3,4)] is not * simple. The SimpleRange class is used for a more efficient * calculations on simple Ranges. * * @see SimpleRange * */ class Range { std::vector > _scope; protected: std::vector _dim, _dim_dropped; std::vector _first, _last; unsigned int _length; public: /** * Default constructor which creates a NULL range of zero length. */ Range(); /** * Constructs a Range. * * @param scope Vector of index vectors. The scope parameter is of * length equal to the number of dimensions. Element i of the * scope vector is the vector of indices for dimension i. Each * element of scope must be non-empty (i.e. must contain at least * one index) or a logic_error is thrown. * * @exception logic_error */ Range(std::vector > const &scope); /** * Virtual destructor */ virtual ~Range(); /** * Equality operator */ bool operator==(Range const &range) const; /** * Inequality operator */ bool operator!=(Range const &range) const; /** * Length of the range. This is the number of indices that are * contained in the range. For example, the range [1:2,4,4:5] * contains 4 elements. */ unsigned int length() const; /** * Returns the index in position n when the indices in the Range * are put in column-major order (i.e. with the left hand index * moving fastest). * * @see RangeIterator */ std::vector leftIndex(unsigned int n) const; /** * Returns the index in position n when the indices in the Raneg * are put in row-major order (i.e. with the right hand index * moving fastest). * * @see RangeIterator */ std::vector rightIndex(unsigned int n) const; /** * Dimension of the range. The range [1:4,2,3:5] has dimension * (4,1,3) if drop==false and (4,3) if drop==true. Dropping of * dimensions follows the S language convention. * * @param drop Should dimensions of size 1 be dropped? */ std::vector const &dim(bool drop) const; /** * Number of dimensions covered by the Range. The range [1:4, 2, * 3:5] has 3 dimensions if drop==false and 2 dimensions if * drop==true. * * @param drop Should dimensions of size 1 be counted? */ unsigned int ndim(bool drop) const; /** * The first element of the Range (in either row-major or * column-major order). */ std::vector const & first() const; /** * The last element of the Range (in either row-major or * column-major order). */ std::vector const & last() const; /** * Less than operator that gives a unique ordering of ranges * Ranges are first sorted by the first element, then the last * element and, if they are still equivalent by these criteria, a * lexicographic ordering of the scope. */ bool operator<(Range const &rhs) const; /** * Returns the scope vector used to construct the Range. */ std::vector > const &scope() const; }; /** * Tests for NULL ranges. */ inline bool isNULL(Range const &range) { return range.length() == 0; } /** * Returns a string containing a BUGS language representation of * the given range. * * Simple ranges, consisting of contiguous elements in increasing * order, are represented as in R: e.g. a range with lower limit * (1,2,3) and upper limit (3,3,3) will be printed as * "[1:3,2:3,3]. * * Complex ranges, consisting of elements that are not contiguous * or not in order, are not represented exactly when printed. The * first and last indices in the range are given separated by * ellipses, e.g. the range c(3,7,4,2,2,5) is represented as * "[3...5]" */ std::string print(Range const &range); } /* namespace jags */ #endif /* RANGE_H_ */ JAGS-4.3.2/src/include/sarray/SimpleRange.h0000664000175000017500000001026114224052514015260 00000000000000#ifndef SIMPLE_RANGE_H_ #define SIMPLE_RANGE_H_ #include #include #include namespace jags { /** * @short Represents a contiguous ordered collection of array indices * * SimpleRange is used for a Range consisting of a contiguous * block of indices. It is uniquely defined by its lower and upper * bounds and contains every index in between. */ class SimpleRange : public Range { public: /** * Default constructor which constructs a NULL range, with * zero-length upper and lower limits. */ SimpleRange(); /** * Destructor */ ~SimpleRange(); /** * Constructs a simple range given lower and upper limits A * logic_error is thrown if these are of different lengths * * @param lower Lower limits. * * @param upper Upper limits. A range_error is thrown if any * element of upper is smaller than the corresponding * element of lower. * * @exception range_error */ SimpleRange(std::vector const &lower, std::vector const &upper); /** * Constructs a scalar range from an index. The upper and lower * bounds are both equal to the supplied index. */ SimpleRange(std::vector const &index); /** * Constructs a range from a dimension. For each index, the lower * limit is 1 and the upper limit is the corresponding element of * dim (cast to a signed int). * * This constructor should not be confused with the constructor * that creates a scalar range from a vector of signed integers. */ SimpleRange(std::vector const &dim); /** * Equality operator. A SimpleRange is uniquely defined by * its lower and upper limits, so testing for equality is * much quicker than for a Range object. */ bool operator==(SimpleRange const &range) const; /** * Inequality operator */ bool operator!=(SimpleRange const &range) const; /* * Indicates whether the supplied index is contained * inside this SimpleRange. bool contains(std::vector const &test_index) const; */ /** * Indicates whether the test SimpleRange is completely * contained inside this SimpleRange. * * @param test_range Test SimpleRange */ bool contains(SimpleRange const &test_range) const; /** * Indicates whether the test Range is completely contained * inside this SimpleRange. * * @param test_range Test Range */ bool contains(Range const &test_range) const; /** * The inverse of leftIndex. The left offset is the position * of the given index in the sequence when all indices in the * Range are written out in column major order (i.e. with the * left index moving fastest). * * @param index Index vector to convert to offset. An out_of_range * exception is thrown if the index is not contained in the range. * * @exception out_of_range */ unsigned int leftOffset(std::vector const &index) const; /** * The inverse of rightIndex. The right offset is the position * of the given index in the sequence when all indices in the * range are given in row major order (i.e. with the right * index moving fastest). * * @param index Index vector to convert to offset. An out_of_range * exception is thrown if the index is not contained in the range. * * @exception out_of_range */ unsigned int rightOffset(std::vector const &index) const; /** * Less than operator. It defines the same ordering as * Range#operator< among SimpleRange objects but the * calculations are more efficient as a SimpleRange is * uniquely defined by its first and last elements. */ bool operator<(SimpleRange const &rhs) const; /** * The lower bound of the Range (an alias for Range#first) */ inline std::vector const & lower() const { return first(); } /** * The upper bound of the Range (an alias for Range#last) */ inline std::vector const & upper() const { return last(); } }; /** * Returns a string containing a BUGS language representation of * the given range: e.g. a simple range with lower limit (1,2,3) * and upper limit (3,3,3) will be printed as "[1:3,2:3,3]" */ std::string print(SimpleRange const &range); } /* namespace jags */ #endif /* SIMPLE_RANGE_H_ */ JAGS-4.3.2/src/include/sarray/Makefile.in0000644000175000017500000004263714400675235014767 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/sarray ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(sarrayinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(sarrayincludedir)" HEADERS = $(sarrayinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ sarrayincludedir = $(pkgincludedir)/sarray sarrayinclude_HEADERS = RangeIterator.h SArray.h Range.h SimpleRange.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/sarray/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/sarray/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-sarrayincludeHEADERS: $(sarrayinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(sarrayinclude_HEADERS)'; test -n "$(sarrayincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sarrayincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sarrayincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(sarrayincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(sarrayincludedir)" || exit $$?; \ done uninstall-sarrayincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(sarrayinclude_HEADERS)'; test -n "$(sarrayincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(sarrayincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(sarrayincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-sarrayincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-sarrayincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am \ install-sarrayincludeHEADERS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-sarrayincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/rng/0000755000175000017500000000000014400711324012241 500000000000000JAGS-4.3.2/src/include/rng/Makefile.am0000664000175000017500000000015314224052371014222 00000000000000rngincludedir = $(pkgincludedir)/rng rnginclude_HEADERS = RNG.h RmathRNG.h RNGFactory.h TruncatedNormal.h JAGS-4.3.2/src/include/rng/RNG.h0000664000175000017500000000402714224052514012770 00000000000000#ifndef RNG_H_ #define RNG_H_ #include #include namespace jags { /** * Abstract class for a psuedo random number generator * * @short Random Number Generator */ struct RNG { const std::string _name; RNG(std::string const &name); virtual ~RNG(); /** * Sets the state of the RNG given a single integer value. This * may be used to set the state using, for example, the current time * stamp. * * @param seed Unsigned integer from which the initial state is generated. * The RNG must be able to construct a valid initial state from any * unsigned integer */ virtual void init(unsigned int seed) = 0; /** * Returns the internal state of the RNG as a vector of integers * * @state Vector of integers that is overwritten with the RNG state. */ virtual void getState(std::vector &state) const = 0; /** * Sets the internal state of the RNG given a vector of integers * * @state Vector of integers describing the internal state of the RNG. * Only vectors previously derived from a call to getState should be used * as input to setState. Other values are not guaranteed to give a valid * state. */ virtual bool setState(std::vector const &state) = 0; /** * Generates a random value with a uniform distribution on (0,1) */ virtual double uniform() = 0; /** * Generates a standard normal random value */ virtual double normal() = 0; /** * Generates are andom value with an exponential distribution */ virtual double exponential() = 0; /** * This static utility function may be used by an RNG object to coerce * values in the range [0,1] to the open range (0,1) */ static double fixup(double x); /** * Returns the name of the RNG */ std::string const &name() const; static double uniform(void *); static double normal(void *); static double exponential(void *); }; } /* namespace jags */ #endif /* RNG_H_ */ JAGS-4.3.2/src/include/rng/RmathRNG.h0000664000175000017500000000124014224052514013756 00000000000000#ifndef RMATH_RNG_H_ #define RMATH_RNG_H_ #include namespace jags { enum NormKind {AHRENS_DIETER, BOX_MULLER, KINDERMAN_RAMAGE}; /** * @short RNG object based on the R math library * * An RmathRNG object implements the normal and exponential functions * using code from the R math library. */ class RmathRNG : public RNG { NormKind _N01_kind; double _BM_norm_keep; public: /** * @param norm_kind Defines the algorithm for producing normal random * variables */ RmathRNG(std::string const &name, NormKind norm_kind); double normal(); double exponential(); }; } /* namespace jags */ #endif /* RMATH_RNG_H_ */ JAGS-4.3.2/src/include/rng/RNGFactory.h0000664000175000017500000000274114224052514014321 00000000000000#ifndef RNG_FACTORY_H_ #define RNG_FACTORY_H_ #include #include namespace jags { struct RNG; /** * @short Factory for RNG objects */ class RNGFactory { public: /** * Destructor. An RNGFactory retains ownership of the RNG objects * it generates, and should delete them when the destructor is called. */ virtual ~RNGFactory() {}; /** * Sets the random seed of the RNG factory so that a reproducible * sequence of RNGs can be produced. * * @param seed Seed that uniquely determines the sequence of RNGs * produced by subsequent calls to makeRNGs. */ virtual void setSeed(unsigned int seed) = 0; /** * Returns a vector of newly allocated RNG objects. * * @param n Number of RNGs requested. Note that an RNG factory have the * capacity to make only m < n independent samplers (where m may be zero). * In this case it should return a vector of length m. */ virtual std::vector makeRNGs(unsigned int n) = 0; /** * Returns a newly allocated RNG object. * * This function can be repeatedly called with the same name * argument. There is no guarantee that RNG objects created in this * way will generate independent streams. */ virtual RNG * makeRNG(std::string const &name) = 0; /** * Returns the name of the RNG factory */ virtual std::string name() const = 0; }; } /* namespace jags */ #endif /* RNG_FACTORY_H_ */ JAGS-4.3.2/src/include/rng/TruncatedNormal.h0000664000175000017500000000243514224052371015446 00000000000000#ifndef TRUNCATED_NORMAL_H_ #define TRUNCATED_NORMAL_H_ namespace jags { struct RNG; /** * Draws a random sample from a left-truncated normal distribution. * * @param left Left limit of the truncated distribution * @param rng Pointer to a Random Number Generator * @param mu Mean of untruncated distribution * @param sigma Standard deviation of untruncated distribution */ double lnormal(double left, RNG *rng, double mu = 0, double sigma = 1); /** * Draws a random sample from a right-truncated normal distribution. * * @param right Right limit of the distribution * @param rng Pointer to a Random Number Generator * @param mu Mean of untruncated distribution * @param sigma Standard deviation of untruncated distribution */ double rnormal(double right, RNG *rng, double mu = 0, double sigma = 1); /** * Draws a random sample from an interval-truncated normal distribution. * * @param left Left limit of the distribution * @param right Right limit of the distribution * @param rng Pointer to a Random Number Generator * @param mu Mean of untruncated distribution * @param sigma Standard deviation of untruncated distribution */ double inormal(double left, double right, RNG *rng, double mu = 0, double sigma = 1); } /* namespace jags */ #endif /* TRUNCATED_NORMAL_H_ */ JAGS-4.3.2/src/include/rng/Makefile.in0000644000175000017500000004252114400675235014244 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/rng ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(rnginclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(rngincludedir)" HEADERS = $(rnginclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ rngincludedir = $(pkgincludedir)/rng rnginclude_HEADERS = RNG.h RmathRNG.h RNGFactory.h TruncatedNormal.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/rng/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/rng/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-rngincludeHEADERS: $(rnginclude_HEADERS) @$(NORMAL_INSTALL) @list='$(rnginclude_HEADERS)'; test -n "$(rngincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(rngincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(rngincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(rngincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(rngincludedir)" || exit $$?; \ done uninstall-rngincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(rnginclude_HEADERS)'; test -n "$(rngincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(rngincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(rngincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-rngincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-rngincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am \ install-rngincludeHEADERS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-rngincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/util/0000755000175000017500000000000014400711324012430 500000000000000JAGS-4.3.2/src/include/util/Makefile.am0000664000175000017500000000014114224052514014405 00000000000000utilincludedir = $(pkgincludedir)/util utilinclude_HEADERS = nainf.h dim.h logical.h integer.h JAGS-4.3.2/src/include/util/nainf.h0000664000175000017500000000045514224052514013625 00000000000000#ifndef NA_INF_H_ #define NA_INF_H_ #ifdef __cplusplus extern "C" { #endif extern const double JAGS_NA; extern const double JAGS_NAN; extern const double JAGS_POSINF; extern const double JAGS_NEGINF; int jags_finite(double); int jags_isnan(double); #ifdef __cplusplus } #endif #endif JAGS-4.3.2/src/include/util/dim.h0000664000175000017500000001017214224052514013300 00000000000000#ifndef DIM_H_ #define DIM_H_ #include #include namespace jags { /** * @short Test for flat dimensions * * A vector "dim" representing a dimension is considered "flat" if * it is either empty or it includes elements equal to zero. Flat * dimensions are unsuitable * * Note that isFlat, isScalar, isVector and isArray are mutually * exclusive. Exactly one of them will return true for any given * input vector. * * @see isScalar, isVector, isArray */ inline bool isFlat(std::vector const &dim) { return dim.empty() || std::find(dim.begin(), dim.end(), 0U) != dim.end(); } /** * @short Test for scalar dimensions * * Tests whether the dimension represented by the vector "dim" * corresponds to a scalar quantity. * * @see isFlat, isVector, isArray */ inline bool isScalar(std::vector const &dim) { return dim.size() == 1 && dim[0] == 1; } /** * @short Test for vector dimensions * * Tests whether the dimension represented by the vector "dim" * corresponds to a vector quantity. * * @see isFlat, isScalar, isArray */ inline bool isVector(std::vector const &dim) { return dim.size() == 1 && dim[0] > 1; } /** * @short Test for array dimensions * * Tests whether the dimension represented by the vector "dim" * corresponds to a matrix or higher-dimensional array. * * @see isFlat, isScalar, isArray */ inline bool isArray(std::vector const &dim) { return dim.size() > 1 && std::find(dim.begin(), dim.end(), 0U) == dim.end(); } /** * @short Test for matrices * * Tests whether the dimension represented by the vector "dim" * corresponds to a matrix (i.e. a two-dimensional array). */ inline bool isMatrix(std::vector const &dim) { return dim.size() == 2 && dim[0] != 0 && dim[1] != 0; } /** * * @short Test for square matrices * * Tests whether the dimension represented by the vector "dim" * corresponds to a square matrix. */ inline bool isSquareMatrix(std::vector const &dim) { return isMatrix(dim) && dim[0] == dim[1]; } /** * Returns the product of the elements of a vector of unsigned * integers. The most common usage of this function is to * calculate the number of elements in an array given its * dimensions. */ unsigned int product(std::vector const &arg); /** * @short Drops redundant dimensions * * Given a vector representing a dimension, returns a reduced * vector in which dimensions that have only one level are * removed. If the vector consists of only scalar dimensions * then the return value is a vector of length 1 and value 1. * * Flat dimensions (corresponding to elements with value * zero) are not removed. */ std::vector drop(std::vector const &dims); /** * @short Gets a constant reference to a unique dimension * * Vectors of unsigned integers are frequently repeated objects in * the JAGS library, and are typically used to represent * dimensions of Nodes and NodeArrays. This function creates a * unique constant reference to the requested vector, avoiding * redundant copies of the vector taking up memory. */ std::vector const & getUnique(std::vector const &dim); /** * @short Getst a constant reference to a unique vector of dimension * * Vectors of vectors of unsigned integers are frequently repeated * objects in the JAGS library (Typically as dimensions of * parameters for Functions and Distributions). This function * returns a reference to a unique copy of the requested vector in * order to save memory. */ std::vector > const & getUnique(std::vector > const &dimvec); } #endif /* DIM_H_ */ JAGS-4.3.2/src/include/util/logical.h0000664000175000017500000000077214224052514014146 00000000000000#ifndef LOGICAL_H_ #define LOGICAL_H_ #include #include /** * Tests whether all elements of the boolean vector "mask" are true. */ inline bool allTrue (std::vector const &mask) { return std::find(mask.begin(), mask.end(), false) == mask.end(); } /** * Tests whether any elements of the boolean vector "mask" are true. */ inline bool anyTrue (std::vector const &mask) { return std::find(mask.begin(), mask.end(), true) != mask.end(); } #endif /* LOGICAL_H_ */ JAGS-4.3.2/src/include/util/integer.h0000664000175000017500000000025314224052514014163 00000000000000#ifndef UTIL_INTEGER_H_ #define UTIL_INTEGER_H_ namespace jags { bool checkInteger(double); int asInteger(double); } /* namespace jags */ #endif /* UTIL_INTEGER_H_ */ JAGS-4.3.2/src/include/util/Makefile.in0000644000175000017500000004253514400675235014440 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/util ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(utilinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(utilincludedir)" HEADERS = $(utilinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ utilincludedir = $(pkgincludedir)/util utilinclude_HEADERS = nainf.h dim.h logical.h integer.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/util/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-utilincludeHEADERS: $(utilinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(utilinclude_HEADERS)'; test -n "$(utilincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(utilincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(utilincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(utilincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(utilincludedir)" || exit $$?; \ done uninstall-utilincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(utilinclude_HEADERS)'; test -n "$(utilincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(utilincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(utilincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-utilincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-utilincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ install-utilincludeHEADERS installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ uninstall-utilincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/include/module/0000755000175000017500000000000014400711324012740 500000000000000JAGS-4.3.2/src/include/module/Makefile.am0000664000175000017500000000013514224052371014721 00000000000000moduleincludedir = $(pkgincludedir)/module moduleinclude_HEADERS = Module.h ModuleError.h JAGS-4.3.2/src/include/module/Module.h0000664000175000017500000000547514224052514014276 00000000000000#ifndef _MODULE_H_ #define _MODULE_H_ #include #include #include #include #include #include namespace jags { class SamplerFactory; class RNGFactory; class MonitorFactory; class LinkFunctiontion; class ScalarFunction; class VectorFunction; class ArrayFunction; class ScalarDist; class RScalarDist; class VectorDist; class ArrayDist; /** * @short Memory management for dynamically loadable modules * * Dynamically loadable modules may extend the capabilities of the JAGS library * by defining new subclasses of Function, Distribution, SamplerFactory, * and RNGFactory. * * Each module must instantiate a subclass of Module. The constructor for * this subcluass must dynamically allocate instances of the sub-classes * defined by the module, and store them with the appropriate insert * member function. */ class Module { std::string _name; bool _loaded; std::vector _fp_list; std::vector _functions; std::vector > _obs_functions; std::vector _dp_list; std::vector _distributions; std::vector _sampler_factories; std::vector _rng_factories; std::vector _monitor_factories; public: Module(std::string const &name); virtual ~Module(); void insert(ScalarFunction*); void insert(LinkFunction*); void insert(VectorFunction*); void insert(ArrayFunction*); void insert(Distribution*); void insert(RScalarDist*); void insert(ScalarDist*); void insert(VectorDist*); void insert(ArrayDist*); void insert(ScalarDist*, ScalarFunction*); void insert(ScalarDist*, LinkFunction*); void insert(ScalarDist*, VectorFunction*); void insert(ScalarDist*, ArrayFunction*); void insert(VectorDist*, ScalarFunction*); void insert(VectorDist*, LinkFunction*); void insert(VectorDist*, VectorFunction*); void insert(VectorDist*, ArrayFunction*); void insert(ArrayDist*, ScalarFunction*); void insert(ArrayDist*, LinkFunction*); void insert(ArrayDist*, VectorFunction*); void insert(ArrayDist*, ArrayFunction*); void insert(SamplerFactory*); void insert(RNGFactory*); void insert(MonitorFactory*); std::vector const &functions() const; std::vector const &distributions() const; std::vector const &samplerFactories() const; std::vector const &rngFactories() const; std::vector const &monitorFactories() const; void load(); void unload(); std::string const &name() const; static std::list &modules(); static std::list &loadedModules(); }; } /* namespace jags */ #endif /* _MODULE_H_ */ JAGS-4.3.2/src/include/module/ModuleError.h0000664000175000017500000000077014224052514015301 00000000000000#ifndef MODULE_ERROR_H_ #define MODULE_ERROR_H_ #include namespace jags { class Node; class Distribution; class Function; void throwRuntimeError(std::string const &message); void throwLogicError(std::string const &message); void throwNodeError(Node const *node, std::string const &message); void throwDistError(Distribution const *dist, std::string const &message); void throwFuncError(Function const *func, std::string const &message); } /* namespace jags */ #endif /* MODULE_ERROR_H_ */ JAGS-4.3.2/src/include/module/Makefile.in0000644000175000017500000004260714400675235014750 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/include/module ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(moduleinclude_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(moduleincludedir)" HEADERS = $(moduleinclude_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ moduleincludedir = $(pkgincludedir)/module moduleinclude_HEADERS = Module.h ModuleError.h all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/include/module/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/include/module/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-moduleincludeHEADERS: $(moduleinclude_HEADERS) @$(NORMAL_INSTALL) @list='$(moduleinclude_HEADERS)'; test -n "$(moduleincludedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(moduleincludedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduleincludedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(moduleincludedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(moduleincludedir)" || exit $$?; \ done uninstall-moduleincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(moduleinclude_HEADERS)'; test -n "$(moduleincludedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(moduleincludedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: for dir in "$(DESTDIR)$(moduleincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-moduleincludeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-moduleincludeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man \ install-moduleincludeHEADERS install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-moduleincludeHEADERS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/0000755000175000017500000000000014400711324010576 500000000000000JAGS-4.3.2/src/lib/Makefile.am0000664000175000017500000000166414224052514012566 00000000000000SUBDIRS = util sarray distribution function sampler graph model \ compiler rng module extra_dist = version.cc.in lib_LTLIBRARIES = libjags.la libjags_la_SOURCES = version.cc Console.cc libjags_la_CPPFLAGS = -I$(top_srcdir)/src/include libjags_la_LIBADD = model/libmodel.la \ util/libutil.la \ sarray/libsarray.la \ function/libfunc.la \ sampler/libsampler.la \ distribution/libdist.la \ graph/libgraph.la \ compiler/libcompiler.la \ rng/librng.la \ module/libmodule.la libjags_la_LDFLAGS = -version-info $(JAGS_MAJOR):$(JAGS_MINOR):0 if WINDOWS libjags_la_LDFLAGS += -no-undefined libjags_la_SOURCES += dllversion.rc endif ### Test library if CANCHECK check_LTLIBRARIES = libtest.la libtest_la_SOURCES = testlib.cc libtest_la_CPPFLAGS = -I$(top_srcdir)/src/include libtest_la_LIBADD = function/libfuntest.la if WINDOWS libtest_la_LDFLAGS = -no-undefined endif endif JAGS-4.3.2/src/lib/Makefile.in0000644000175000017500000007733314400675235012612 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WINDOWS_TRUE@am__append_1 = -no-undefined @WINDOWS_TRUE@am__append_2 = dllversion.rc subdir = src/lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = version.cc CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libjags_la_DEPENDENCIES = model/libmodel.la util/libutil.la \ sarray/libsarray.la function/libfunc.la sampler/libsampler.la \ distribution/libdist.la graph/libgraph.la \ compiler/libcompiler.la rng/librng.la module/libmodule.la am__libjags_la_SOURCES_DIST = version.cc Console.cc dllversion.rc am__objects_1 = am_libjags_la_OBJECTS = libjags_la-version.lo libjags_la-Console.lo \ $(am__objects_1) libjags_la_OBJECTS = $(am_libjags_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libjags_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libjags_la_LDFLAGS) $(LDFLAGS) -o $@ @CANCHECK_TRUE@libtest_la_DEPENDENCIES = function/libfuntest.la am__libtest_la_SOURCES_DIST = testlib.cc @CANCHECK_TRUE@am_libtest_la_OBJECTS = libtest_la-testlib.lo libtest_la_OBJECTS = $(am_libtest_la_OBJECTS) libtest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libtest_la_LDFLAGS) $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libtest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libjags_la-Console.Plo \ ./$(DEPDIR)/libjags_la-version.Plo \ ./$(DEPDIR)/libtest_la-testlib.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libjags_la_SOURCES) $(libtest_la_SOURCES) DIST_SOURCES = $(am__libjags_la_SOURCES_DIST) \ $(am__libtest_la_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/version.cc.in \ $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = util sarray distribution function sampler graph model \ compiler rng module extra_dist = version.cc.in lib_LTLIBRARIES = libjags.la libjags_la_SOURCES = version.cc Console.cc $(am__append_2) libjags_la_CPPFLAGS = -I$(top_srcdir)/src/include libjags_la_LIBADD = model/libmodel.la \ util/libutil.la \ sarray/libsarray.la \ function/libfunc.la \ sampler/libsampler.la \ distribution/libdist.la \ graph/libgraph.la \ compiler/libcompiler.la \ rng/librng.la \ module/libmodule.la libjags_la_LDFLAGS = -version-info $(JAGS_MAJOR):$(JAGS_MINOR):0 \ $(am__append_1) ### Test library @CANCHECK_TRUE@check_LTLIBRARIES = libtest.la @CANCHECK_TRUE@libtest_la_SOURCES = testlib.cc @CANCHECK_TRUE@libtest_la_CPPFLAGS = -I$(top_srcdir)/src/include @CANCHECK_TRUE@libtest_la_LIBADD = function/libfuntest.la @CANCHECK_TRUE@@WINDOWS_TRUE@libtest_la_LDFLAGS = -no-undefined all: all-recursive .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): version.cc: $(top_builddir)/config.status $(srcdir)/version.cc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libjags.la: $(libjags_la_OBJECTS) $(libjags_la_DEPENDENCIES) $(EXTRA_libjags_la_DEPENDENCIES) $(AM_V_CXXLD)$(libjags_la_LINK) -rpath $(libdir) $(libjags_la_OBJECTS) $(libjags_la_LIBADD) $(LIBS) libtest.la: $(libtest_la_OBJECTS) $(libtest_la_DEPENDENCIES) $(EXTRA_libtest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libtest_la_LINK) $(am_libtest_la_rpath) $(libtest_la_OBJECTS) $(libtest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjags_la-Console.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjags_la-version.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtest_la-testlib.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libjags_la-version.lo: version.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjags_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libjags_la-version.lo -MD -MP -MF $(DEPDIR)/libjags_la-version.Tpo -c -o libjags_la-version.lo `test -f 'version.cc' || echo '$(srcdir)/'`version.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjags_la-version.Tpo $(DEPDIR)/libjags_la-version.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='version.cc' object='libjags_la-version.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjags_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libjags_la-version.lo `test -f 'version.cc' || echo '$(srcdir)/'`version.cc libjags_la-Console.lo: Console.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjags_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libjags_la-Console.lo -MD -MP -MF $(DEPDIR)/libjags_la-Console.Tpo -c -o libjags_la-Console.lo `test -f 'Console.cc' || echo '$(srcdir)/'`Console.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjags_la-Console.Tpo $(DEPDIR)/libjags_la-Console.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Console.cc' object='libjags_la-Console.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjags_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libjags_la-Console.lo `test -f 'Console.cc' || echo '$(srcdir)/'`Console.cc libtest_la-testlib.lo: testlib.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libtest_la-testlib.lo -MD -MP -MF $(DEPDIR)/libtest_la-testlib.Tpo -c -o libtest_la-testlib.lo `test -f 'testlib.cc' || echo '$(srcdir)/'`testlib.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtest_la-testlib.Tpo $(DEPDIR)/libtest_la-testlib.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testlib.cc' object='libtest_la-testlib.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtest_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libtest_la-testlib.lo `test -f 'testlib.cc' || echo '$(srcdir)/'`testlib.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-recursive all-am: Makefile $(LTLIBRARIES) install-checkLTLIBRARIES: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-checkLTLIBRARIES clean-generic clean-libLTLIBRARIES \ clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/libjags_la-Console.Plo -rm -f ./$(DEPDIR)/libjags_la-version.Plo -rm -f ./$(DEPDIR)/libtest_la-testlib.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/libjags_la-Console.Plo -rm -f ./$(DEPDIR)/libjags_la-version.Plo -rm -f ./$(DEPDIR)/libtest_la-testlib.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-checkLTLIBRARIES \ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/version.cc.in0000664000175000017500000000022514224052371013124 00000000000000#include extern "C" { const char * jags_version() { const char * version = "@PACKAGE_VERSION@"; return version; } } JAGS-4.3.2/src/lib/version.cc0000644000175000017500000000021114400711162012504 00000000000000#include extern "C" { const char * jags_version() { const char * version = "4.3.2"; return version; } } JAGS-4.3.2/src/lib/Console.cc0000664000175000017500000004705014224052514012442 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::ostream; using std::endl; using std::flush; using std::vector; using std::string; using std::map; using std::list; using std::set; using std::pair; using std::FILE; // Need to distinguish between errors that delete the model // and errors that don't delete the model (in update) // so that we can then dump parameter values from parser.cc #define CATCH_ERRORS_DUMP \ catch (ParentError const &except) { \ except.printMessage(_err, _model->symtab()); \ return false; \ } \ catch (NodeError const &except) { \ except.printMessage(_err, _model->symtab()); \ return false; \ } \ catch (std::runtime_error const &except) { \ _err << "RUNTIME ERROR:\n"; \ _err << except.what() << endl; \ return false; \ } \ catch (std::logic_error const &except) { \ _err << "LOGIC ERROR:\n" << except.what() << '\n'; \ _err << "Please send a bug report to " \ << PACKAGE_BUGREPORT << endl; \ return false; \ } #define CATCH_ERRORS \ catch (ParentError const &except) { \ except.printMessage(_err, _model->symtab()); \ clearModel(); \ return false; \ } \ catch (NodeError const &except) { \ except.printMessage(_err, _model->symtab()); \ clearModel(); \ return false; \ } \ catch (std::runtime_error const &except) { \ _err << "RUNTIME ERROR:\n"; \ _err << except.what() << endl; \ clearModel(); \ return false; \ } \ catch (std::logic_error const &except) { \ _err << "LOGIC ERROR:\n" << except.what() << '\n'; \ _err << "Please send a bug report to " \ << PACKAGE_BUGREPORT << endl; \ clearModel(); \ return false; \ } /* Helper functions for dumpState */ namespace jags { static bool isData(Node const *node) { return node->randomVariableStatus() == RV_TRUE_OBSERVED; } static bool isParameter(Node const *node) { return node->randomVariableStatus() == RV_TRUE_UNOBSERVED; } static bool alwaysTrue(Node const *node) { return true; } Console::Console(ostream &out, ostream &err) : _out(out), _err(err), _model(0), _pdata(0), _prelations(0), _pvariables(0) { } Console::~Console() { delete _model; delete _pdata; delete _prelations; if (_pvariables) { for (unsigned int i = 0; i < _pvariables->size(); ++i) { delete (*_pvariables)[i]; } delete _pvariables; } } static void getVariableNames(ParseTree const *ptree, set &nameset, vector &namelist, vector &counters) { /* Get variables from model, ensuring that we ignore counters. */ if (ptree->treeClass() == P_VAR) { string const &var = ptree->name(); if (find(counters.begin(), counters.end(), var) == counters.end()) { if (nameset.count(var) == 0) { nameset.insert(var); namelist.push_back(var); } } } vector const ¶m = ptree->parameters(); for (vector::const_iterator p = param.begin(); p != param.end(); ++p) { //ParseTree objects of type P_BOUND can have null parameters if (*p == 0) continue; if ((*p)->treeClass() == P_FOR) { ParseTree *counter = (*p)->parameters()[0]; for (unsigned int i = 0; i < counter->parameters().size(); ++i) { getVariableNames(counter->parameters()[i], nameset, namelist, counters); } counters.push_back(counter->name()); getVariableNames((*p)->parameters()[1], nameset, namelist, counters); counters.pop_back(); } else { getVariableNames(*p, nameset, namelist, counters); } } } bool Console::checkModel(FILE *file) { if (_model) { _out << "Replacing existing model" << endl; clearModel(); } _model = 0; string message; int status = parse_bugs(file, _pvariables, _pdata, _prelations, message); if (status != 0) { _err << endl << "Error parsing model file:" << endl << message << endl; //Tidy up delete _pdata; _pdata = 0; delete _prelations; _prelations = 0; if (_pvariables) { for (unsigned int i = 0; i < _pvariables->size(); ++i) { delete (*_pvariables)[i]; } delete _pvariables; _pvariables = 0; } return false; } //Get names of all variables in the model set nameset; vector counterstack; _array_names.clear(); if (_pvariables) { for (vector::const_iterator p = _pvariables->begin(); p != _pvariables->end(); ++p) { getVariableNames(*p, nameset, _array_names, counterstack); } } if (_pdata) { getVariableNames(_pdata, nameset, _array_names, counterstack); } if (_prelations) { getVariableNames(_prelations, nameset, _array_names, counterstack); } return true; } bool Console::compile(map &data_table, unsigned int nchain, bool gendata) { if (nchain == 0) { _err << "You must have at least one chain" << endl; return false; } if (_model) { _out << "Replacing existing model" << endl; clearModel(); } RNG *datagen_rng = 0; if (_pdata && gendata) { _model = new BUGSModel(1); Compiler compiler(*_model, data_table); _out << "Compiling data graph" << endl; try { if (_pvariables) { _out << " Declaring variables" << endl; compiler.declareVariables(*_pvariables); } _out << " Resolving undeclared variables" << endl; compiler.undeclaredVariables(_pdata); _out << " Allocating nodes" << endl; compiler.writeRelations(_pdata); /* Check validity of data generating model */ for (vector::const_iterator r = _model->nodes().begin(); r != _model->nodes().end(); ++r) { if ((*r)->randomVariableStatus() == RV_TRUE_OBSERVED) { vector const &parents = (*r)->parents(); for (vector::const_iterator p = parents.begin(); p != parents.end(); ++p) { if (!((*p)->isFixed())) { _err << "Invalid data graph: observed node " << _model->symtab().getName(*r) << " has non-fixed parent " << _model->symtab().getName(*p) << "\n"; clearModel(); return false; } } } } _out << " Initializing" << endl; _model->initialize(true); // Do a single update (by forward sampling) _model->update(1); //Save data generating RNG for later use. It is owned by the //RNGFactory, not the model. datagen_rng = _model->rng(0); _out << " Reading data back into data table" << endl; _model->symtab().readValues(data_table, 0, alwaysTrue); delete _model; _model = 0; } CATCH_ERRORS; } _model = new BUGSModel(nchain); Compiler compiler(*_model, data_table); _out << "Compiling model graph" << endl; try { if (_pvariables) { _out << " Declaring variables" << endl; compiler.declareVariables(*_pvariables); } if (_prelations) { _out << " Resolving undeclared variables" << endl; compiler.undeclaredVariables(_prelations); _out << " Allocating nodes" << endl; compiler.writeRelations(_prelations); } else { _err << "Nothing to compile" << endl; return false; } if (_model) { unsigned int nobs = 0, nparam = 0; vector const &snodes = _model->stochasticNodes(); for (unsigned int i = 0; i < snodes.size(); ++i) { if (isObserved(snodes[i])) { ++nobs; } else { ++nparam; } } _out << "Graph information:\n"; _out << " Observed stochastic nodes: " << nobs << "\n"; _out << " Unobserved stochastic nodes: " << nparam << "\n"; _out << " Total graph size: " << _model->nodes().size() << endl; if (datagen_rng) { // Reuse the data-generation RNG, if there is one, for chain 0 _model->setRNG(datagen_rng, 0); } } else { _err << "No model" << endl; return false; } } CATCH_ERRORS; return true; } bool Console::initialize() { if (_model == 0) { _err << "Can't initialize. No model!" << endl; return false; } if (_model->nodes().size() == 0) { _err << "Can't initialize. No nodes in graph." << endl; _err << "Have you compiled the model?" << endl; return false; } if (_model->isInitialized()) { _out << "Model is already initialized" << endl; return true; } try { _out << "Initializing model" << endl; _model->initialize(false); } CATCH_ERRORS; return true; } bool Console::setParameters(map const &init_table, unsigned int chain) { if (_model == 0) { _err << "Can't set initial values. No model!" << endl; return false; } if (chain == 0 || chain > nchain()) { _err << "Invalid chain number" << endl; return false; } try { _model->setParameters(init_table, chain - 1); } CATCH_ERRORS; return true; } bool Console::setRNGname(string const &name, unsigned int chain) { if (_model == 0) { _err << "Can't set RNG name. No model!" << endl; return false; } try { bool name_ok = _model->setRNG(name, chain - 1); if (!name_ok) { _err << "RNG name " << name << " not found\n"; return false; } } CATCH_ERRORS; return true; } bool Console::update(unsigned int n) { if (_model == 0) { _err << "Can't update. No model!" << endl; return false; } if (!_model->isInitialized()) { _err << "Model not initialized" << endl; return false; } try { _model->update(n); } CATCH_ERRORS_DUMP; return true; } unsigned int Console::iter() const { if (!_model) { return 0; } else { return _model->iteration(); } } bool Console::setMonitor(string const &name, Range const &range, unsigned int thin, string const &type) { if (!_model) { _err << "Can't set monitor. No model!" << endl; return false; } if (thin == 0) { _err << "Failed to set " << type << " monitor for " << name << print(range) << endl; _err << "Thinning interval must be > 0" << endl; return false; } try { if (_model->isAdapting()) { _out << "NOTE: Stopping adaptation\n" << endl; _model->adaptOff(); } string msg; bool ok = _model->setMonitor(name, range, thin, type, msg); if (!ok) { _err << "Failed to set " << type << " monitor for " << name << print(range) << endl; if (!msg.empty()) { _err << msg << endl; } return false; } } CATCH_ERRORS; return true; } bool Console::clearMonitor(string const &name, Range const &range, string const &type) { if (!_model) { _err << "Can't clear monitor. No model!" << endl; return false; } try { bool ok = _model->deleteMonitor(name, range, type); if (!ok) { _err << "Failed to clear " << type << " monitor for node " << name << print(range) << endl; return false; } } CATCH_ERRORS; return true; } void Console::clearModel() { _out << "Deleting model" << endl; delete _model; _model = 0; } bool Console::dumpState(map &data_table, string &rng_name, DumpType type, unsigned int chain) { if (!_model) { _err << "No model" << endl; return false; } if (_model->symtab().size() == 0) { _err << "Symbol table is empty" << endl; return false; } if (chain == 0 || chain > nchain()) { _err << "Invalid chain number" << endl; return false; } bool (*selection)(Node const *) = 0; switch (type) { case DUMP_PARAMETERS: selection = isParameter; break; case DUMP_DATA: selection = isData; break; case DUMP_ALL: selection = alwaysTrue; break; } try { _model->symtab().readValues(data_table, chain - 1, selection); if (type == DUMP_PARAMETERS || type == DUMP_ALL) { vector rngstate; if (_model->rng(chain - 1)) { _model->rng(chain - 1)->getState(rngstate); vector dimrng(1,rngstate.size()); SArray rngsarray(dimrng); rngsarray.setValue(rngstate); data_table.insert(pair(".RNG.state",rngsarray)); rng_name = _model->rng(chain - 1)->name(); } } } CATCH_ERRORS; // Model is subsequently cleared by calling functions in parser return true; } bool Console::dumpMonitors(map &data_table, string const &type, bool flat) { if (_model == 0) { _err << "Cannot dump monitors. No model!" << endl; return false; } try { list const &monitors = _model->monitors(); list::const_iterator p; for (p = monitors.begin(); p != monitors.end(); ++p) { Monitor const *monitor = p->monitor(); if (p->niter() > 0 && monitor->type() == type) { data_table.insert(pair(monitor->name(), monitor->dump(flat))); } } } CATCH_ERRORS; return true; } bool Console::coda(string const &prefix) { if (!_model) { _err << "Can't dump CODA output. No model!" << endl; return false; } try { string warn; _model->coda(prefix, warn); if (!warn.empty()) { _err << "WARNING:\n" << warn; } } CATCH_ERRORS; return true; } bool Console::coda(vector > const &nodes, string const &prefix) { if (!_model) { _err << "Can't dump CODA output. No model!" << endl; return false; } try { string warn; _model->coda(nodes, prefix, warn); if (!warn.empty()) { _err << "WARNINGS:\n" << warn; } } CATCH_ERRORS; return true; } BUGSModel const *Console::model() { return _model; } unsigned int Console::nchain() const { if (_model == 0) { return 0; } else { return _model->nchain(); } } bool Console::checkAdaptation(bool &status) { if (_model == 0) { _err << "Can't update. No model!" << endl; return false; } if (!_model->isInitialized()) { _err << "Model not initialized" << endl; return false; } try { status = _model->checkAdaptation(); } CATCH_ERRORS; return true; } bool Console::adaptOff(void) { if (_model == 0) { _err << "Cannot stop adaptation. No model!" << endl; return false; } if (!_model->isInitialized()) { _err << "Cannot stop adaptation. Model not initialized" << endl; return false; } try { _model->adaptOff(); } CATCH_ERRORS; return true; } bool Console::isAdapting() const { return _model ? _model->isAdapting() : false; } vector const &Console::variableNames() const { return _array_names; } bool Console::dumpSamplers(vector > &sampler_names) { if (_model == 0) { _err << "Can't dump samplers. No model!" << endl; return false; } if (!_model->isInitialized()) { _err << "Model not initialized" << endl; return false; } try { _model->samplerNames(sampler_names); } CATCH_ERRORS; return true; } bool Console::loadModule(string const &name) { list::const_iterator p; for (p = Module::modules().begin(); p != Module::modules().end(); ++p) { if ((*p)->name() == name) { (*p)->load(); if (rngSeed() != 0) { // Set default seed of RNG factories vector const &facs = (*p)->rngFactories(); for (unsigned int i = 0; i < facs.size(); ++i) { facs[i]->setSeed(rngSeed()); } } return true; } } return false; } vector Console::listModules() { vector ans; list::const_iterator p; for (p = Module::loadedModules().begin(); p != Module::loadedModules().end(); ++p) { ans.push_back((*p)->name()); } return ans; } bool Console::unloadModule(string const &name) { list::iterator p; for (p = Module::loadedModules().begin(); p != Module::loadedModules().end(); ++p) { if ((*p)->name() == name) { (*p)->unload(); return true; } } return false; } static bool setSamplerActive(string const &name, bool flag) { bool ans = false; list > &faclist = Model::samplerFactories(); list >::iterator p; for (p = faclist.begin(); p != faclist.end(); ++p) { if (p->first->name() == name) { p->second = flag; ans = true; } } return ans; } static bool setMonitorActive(string const &name, bool flag) { bool ans = false; list > &faclist = Model::monitorFactories(); list >::iterator p; for (p = faclist.begin(); p != faclist.end(); ++p) { if (p->first->name() == name) { p->second = flag; ans = true; } } return ans; } static bool setRNGActive(string const &name, bool flag) { bool ans = false; list > &faclist = Model::rngFactories(); list >::iterator p; for (p = faclist.begin(); p != faclist.end(); ++p) { if (p->first->name() == name) { p->second = flag; ans = true; } } return ans; } bool Console::setFactoryActive(string const &name, FactoryType type, bool flag) { bool ok = false; switch(type) { case SAMPLER_FACTORY: ok = setSamplerActive(name, flag); break; case MONITOR_FACTORY: ok = setMonitorActive(name, flag); break; case RNG_FACTORY: ok = setRNGActive(name, flag); break; } return ok; } static vector > listSamplerFactories() { vector > ans; list > const &flist = Model::samplerFactories(); for (list >::const_iterator p = flist.begin(); p != flist.end(); ++p) { ans.push_back(pair(p->first->name(), p->second)); } return ans; } static vector > listMonitorFactories() { vector > ans; list > const &flist = Model::monitorFactories(); for (list >::const_iterator p = flist.begin(); p != flist.end(); ++p) { ans.push_back(pair(p->first->name(), p->second)); } return ans; } static vector > listRNGFactories() { vector > ans; list > const &flist = Model::rngFactories(); for (list >::const_iterator p = flist.begin(); p != flist.end(); ++p) { ans.push_back(pair(p->first->name(), p->second)); } return ans; } vector > Console::listFactories(FactoryType type) { vector > ans; switch(type) { case SAMPLER_FACTORY: ans = listSamplerFactories(); break; case MONITOR_FACTORY: ans = listMonitorFactories(); break; case RNG_FACTORY: ans = listRNGFactories(); break; } return ans; } unsigned int &Console::rngSeed() { static unsigned int seed = 0; return seed; } void Console::setRNGSeed(unsigned int seed) { if (seed == 0) return; list >::const_iterator p; for (p = Model::rngFactories().begin(); p != Model::rngFactories().end(); ++p) { p->first->setSeed(seed); } rngSeed() = seed; } } //namespace jags JAGS-4.3.2/src/lib/dllversion.rc0000664000175000017500000000126614224052371013240 00000000000000#include #include VS_VERSION_INFO VERSIONINFO FILEVERSION JAGS_MAJOR,JAGS_MINORJAGS_PATCH,HG_YEAR,HG_MONTH_DAY PRODUCTVERSION JAGS_MAJOR,JAGS_MINOR,JAGS_PATCH,0 FILEFLAGSMASK 0x3L FILEOS VOS__WINDOWS32 FILETYPE VFT_DLL BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904E4" BEGIN VALUE "FileDescription", "JAGS for Windows DLL\0" VALUE "FileVersion", HG_VERSION "\0" VALUE "LegalCopyright", "Martyn Plummer" HG_YEAR "\0" VALUE "Project info", "https://www.sourceforge.net/projects/mcmc-jags\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1252 END END JAGS-4.3.2/src/lib/testlib.cc0000664000175000017500000000150514224052371012502 00000000000000#include #include #include using std::sqrt; JAGSFixture::JAGSFixture() : tol(sqrt(DBL_EPSILON)), F(1), T(1), FF(2), FT(2), TF(2), TT(2), FFF(3), FFT(3), FTF(3), FTT(3), TFF(3), TFT(3), TTF(3), TTT(3) { F[0] = false; T[0] = true; FF[0] = false; FF[1] = false; FT[0] = false; FT[1] = true; TF[0] = true; TF[1] = false; TT[0] = true; TT[1] = true; FFF[0] = false; FFF[1] = false; FFT[2] = false; FFT[0] = false; FFT[1] = false; FFT[2] = true; FTF[0] = false; FTF[1] = true; FTF[2] = false; FTT[0] = false; FTT[1] = true; FTT[2] = true; TFF[0] = true; TFF[1] = false; TFT[2] = false; TFT[0] = true; TFT[1] = false; TFT[2] = true; TTF[0] = true; TTF[1] = true; TTF[2] = false; TTT[0] = true; TTT[1] = true; TTT[2] = true; } JAGS-4.3.2/src/lib/util/0000755000175000017500000000000014400711324011553 500000000000000JAGS-4.3.2/src/lib/util/Makefile.am0000664000175000017500000000022014224052514013526 00000000000000noinst_LTLIBRARIES = libutil.la libutil_la_CPPFLAGS = -I$(top_srcdir)/src/include libutil_la_SOURCES = nainf.c naconst.cc dim.cc integer.cc JAGS-4.3.2/src/lib/util/Makefile.in0000644000175000017500000006351314400675235013562 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/util ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libutil_la_LIBADD = am_libutil_la_OBJECTS = libutil_la-nainf.lo libutil_la-naconst.lo \ libutil_la-dim.lo libutil_la-integer.lo libutil_la_OBJECTS = $(am_libutil_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libutil_la-dim.Plo \ ./$(DEPDIR)/libutil_la-integer.Plo \ ./$(DEPDIR)/libutil_la-naconst.Plo \ ./$(DEPDIR)/libutil_la-nainf.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libutil_la_SOURCES) DIST_SOURCES = $(libutil_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libutil.la libutil_la_CPPFLAGS = -I$(top_srcdir)/src/include libutil_la_SOURCES = nainf.c naconst.cc dim.cc integer.cc all: all-am .SUFFIXES: .SUFFIXES: .c .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/util/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libutil.la: $(libutil_la_OBJECTS) $(libutil_la_DEPENDENCIES) $(EXTRA_libutil_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libutil_la_OBJECTS) $(libutil_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutil_la-dim.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutil_la-integer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutil_la-naconst.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libutil_la-nainf.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libutil_la-nainf.lo: nainf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libutil_la-nainf.lo -MD -MP -MF $(DEPDIR)/libutil_la-nainf.Tpo -c -o libutil_la-nainf.lo `test -f 'nainf.c' || echo '$(srcdir)/'`nainf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutil_la-nainf.Tpo $(DEPDIR)/libutil_la-nainf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nainf.c' object='libutil_la-nainf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libutil_la-nainf.lo `test -f 'nainf.c' || echo '$(srcdir)/'`nainf.c .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libutil_la-naconst.lo: naconst.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libutil_la-naconst.lo -MD -MP -MF $(DEPDIR)/libutil_la-naconst.Tpo -c -o libutil_la-naconst.lo `test -f 'naconst.cc' || echo '$(srcdir)/'`naconst.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutil_la-naconst.Tpo $(DEPDIR)/libutil_la-naconst.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='naconst.cc' object='libutil_la-naconst.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libutil_la-naconst.lo `test -f 'naconst.cc' || echo '$(srcdir)/'`naconst.cc libutil_la-dim.lo: dim.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libutil_la-dim.lo -MD -MP -MF $(DEPDIR)/libutil_la-dim.Tpo -c -o libutil_la-dim.lo `test -f 'dim.cc' || echo '$(srcdir)/'`dim.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutil_la-dim.Tpo $(DEPDIR)/libutil_la-dim.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dim.cc' object='libutil_la-dim.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libutil_la-dim.lo `test -f 'dim.cc' || echo '$(srcdir)/'`dim.cc libutil_la-integer.lo: integer.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libutil_la-integer.lo -MD -MP -MF $(DEPDIR)/libutil_la-integer.Tpo -c -o libutil_la-integer.lo `test -f 'integer.cc' || echo '$(srcdir)/'`integer.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libutil_la-integer.Tpo $(DEPDIR)/libutil_la-integer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='integer.cc' object='libutil_la-integer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libutil_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libutil_la-integer.lo `test -f 'integer.cc' || echo '$(srcdir)/'`integer.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libutil_la-dim.Plo -rm -f ./$(DEPDIR)/libutil_la-integer.Plo -rm -f ./$(DEPDIR)/libutil_la-naconst.Plo -rm -f ./$(DEPDIR)/libutil_la-nainf.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libutil_la-dim.Plo -rm -f ./$(DEPDIR)/libutil_la-integer.Plo -rm -f ./$(DEPDIR)/libutil_la-naconst.Plo -rm -f ./$(DEPDIR)/libutil_la-nainf.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/util/nainf.c0000664000175000017500000000212114224052514012733 00000000000000#include #include #include #include /* We use C rather than C++ to detect non-finite values because there is no standard way to do it in C++. The problems include: - The C99 standard defines macros "isfinite" and "isnan". However, the current C++ standard predates C99, so there is no guarantee that these exist. And if they do exist, they may be macros or functions, and in the latter case, may be declared inside the std namespace. Or not. - The configure script, using m4 macros borrowed from R, creates macros HAVE_WORKING_FINITE and HAVE_WORKING_ISFINITE. These are created using test functions C, but the results may not be valid for C++ (for example, in Solaris). */ #ifdef HAVE_IEEEFP_H # include #endif int jags_finite(double x) { #ifdef HAVE_WORKING_ISFINITE return isfinite(x); #elif HAVE_WORKING_FINITE return finite(x); # else /* neither finite nor isfinite work */ return (!isnan(x) & (x != JAGS_POSINF) & (x != JAGS_NEGINF)); #endif } int jags_isnan(double x) { return (isnan(x) != 0); } JAGS-4.3.2/src/lib/util/naconst.cc0000664000175000017500000000045014224052514013453 00000000000000#include #include #include static double f_div(double x, double y) { return x/y; } const double JAGS_NA = -DBL_MAX*(1-1e-15); const double JAGS_NAN = f_div(0.0, 0.0); const double JAGS_POSINF = f_div(1.0, 0.0); const double JAGS_NEGINF = f_div(-1.0, 0.0); JAGS-4.3.2/src/lib/util/dim.cc0000664000175000017500000000203314224052514012556 00000000000000#include #include #include using std::vector; using std::set; namespace jags { vector const &getUnique(vector const &dim) { static set > _dimset; return *(_dimset.insert(dim).first); } vector > const & getUnique(vector > const &dimvec) { static set > > _dimvecset; return *(_dimvecset.insert(dimvec).first); } unsigned int product(vector const &x) { if (x.empty()) return 0; unsigned int y = x[0]; for (unsigned int i = 1; i < x.size(); ++i) { y *= x[i]; } return y; } vector drop(vector const &dims) { vector ans; bool empty = true; for (unsigned int i = 0; i < dims.size(); ++i) { if (dims[i] != 0) { empty = false; } if (dims[i] != 1) { ans.push_back(dims[i]); } } if (ans.empty() && !empty) { ans.push_back(1U); } return ans; } } JAGS-4.3.2/src/lib/util/integer.cc0000664000175000017500000000136314224052514013447 00000000000000#include #include #include #include #include #include using std::runtime_error; using std::fabs; using std::string; static const double eps = 16 * DBL_EPSILON; static int coerceInteger(double fval) { if (fval > 0) { return static_cast(fval + eps); } else { return static_cast(fval - eps); } } namespace jags { int asInteger(double fval) { if (fval >= INT_MAX || fval <= INT_MIN) { throw runtime_error(string("double value out of range for conversion to int")); } return coerceInteger(fval); } bool checkInteger(double fval) { if (fval >= INT_MAX || fval <= INT_MIN) { return false; } return fabs(fval - coerceInteger(fval)) < eps; } } JAGS-4.3.2/src/lib/sarray/0000755000175000017500000000000014400711324012077 500000000000000JAGS-4.3.2/src/lib/sarray/Makefile.am0000664000175000017500000000024514224052371014062 00000000000000noinst_LTLIBRARIES = libsarray.la libsarray_la_CPPFLAGS = -I$(top_srcdir)/src/include libsarray_la_SOURCES = Range.cc SimpleRange.cc RangeIterator.cc SArray.cc JAGS-4.3.2/src/lib/sarray/Makefile.in0000644000175000017500000006010514400675235014100 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/sarray ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libsarray_la_LIBADD = am_libsarray_la_OBJECTS = libsarray_la-Range.lo \ libsarray_la-SimpleRange.lo libsarray_la-RangeIterator.lo \ libsarray_la-SArray.lo libsarray_la_OBJECTS = $(am_libsarray_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libsarray_la-Range.Plo \ ./$(DEPDIR)/libsarray_la-RangeIterator.Plo \ ./$(DEPDIR)/libsarray_la-SArray.Plo \ ./$(DEPDIR)/libsarray_la-SimpleRange.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libsarray_la_SOURCES) DIST_SOURCES = $(libsarray_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libsarray.la libsarray_la_CPPFLAGS = -I$(top_srcdir)/src/include libsarray_la_SOURCES = Range.cc SimpleRange.cc RangeIterator.cc SArray.cc all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/sarray/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/sarray/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libsarray.la: $(libsarray_la_OBJECTS) $(libsarray_la_DEPENDENCIES) $(EXTRA_libsarray_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libsarray_la_OBJECTS) $(libsarray_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsarray_la-Range.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsarray_la-RangeIterator.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsarray_la-SArray.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsarray_la-SimpleRange.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libsarray_la-Range.lo: Range.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsarray_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsarray_la-Range.lo -MD -MP -MF $(DEPDIR)/libsarray_la-Range.Tpo -c -o libsarray_la-Range.lo `test -f 'Range.cc' || echo '$(srcdir)/'`Range.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsarray_la-Range.Tpo $(DEPDIR)/libsarray_la-Range.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Range.cc' object='libsarray_la-Range.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsarray_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsarray_la-Range.lo `test -f 'Range.cc' || echo '$(srcdir)/'`Range.cc libsarray_la-SimpleRange.lo: SimpleRange.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsarray_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsarray_la-SimpleRange.lo -MD -MP -MF $(DEPDIR)/libsarray_la-SimpleRange.Tpo -c -o libsarray_la-SimpleRange.lo `test -f 'SimpleRange.cc' || echo '$(srcdir)/'`SimpleRange.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsarray_la-SimpleRange.Tpo $(DEPDIR)/libsarray_la-SimpleRange.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SimpleRange.cc' object='libsarray_la-SimpleRange.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsarray_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsarray_la-SimpleRange.lo `test -f 'SimpleRange.cc' || echo '$(srcdir)/'`SimpleRange.cc libsarray_la-RangeIterator.lo: RangeIterator.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsarray_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsarray_la-RangeIterator.lo -MD -MP -MF $(DEPDIR)/libsarray_la-RangeIterator.Tpo -c -o libsarray_la-RangeIterator.lo `test -f 'RangeIterator.cc' || echo '$(srcdir)/'`RangeIterator.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsarray_la-RangeIterator.Tpo $(DEPDIR)/libsarray_la-RangeIterator.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RangeIterator.cc' object='libsarray_la-RangeIterator.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsarray_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsarray_la-RangeIterator.lo `test -f 'RangeIterator.cc' || echo '$(srcdir)/'`RangeIterator.cc libsarray_la-SArray.lo: SArray.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsarray_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsarray_la-SArray.lo -MD -MP -MF $(DEPDIR)/libsarray_la-SArray.Tpo -c -o libsarray_la-SArray.lo `test -f 'SArray.cc' || echo '$(srcdir)/'`SArray.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsarray_la-SArray.Tpo $(DEPDIR)/libsarray_la-SArray.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SArray.cc' object='libsarray_la-SArray.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsarray_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsarray_la-SArray.lo `test -f 'SArray.cc' || echo '$(srcdir)/'`SArray.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libsarray_la-Range.Plo -rm -f ./$(DEPDIR)/libsarray_la-RangeIterator.Plo -rm -f ./$(DEPDIR)/libsarray_la-SArray.Plo -rm -f ./$(DEPDIR)/libsarray_la-SimpleRange.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libsarray_la-Range.Plo -rm -f ./$(DEPDIR)/libsarray_la-RangeIterator.Plo -rm -f ./$(DEPDIR)/libsarray_la-SArray.Plo -rm -f ./$(DEPDIR)/libsarray_la-SimpleRange.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/sarray/Range.cc0000664000175000017500000000717514224052514013401 00000000000000#include #include #include #include #include using std::vector; using std::out_of_range; using std::logic_error; using std::string; using std::ostringstream; static vector makeDim(vector > const &scope) { vector dims; for (unsigned int i = 0; i < scope.size(); i++) { dims.push_back(scope[i].size()); } return dims; } namespace jags { Range::Range() : _scope(0), _dim(0), _dim_dropped(0), _first(0), _last(0), _length() { } Range::Range(vector > const &scope) : _scope(scope), _dim(makeDim(_scope)), _dim_dropped(drop(_dim)), _first(0), _last(0), _length(product(_dim)) { //Check that we have no zero-length index vectors. The //leftIndex and rightIndex member functions rely on this //assumption, as well as the RangeIterator class. for (unsigned int i = 0; i < scope.size(); ++i) { if (scope[i].empty()) { throw logic_error("Zero dimension in Range constructor"); } _first.push_back(scope[i].front()); _last.push_back(scope[i].back()); } } Range::~Range() { //Virtual destructor } unsigned int Range::length() const { return _length; } unsigned int Range::ndim(bool drop) const { return drop ? _dim_dropped.size() : _dim.size(); } vector const &Range::dim(bool drop) const { return drop ? _dim_dropped : _dim; } vector Range::leftIndex(unsigned int offset) const { if (offset >= _length) { throw out_of_range("Range::leftIndex. Offset out of bounds"); } unsigned int ndim = _scope.size(); vector index(ndim); for (unsigned int i = 0; i < ndim; ++i) { index[i] = _scope[i][offset % _dim[i]]; offset /= _dim[i]; } return index; } vector Range::rightIndex(unsigned int offset) const { if (offset >= _length) { throw out_of_range("Range::rightIndex. Offset out of bounds"); } int ndim = _scope.size(); vector index(ndim); for (int i = ndim - 1; i >= 0; --i) { index[i] = _scope[i][offset % _dim[i]]; offset /= _dim[i]; } return index; } vector const &Range::first() const { return _first; } vector const &Range::last() const { return _last; } bool Range::operator==(Range const &range) const { return _scope == range._scope; } bool Range::operator!=(Range const &range) const { return _scope != range._scope; } bool Range::operator<(Range const &rhs) const { //Sort by the first element if (_first < rhs._first) { return true; } else if (rhs._first < _first) { return false; } //Then last element else if (_last < rhs._last) { return true; } else if (rhs._last < _last) { return false; } //Then lexigraphic ordering of the scope return _scope < rhs._scope; } string print(Range const &range) { if (isNULL(range)) return ""; ostringstream ostr; ostr << "["; for (unsigned int i = 0; i < range.ndim(false); ++i) { if (i > 0) { ostr << ","; } vector const &indices = range.scope()[i]; ostr << indices[0]; if (indices.size() > 1) { bool simple = true; int val = indices[0] + 1; for (unsigned int j = 1; j < indices.size(); ++j) { if (indices[j] != val) { simple = false; break; } ++val; } if (simple) { ostr << ":"; } else { ostr << "..."; } ostr << indices.back(); } } ostr << "]"; return ostr.str(); } vector > const &Range::scope() const { return _scope; } } //namespace jags JAGS-4.3.2/src/lib/sarray/SimpleRange.cc0000664000175000017500000001103614224052514014542 00000000000000#include #include #include #include #include #include using std::vector; using std::min; using std::max; using std::out_of_range; using std::invalid_argument; using std::logic_error; using std::string; using std::ostringstream; using std::sort; static vector asSigned(vector const &orig) { unsigned int n = orig.size(); vector ans(n); for (unsigned int i = 0; i < n; ++i) { ans[i] = static_cast(orig[i]); if (ans[i] < 0) { throw out_of_range("Dimension too large in Range constructor"); } } return ans; } static vector > makeScope(vector const &lower, vector const &upper) { unsigned int ndim = lower.size(); if (upper.size() != ndim) { throw logic_error("Dimension mismatch in Range constructor"); } vector > scope(ndim); for (unsigned int i = 0; i < ndim; ++i) { if (lower[i] <= upper[i]) { for (int j = lower[i]; j <= upper[i]; ++j) { scope[i].push_back(j); } } } return scope; } namespace jags { SimpleRange::SimpleRange(vector const &lower, vector const &upper) : Range(makeScope(lower, upper)) { } SimpleRange::SimpleRange(vector const &index) : Range(makeScope(index, index)) { } SimpleRange::SimpleRange(vector const &dim) : Range(makeScope(vector(dim.size(), 1), asSigned(dim))) { } SimpleRange::SimpleRange() : Range() { } SimpleRange::~SimpleRange() { } /* FIXME: API change than can only be introduced in JAGS 5.0.0 bool SimpleRange::contains(vector const &index) const { unsigned int N = ndim(false); if (N != index.size()) { return false; } for (unsigned int i = 0; i < N; ++i) { if (index[i] < _first[i] || index[i] > _last[i]) { return false; } } return true; } */ bool SimpleRange::contains(SimpleRange const &other) const { unsigned int N = ndim(false); if (N != other.ndim(false)) { return false; } for (unsigned int i = 0; i < N; ++i) { if (other._first[i] < _first[i] || other._last[i] > _last[i]) { return false; } } return true; } bool SimpleRange::contains(Range const &other) const { unsigned int ndim = scope().size(); if (other.scope().size() != ndim) { throw invalid_argument("SimpleRange::contains. Dimension mismatch"); } for (unsigned int i = 0; i < ndim; ++i) { vector const &indices = other.scope()[i]; for (unsigned int j = 0; j < indices.size(); ++j) { if (indices[j] < _first[i] || indices[j] > _last[i]) { return false; } } } return true; } unsigned int SimpleRange::leftOffset(vector const &index) const { unsigned int offset = 0; int step = 1; unsigned int ndim = _last.size(); for (unsigned int i = 0; i < ndim; i++) { if (index[i] < _first[i] || index[i] > _last[i]) { throw out_of_range("SimpleRange::leftOffset. Index outside of allowed range"); } offset += step * (index[i] - _first[i]); step *= _dim[i]; } return offset; } unsigned int SimpleRange::rightOffset(vector const &index) const { unsigned int offset = 0; int step = 1; for (int i = _last.size() - 1; i >= 0; --i) { if (index[i] < _first[i] || index[i] > _last[i]) { throw out_of_range("SimpleRange::rightOffset. Index outside of allowed range"); } offset += step * (index[i] - _first[i]); step *= _dim[i]; } return offset; } bool SimpleRange::operator<(SimpleRange const &rhs) const { //Sort by the first element if (_first < rhs._first) { return true; } else if (rhs._first < _first) { return false; } //Then last element return _last < rhs._last; } bool SimpleRange::operator==(SimpleRange const &rhs) const { return (_first == rhs._first) && (_last == rhs._last); } bool SimpleRange::operator!=(SimpleRange const &rhs) const { return (_first != rhs._first) || (_last != rhs._last); } string print(SimpleRange const &range) { if (isNULL(range)) { return ""; } vector const & lower = range.lower(); vector const & upper = range.upper(); ostringstream ostr; ostr << "["; for (unsigned int i = 0; i < range.ndim(false); ++i) { if (i > 0) ostr << ","; if (lower[i] == upper[i]) { ostr << lower[i]; } else { ostr << lower[i] << ":" << upper[i]; } } ostr << "]"; return ostr.str(); } } //namespace jags JAGS-4.3.2/src/lib/sarray/RangeIterator.cc0000664000175000017500000000202714224052514015102 00000000000000#include #include using std::vector; namespace jags { RangeIterator::RangeIterator(Range const &range) : vector(range.first()), _scope(range.scope()), _dim(range.dim(false)), _index(_dim.size(), 0), _atend(0) {} unsigned int RangeIterator::atEnd() const { return _atend; } RangeIterator &RangeIterator::nextLeft() { unsigned int i = 0; for (; i < _index.size(); ++i) { unsigned int &ind = _index[i]; int &val = operator[](i); if (++ind >= _dim[i]) ind = 0; val = _scope[i][ind]; if (ind > 0) break; } if (i == _index.size()) { _atend++; } return *this; } RangeIterator &RangeIterator::nextRight() { unsigned int j = _index.size(); for ( ; j > 0; --j) { int i = j - 1; unsigned int &ind = _index[i]; int &val = operator[](i); if (++ind >= _dim[i]) ind = 0; val = _scope[i][ind]; if (ind > 0) break; } if (j == 0) { _atend++; } return *this; } } //namespace jags JAGS-4.3.2/src/lib/sarray/SArray.cc0000664000175000017500000000442614224052514013542 00000000000000#include #include #include #include #include using std::vector; using std::logic_error; using std::length_error; using std::copy; using std::string; namespace jags { SArray::SArray(vector const &dim) : _range(dim), _value(_range.length(), JAGS_NA), _discrete(false), _s_dimnames(dim.size()) { } SArray::SArray(SArray const &orig) : _range(orig._range), _value(orig._value), _discrete(orig._discrete), _s_dimnames(orig._s_dimnames), _dimnames(orig._dimnames) { } SimpleRange const &SArray::range() const { return _range; } void SArray::setValue(vector const &x) { if (x.size() != _value.size()) { throw length_error("Length mismatch error in SArray::setValue"); } else { copy(x.begin(), x.end(), _value.begin()); _discrete = false; } } void SArray::setValue(vector const &x) { if (x.size() != _value.size()) { throw length_error("Length mismatch error in SArray::setValue"); } else { copy(x.begin(), x.end(), _value.begin()); _discrete = true; } } void SArray::setValue(double value, unsigned int i) { if (i >= _range.length()) { throw logic_error("Attempt to set value of invalid element of SArray"); } else { _value[i] = value; } } vector const &SArray::value() const { return _value; } bool SArray::isDiscreteValued() const { return _discrete; } vector const &SArray::dimNames() const { return _dimnames; } void SArray::setDimNames(vector const &names) { if (names.empty() || names.size() == _range.ndim(false)) { _dimnames = names; } else { throw length_error("Invalid length in SArray::setDimNames"); } } vector const &SArray::getSDimNames(unsigned int i) const { if (i >= _range.ndim(false)) throw logic_error("Dimension out of range in setSDimNames"); return _s_dimnames[i]; } void SArray::setSDimNames(vector const &names, unsigned int i) { if (i >= _range.ndim(false)) throw logic_error("Dimension out of range in setSDimNames"); if (names.empty() || names.size() == _range.dim(false)[i]) { _s_dimnames[i] = names; } else { throw length_error("Invalid length in SArray::setSDimNames"); } } } //namespace jags JAGS-4.3.2/src/lib/distribution/0000755000175000017500000000000014400711324013315 500000000000000JAGS-4.3.2/src/lib/distribution/Makefile.am0000664000175000017500000000040014224052514015270 00000000000000noinst_LTLIBRARIES = libdist.la libdist_la_CPPFLAGS = -I$(top_srcdir)/src/include libdist_la_SOURCES = Distribution.cc ScalarDist.cc VectorDist.cc \ ArrayDist.cc DistPtr.cc DistTab.cc DistError.cc RScalarDist.cc \ c99_math.c noinst_HEADERS = c99_math.h JAGS-4.3.2/src/lib/distribution/c99_math.h0000664000175000017500000000017114224052514015027 00000000000000#ifndef C99_MATH_H_ #define C99_MATH_H_ extern "C" { double jags_expm1(double); double jags_log1p(double); } #endif JAGS-4.3.2/src/lib/distribution/Makefile.in0000644000175000017500000010162414400675235015320 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/distribution ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libdist_la_LIBADD = am_libdist_la_OBJECTS = libdist_la-Distribution.lo \ libdist_la-ScalarDist.lo libdist_la-VectorDist.lo \ libdist_la-ArrayDist.lo libdist_la-DistPtr.lo \ libdist_la-DistTab.lo libdist_la-DistError.lo \ libdist_la-RScalarDist.lo libdist_la-c99_math.lo libdist_la_OBJECTS = $(am_libdist_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libdist_la-ArrayDist.Plo \ ./$(DEPDIR)/libdist_la-DistError.Plo \ ./$(DEPDIR)/libdist_la-DistPtr.Plo \ ./$(DEPDIR)/libdist_la-DistTab.Plo \ ./$(DEPDIR)/libdist_la-Distribution.Plo \ ./$(DEPDIR)/libdist_la-RScalarDist.Plo \ ./$(DEPDIR)/libdist_la-ScalarDist.Plo \ ./$(DEPDIR)/libdist_la-VectorDist.Plo \ ./$(DEPDIR)/libdist_la-c99_math.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libdist_la_SOURCES) DIST_SOURCES = $(libdist_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libdist.la libdist_la_CPPFLAGS = -I$(top_srcdir)/src/include libdist_la_SOURCES = Distribution.cc ScalarDist.cc VectorDist.cc \ ArrayDist.cc DistPtr.cc DistTab.cc DistError.cc RScalarDist.cc \ c99_math.c noinst_HEADERS = c99_math.h all: all-am .SUFFIXES: .SUFFIXES: .c .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/distribution/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/distribution/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libdist.la: $(libdist_la_OBJECTS) $(libdist_la_DEPENDENCIES) $(EXTRA_libdist_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libdist_la_OBJECTS) $(libdist_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdist_la-ArrayDist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdist_la-DistError.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdist_la-DistPtr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdist_la-DistTab.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdist_la-Distribution.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdist_la-RScalarDist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdist_la-ScalarDist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdist_la-VectorDist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdist_la-c99_math.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libdist_la-c99_math.lo: c99_math.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libdist_la-c99_math.lo -MD -MP -MF $(DEPDIR)/libdist_la-c99_math.Tpo -c -o libdist_la-c99_math.lo `test -f 'c99_math.c' || echo '$(srcdir)/'`c99_math.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdist_la-c99_math.Tpo $(DEPDIR)/libdist_la-c99_math.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='c99_math.c' object='libdist_la-c99_math.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libdist_la-c99_math.lo `test -f 'c99_math.c' || echo '$(srcdir)/'`c99_math.c .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libdist_la-Distribution.lo: Distribution.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdist_la-Distribution.lo -MD -MP -MF $(DEPDIR)/libdist_la-Distribution.Tpo -c -o libdist_la-Distribution.lo `test -f 'Distribution.cc' || echo '$(srcdir)/'`Distribution.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdist_la-Distribution.Tpo $(DEPDIR)/libdist_la-Distribution.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Distribution.cc' object='libdist_la-Distribution.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdist_la-Distribution.lo `test -f 'Distribution.cc' || echo '$(srcdir)/'`Distribution.cc libdist_la-ScalarDist.lo: ScalarDist.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdist_la-ScalarDist.lo -MD -MP -MF $(DEPDIR)/libdist_la-ScalarDist.Tpo -c -o libdist_la-ScalarDist.lo `test -f 'ScalarDist.cc' || echo '$(srcdir)/'`ScalarDist.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdist_la-ScalarDist.Tpo $(DEPDIR)/libdist_la-ScalarDist.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ScalarDist.cc' object='libdist_la-ScalarDist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdist_la-ScalarDist.lo `test -f 'ScalarDist.cc' || echo '$(srcdir)/'`ScalarDist.cc libdist_la-VectorDist.lo: VectorDist.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdist_la-VectorDist.lo -MD -MP -MF $(DEPDIR)/libdist_la-VectorDist.Tpo -c -o libdist_la-VectorDist.lo `test -f 'VectorDist.cc' || echo '$(srcdir)/'`VectorDist.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdist_la-VectorDist.Tpo $(DEPDIR)/libdist_la-VectorDist.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='VectorDist.cc' object='libdist_la-VectorDist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdist_la-VectorDist.lo `test -f 'VectorDist.cc' || echo '$(srcdir)/'`VectorDist.cc libdist_la-ArrayDist.lo: ArrayDist.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdist_la-ArrayDist.lo -MD -MP -MF $(DEPDIR)/libdist_la-ArrayDist.Tpo -c -o libdist_la-ArrayDist.lo `test -f 'ArrayDist.cc' || echo '$(srcdir)/'`ArrayDist.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdist_la-ArrayDist.Tpo $(DEPDIR)/libdist_la-ArrayDist.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArrayDist.cc' object='libdist_la-ArrayDist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdist_la-ArrayDist.lo `test -f 'ArrayDist.cc' || echo '$(srcdir)/'`ArrayDist.cc libdist_la-DistPtr.lo: DistPtr.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdist_la-DistPtr.lo -MD -MP -MF $(DEPDIR)/libdist_la-DistPtr.Tpo -c -o libdist_la-DistPtr.lo `test -f 'DistPtr.cc' || echo '$(srcdir)/'`DistPtr.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdist_la-DistPtr.Tpo $(DEPDIR)/libdist_la-DistPtr.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DistPtr.cc' object='libdist_la-DistPtr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdist_la-DistPtr.lo `test -f 'DistPtr.cc' || echo '$(srcdir)/'`DistPtr.cc libdist_la-DistTab.lo: DistTab.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdist_la-DistTab.lo -MD -MP -MF $(DEPDIR)/libdist_la-DistTab.Tpo -c -o libdist_la-DistTab.lo `test -f 'DistTab.cc' || echo '$(srcdir)/'`DistTab.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdist_la-DistTab.Tpo $(DEPDIR)/libdist_la-DistTab.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DistTab.cc' object='libdist_la-DistTab.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdist_la-DistTab.lo `test -f 'DistTab.cc' || echo '$(srcdir)/'`DistTab.cc libdist_la-DistError.lo: DistError.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdist_la-DistError.lo -MD -MP -MF $(DEPDIR)/libdist_la-DistError.Tpo -c -o libdist_la-DistError.lo `test -f 'DistError.cc' || echo '$(srcdir)/'`DistError.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdist_la-DistError.Tpo $(DEPDIR)/libdist_la-DistError.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DistError.cc' object='libdist_la-DistError.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdist_la-DistError.lo `test -f 'DistError.cc' || echo '$(srcdir)/'`DistError.cc libdist_la-RScalarDist.lo: RScalarDist.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdist_la-RScalarDist.lo -MD -MP -MF $(DEPDIR)/libdist_la-RScalarDist.Tpo -c -o libdist_la-RScalarDist.lo `test -f 'RScalarDist.cc' || echo '$(srcdir)/'`RScalarDist.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdist_la-RScalarDist.Tpo $(DEPDIR)/libdist_la-RScalarDist.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RScalarDist.cc' object='libdist_la-RScalarDist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdist_la-RScalarDist.lo `test -f 'RScalarDist.cc' || echo '$(srcdir)/'`RScalarDist.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libdist_la-ArrayDist.Plo -rm -f ./$(DEPDIR)/libdist_la-DistError.Plo -rm -f ./$(DEPDIR)/libdist_la-DistPtr.Plo -rm -f ./$(DEPDIR)/libdist_la-DistTab.Plo -rm -f ./$(DEPDIR)/libdist_la-Distribution.Plo -rm -f ./$(DEPDIR)/libdist_la-RScalarDist.Plo -rm -f ./$(DEPDIR)/libdist_la-ScalarDist.Plo -rm -f ./$(DEPDIR)/libdist_la-VectorDist.Plo -rm -f ./$(DEPDIR)/libdist_la-c99_math.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libdist_la-ArrayDist.Plo -rm -f ./$(DEPDIR)/libdist_la-DistError.Plo -rm -f ./$(DEPDIR)/libdist_la-DistPtr.Plo -rm -f ./$(DEPDIR)/libdist_la-DistTab.Plo -rm -f ./$(DEPDIR)/libdist_la-Distribution.Plo -rm -f ./$(DEPDIR)/libdist_la-RScalarDist.Plo -rm -f ./$(DEPDIR)/libdist_la-ScalarDist.Plo -rm -f ./$(DEPDIR)/libdist_la-VectorDist.Plo -rm -f ./$(DEPDIR)/libdist_la-c99_math.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/distribution/Distribution.cc0000664000175000017500000000156714224052514016241 00000000000000#include #include #include using std::vector; using std::string; namespace jags { Distribution::Distribution(string const &name, unsigned int npar) : _name(name), _npar(npar) { } Distribution::~Distribution() { } string const &Distribution::name() const { return _name; } string Distribution::alias() const { return ""; } unsigned int Distribution::npar () const { return _npar; } bool Distribution::isLocationParameter(unsigned int i) const { return false; } bool Distribution::isScaleParameter(unsigned int i) const { return false; } bool Distribution::isDiscreteValued(vector const &mask) const { return false; } bool Distribution::canBound() const { return false; } bool Distribution::checkParameterDiscrete(vector const &mask) const { return true; } } //namespace jags JAGS-4.3.2/src/lib/distribution/ScalarDist.cc0000664000175000017500000000415014224052514015602 00000000000000#include #include #include #include #include #include #include using std::max; using std::min; using std::string; using std::vector; using std::length_error; using std::logic_error; using std::count_if; namespace jags { ScalarDist::ScalarDist(string const &name, unsigned int npar, Support support) : Distribution(name, npar), _support(support) { } double ScalarDist::l(vector const ¶meters) const { switch(_support) { case DIST_UNBOUNDED: return JAGS_NEGINF; break; case DIST_POSITIVE: case DIST_PROPORTION: return 0; break; case DIST_SPECIAL: //You must overload this function throw logic_error("Cannot call ScalarDist::l for special distribution"); } return 0; //Wall } double ScalarDist::u(vector const ¶meters) const { switch(_support) { case DIST_UNBOUNDED: case DIST_POSITIVE: return JAGS_POSINF; break; case DIST_PROPORTION: return 1; break; case DIST_SPECIAL: //You must overload this function throw logic_error("Cannot call ScalarDist::u for special distribution"); } return 0; //Wall } bool ScalarDist::isSupportFixed(vector const &fixmask) const { if (_support == DIST_SPECIAL) { //You must overload this function throw logic_error("Cannot call ScalarDist::isSupportFixed for special distribution"); } else { return true; } } unsigned int ScalarDist::df() const { return 1; } double ScalarDist::KL(vector const &par1, vector const &par2, double const *lower, double const *upper, RNG *rng, unsigned int nrep) const { double div = 0; for (unsigned int r = 0; r < nrep; ++r) { double v1 = randomSample(par1, lower, upper, rng); div += logDensity(v1, PDF_FULL, par1, lower, upper); div -= logDensity(v1, PDF_FULL, par2, lower, upper); } return div / nrep; } double ScalarDist::KL(vector const &par1, vector const &par2) const { return JAGS_NA; } } //namespace jags JAGS-4.3.2/src/lib/distribution/VectorDist.cc0000664000175000017500000000217114224052514015640 00000000000000#include #include #include using std::string; using std::vector; namespace jags { VectorDist::VectorDist(string const &name, unsigned int npar) : Distribution(name, npar) { } unsigned int VectorDist::df(vector const &par) const { return length(par); } double VectorDist::KL(vector const &par1, vector const &par2, vector const &lengths, double const *lower, double const *upper, RNG *rng, unsigned int nrep) const { double div = 0; unsigned int N = length(lengths); vector v(N); for (unsigned int r = 0; r < nrep; ++r) { randomSample(&v[0], N, par1, lengths, lower, upper, rng); div += logDensity(&v[0], N, PDF_FULL, par1, lengths, lower, upper); div -= logDensity(&v[0], N, PDF_FULL, par2, lengths, lower, upper); } return div / nrep; } double VectorDist::KL(std::vector const &par1, std::vector const &par2, std::vector const &lengths) const { return JAGS_NA; } } //namespace jags JAGS-4.3.2/src/lib/distribution/ArrayDist.cc0000664000175000017500000000226014224052514015453 00000000000000#include #include #include #include using std::string; using std::vector; namespace jags { ArrayDist::ArrayDist(string const &name, unsigned int npar) : Distribution(name, npar) { } unsigned int ArrayDist::df(vector > const &pdims) const { return product(dim(pdims)); } double ArrayDist::KL(vector const &par1, vector const &par2, vector > const &dims, double const *lower, double const *upper, RNG *rng, unsigned int nrep) const { double div = 0; vector d = dim(dims); unsigned int N = product(d); vector v(N); for (unsigned int r = 0; r < nrep; ++r) { randomSample(&v[0], N, par1, dims, lower, upper, rng); div += logDensity(&v[0], N, PDF_FULL, par1, dims, lower, upper); div -= logDensity(&v[0], N, PDF_FULL, par2, dims, lower, upper); } return div / nrep; } double ArrayDist::KL(vector const &par1, vector const &par2, vector > const &dims) const { return JAGS_NA; } } //namespace jags JAGS-4.3.2/src/lib/distribution/DistPtr.cc0000664000175000017500000000205414224052514015143 00000000000000#include #include using std::string; namespace jags { DistPtr::DistPtr() : sdist(0), vdist(0), adist(0) {} DistPtr::DistPtr(ScalarDist const *sf) : sdist(sf), vdist(0), adist(0) {} DistPtr::DistPtr(VectorDist const *vf) : sdist(0), vdist(vf), adist(0) {} DistPtr::DistPtr(ArrayDist const *af) : sdist(0), vdist(0), adist(af) {} string const &DistPtr::name() const { static const string nullstring; if (sdist) return sdist->name(); else if (vdist) return vdist->name(); else if (adist) return adist->name(); else return nullstring; } ScalarDist const * SCALAR(DistPtr const &p) { return p.sdist; } VectorDist const * VECTOR(DistPtr const &p) { return p.vdist; } ArrayDist const * ARRAY(DistPtr const &p) { return p.adist; } bool DistPtr::operator==(DistPtr const &rhs) const { return (sdist==rhs.sdist && vdist==rhs.vdist && adist==rhs.adist); } bool isNULL(DistPtr const &p) { return (p.sdist == 0 && p.vdist == 0 && p.adist == 0); } } //namespace jags JAGS-4.3.2/src/lib/distribution/DistTab.cc0000664000175000017500000000341214400665570015113 00000000000000#include #include #include #include using std::string; using std::find_if; using std::bind; namespace jags { typedef std::list DistList; // Adaptable binary predicate for find_if algorithm struct isDistName { bool operator()(DistPtr const &dist, string const &name) const { if (SCALAR(dist)) return SCALAR(dist)->name() == name; if (VECTOR(dist)) return VECTOR(dist)->name() == name; if (ARRAY(dist)) return ARRAY(dist)->name() == name; return false; } }; // Adaptable binary predicate for find_if algorithm struct isDistAlias { bool operator()(DistPtr const &dist, string const &name) const { if (name.length() == 0) return false; if (SCALAR(dist)) return SCALAR(dist)->alias() == name; if (VECTOR(dist)) return VECTOR(dist)->alias() == name; if (ARRAY(dist)) return ARRAY(dist)->alias() == name; return false; } }; DistTab::DistTab() : _dlist(), _nulldist() { //Required by Solaris Studio, which won't create a default constructor //with -std=c++11 } void DistTab::insert (DistPtr const &dist) { DistList::const_iterator p = std::find(_dlist.begin(), _dlist.end(), dist); if (p == _dlist.end()) _dlist.push_front(dist); } DistPtr const &DistTab::find(string const &name) const { DistList::const_iterator p = find_if(_dlist.begin(), _dlist.end(), bind(isDistName(), std::placeholders::_1, name)); if (p == _dlist.end()) { p = find_if(_dlist.begin(), _dlist.end(), bind(isDistAlias(), std::placeholders::_1, name)); } return (p == _dlist.end()) ? _nulldist : *p; } void DistTab::erase(DistPtr const &dist) { _dlist.remove(dist); } } //namespace jags JAGS-4.3.2/src/lib/distribution/DistError.cc0000664000175000017500000000044214224052371015467 00000000000000#include #include #include using std::string; namespace jags { DistError::DistError(Distribution const *edist, string const &emsg) : runtime_error(emsg + " in distribution " + edist->name()) { } } //namespace jags JAGS-4.3.2/src/lib/distribution/RScalarDist.cc0000664000175000017500000001271614224052514015733 00000000000000#include #include #include #include #include #include "c99_math.h" #include #include using std::string; using std::vector; using std::log; using std::min; using std::max; //debuggin #include using std::logic_error; namespace jags { double RScalarDist::calPlower(double lower, vector const ¶meters) const { //P(X < lower) if (_discrete) lower -= 1; return p(lower, parameters, true, false); } double RScalarDist::calPupper(double upper, vector const ¶meters) const { //P(X <= upper) return p(upper, parameters, true, false); } RScalarDist::RScalarDist(string const &name, unsigned int npar, Support support, bool discrete) : ScalarDist(name, npar, support), _discrete(discrete) { } double RScalarDist::typicalValue(vector const ¶meters, double const *lower, double const *upper) const { double llimit = l(parameters), ulimit = u(parameters); double plower = 0, pupper = 1; if (lower) { llimit = max(llimit, *lower); plower = calPlower(llimit, parameters); } if (upper) { ulimit = min(ulimit, *upper); pupper = calPupper(ulimit, parameters); } double pmed = (plower + pupper)/2; double med = q(pmed, parameters, true, false); //Calculate the log densities double dllimit = d(llimit, PDF_FULL, parameters, true); double dulimit = d(ulimit, PDF_FULL, parameters, true); double dmed = d(med, PDF_FULL, parameters, true); //Pick the median if it has the highest density, otherwise pick //a point near to (but not on) the boundary if (dmed >= dllimit && dmed >= dulimit) { return med; } else if (dulimit > dllimit) { return q(0.1 * plower + 0.9 * pupper, parameters, true, false); } else { return q(0.9 * plower + 0.1 * pupper, parameters, true, false); } } double RScalarDist::logDensity(double x, PDFType type, vector const ¶meters, double const *lower, double const *upper) const { if (lower && x < *lower) return JAGS_NEGINF; if (upper && x > *upper) return JAGS_NEGINF; if (upper && lower && *upper < *lower) return JAGS_NEGINF; double loglik = d(x, type, parameters, true); if (type != PDF_PRIOR && (lower || upper)) { //Normalize truncated distributions double ll = l(parameters); if (lower) ll = max(*lower, ll); if (_discrete) ll -= 1; //Adjustment for discrete valued distributions /* In theory, we just have to subtract log[P(lower <= X <= upper)] from the log likelihood. But we need to work around numerical problems. */ bool have_lower = lower && p(ll, parameters, true, false) > 0; bool have_upper = upper && p(*upper, parameters, false, false) > 0; if (have_lower && have_upper) { if (p(ll, parameters, false, false) < 0.5) { //Use upper tail: log (P(lower <= X) - P(upper < X)) loglik -= log(p(ll, parameters, false, false) - p(*upper, parameters, false, false)); } else { //Use lower tail: log (P(X <= upper) - P(X < lower)) loglik -= log(p(*upper, parameters, true, false) - p(ll, parameters, true, false)); } } else if (have_lower) { // log P(lower <= X) loglik -= p(ll, parameters, false, true); } else if (have_upper) { // log P(X <= upper) loglik -= p(*upper, parameters, true, true); } } return loglik; } double RScalarDist::randomSample(vector const ¶meters, double const *lower, double const *upper, RNG *rng) const { if (!lower && !upper) { return r(parameters, rng); } double plower = lower ? calPlower(*lower, parameters) : 0; double pupper = upper ? calPupper(*upper, parameters) : 1; if (pupper - plower > 0.25) { //Rejection sampling if expected number of samples is 4 or less while (true) { double y = r(parameters, rng); if (lower && y < *lower) continue; if (upper && y > *upper) continue; return y; } } //Inversion if (plower > 0.75) { // Upper tail: work on log scale for numerical stability double ll = *lower; if (_discrete) ll -= 1; double logpl = p(ll, parameters, false, true); double logp = logpl; if (!upper) { logp -= rng->exponential(); } else { double logpu = p(*upper, parameters, false, true); double delta = logpu - logpl; logp += jags_log1p(rng->uniform() * jags_expm1(delta)); } return q(logp, parameters, false, true); } else if (pupper < 0.25) { // Lower tail: work on log scale for numerical stability double logpu = p(*upper, parameters, true, true); double logp = logpu; if (!lower) { logp -= rng->exponential(); } else { double ll = *lower; if (_discrete) ll -= 1; double logpl = p(ll, parameters, true, true); double delta = logpl - logpu; logp += jags_log1p(rng->uniform() * jags_expm1(delta)); } return q(logp, parameters, true, true); } else { // Central double p = plower + rng->uniform() * (pupper - plower); return q(p, parameters, true, false); } } bool RScalarDist::canBound() const { return true; } bool RScalarDist::isDiscreteValued(vector const &mask) const { return _discrete; } bool RScalarDist::discrete() const { return _discrete; } double xlog0(double x, bool give_log) { if (x < 0) return JAGS_POSINF; else if (x > 0) return give_log ? JAGS_NEGINF : 0; else return give_log ? 0 : 1; } } JAGS-4.3.2/src/lib/distribution/c99_math.c0000664000175000017500000000026714224052514015030 00000000000000/* Remap some C99 functions for conformance with C++98 */ #include double jags_expm1(double x) { return expm1(x); } double jags_log1p(double x) { return log1p(x); } JAGS-4.3.2/src/lib/function/0000755000175000017500000000000014400711324012423 500000000000000JAGS-4.3.2/src/lib/function/Makefile.am0000664000175000017500000000112314224052371014402 00000000000000noinst_LTLIBRARIES = libfunc.la libfunc_la_CPPFLAGS = -I$(top_srcdir)/src/include libfunc_la_SOURCES = Function.cc ScalarFunction.cc LinkFunction.cc \ VectorFunction.cc ArrayFunction.cc FunctionPtr.cc FuncTab.cc FuncError.cc \ DPQFunction.cc DFunction.cc PFunction.cc QFunction.cc \ ScalarLogDensity.cc VectorLogDensity.cc ArrayLogDensity.cc \ ScalarVectorFunction.cc if CANCHECK check_LTLIBRARIES = libfuntest.la libfuntest_la_SOURCES = testfun.cc libfuntest_la_CPPFLAGS = -I$(top_srcdir)/src/include libfuntest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) libfuntest_la_LDFLAGS = $(CPPUNIT_LIBS) endif JAGS-4.3.2/src/lib/function/Makefile.in0000644000175000017500000012707314400675235014434 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/function ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libfunc_la_LIBADD = am_libfunc_la_OBJECTS = libfunc_la-Function.lo \ libfunc_la-ScalarFunction.lo libfunc_la-LinkFunction.lo \ libfunc_la-VectorFunction.lo libfunc_la-ArrayFunction.lo \ libfunc_la-FunctionPtr.lo libfunc_la-FuncTab.lo \ libfunc_la-FuncError.lo libfunc_la-DPQFunction.lo \ libfunc_la-DFunction.lo libfunc_la-PFunction.lo \ libfunc_la-QFunction.lo libfunc_la-ScalarLogDensity.lo \ libfunc_la-VectorLogDensity.lo libfunc_la-ArrayLogDensity.lo \ libfunc_la-ScalarVectorFunction.lo libfunc_la_OBJECTS = $(am_libfunc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libfuntest_la_LIBADD = am__libfuntest_la_SOURCES_DIST = testfun.cc @CANCHECK_TRUE@am_libfuntest_la_OBJECTS = libfuntest_la-testfun.lo libfuntest_la_OBJECTS = $(am_libfuntest_la_OBJECTS) libfuntest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libfuntest_la_CXXFLAGS) $(CXXFLAGS) $(libfuntest_la_LDFLAGS) \ $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libfuntest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libfunc_la-ArrayFunction.Plo \ ./$(DEPDIR)/libfunc_la-ArrayLogDensity.Plo \ ./$(DEPDIR)/libfunc_la-DFunction.Plo \ ./$(DEPDIR)/libfunc_la-DPQFunction.Plo \ ./$(DEPDIR)/libfunc_la-FuncError.Plo \ ./$(DEPDIR)/libfunc_la-FuncTab.Plo \ ./$(DEPDIR)/libfunc_la-Function.Plo \ ./$(DEPDIR)/libfunc_la-FunctionPtr.Plo \ ./$(DEPDIR)/libfunc_la-LinkFunction.Plo \ ./$(DEPDIR)/libfunc_la-PFunction.Plo \ ./$(DEPDIR)/libfunc_la-QFunction.Plo \ ./$(DEPDIR)/libfunc_la-ScalarFunction.Plo \ ./$(DEPDIR)/libfunc_la-ScalarLogDensity.Plo \ ./$(DEPDIR)/libfunc_la-ScalarVectorFunction.Plo \ ./$(DEPDIR)/libfunc_la-VectorFunction.Plo \ ./$(DEPDIR)/libfunc_la-VectorLogDensity.Plo \ ./$(DEPDIR)/libfuntest_la-testfun.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libfunc_la_SOURCES) $(libfuntest_la_SOURCES) DIST_SOURCES = $(libfunc_la_SOURCES) $(am__libfuntest_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libfunc.la libfunc_la_CPPFLAGS = -I$(top_srcdir)/src/include libfunc_la_SOURCES = Function.cc ScalarFunction.cc LinkFunction.cc \ VectorFunction.cc ArrayFunction.cc FunctionPtr.cc FuncTab.cc FuncError.cc \ DPQFunction.cc DFunction.cc PFunction.cc QFunction.cc \ ScalarLogDensity.cc VectorLogDensity.cc ArrayLogDensity.cc \ ScalarVectorFunction.cc @CANCHECK_TRUE@check_LTLIBRARIES = libfuntest.la @CANCHECK_TRUE@libfuntest_la_SOURCES = testfun.cc @CANCHECK_TRUE@libfuntest_la_CPPFLAGS = -I$(top_srcdir)/src/include @CANCHECK_TRUE@libfuntest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) @CANCHECK_TRUE@libfuntest_la_LDFLAGS = $(CPPUNIT_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/function/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/function/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libfunc.la: $(libfunc_la_OBJECTS) $(libfunc_la_DEPENDENCIES) $(EXTRA_libfunc_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libfunc_la_OBJECTS) $(libfunc_la_LIBADD) $(LIBS) libfuntest.la: $(libfuntest_la_OBJECTS) $(libfuntest_la_DEPENDENCIES) $(EXTRA_libfuntest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libfuntest_la_LINK) $(am_libfuntest_la_rpath) $(libfuntest_la_OBJECTS) $(libfuntest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-ArrayFunction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-ArrayLogDensity.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-DFunction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-DPQFunction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-FuncError.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-FuncTab.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-Function.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-FunctionPtr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-LinkFunction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-PFunction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-QFunction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-ScalarFunction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-ScalarLogDensity.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-ScalarVectorFunction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-VectorFunction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfunc_la-VectorLogDensity.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfuntest_la-testfun.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libfunc_la-Function.lo: Function.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-Function.lo -MD -MP -MF $(DEPDIR)/libfunc_la-Function.Tpo -c -o libfunc_la-Function.lo `test -f 'Function.cc' || echo '$(srcdir)/'`Function.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-Function.Tpo $(DEPDIR)/libfunc_la-Function.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Function.cc' object='libfunc_la-Function.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-Function.lo `test -f 'Function.cc' || echo '$(srcdir)/'`Function.cc libfunc_la-ScalarFunction.lo: ScalarFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-ScalarFunction.lo -MD -MP -MF $(DEPDIR)/libfunc_la-ScalarFunction.Tpo -c -o libfunc_la-ScalarFunction.lo `test -f 'ScalarFunction.cc' || echo '$(srcdir)/'`ScalarFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-ScalarFunction.Tpo $(DEPDIR)/libfunc_la-ScalarFunction.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ScalarFunction.cc' object='libfunc_la-ScalarFunction.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-ScalarFunction.lo `test -f 'ScalarFunction.cc' || echo '$(srcdir)/'`ScalarFunction.cc libfunc_la-LinkFunction.lo: LinkFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-LinkFunction.lo -MD -MP -MF $(DEPDIR)/libfunc_la-LinkFunction.Tpo -c -o libfunc_la-LinkFunction.lo `test -f 'LinkFunction.cc' || echo '$(srcdir)/'`LinkFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-LinkFunction.Tpo $(DEPDIR)/libfunc_la-LinkFunction.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LinkFunction.cc' object='libfunc_la-LinkFunction.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-LinkFunction.lo `test -f 'LinkFunction.cc' || echo '$(srcdir)/'`LinkFunction.cc libfunc_la-VectorFunction.lo: VectorFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-VectorFunction.lo -MD -MP -MF $(DEPDIR)/libfunc_la-VectorFunction.Tpo -c -o libfunc_la-VectorFunction.lo `test -f 'VectorFunction.cc' || echo '$(srcdir)/'`VectorFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-VectorFunction.Tpo $(DEPDIR)/libfunc_la-VectorFunction.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='VectorFunction.cc' object='libfunc_la-VectorFunction.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-VectorFunction.lo `test -f 'VectorFunction.cc' || echo '$(srcdir)/'`VectorFunction.cc libfunc_la-ArrayFunction.lo: ArrayFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-ArrayFunction.lo -MD -MP -MF $(DEPDIR)/libfunc_la-ArrayFunction.Tpo -c -o libfunc_la-ArrayFunction.lo `test -f 'ArrayFunction.cc' || echo '$(srcdir)/'`ArrayFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-ArrayFunction.Tpo $(DEPDIR)/libfunc_la-ArrayFunction.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArrayFunction.cc' object='libfunc_la-ArrayFunction.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-ArrayFunction.lo `test -f 'ArrayFunction.cc' || echo '$(srcdir)/'`ArrayFunction.cc libfunc_la-FunctionPtr.lo: FunctionPtr.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-FunctionPtr.lo -MD -MP -MF $(DEPDIR)/libfunc_la-FunctionPtr.Tpo -c -o libfunc_la-FunctionPtr.lo `test -f 'FunctionPtr.cc' || echo '$(srcdir)/'`FunctionPtr.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-FunctionPtr.Tpo $(DEPDIR)/libfunc_la-FunctionPtr.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='FunctionPtr.cc' object='libfunc_la-FunctionPtr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-FunctionPtr.lo `test -f 'FunctionPtr.cc' || echo '$(srcdir)/'`FunctionPtr.cc libfunc_la-FuncTab.lo: FuncTab.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-FuncTab.lo -MD -MP -MF $(DEPDIR)/libfunc_la-FuncTab.Tpo -c -o libfunc_la-FuncTab.lo `test -f 'FuncTab.cc' || echo '$(srcdir)/'`FuncTab.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-FuncTab.Tpo $(DEPDIR)/libfunc_la-FuncTab.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='FuncTab.cc' object='libfunc_la-FuncTab.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-FuncTab.lo `test -f 'FuncTab.cc' || echo '$(srcdir)/'`FuncTab.cc libfunc_la-FuncError.lo: FuncError.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-FuncError.lo -MD -MP -MF $(DEPDIR)/libfunc_la-FuncError.Tpo -c -o libfunc_la-FuncError.lo `test -f 'FuncError.cc' || echo '$(srcdir)/'`FuncError.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-FuncError.Tpo $(DEPDIR)/libfunc_la-FuncError.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='FuncError.cc' object='libfunc_la-FuncError.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-FuncError.lo `test -f 'FuncError.cc' || echo '$(srcdir)/'`FuncError.cc libfunc_la-DPQFunction.lo: DPQFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-DPQFunction.lo -MD -MP -MF $(DEPDIR)/libfunc_la-DPQFunction.Tpo -c -o libfunc_la-DPQFunction.lo `test -f 'DPQFunction.cc' || echo '$(srcdir)/'`DPQFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-DPQFunction.Tpo $(DEPDIR)/libfunc_la-DPQFunction.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DPQFunction.cc' object='libfunc_la-DPQFunction.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-DPQFunction.lo `test -f 'DPQFunction.cc' || echo '$(srcdir)/'`DPQFunction.cc libfunc_la-DFunction.lo: DFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-DFunction.lo -MD -MP -MF $(DEPDIR)/libfunc_la-DFunction.Tpo -c -o libfunc_la-DFunction.lo `test -f 'DFunction.cc' || echo '$(srcdir)/'`DFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-DFunction.Tpo $(DEPDIR)/libfunc_la-DFunction.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DFunction.cc' object='libfunc_la-DFunction.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-DFunction.lo `test -f 'DFunction.cc' || echo '$(srcdir)/'`DFunction.cc libfunc_la-PFunction.lo: PFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-PFunction.lo -MD -MP -MF $(DEPDIR)/libfunc_la-PFunction.Tpo -c -o libfunc_la-PFunction.lo `test -f 'PFunction.cc' || echo '$(srcdir)/'`PFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-PFunction.Tpo $(DEPDIR)/libfunc_la-PFunction.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='PFunction.cc' object='libfunc_la-PFunction.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-PFunction.lo `test -f 'PFunction.cc' || echo '$(srcdir)/'`PFunction.cc libfunc_la-QFunction.lo: QFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-QFunction.lo -MD -MP -MF $(DEPDIR)/libfunc_la-QFunction.Tpo -c -o libfunc_la-QFunction.lo `test -f 'QFunction.cc' || echo '$(srcdir)/'`QFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-QFunction.Tpo $(DEPDIR)/libfunc_la-QFunction.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='QFunction.cc' object='libfunc_la-QFunction.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-QFunction.lo `test -f 'QFunction.cc' || echo '$(srcdir)/'`QFunction.cc libfunc_la-ScalarLogDensity.lo: ScalarLogDensity.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-ScalarLogDensity.lo -MD -MP -MF $(DEPDIR)/libfunc_la-ScalarLogDensity.Tpo -c -o libfunc_la-ScalarLogDensity.lo `test -f 'ScalarLogDensity.cc' || echo '$(srcdir)/'`ScalarLogDensity.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-ScalarLogDensity.Tpo $(DEPDIR)/libfunc_la-ScalarLogDensity.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ScalarLogDensity.cc' object='libfunc_la-ScalarLogDensity.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-ScalarLogDensity.lo `test -f 'ScalarLogDensity.cc' || echo '$(srcdir)/'`ScalarLogDensity.cc libfunc_la-VectorLogDensity.lo: VectorLogDensity.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-VectorLogDensity.lo -MD -MP -MF $(DEPDIR)/libfunc_la-VectorLogDensity.Tpo -c -o libfunc_la-VectorLogDensity.lo `test -f 'VectorLogDensity.cc' || echo '$(srcdir)/'`VectorLogDensity.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-VectorLogDensity.Tpo $(DEPDIR)/libfunc_la-VectorLogDensity.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='VectorLogDensity.cc' object='libfunc_la-VectorLogDensity.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-VectorLogDensity.lo `test -f 'VectorLogDensity.cc' || echo '$(srcdir)/'`VectorLogDensity.cc libfunc_la-ArrayLogDensity.lo: ArrayLogDensity.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-ArrayLogDensity.lo -MD -MP -MF $(DEPDIR)/libfunc_la-ArrayLogDensity.Tpo -c -o libfunc_la-ArrayLogDensity.lo `test -f 'ArrayLogDensity.cc' || echo '$(srcdir)/'`ArrayLogDensity.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-ArrayLogDensity.Tpo $(DEPDIR)/libfunc_la-ArrayLogDensity.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArrayLogDensity.cc' object='libfunc_la-ArrayLogDensity.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-ArrayLogDensity.lo `test -f 'ArrayLogDensity.cc' || echo '$(srcdir)/'`ArrayLogDensity.cc libfunc_la-ScalarVectorFunction.lo: ScalarVectorFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libfunc_la-ScalarVectorFunction.lo -MD -MP -MF $(DEPDIR)/libfunc_la-ScalarVectorFunction.Tpo -c -o libfunc_la-ScalarVectorFunction.lo `test -f 'ScalarVectorFunction.cc' || echo '$(srcdir)/'`ScalarVectorFunction.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfunc_la-ScalarVectorFunction.Tpo $(DEPDIR)/libfunc_la-ScalarVectorFunction.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ScalarVectorFunction.cc' object='libfunc_la-ScalarVectorFunction.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libfunc_la-ScalarVectorFunction.lo `test -f 'ScalarVectorFunction.cc' || echo '$(srcdir)/'`ScalarVectorFunction.cc libfuntest_la-testfun.lo: testfun.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfuntest_la_CPPFLAGS) $(CPPFLAGS) $(libfuntest_la_CXXFLAGS) $(CXXFLAGS) -MT libfuntest_la-testfun.lo -MD -MP -MF $(DEPDIR)/libfuntest_la-testfun.Tpo -c -o libfuntest_la-testfun.lo `test -f 'testfun.cc' || echo '$(srcdir)/'`testfun.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfuntest_la-testfun.Tpo $(DEPDIR)/libfuntest_la-testfun.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testfun.cc' object='libfuntest_la-testfun.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfuntest_la_CPPFLAGS) $(CPPFLAGS) $(libfuntest_la_CXXFLAGS) $(CXXFLAGS) -c -o libfuntest_la-testfun.lo `test -f 'testfun.cc' || echo '$(srcdir)/'`testfun.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libfunc_la-ArrayFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-ArrayLogDensity.Plo -rm -f ./$(DEPDIR)/libfunc_la-DFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-DPQFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-FuncError.Plo -rm -f ./$(DEPDIR)/libfunc_la-FuncTab.Plo -rm -f ./$(DEPDIR)/libfunc_la-Function.Plo -rm -f ./$(DEPDIR)/libfunc_la-FunctionPtr.Plo -rm -f ./$(DEPDIR)/libfunc_la-LinkFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-PFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-QFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-ScalarFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-ScalarLogDensity.Plo -rm -f ./$(DEPDIR)/libfunc_la-ScalarVectorFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-VectorFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-VectorLogDensity.Plo -rm -f ./$(DEPDIR)/libfuntest_la-testfun.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libfunc_la-ArrayFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-ArrayLogDensity.Plo -rm -f ./$(DEPDIR)/libfunc_la-DFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-DPQFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-FuncError.Plo -rm -f ./$(DEPDIR)/libfunc_la-FuncTab.Plo -rm -f ./$(DEPDIR)/libfunc_la-Function.Plo -rm -f ./$(DEPDIR)/libfunc_la-FunctionPtr.Plo -rm -f ./$(DEPDIR)/libfunc_la-LinkFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-PFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-QFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-ScalarFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-ScalarLogDensity.Plo -rm -f ./$(DEPDIR)/libfunc_la-ScalarVectorFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-VectorFunction.Plo -rm -f ./$(DEPDIR)/libfunc_la-VectorLogDensity.Plo -rm -f ./$(DEPDIR)/libfuntest_la-testfun.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/function/Function.cc0000664000175000017500000000272314224052514014450 00000000000000#include #include using std::vector; using std::string; namespace jags { Function::Function (string const &name, unsigned int npar) : _name (name), _npar (npar) { } Function::~Function () { //virtual destructor } string const & Function::name () const { return _name; } string Function::alias() const { return ""; } unsigned int Function::npar() const { return _npar; } bool Function::isDiscreteValued(vector const &mask) const { return false; } bool Function::isScale(vector const &mask, vector const &isfixed) const { return false; } bool Function::isLinear(vector const &mask, vector const &isfixed) const { return isScale(mask, isfixed); } bool Function::isAdditive(vector const &mask, vector const &isfixed) const { return false; } bool Function::isPower(vector const &mask, vector const &isfixed) const { return false; } string Function::deparse(vector const &par) const { string name = this->name(); name.append("("); for (unsigned int i = 0; i < par.size(); ++i) { if (i > 0) { name.append(","); } name.append(par[i]); } name.append(")"); return name; } bool Function::checkParameterDiscrete(vector const &mask) const { return true; } bool Function::checkParameterFixed(std::vector const &mask) const { return true; } } //namespace jags JAGS-4.3.2/src/lib/function/ScalarFunction.cc0000664000175000017500000000130314224052514015567 00000000000000#include #include #include #include using std::vector; using std::string; using std::find_if; namespace jags { ScalarFunction::ScalarFunction (string const &name, unsigned int npar) : Function (name, npar) { } bool ScalarFunction::checkParameterValue(vector const &args) const { return true; } bool ScalarFunction::isPower(vector const &mask, vector const &isfixed) const { unsigned int nmask = 0; for (unsigned int i = 0; i < mask.size(); ++i) { nmask += mask[i]; } if (nmask > 1) return false; else return isScale(mask, vector()); } } //namespace jags JAGS-4.3.2/src/lib/function/LinkFunction.cc0000664000175000017500000000044614224052514015266 00000000000000#include #include using std::string; namespace jags { LinkFunction::LinkFunction (string const &name, string const &link) : Function (name, 1), _link(link) { } string const & LinkFunction::linkName () const { return _link; } } //namespace jags JAGS-4.3.2/src/lib/function/VectorFunction.cc0000664000175000017500000000111714224052514015627 00000000000000#include #include using std::vector; using std::string; namespace jags { VectorFunction::VectorFunction (string const &name, unsigned int npar) : Function(name, npar) { } bool VectorFunction::checkParameterValue(vector const &args, vector const &lengths) const { return true; } bool VectorFunction::checkParameterLength(vector const &arglen) const { for (unsigned int i = 0; i < arglen.size(); ++i) { if (arglen[i] == 0) return false; } return true; } } //namespace jags JAGS-4.3.2/src/lib/function/ArrayFunction.cc0000664000175000017500000000061214224052514015442 00000000000000#include #include using std::vector; using std::string; namespace jags { ArrayFunction::ArrayFunction (string const &name, unsigned int npar) : Function(name, npar) { } bool ArrayFunction::checkParameterValue(vector const &args, vector > const &dims) const { return true; } } //namespace jags JAGS-4.3.2/src/lib/function/FunctionPtr.cc0000664000175000017500000000321114224052514015127 00000000000000#include #include using std::string; namespace jags { FunctionPtr::FunctionPtr() : lfunc(0), sfunc(0), vfunc(0), afunc(0) {} FunctionPtr::FunctionPtr(ScalarFunction const *sf) : lfunc(0), sfunc(sf), vfunc(0), afunc(0) {} FunctionPtr::FunctionPtr(VectorFunction const *vf) : lfunc(0), sfunc(0), vfunc(vf), afunc(0) {} FunctionPtr::FunctionPtr(ArrayFunction const *af) : lfunc(0), sfunc(0), vfunc(0), afunc(af) {} FunctionPtr::FunctionPtr(LinkFunction const *lf) : lfunc(lf), sfunc(0), vfunc(0), afunc(0) {} string const &FunctionPtr::name() const { static const string nullstring; if (lfunc) return lfunc->name(); else if (sfunc) return sfunc->name(); else if (vfunc) return vfunc->name(); else if (afunc) return afunc->name(); else return nullstring; } LinkFunction const * LINK(FunctionPtr const &p) { return p.lfunc; } ScalarFunction const * SCALAR(FunctionPtr const &p) { return p.sfunc; } VectorFunction const * VECTOR(FunctionPtr const &p) { return p.vfunc; } ArrayFunction const * ARRAY(FunctionPtr const &p) { return p.afunc; } Function const * FUNC(FunctionPtr const &p) { if (p.lfunc) return p.lfunc; else if (p.sfunc) return p.sfunc; else if (p.vfunc) return p.vfunc; else if (p.afunc) return p.afunc; else return 0; } bool FunctionPtr::operator==(FunctionPtr const &rhs) const { return (lfunc == rhs.lfunc && sfunc==rhs.sfunc && vfunc==rhs.vfunc && afunc==rhs.afunc); } bool isNULL(FunctionPtr const &p) { return (p.lfunc==0 && p.sfunc == 0 && p.vfunc == 0 && p.afunc == 0); } } //namespace jags JAGS-4.3.2/src/lib/function/FuncTab.cc0000664000175000017500000000454614400666306014220 00000000000000#include #include #include #include #include using std::string; using std::find_if; using std::bind; namespace jags { typedef std::list FuncList; // Adaptable binary predicate for find_if algorithm struct isFuncName { bool operator()(FunctionPtr const &func, string const &name) const { if (LINK(func)) return LINK(func)->name() == name; if (SCALAR(func)) return SCALAR(func)->name() == name; if (VECTOR(func)) return VECTOR(func)->name() == name; if (ARRAY(func)) return ARRAY(func)->name() == name; return false; } }; // Adaptable binary predicate for find_if algorithm struct isFuncAlias { bool operator()(FunctionPtr const &func, string const &name) const { if (LINK(func)) return LINK(func)->alias() == name; if (SCALAR(func)) return SCALAR(func)->alias() == name; if (VECTOR(func)) return VECTOR(func)->alias() == name; if (ARRAY(func)) return ARRAY(func)->alias() == name; return false; } }; // Adaptable binary predicate for find_if algorithm struct isLinkName { bool operator()(FunctionPtr const &func, string const &name) const { return LINK(func) != 0 && LINK(func)->linkName() == name; } }; FuncTab::FuncTab() : _flist(), _nullfun() { //Required by Solaris Studio, which won't create a default constructor //with -std=c++11 } void FuncTab::insert (FunctionPtr const &func) { FuncList::const_iterator p = std::find(_flist.begin(), _flist.end(), func); if (p == _flist.end()) _flist.push_front(func); } FunctionPtr const &FuncTab::find(string const &name) const { FuncList::const_iterator p = find_if(_flist.begin(), _flist.end(), bind(isFuncName(), std::placeholders::_1, name)); if (p == _flist.end()) { p = find_if(_flist.begin(), _flist.end(), bind(isFuncAlias(), std::placeholders::_1, name)); } return (p == _flist.end()) ? _nullfun : *p; } LinkFunction const * FuncTab::findLink (string const &name) const { FuncList::const_iterator p = find_if(_flist.begin(), _flist.end(), bind(isLinkName(), std::placeholders::_1, name)); return (p == _flist.end()) ? 0 : LINK(*p); } void FuncTab::erase(FunctionPtr const &func) { _flist.remove(func); } } //namespace jags JAGS-4.3.2/src/lib/function/FuncError.cc0000664000175000017500000000041614224052514014565 00000000000000#include #include #include using std::string; namespace jags { FuncError::FuncError(Function const *efunc, string const &emsg) : runtime_error(emsg + " in function " + efunc->name()) { } } //namespace jags JAGS-4.3.2/src/lib/function/DPQFunction.cc0000664000175000017500000000117214224052514015012 00000000000000#include #include #include using std::vector; using std::string; namespace jags { DPQFunction::DPQFunction(string const &name, RScalarDist const *dist) : ScalarFunction(name, dist->npar() + 1), _dist(dist) {} RScalarDist const *DPQFunction::dist() const { return _dist; } bool DPQFunction::checkArgs(vector const &args) const { vector param(_dist->npar()); for (unsigned int i = 0; i < param.size(); ++i) { param[i] = args[i+1]; } return _dist->checkParameterValue(param); } } JAGS-4.3.2/src/lib/function/DFunction.cc0000664000175000017500000000137514224052514014556 00000000000000#include #include #include using std::vector; using std::string; namespace jags { DFunction::DFunction(RScalarDist const *dist) : DPQFunction(dist->name(), dist) {} double DFunction::evaluate(vector const &args) const { double x = *args[0]; vector param(args.size() - 1); for (unsigned int i = 1; i < args.size(); ++i) { param[i-1] = args[i]; } return dist()->d(x, PDF_FULL, param, false); } bool DFunction::checkParameterValue(vector const &args) const { if (dist()->discrete()) { double x = *args[0]; if (x != static_cast(x)) return false; } return checkArgs(args); } } JAGS-4.3.2/src/lib/function/PFunction.cc0000664000175000017500000000142014224052514014561 00000000000000#include #include #include using std::vector; using std::string; namespace jags { PFunction::PFunction(RScalarDist const *dist) : DPQFunction(string("p") + dist->name().substr(1), dist) {} double PFunction::evaluate(vector const &args) const { double x = *args[0]; vector param(args.size() - 1); for (unsigned int i = 1; i < args.size(); ++i) { param[i-1] = args[i]; } return dist()->p(x, param, true, false); } bool PFunction::checkParameterValue(vector const &args) const { if (dist()->discrete()) { double x = *args[0]; if (x != static_cast(x)) return false; } return checkArgs(args); } } JAGS-4.3.2/src/lib/function/QFunction.cc0000664000175000017500000000123614224052514014567 00000000000000#include #include #include using std::vector; using std::string; namespace jags { QFunction::QFunction(RScalarDist const *dist) : DPQFunction(string("q") + dist->name().substr(1), dist) {} double QFunction::evaluate(vector const &args) const { double x = *args[0]; vector param(args.size() - 1); for (unsigned int i = 1; i < args.size(); ++i) { param[i-1] = args[i]; } return dist()->q(x, param, true, false); } bool QFunction::checkParameterValue(vector const &args) const { return checkArgs(args); } } JAGS-4.3.2/src/lib/function/ScalarLogDensity.cc0000664000175000017500000000250414224052514016067 00000000000000#include #include #include using std::vector; using std::string; namespace jags { ScalarLogDensity::ScalarLogDensity(ScalarDist const *dist) : ScalarFunction(string("logdensity.") + dist->name().substr(1), dist->npar() + 1), _dist(dist) {} double ScalarLogDensity::evaluate(vector const &args) const { vector param(_dist->npar()); for (unsigned int i = 0; i < param.size(); ++i) { param[i] = args[i+1]; } return _dist->logDensity(*args[0], PDF_FULL, param, 0, 0); } bool ScalarLogDensity::checkParameterValue(vector const &args) const { //We have to include discreteness check here as there is //no equivalent of checkParameterDiscrete for Functions. vector mask(_dist->npar()); for (unsigned int i = 0; i < mask.size(); ++i) { double p = *args[i + 1]; mask[i] = (p == static_cast(p)); } if (!_dist->checkParameterDiscrete(mask)) return false; if (_dist->isDiscreteValued(mask)) { if (*args[0] != static_cast(*args[0])) { return false; } } vector param(_dist->npar()); for (unsigned int i = 0; i < param.size(); ++i) { param[i] = args[i+1]; } return _dist->checkParameterValue(param); } } JAGS-4.3.2/src/lib/function/VectorLogDensity.cc0000664000175000017500000000427314224052514016131 00000000000000#include #include #include using std::vector; using std::string; namespace jags { VectorLogDensity::VectorLogDensity(VectorDist const *dist) : VectorFunction(string("logdensity.") + dist->name().substr(1), dist->npar() + 1), _dist(dist) {} unsigned int VectorLogDensity::length(vector const &lengths, vector const &values) const { return 1; } void VectorLogDensity::evaluate(double *value, vector const &args, vector const &lengths) const { unsigned int npar = _dist->npar(); vector dargs(npar); vector dlengths(npar); for (unsigned int i = 0; i < npar; ++i) { dargs[i] = args[i+1]; dlengths[i] = lengths[i+1]; } value[0] = _dist->logDensity(args[0], lengths[0], PDF_FULL, dargs, dlengths, 0, 0); } bool VectorLogDensity::checkParameterLength(vector const &lengths) const { unsigned int npar = _dist->npar(); vector dlengths(npar); for (unsigned int i = 0; i < npar; ++i) { dlengths[i] = lengths[i+1]; } if (!_dist->checkParameterLength(dlengths)) return false; if (lengths[0] != _dist->length(dlengths)) return false; return true; } bool VectorLogDensity::checkParameterValue(vector const &args, vector const &lengths) const { //We have to include discreteness check here as there is //no equivalent of checkParameterDiscrete for Functions. unsigned int npar = _dist->npar(); vector mask(npar); for (unsigned int i = 0; i < npar; ++i) { double p = *args[i + 1]; mask[i] = (p == static_cast(p)); } if (!_dist->checkParameterDiscrete(mask)) return false; if (_dist->isDiscreteValued(mask)) { if (*args[0] != static_cast(*args[0])) { return false; } } vector dargs(npar); vector dlengths(npar); for (unsigned int i = 0; i < npar; ++i) { dargs[i] = args[i+1]; dlengths[i] = lengths[i+1]; } return _dist->checkParameterValue(dargs, dlengths); } } JAGS-4.3.2/src/lib/function/ArrayLogDensity.cc0000664000175000017500000000431614224052514015743 00000000000000#include #include #include #include using std::vector; using std::string; namespace jags { ArrayLogDensity::ArrayLogDensity(ArrayDist const *dist) : ArrayFunction(string("logdensity.") + dist->name().substr(1), dist->npar() + 1), _dist(dist) {} vector ArrayLogDensity::dim( vector > const &dims, vector const &values) const { return vector(1, 1); } void ArrayLogDensity::evaluate( double *value, vector const &args, vector > const &dims) const { unsigned int npar = _dist->npar(); vector dargs(npar); vector > ddims(npar); for (unsigned int i = 0; i < npar; ++i) { dargs[i] = args[i+1]; ddims[i] = dims[i+1]; } value[0] = _dist->logDensity(args[0], product(dims[0]), PDF_FULL, dargs, ddims, 0, 0); } bool ArrayLogDensity::checkParameterDim(vector > const &dim) const { unsigned int npar = _dist->npar(); vector > ddim(npar); for (unsigned int i = 0; i < npar; ++i) { ddim[i] = dim[i+1]; } if (!_dist->checkParameterDim(ddim)) return false; if (dim[0] != _dist->dim(ddim)) return false; return true; } bool ArrayLogDensity::checkParameterValue(vector const &args, vector > const &dims) const { //We have to include discreteness check here as there is //no equivalent of checkParameterDiscrete for Functions. unsigned int npar = _dist->npar(); vector mask(npar); for (unsigned int i = 0; i < npar; ++i) { double p = *args[i + 1]; mask[i] = (p == static_cast(p)); } if (!_dist->checkParameterDiscrete(mask)) return false; if (_dist->isDiscreteValued(mask)) { if (*args[0] != static_cast(*args[0])) { return false; } } vector dargs(npar); vector > ddims(npar); for (unsigned int i = 0; i < npar; ++i) { dargs[i] = args[i+1]; ddims[i] = dims[i+1]; } return _dist->checkParameterValue(dargs, ddims); } } JAGS-4.3.2/src/lib/function/ScalarVectorFunction.cc0000664000175000017500000000116514224052514016760 00000000000000#include #include using std::vector; using std::string; namespace jags { ScalarVectorFunction::ScalarVectorFunction (string const &name, unsigned int npar) : VectorFunction(name, npar) { } void ScalarVectorFunction::evaluate(double *value, vector const &args, vector const &lengths) const { *value = scalarEval(args, lengths); } unsigned int ScalarVectorFunction::length(vector const &lengths, vector const &values) const { return 1; } } JAGS-4.3.2/src/lib/function/testfun.cc0000664000175000017500000002310514224052514014350 00000000000000#include #include #include #include using jags::ScalarFunction; using jags::VectorFunction; using jags::Function; #include #include #include using std::vector; using std::string; using std::copy; using std::floor; /* All functions */ bool isdiscrete(Function const *f, bool mask1) { CPPUNIT_ASSERT(checkNPar(f, 1)); return f->isDiscreteValued(vector(1, mask1)); } bool isdiscrete(Function const *f, bool mask1, bool mask2) { CPPUNIT_ASSERT(checkNPar(f, 2)); vector arg(2); arg[0] = mask1; arg[1] = mask2; return f->isDiscreteValued(arg); } bool isdiscrete(Function const *f, bool mask1, bool mask2, bool mask3) { CPPUNIT_ASSERT(checkNPar(f, 3)); vector arg(3); arg[0] = mask1; arg[1] = mask2; arg[2] = mask3; return f->isDiscreteValued(arg); } class BoolIterator : public std::vector { public: bool atEnd; BoolIterator(unsigned int n) : vector(n, false), atEnd(false) {}; void next() { bool bump = true; for (unsigned int i = 0; i < size(); ++i) { if (bump) { bool x = operator[](i); //current value bump = x; operator[](i) = !x; } else return; } if (bump) atEnd=true; } }; bool isdiscrete(Function const *f, unsigned int npar, bool (*predicate) (vector const &)) { CPPUNIT_ASSERT(checkNPar(f, npar)); BoolIterator mask(npar); for(BoolIterator mask(npar); !mask.atEnd; mask.next()) { if (f->isDiscreteValued(mask) != predicate(mask)) { return false; } } return true; } bool always(vector const &mask) { return true; } bool never(vector const &mask) { return false; } bool all(vector const &mask) { return allTrue(mask); } bool any(vector const &mask) { return anyTrue(mask); } bool neveradditive(Function const *f, unsigned int npar) { CPPUNIT_ASSERT_MESSAGE(f->name(), checkNPar(f, npar)); for(BoolIterator mask(npar); !mask.atEnd; mask.next()) { if (f->isAdditive(mask, vector())) return false; for(BoolIterator fixed(npar); !fixed.atEnd; fixed.next()) { if (f->isAdditive(mask, fixed)) return false; } } return true; } bool neverlinear(Function const *f, unsigned int npar) { CPPUNIT_ASSERT_MESSAGE(f->name(), checkNPar(f, npar)); for(BoolIterator mask(npar); !mask.atEnd; mask.next()) { if (f->isLinear(mask, vector())) return false; for(BoolIterator fixed(npar); !fixed.atEnd; fixed.next()) { if (f->isLinear(mask, fixed)) return false; } } return true; } bool neverscale(Function const *f, unsigned int npar) { CPPUNIT_ASSERT_MESSAGE(f->name(), checkNPar(f, npar)); for(BoolIterator mask(npar); !mask.atEnd; mask.next()) { if (f->isScale(mask, vector())) return false; for(BoolIterator fixed(npar); !fixed.atEnd; fixed.next()) { if (f->isScale(mask, fixed)) return false; } } return true; } bool neverpow(Function const *f, unsigned int npar) { CPPUNIT_ASSERT_MESSAGE(f->name(), checkNPar(f, npar)); for(BoolIterator mask(npar); !mask.atEnd; mask.next()) { if (f->isPower(mask, vector())) return false; for(BoolIterator fixed(npar); !fixed.atEnd; fixed.next()) { if (f->isPower(mask, fixed)) return false; } } return true; } bool neverclosed(Function const *f, unsigned int npar) { return neverscale(f, npar) && neverlinear(f, npar) && neverpow(f, npar) && neveradditive(f, npar); } /* Scalar functions */ static bool checkval(ScalarFunction const *f, double x) { CPPUNIT_ASSERT_MESSAGE(f->name(), checkNPar(f, 1)); vector arg(1, &x); return f->checkParameterValue(arg); } void checkLimits(ScalarFunction const *f, double lower, double upper) { CPPUNIT_ASSERT(lower < upper); CPPUNIT_ASSERT_MESSAGE(f->name(), checkval(f, lower)); CPPUNIT_ASSERT_MESSAGE(f->name(), checkval(f, upper)); CPPUNIT_ASSERT_MESSAGE(f->name(), !jags_isnan(eval(f, lower))); CPPUNIT_ASSERT_MESSAGE(f->name(), !jags_isnan(eval(f, upper))); if (jags_finite(upper)) { if (upper > 1) { upper *= (1.0 + DBL_EPSILON); } else if (upper < -1) { upper *= (1.0 - DBL_EPSILON); } else { upper += DBL_EPSILON; } CPPUNIT_ASSERT_MESSAGE(f->name(), !checkval(f, upper)); } if (jags_finite(lower)) { if (lower > 1) { lower *= (1.0 - DBL_EPSILON); } else if (lower < -1) { lower *= (1.0 + DBL_EPSILON); } else { lower -= DBL_EPSILON; } CPPUNIT_ASSERT_MESSAGE(f->name(), !checkval(f, lower)); } } static vector discreteMask(vector const &args) { vector out(args.size(), true); for (unsigned int i = 0; i < args.size(); ++i) { double v = *args[i]; if (v != floor(v + 0.5)) { out[i] = false; } } return out; } static double checkEval(ScalarFunction const *f, vector const &args) { //Evaluate scalar function with checks CPPUNIT_ASSERT_MESSAGE(f->name(), checkNPar(f, args.size())); vector mask = discreteMask(args); CPPUNIT_ASSERT_MESSAGE(f->name(), f->checkParameterDiscrete(mask)); CPPUNIT_ASSERT_MESSAGE(f->name(), f->checkParameterValue(args)); return f->evaluate(args); } /* Evaluate a scalar function that takes a single argument */ double eval(ScalarFunction const *f, const double x) { vector arg(1, &x); return checkEval(f, arg); } /* Evaluate a scalar function that takes two arguments */ double eval(ScalarFunction const *f, double x, double y) { CPPUNIT_ASSERT_MESSAGE(f->name(), checkNPar(f, 2)); vector args(2); args[0] = &x; args[1] = &y; CPPUNIT_ASSERT_MESSAGE(f->name(), f->checkParameterValue(args)); return checkEval(f, args); } /* Evaluate a scalar function that takes three arguments */ double eval(ScalarFunction const *f, double x, double y, double z) { CPPUNIT_ASSERT_MESSAGE(f->name(), checkNPar(f, 3)); vector args(3); args[0] = &x; args[1] = &y; args[2] = &z; CPPUNIT_ASSERT_MESSAGE(f->name(), f->checkParameterValue(args)); return checkEval(f, args); } static vector discreteMask(vector const &args, vector const &arglen) { vector out(args.size(), true); for (unsigned int i = 0; i < args.size(); ++i) { double const *v = args[i]; for (unsigned int j = 0; j < arglen[i]; ++j) { if (v[j] != floor(v[j] + 0.5)) { out[i] = false; break; } } } return out; } static vector checkVEval(VectorFunction const *f, vector const &args, vector const &arglen) { // Evaluate vector function with checks CPPUNIT_ASSERT_EQUAL_MESSAGE(f->name(), args.size(), arglen.size()); CPPUNIT_ASSERT_MESSAGE(f->name(), checkNPar(f, args.size())); CPPUNIT_ASSERT_MESSAGE(f->name(), f->checkParameterLength(arglen)); vector mask = discreteMask(args, arglen); CPPUNIT_ASSERT_MESSAGE(f->name(), f->checkParameterDiscrete(mask)); CPPUNIT_ASSERT_MESSAGE(f->name(), f->checkParameterValue(args, arglen)); vector ans(f->length(arglen, args)); f->evaluate(&ans[0], args, arglen); return ans; } /* Evaluate a VectorFunction that takes a single argument */ vector veval(VectorFunction const *f, vector const &x) { vector arg(1, &x[0]); vector arglen(1, x.size()); return checkVEval(f, arg, arglen); } //Evaluate a VectorFunction that takes two arguments vector veval(VectorFunction const *f, vector const &x, vector const &y) { vector arg(2); arg[0] = &x[0]; arg[1] = &y[0]; vector arglen(2); arglen[0] = x.size(); arglen[1] = y.size(); return checkVEval(f, arg, arglen); } //Evaluate a VectorFunction that takes three arguments vector veval(VectorFunction const *f, vector const &x, vector const &y, vector const &z) { vector arg(3); arg[0] = &x[0]; arg[1] = &y[0]; arg[2] = &z[0]; vector arglen(3); arglen[0] = x.size(); arglen[1] = y.size(); arglen[2] = z.size(); return checkVEval(f, arg, arglen); } //Evaluate a VectorFunction that takes four arguments vector veval(VectorFunction const *f, vector const &x, vector const &y, vector const &z, vector const &w) { vector arg(4); arg[0] = &x[0]; arg[1] = &y[0]; arg[2] = &z[0]; arg[3] = &w[0]; vector arglen(4); arglen[0] = x.size(); arglen[1] = y.size(); arglen[2] = z.size(); arglen[3] = w.size(); return checkVEval(f, arg, arglen); } /* Evaluate a VectorFunction that takes a single argument and returns a scalar */ double eval(VectorFunction const *f, vector const &x) { vector y = veval(f, x); CPPUNIT_ASSERT_EQUAL(static_cast(1), y.size()); return y[0]; } /* Evaluate a VectorFunction that takes two arguments and returns a scalar */ double eval(VectorFunction const *f, vector const &x, vector const &y) { vector z = veval(f, x, y); CPPUNIT_ASSERT_EQUAL(static_cast(1), z.size()); return z[0]; } /* Evaluate a VectorFunction that takes three arguments and returns a scalar */ double eval(VectorFunction const *f, vector const &x, vector const &y, vector const &z) { vector ans = veval(f, x, y, z); CPPUNIT_ASSERT_EQUAL(static_cast(1), ans.size()); return ans[0]; } JAGS-4.3.2/src/lib/sampler/0000755000175000017500000000000014400711324012241 500000000000000JAGS-4.3.2/src/lib/sampler/Makefile.am0000664000175000017500000000054314224052514014224 00000000000000noinst_LTLIBRARIES = libsampler.la libsampler_la_CPPFLAGS = -I$(top_srcdir)/src/include libsampler_la_SOURCES = Sampler.cc GraphView.cc Slicer.cc \ Metropolis.cc RWMetropolis.cc MutableSampleMethod.cc ImmutableSampleMethod.cc \ Linear.cc SamplerFactory.cc SingletonFactory.cc StepAdapter.cc \ TemperedMetropolis.cc MutableSampler.cc ImmutableSampler.cc JAGS-4.3.2/src/lib/sampler/Makefile.in0000644000175000017500000011567514400675235014257 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/sampler ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libsampler_la_LIBADD = am_libsampler_la_OBJECTS = libsampler_la-Sampler.lo \ libsampler_la-GraphView.lo libsampler_la-Slicer.lo \ libsampler_la-Metropolis.lo libsampler_la-RWMetropolis.lo \ libsampler_la-MutableSampleMethod.lo \ libsampler_la-ImmutableSampleMethod.lo libsampler_la-Linear.lo \ libsampler_la-SamplerFactory.lo \ libsampler_la-SingletonFactory.lo libsampler_la-StepAdapter.lo \ libsampler_la-TemperedMetropolis.lo \ libsampler_la-MutableSampler.lo \ libsampler_la-ImmutableSampler.lo libsampler_la_OBJECTS = $(am_libsampler_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libsampler_la-GraphView.Plo \ ./$(DEPDIR)/libsampler_la-ImmutableSampleMethod.Plo \ ./$(DEPDIR)/libsampler_la-ImmutableSampler.Plo \ ./$(DEPDIR)/libsampler_la-Linear.Plo \ ./$(DEPDIR)/libsampler_la-Metropolis.Plo \ ./$(DEPDIR)/libsampler_la-MutableSampleMethod.Plo \ ./$(DEPDIR)/libsampler_la-MutableSampler.Plo \ ./$(DEPDIR)/libsampler_la-RWMetropolis.Plo \ ./$(DEPDIR)/libsampler_la-Sampler.Plo \ ./$(DEPDIR)/libsampler_la-SamplerFactory.Plo \ ./$(DEPDIR)/libsampler_la-SingletonFactory.Plo \ ./$(DEPDIR)/libsampler_la-Slicer.Plo \ ./$(DEPDIR)/libsampler_la-StepAdapter.Plo \ ./$(DEPDIR)/libsampler_la-TemperedMetropolis.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libsampler_la_SOURCES) DIST_SOURCES = $(libsampler_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libsampler.la libsampler_la_CPPFLAGS = -I$(top_srcdir)/src/include libsampler_la_SOURCES = Sampler.cc GraphView.cc Slicer.cc \ Metropolis.cc RWMetropolis.cc MutableSampleMethod.cc ImmutableSampleMethod.cc \ Linear.cc SamplerFactory.cc SingletonFactory.cc StepAdapter.cc \ TemperedMetropolis.cc MutableSampler.cc ImmutableSampler.cc all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/sampler/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/sampler/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libsampler.la: $(libsampler_la_OBJECTS) $(libsampler_la_DEPENDENCIES) $(EXTRA_libsampler_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libsampler_la_OBJECTS) $(libsampler_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-GraphView.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-ImmutableSampleMethod.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-ImmutableSampler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-Linear.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-Metropolis.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-MutableSampleMethod.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-MutableSampler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-RWMetropolis.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-Sampler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-SamplerFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-SingletonFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-Slicer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-StepAdapter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsampler_la-TemperedMetropolis.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libsampler_la-Sampler.lo: Sampler.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-Sampler.lo -MD -MP -MF $(DEPDIR)/libsampler_la-Sampler.Tpo -c -o libsampler_la-Sampler.lo `test -f 'Sampler.cc' || echo '$(srcdir)/'`Sampler.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-Sampler.Tpo $(DEPDIR)/libsampler_la-Sampler.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Sampler.cc' object='libsampler_la-Sampler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-Sampler.lo `test -f 'Sampler.cc' || echo '$(srcdir)/'`Sampler.cc libsampler_la-GraphView.lo: GraphView.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-GraphView.lo -MD -MP -MF $(DEPDIR)/libsampler_la-GraphView.Tpo -c -o libsampler_la-GraphView.lo `test -f 'GraphView.cc' || echo '$(srcdir)/'`GraphView.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-GraphView.Tpo $(DEPDIR)/libsampler_la-GraphView.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GraphView.cc' object='libsampler_la-GraphView.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-GraphView.lo `test -f 'GraphView.cc' || echo '$(srcdir)/'`GraphView.cc libsampler_la-Slicer.lo: Slicer.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-Slicer.lo -MD -MP -MF $(DEPDIR)/libsampler_la-Slicer.Tpo -c -o libsampler_la-Slicer.lo `test -f 'Slicer.cc' || echo '$(srcdir)/'`Slicer.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-Slicer.Tpo $(DEPDIR)/libsampler_la-Slicer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Slicer.cc' object='libsampler_la-Slicer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-Slicer.lo `test -f 'Slicer.cc' || echo '$(srcdir)/'`Slicer.cc libsampler_la-Metropolis.lo: Metropolis.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-Metropolis.lo -MD -MP -MF $(DEPDIR)/libsampler_la-Metropolis.Tpo -c -o libsampler_la-Metropolis.lo `test -f 'Metropolis.cc' || echo '$(srcdir)/'`Metropolis.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-Metropolis.Tpo $(DEPDIR)/libsampler_la-Metropolis.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Metropolis.cc' object='libsampler_la-Metropolis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-Metropolis.lo `test -f 'Metropolis.cc' || echo '$(srcdir)/'`Metropolis.cc libsampler_la-RWMetropolis.lo: RWMetropolis.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-RWMetropolis.lo -MD -MP -MF $(DEPDIR)/libsampler_la-RWMetropolis.Tpo -c -o libsampler_la-RWMetropolis.lo `test -f 'RWMetropolis.cc' || echo '$(srcdir)/'`RWMetropolis.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-RWMetropolis.Tpo $(DEPDIR)/libsampler_la-RWMetropolis.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RWMetropolis.cc' object='libsampler_la-RWMetropolis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-RWMetropolis.lo `test -f 'RWMetropolis.cc' || echo '$(srcdir)/'`RWMetropolis.cc libsampler_la-MutableSampleMethod.lo: MutableSampleMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-MutableSampleMethod.lo -MD -MP -MF $(DEPDIR)/libsampler_la-MutableSampleMethod.Tpo -c -o libsampler_la-MutableSampleMethod.lo `test -f 'MutableSampleMethod.cc' || echo '$(srcdir)/'`MutableSampleMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-MutableSampleMethod.Tpo $(DEPDIR)/libsampler_la-MutableSampleMethod.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MutableSampleMethod.cc' object='libsampler_la-MutableSampleMethod.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-MutableSampleMethod.lo `test -f 'MutableSampleMethod.cc' || echo '$(srcdir)/'`MutableSampleMethod.cc libsampler_la-ImmutableSampleMethod.lo: ImmutableSampleMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-ImmutableSampleMethod.lo -MD -MP -MF $(DEPDIR)/libsampler_la-ImmutableSampleMethod.Tpo -c -o libsampler_la-ImmutableSampleMethod.lo `test -f 'ImmutableSampleMethod.cc' || echo '$(srcdir)/'`ImmutableSampleMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-ImmutableSampleMethod.Tpo $(DEPDIR)/libsampler_la-ImmutableSampleMethod.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ImmutableSampleMethod.cc' object='libsampler_la-ImmutableSampleMethod.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-ImmutableSampleMethod.lo `test -f 'ImmutableSampleMethod.cc' || echo '$(srcdir)/'`ImmutableSampleMethod.cc libsampler_la-Linear.lo: Linear.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-Linear.lo -MD -MP -MF $(DEPDIR)/libsampler_la-Linear.Tpo -c -o libsampler_la-Linear.lo `test -f 'Linear.cc' || echo '$(srcdir)/'`Linear.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-Linear.Tpo $(DEPDIR)/libsampler_la-Linear.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Linear.cc' object='libsampler_la-Linear.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-Linear.lo `test -f 'Linear.cc' || echo '$(srcdir)/'`Linear.cc libsampler_la-SamplerFactory.lo: SamplerFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-SamplerFactory.lo -MD -MP -MF $(DEPDIR)/libsampler_la-SamplerFactory.Tpo -c -o libsampler_la-SamplerFactory.lo `test -f 'SamplerFactory.cc' || echo '$(srcdir)/'`SamplerFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-SamplerFactory.Tpo $(DEPDIR)/libsampler_la-SamplerFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SamplerFactory.cc' object='libsampler_la-SamplerFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-SamplerFactory.lo `test -f 'SamplerFactory.cc' || echo '$(srcdir)/'`SamplerFactory.cc libsampler_la-SingletonFactory.lo: SingletonFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-SingletonFactory.lo -MD -MP -MF $(DEPDIR)/libsampler_la-SingletonFactory.Tpo -c -o libsampler_la-SingletonFactory.lo `test -f 'SingletonFactory.cc' || echo '$(srcdir)/'`SingletonFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-SingletonFactory.Tpo $(DEPDIR)/libsampler_la-SingletonFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SingletonFactory.cc' object='libsampler_la-SingletonFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-SingletonFactory.lo `test -f 'SingletonFactory.cc' || echo '$(srcdir)/'`SingletonFactory.cc libsampler_la-StepAdapter.lo: StepAdapter.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-StepAdapter.lo -MD -MP -MF $(DEPDIR)/libsampler_la-StepAdapter.Tpo -c -o libsampler_la-StepAdapter.lo `test -f 'StepAdapter.cc' || echo '$(srcdir)/'`StepAdapter.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-StepAdapter.Tpo $(DEPDIR)/libsampler_la-StepAdapter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='StepAdapter.cc' object='libsampler_la-StepAdapter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-StepAdapter.lo `test -f 'StepAdapter.cc' || echo '$(srcdir)/'`StepAdapter.cc libsampler_la-TemperedMetropolis.lo: TemperedMetropolis.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-TemperedMetropolis.lo -MD -MP -MF $(DEPDIR)/libsampler_la-TemperedMetropolis.Tpo -c -o libsampler_la-TemperedMetropolis.lo `test -f 'TemperedMetropolis.cc' || echo '$(srcdir)/'`TemperedMetropolis.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-TemperedMetropolis.Tpo $(DEPDIR)/libsampler_la-TemperedMetropolis.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='TemperedMetropolis.cc' object='libsampler_la-TemperedMetropolis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-TemperedMetropolis.lo `test -f 'TemperedMetropolis.cc' || echo '$(srcdir)/'`TemperedMetropolis.cc libsampler_la-MutableSampler.lo: MutableSampler.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-MutableSampler.lo -MD -MP -MF $(DEPDIR)/libsampler_la-MutableSampler.Tpo -c -o libsampler_la-MutableSampler.lo `test -f 'MutableSampler.cc' || echo '$(srcdir)/'`MutableSampler.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-MutableSampler.Tpo $(DEPDIR)/libsampler_la-MutableSampler.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MutableSampler.cc' object='libsampler_la-MutableSampler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-MutableSampler.lo `test -f 'MutableSampler.cc' || echo '$(srcdir)/'`MutableSampler.cc libsampler_la-ImmutableSampler.lo: ImmutableSampler.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsampler_la-ImmutableSampler.lo -MD -MP -MF $(DEPDIR)/libsampler_la-ImmutableSampler.Tpo -c -o libsampler_la-ImmutableSampler.lo `test -f 'ImmutableSampler.cc' || echo '$(srcdir)/'`ImmutableSampler.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libsampler_la-ImmutableSampler.Tpo $(DEPDIR)/libsampler_la-ImmutableSampler.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ImmutableSampler.cc' object='libsampler_la-ImmutableSampler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsampler_la-ImmutableSampler.lo `test -f 'ImmutableSampler.cc' || echo '$(srcdir)/'`ImmutableSampler.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libsampler_la-GraphView.Plo -rm -f ./$(DEPDIR)/libsampler_la-ImmutableSampleMethod.Plo -rm -f ./$(DEPDIR)/libsampler_la-ImmutableSampler.Plo -rm -f ./$(DEPDIR)/libsampler_la-Linear.Plo -rm -f ./$(DEPDIR)/libsampler_la-Metropolis.Plo -rm -f ./$(DEPDIR)/libsampler_la-MutableSampleMethod.Plo -rm -f ./$(DEPDIR)/libsampler_la-MutableSampler.Plo -rm -f ./$(DEPDIR)/libsampler_la-RWMetropolis.Plo -rm -f ./$(DEPDIR)/libsampler_la-Sampler.Plo -rm -f ./$(DEPDIR)/libsampler_la-SamplerFactory.Plo -rm -f ./$(DEPDIR)/libsampler_la-SingletonFactory.Plo -rm -f ./$(DEPDIR)/libsampler_la-Slicer.Plo -rm -f ./$(DEPDIR)/libsampler_la-StepAdapter.Plo -rm -f ./$(DEPDIR)/libsampler_la-TemperedMetropolis.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libsampler_la-GraphView.Plo -rm -f ./$(DEPDIR)/libsampler_la-ImmutableSampleMethod.Plo -rm -f ./$(DEPDIR)/libsampler_la-ImmutableSampler.Plo -rm -f ./$(DEPDIR)/libsampler_la-Linear.Plo -rm -f ./$(DEPDIR)/libsampler_la-Metropolis.Plo -rm -f ./$(DEPDIR)/libsampler_la-MutableSampleMethod.Plo -rm -f ./$(DEPDIR)/libsampler_la-MutableSampler.Plo -rm -f ./$(DEPDIR)/libsampler_la-RWMetropolis.Plo -rm -f ./$(DEPDIR)/libsampler_la-Sampler.Plo -rm -f ./$(DEPDIR)/libsampler_la-SamplerFactory.Plo -rm -f ./$(DEPDIR)/libsampler_la-SingletonFactory.Plo -rm -f ./$(DEPDIR)/libsampler_la-Slicer.Plo -rm -f ./$(DEPDIR)/libsampler_la-StepAdapter.Plo -rm -f ./$(DEPDIR)/libsampler_la-TemperedMetropolis.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/sampler/Sampler.cc0000664000175000017500000000047214224052371014104 00000000000000#include #include #include using std::vector; namespace jags { Sampler::Sampler(GraphView *gv) : _gv(gv) { } Sampler::~Sampler() { delete _gv; } vector const &Sampler::nodes() const { return _gv->nodes(); } } //namespace jags JAGS-4.3.2/src/lib/sampler/GraphView.cc0000664000175000017500000002556014224052514014401 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::list; using std::runtime_error; using std::logic_error; using std::string; using std::copy; static unsigned int sumLength(vector const &nodes) { //Adds up the length of a vector of stochastic nodes unsigned int n = 0; for (unsigned int i = 0; i < nodes.size(); ++i) { n += nodes[i]->length(); } return n; } namespace jags { GraphView::GraphView(vector const &nodes, Graph const &graph, bool multilevel) : _length(sumLength(nodes)), _nodes(nodes), _stoch_children(0), _determ_children(0), _multilevel(false) { //Sanity check on node //FIXME: Could use a templated version of countChains here for (unsigned int i = 1; i < nodes.size(); ++i) { if (nodes[i]->nchain() != nodes[0]->nchain()) { throw logic_error("Chain mismatch in GraphView"); } } classifyChildren(nodes, graph, _stoch_children, _determ_children, multilevel); } vector const &GraphView::nodes() const { return _nodes; } static bool classifyNode(StochasticNode *snode, Graph const &sample_graph, set &sset, list &slist) { // classification function for stochastic nodes if (sset.count(snode)) return true; if (sample_graph.contains(snode)) { sset.insert(snode); slist.push_back(snode); return true; } else { return false; } } static bool classifyNode(DeterministicNode *dnode, Graph const &sample_graph, set &sset, list &slist, set &dset, list &dlist) { // Recursive classification function for deterministic nodes if (!sample_graph.contains(dnode)) return false; if (dset.count(dnode)) return true; bool informative = false; list::const_iterator p; for (p = dnode->stochasticChildren()->begin(); p != dnode->stochasticChildren()->end(); ++p) { if (classifyNode(*p, sample_graph, sset, slist)) informative = true; } list::const_iterator q; for (q = dnode->deterministicChildren()->begin(); q != dnode->deterministicChildren()->end(); ++q) { if (classifyNode(*q, sample_graph, sset, slist, dset, dlist)) informative = true; } if (informative) { dset.insert(dnode); dlist.push_back(dnode); } return informative; } void GraphView::classifyChildren(vector const &nodes, Graph const &graph, vector &stoch_nodes, vector &dtrm_nodes, bool multilevel) { set sset; set dset; list slist; list dlist; /* Classify children of each node */ vector::const_iterator p; for (p = nodes.begin(); p != nodes.end(); ++p) { if (!graph.contains(*p)) { throw logic_error("Sampled node outside of sampling graph"); } list const *sch = (*p)->stochasticChildren(); for (list::const_iterator q = sch->begin(); q != sch->end(); ++q) { classifyNode(*q, graph, sset, slist); } list const *dch = (*p)->deterministicChildren(); for (list::const_iterator q = dch->begin(); q != dch->end(); ++q) { classifyNode(*q, graph, sset, slist, dset, dlist); } } if (multilevel) { /* Strip nodes to be sampled out of the set of stochastic children. Such nodes would contribute to both the prior AND the likelihood, causing incorrect calculation of the log full conditional */ for (p = nodes.begin(); p != nodes.end(); ++p) { if (sset.count(*p)) { list::iterator i = find(slist.begin(), slist.end(), *p); if (i == slist.end()) { throw logic_error("error in ClassifyChildren"); } else { slist.erase(i); } } } /* We also need ensure that we calculate the full log density for each sampled node. */ _multilevel = true; } else { for (p = nodes.begin(); p != nodes.end(); ++p) { if (sset.count(*p)) { throw logic_error("Invalid multilevel GraphView"); } } } stoch_nodes.clear(); for (list::const_iterator i = slist.begin(); i != slist.end(); ++i) { stoch_nodes.push_back(*i); } dtrm_nodes.clear(); // Deterministic nodes are pushed onto dtrm_nodes in reverse order for (list::reverse_iterator i = dlist.rbegin(); i != dlist.rend(); ++i) { dtrm_nodes.push_back(*i); } } double GraphView::logFullConditional(unsigned int chain) const { PDFType pdf_prior = _multilevel ? PDF_FULL : PDF_PRIOR; double lprior = 0.0; vector::const_iterator p = _nodes.begin(); for (; p != _nodes.end(); ++p) { lprior += (*p)->logDensity(chain, pdf_prior); } double llike = 0.0; vector::const_iterator q = _stoch_children.begin(); for (; q != _stoch_children.end(); ++q) { llike += (*q)->logDensity(chain, PDF_LIKELIHOOD); } double lfc = lprior + llike; if(jags_isnan(lfc)) { /* Try to find where the calculation went wrong. At this point, we are definitely going to throw an exception. It's just a question of working out which error message. So we can afford to be laborious. */ //Check prior for (p = _nodes.begin(); p != _nodes.end(); ++p) { if (jags_isnan((*p)->logDensity(chain, pdf_prior))) { throw NodeError(*p, "Failure to calculate log density"); } } if (jags_isnan(lprior)) { throw runtime_error("Failure to calculate prior density"); } //Recalculate the deterministic children, checking for //invalid values vector::const_iterator r; for (r =_determ_children.begin(); r != _determ_children.end(); ++r) { if(!(*r)->checkParentValues(chain)) { throw NodeError(*r, "Invalid parent values"); } (*r)->deterministicSample(chain); } //Check likelihood for (q = _stoch_children.begin(); q != _stoch_children.end(); ++q) { if (jags_isnan((*q)->logDensity(chain, PDF_LIKELIHOOD))) { throw NodeError(*q, "Failure to calculate log density"); } } if (jags_isnan(llike)) { throw runtime_error("Failure to calculate likelihood"); } //This could happen adding -Inf to +Inf if (!jags_finite(lprior) && !jags_finite(llike)) { throw runtime_error("Prior and likelihood are incompatible"); } //Something else went wrong, but what? throw runtime_error("Failure to calculate log full conditional"); } return lfc; } double GraphView::logPrior(unsigned int chain) const { //In a multi-level GraphView we need to calculate the full log //density of each sampled node PDFType pdf_prior = _multilevel ? PDF_FULL : PDF_PRIOR; double lprior = 0.0; vector::const_iterator p = _nodes.begin(); for (; p != _nodes.end(); ++p) { lprior += (*p)->logDensity(chain, pdf_prior); } if(jags_isnan(lprior)) { //Try to find where the calculation went wrong for (p = _nodes.begin(); p != _nodes.end(); ++p) { if (jags_isnan((*p)->logDensity(chain, pdf_prior))) { throw NodeError(*p, "Failure to calculate log prior density"); } } throw logic_error("Failure in GraphView::logLikelihood"); } return lprior; } double GraphView::logLikelihood(unsigned int chain) const { double llik = 0.0; vector::const_iterator q = _stoch_children.begin(); for (; q != _stoch_children.end(); ++q) { llik += (*q)->logDensity(chain, PDF_LIKELIHOOD); } if(jags_isnan(llik)) { //Try to find where the calculation went wrong for (q = _stoch_children.begin(); q != _stoch_children.end(); ++q) { if (jags_isnan((*q)->logDensity(chain, PDF_LIKELIHOOD))) { throw NodeError(*q, "Failure to calculate log likelihood"); } } //This could happen if we try to add +Inf to -Inf throw logic_error("Failure in GraphView::logLikelihood"); } return llik; } vector const &GraphView::stochasticChildren() const { return _stoch_children; } vector const &GraphView::deterministicChildren() const { return _determ_children; } void GraphView::setValue(double const * value, unsigned int length, unsigned int chain) const { if (length != _length) { throw logic_error("Argument length mismatch in GraphView::setValue"); } for (unsigned int i = 0; i < _nodes.size(); ++i) { Node *node = _nodes[i]; node->setValue(value, node->length(), chain); value += node->length(); } for (vector::const_iterator p(_determ_children.begin()); p != _determ_children.end(); ++p) { (*p)->deterministicSample(chain); } } void GraphView::setValue(vector const &value, unsigned int chain) const { //FIXME We could inline this setValue(&value[0], value.size(), chain); } void GraphView::getValue(vector &value, unsigned int chain) const { if (value.size() != _length) throw logic_error("length mismatch in GraphView::getValue"); unsigned int k = 0; for (unsigned int i = 0; i < _nodes.size(); ++i) { double const *vi = _nodes[i]->value(chain); for (unsigned int j = 0; j < _nodes[i]->length(); ++j) { value[k++] = vi[j]; } } } unsigned int GraphView::length() const { return _length; } bool GraphView::isDependent(Node const *node) const { for (unsigned int i = 0; i < _nodes.size(); ++i) { if (_nodes[i] == node) return true; } for (unsigned int j = 0; j < _determ_children.size(); ++j) { if (_determ_children[j] == node) return true; } return false; } unsigned int nchain(GraphView const *gv) { return gv->nodes()[0]->nchain(); } void GraphView::checkFinite(unsigned int chain) const { vector::const_iterator p = _nodes.begin(); for ( ; p != _nodes.end(); ++p) { double ld = (*p)->logDensity(chain, PDF_PRIOR); if (jags_isnan(ld)) { throw NodeError(*p, "Error calculating log density"); } else if (ld == JAGS_NEGINF || (!jags_finite(ld) && ld < 0)) { throw NodeError(*p, "Node inconsistent with parents"); } } for (p =_stoch_children.begin(); p != _stoch_children.end(); ++p) { double ld = (*p)->logDensity(chain, PDF_PRIOR); if (jags_isnan(ld)) { throw NodeError(*p, "Error calculting log density"); } else if (ld == JAGS_NEGINF || (!jags_finite(ld) && ld < 0)) { throw NodeError(*p, "Node inconsistent with parents"); } } } } //namespace jags JAGS-4.3.2/src/lib/sampler/Slicer.cc0000664000175000017500000001277514224052514013732 00000000000000#include #include #include #include #include #include #include //Minimum length of adaptive phase before we adjust width #define MIN_ADAPT 50 using std::vector; using std::fabs; using std::runtime_error; namespace jags { Slicer::Slicer(double width, unsigned int max) : _width(width), _adapt(true), _max(max), _sumdiff(0), _iter(0), _state(SLICER_OK) { } bool Slicer::updateStep(RNG *rng) { // Test current value double g0 = logDensity(); if (!jags_finite(g0)) { if (g0 > 0) { _state = SLICER_POSINF; return false; //throw runtime_error("Singularity in likelihood found by Slicer"); } else { _state = SLICER_NEGINF; return false; //FIXME: Not very informative //throw runtime_error("Error in Slicer: Current value is inconsistent with data"); } } // Generate auxiliary variable double z = g0 - rng->exponential();; // Generate random interval of width "_width" about current value double xold = value(); double L = xold - rng->uniform() * _width; double R = L + _width; double lower = JAGS_NEGINF, upper = JAGS_POSINF; getLimits(&lower, &upper); // Stepping out // Randomly set number of steps in left and right directions, // subject to the limit in the maximal size of the interval int j = static_cast(rng->uniform() * _max); int k = _max - 1 - j; if (L < lower) { L = lower; } else { setValue(L); while (j-- > 0 && logDensity() > z) { L -= _width; if (L < lower) { L = lower; break; } setValue(L); } } if (R > upper) { R = upper; } else { setValue(R); while (k-- > 0 && logDensity() > z) { R += _width; if (R > upper) { R = upper; break; } setValue(R); } } // Keep sampling from the interval until acceptance (the loop is // guaranteed to terminate). double xnew; for(;;) { xnew = L + rng->uniform() * (R - L); setValue(xnew); double g = logDensity(); if (g >= z - DBL_EPSILON) { // Accept point break; } else { // shrink the interval if (xnew < xold) { L = xnew; } else { R = xnew; } } } if (_adapt) { _sumdiff += _iter * fabs(xnew - xold); ++_iter; if (_iter > MIN_ADAPT) { _width = 2 * _sumdiff / _iter / (_iter - 1); } } return true; } bool Slicer::updateDouble(RNG *rng) { using namespace std; // Test current value double g0 = logDensity(); if (!jags_finite(g0)) { if (g0 < 0) { _state = SLICER_NEGINF; return false; //throw runtime_error("Error in Slicer: Current value is inconsistent with data"); } else { _state = SLICER_POSINF; return false; //throw runtime_error("Singularity in likelihood found by Slicer"); } } // Generate auxiliary variable double z = g0 - rng->exponential(); // Generate random interval of width "_width" about current value double xold = value(); double L = xold - rng->uniform() * _width; double R = L + _width; double lower = JAGS_NEGINF, upper = JAGS_POSINF; getLimits(&lower, &upper); // Doubling bool left_ok = false, right_ok = false; for (unsigned int i = 0; i < _max; ++i) { if (rng->uniform() < 0.5) { if (L >= lower) { L = 2*L - R; if (L < lower) { left_ok = true; } else { setValue(L); left_ok = logDensity() < z; } } else { left_ok = true; } } else { if (R <= upper) { R = 2*R - L; if (R > upper) { right_ok = true; } else { setValue(R); right_ok = logDensity() < z; } } else { right_ok = true; } } if (left_ok && right_ok) break; } // Keep sampling from the interval until acceptance (the loop is // guaranteed to terminate). double Lbar = L, Rbar = R; double xnew; for(;;) { xnew = Lbar + rng->uniform() * (Rbar - Lbar); if (xnew >= lower && xnew <= upper) { setValue(xnew); double g = logDensity(); if (g >= z && accept(xold, xnew, z, L, R, lower, upper)) { // The accept function will alter the current value. So we // must reset it. setValue(xnew); break; } } // shrink the interval if (xnew <= xold) { Lbar = xnew; } else { Rbar = xnew; } } if (_adapt) { _sumdiff += _iter * fabs(xnew - xold); ++_iter; if (_iter > MIN_ADAPT) { _width = 2 * _sumdiff / _iter / (_iter - 1); } } return true; } bool Slicer::accept(double xold, double xnew, double z, double L, double R, double lower, double upper) { //Acceptance step for doubling update method bool d = false; while ((R - L) > 1.1 * _width) { double M = (L + R)/2; if ((xold < M && xnew >= M) || (xold >= M && xnew < M)) d = true; if (xnew < M) { R = M; } else { L = M; } if (d) { bool right_ok = true; if (R <= upper) { setValue(R); right_ok = logDensity() < z; } bool left_ok = true; if (L >= lower) { setValue(L); left_ok = logDensity() < z; } if (left_ok && right_ok) { return false; } } } return true; } void Slicer::adaptOff() { _adapt = false; } bool Slicer::checkAdaptation() const { //FIXME We could try a bit harder than this return (_iter > MIN_ADAPT); } bool Slicer::isAdaptive() const { return true; } SlicerState Slicer::state() const { return _state; } } //namespace jags JAGS-4.3.2/src/lib/sampler/Metropolis.cc0000664000175000017500000000155414224052514014637 00000000000000#include #include #include #include #include using std::logic_error; using std::vector; using std::copy; using std::min; namespace jags { Metropolis::Metropolis(vector const &value) : _last_value(value), _adapt(true) { } Metropolis::~Metropolis() { } bool Metropolis::accept(RNG *rng, double prob) { bool accept = rng->uniform() <= prob; if (accept) { //Store current value as last accepted value getValue(_last_value); } else { //Revert to last accepted value setValue(_last_value); } if (_adapt) { rescale(min(prob, 1.0)); } return accept; } void Metropolis::adaptOff() { _adapt = false; } bool Metropolis::isAdaptive() const { return true; } unsigned int Metropolis::length() const { return _last_value.size(); } } //namespace jags JAGS-4.3.2/src/lib/sampler/RWMetropolis.cc0000664000175000017500000000305614224052514015107 00000000000000#include #include #include #include #include using std::vector; using std::log; using std::exp; using std::fabs; namespace jags { RWMetropolis::RWMetropolis(vector const &value, double step, double prob) : Metropolis(value), _step_adapter(step, prob), _pmean(0), _niter(2) { } RWMetropolis::~RWMetropolis() { } void RWMetropolis::rescale(double p) { _step_adapter.rescale(p); // We keep a weighted mean estimate of the mean acceptance probability // with the weights in favour of more recent iterations _pmean += 2 * (p - _pmean) / _niter; _niter++; } void RWMetropolis::update(RNG *rng) { vector value(length()); getValue(value); double log_p = logDensity() + logJacobian(value); step(value, _step_adapter.stepSize(), rng); setValue(value); double log_p_new = logDensity() + logJacobian(value); double odds = ( jags_finite( log_p ) && jags_finite( log_p_new ) ) ? exp( log_p_new - log_p ) : ( log_p_new > log_p ? 1 : 0 ); accept(rng, odds); } bool RWMetropolis::checkAdaptation() const { if (_pmean == 0 || _pmean == 1) { return false; } return fabs(_step_adapter.logitDeviation(_pmean)) < 0.5; } void RWMetropolis::step(vector &value, double s, RNG *rng) const { for (unsigned int i = 0; i < value.size(); ++i) { value[i] += rng->normal() * s; } } double RWMetropolis::logJacobian(vector const &value) const { return 0; } } //namespace jags JAGS-4.3.2/src/lib/sampler/MutableSampleMethod.cc0000664000175000017500000000024014224052514016365 00000000000000#include #include namespace jags { MutableSampleMethod::~MutableSampleMethod() { } } //namespace jags JAGS-4.3.2/src/lib/sampler/ImmutableSampleMethod.cc0000664000175000017500000000024614224052514016721 00000000000000#include #include namespace jags { ImmutableSampleMethod::~ImmutableSampleMethod() { } } //namespace jags JAGS-4.3.2/src/lib/sampler/Linear.cc0000664000175000017500000001257414224052514013720 00000000000000#include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::list; namespace jags { typedef bool (DeterministicNode::*NodeCheckFn) (GraphMarks const&, bool) const; static bool isLink(DeterministicNode const *dnode) { return dynamic_cast(dnode) != 0; } bool checkAdditive(SingletonGraphView const *sgv, bool fixed) { vector const &dn = sgv->deterministicChildren(); set ancestors; ancestors.insert(sgv->node()); for (unsigned int i = 0; i < dn.size(); ++i) { if(dn[i]->isClosed(ancestors, DNODE_ADDITIVE, fixed)) { ancestors.insert(dn[i]); } else { return false; } } return true; } bool checkAdditive(vector const &snodes, Graph const &graph, bool fixed) { //A GraphView is additive if every SingletonGraphview for each //sampled node in the same graph is additive. for (unsigned int i = 0; i < snodes.size(); ++i) { SingletonGraphView sgv(snodes[i], graph); if (!checkAdditive(&sgv, false)) return false; } if (!fixed) return true; //If we want to ensure that the additive function has a fixed //intercept, we need to ensure that all parent nodes of //deterministic children are either additive nodes themselves //or are fixed. set ancestors; //Sampled nodes are trivial (fixed) additive functions of themselves #ifndef _RWSTD_NO_MEMBER_TEMPLATES ancestors.insert(snodes.begin(), snodes.end()); #else //Workaround for Solaris libCstd for (vector::const_iterator p = snodes.begin(); p != snodes.end(); ++p) { ancestors.insert(*p); } #endif GraphView gv(snodes, graph); vector const &dn = gv.deterministicChildren(); for (unsigned int j = 0; j < dn.size(); ++j) { vector parj = dn[j]->parents(); for (unsigned int k = 0; k < parj.size(); ++k) { if (ancestors.count(parj[k]) == 0 && !parj[k]->isFixed()) { return false; } } ancestors.insert(dn[j]); } return true; } bool checkLinear(GraphView const *gv, bool fixed, bool link) { vector const &dn = gv->deterministicChildren(); set ancestors; //Sampled nodes are trivial (fixed) linear functions of themselves #ifndef _RWSTD_NO_MEMBER_TEMPLATES ancestors.insert(gv->nodes().begin(), gv->nodes().end()); #else //Workaround for Solaris libCstd for (vector::const_iterator p = gv->nodes().begin(); p != gv->nodes().end(); ++p) { ancestors.insert(*p); } #endif for (unsigned int j = 0; j < dn.size(); ++j) { if (dn[j]->isClosed(ancestors, DNODE_LINEAR, fixed)) { ancestors.insert(dn[j]); } else if (link && isLink(dn[j])) { // A link function is allowed if no other deterministic // nodes in the GraphView depend on it. set dset; list const *dc = dn[j]->deterministicChildren(); #ifndef _RWSTD_NO_MEMBER_TEMPLATES dset.insert(dc->begin(), dc->end()); #else for (list::const_iterator p = dc->begin(); p != dc->end(); ++p) { dset.insert(*p); } #endif for (unsigned int k = j + 1; k < dn.size(); ++k) { if (dset.count(dn[k])) { return false; } } } else { return false; } } return true; } bool checkScale(GraphView const *gv, bool fixed) { vector const &dnodes = gv->deterministicChildren(); set ancestors; //FIXME: valid for multiple nodes? #ifdef _RWSTD_NO_MEMBER_TEMPLATES //Workaround for Solaris libCstd for (vector::const_iterator p = gv->nodes().begin(); p != gv->nodes().end(); ++p) { ancestors.insert(*p); } #else ancestors.insert(gv->nodes().begin(), gv->nodes().end()); #endif //Start off looking for scale transformations, then fall back on //scale mixture transformations if fixed is false. bool mix = false; for (unsigned int j = 0; j < dnodes.size(); ++j) { if (!mix) { if (dnodes[j]->isClosed(ancestors, DNODE_SCALE, fixed)) { ancestors.insert(dnodes[j]); } else if (!fixed) { mix = true; } else { return false; } } if (mix) { if (dnodes[j]->isClosed(ancestors, DNODE_SCALE_MIX, false)) { ancestors.insert(dnodes[j]); } else { return false; } } } return true; } bool checkPower(GraphView const *gv, bool fixed) { set ancestors; #ifndef _RWSTD_NO_MEMBER_TEMPLATES ancestors.insert(gv->nodes().begin(), gv->nodes().end()); #else //Workaround for Solaris libCstd for (vector::const_iterator p = gv->nodes().begin(); p != gv->nodes().end(); ++p) { ancestors.insert(*p); } #endif vector const &dnodes = gv->deterministicChildren(); for (unsigned int j = 0; j < dnodes.size(); ++j) { if (dnodes[j]->isClosed(ancestors, DNODE_POWER, fixed)) { ancestors.insert(dnodes[j]); } else { return false; } } return true; } } //namespace jags JAGS-4.3.2/src/lib/sampler/SamplerFactory.cc0000664000175000017500000000042014224052514015424 00000000000000#include #include /* We must have a real destructor, even though it doesn't do anything, * otherwise the destructors for child classes never get called */ namespace jags { SamplerFactory::~SamplerFactory() { } } //namespace jags JAGS-4.3.2/src/lib/sampler/SingletonFactory.cc0000664000175000017500000000103414224052371015766 00000000000000#include #include #include using std::vector; using std::list; namespace jags { vector SingletonFactory::makeSamplers(list const &nodes, Graph const &graph) const { vector samplers; for (list::const_iterator p = nodes.begin(); p != nodes.end(); ++p) { if (canSample(*p, graph)) { samplers.push_back(makeSampler(*p, graph)); } } return samplers; } } //namespace jags JAGS-4.3.2/src/lib/sampler/StepAdapter.cc0000664000175000017500000000256714224052371014724 00000000000000#include #include #include #include #include #include using std::min; using std::log; using std::exp; using std::logic_error; /* The value _n controls the reduction in the step size when rescale is called. There is no reason to give it an initial value of zero. In fact this is a poor choice since the step size would be immediately halved. We start with a value of 10 so the first change in step size is 10%. */ #define INITIAL_N 10 namespace jags { StepAdapter::StepAdapter(double step, double prob) : _prob(prob), _lstep(log(step)), _p_over_target(false), _n(INITIAL_N) { if (prob < 0 || prob > 1 || step < 0) throw logic_error("Invalid initial values in StepAdapter"); } void StepAdapter::rescale(double p) { p = min(p, 1.0); _lstep += (p - _prob) / _n; if ((p > _prob) != _p_over_target) { // Reduce the step size only when the acceptance probability // crosses the target value. This allows us to adapt quickly // to a poor initial choice of scale. _p_over_target = !_p_over_target; _n++; } } double StepAdapter::stepSize() const { return exp(_lstep); } double StepAdapter::logitDeviation(double p) const { double logit_target = log(_prob/(1 - _prob)); double logit_p = log(p/(1 - p)); return logit_target - logit_p; } } //namespace jags JAGS-4.3.2/src/lib/sampler/TemperedMetropolis.cc0000664000175000017500000000771314224052514016330 00000000000000#include #include #include #include #include using std::vector; using std::invalid_argument; using std::log; using std::exp; using std::fabs; //Minimum number of iterations before we can go to the next level #define MIN_STEP 50 static vector makePower(int max_level, double max_temp) { vector pwr(max_level + 1); double delta = log(max_temp) / max_level; for (int t = 0; t <= max_level; ++t) { pwr[t] = exp(-t * delta); } return pwr; } namespace jags { TemperedMetropolis::TemperedMetropolis(vector const &value, int max_level, double max_temp, unsigned int nrep) : Metropolis(value), _max_level(max_level), _nrep(nrep), _pwr(makePower(max_level, max_temp)), _t(0), _tmax(1), _step_adapter(0), _pmean(0), _niter(2) { if (max_temp <= 1) { throw invalid_argument("Invalid max_temp in TemperedMetropolis "); } if (max_level <= 0) { throw invalid_argument("Invalid max_level in TemperedMetropolis"); } _step_adapter.push_back(0); StepAdapter *adapter = new StepAdapter(0.1); _step_adapter.push_back(adapter); } TemperedMetropolis::~TemperedMetropolis() { for (unsigned int i = 1; i < _step_adapter.size(); ++i) { delete _step_adapter[i]; } } void TemperedMetropolis::temperedUpdate(RNG *rng, double &lprior0, double &llik0, vector &value0) { vector x = value0; for (unsigned int r = 0; r < _nrep; ++r) { step(x, _step_adapter[_t]->stepSize(), rng); setValue(x); double lprior1 = logPrior() + logJacobian(x); double llik1 = logLikelihood(); double lprob = (lprior1 - lprior0) + _pwr[_t] * (llik1 - llik0); if (accept(rng, exp(lprob))) { lprior0 = lprior1; llik0 = llik1; value0 = x; } else { x = value0; } } } void TemperedMetropolis::update(RNG *rng) { //Save the current state vector last_value(length()); getValue(last_value); //Make copies of the current state and log density //These are modified in place by temperedUpdate double log_prior = logPrior() + logJacobian(last_value); double log_lik = logLikelihood(); vector current_value = last_value; double log_global_prob = 0; for (_t = 1; _t <= _tmax; _t++) { log_global_prob += (_pwr[_t] - _pwr[_t-1]) * log_lik; temperedUpdate(rng, log_prior, log_lik, current_value); } for (_t = _tmax; _t >= 1; _t--) { temperedUpdate(rng, log_prior, log_lik, current_value); log_global_prob -= (_pwr[_t] - _pwr[_t-1]) * log_lik; } //Global Metropolis-Hastings acceptance step if (!accept(rng, exp(log_global_prob))) { //Force return to last good value setValue(last_value); accept(rng, 1.0); } } void TemperedMetropolis::rescale(double p) { if (_t == 0) return; //No adaptation for global acceptance step _step_adapter[_t]->rescale(p); if (_t == _tmax && _tmax < _max_level) { // We keep a weighted mean estimate of the mean acceptance probability // with the weights in favour of more recent iterations _pmean += 2 * (p - _pmean) / _niter++; // If mean acceptance probability is in target range, increase // temperature to the next level. We enforce a delay of // MIN_STEP iterations first. double delta = _step_adapter[_t]->logitDeviation(_pmean); if (_niter > MIN_STEP + 2 && fabs(delta) < 0.25) { _niter = 2; _pmean = 0; _tmax++; double step = _step_adapter.back()->stepSize(); StepAdapter *adapter = new StepAdapter(step); _step_adapter.push_back(adapter); } } } bool TemperedMetropolis::checkAdaptation() const { return (_tmax == _max_level); } void TemperedMetropolis::step(vector &value, double s, RNG *rng) const { for (unsigned int i = 0; i < value.size(); ++i) { value[i] += rng->normal() * s; } } double TemperedMetropolis::logJacobian(vector const &value) const { return 0; } } //namespace jags JAGS-4.3.2/src/lib/sampler/MutableSampler.cc0000664000175000017500000000250314224052514015412 00000000000000#include #include #include #include #include using std::vector; using std::logic_error; using std::string; namespace jags { MutableSampler::MutableSampler(GraphView *gv, vector const &methods, std::string const &name) : Sampler(gv), _methods(methods), _name(name) { } MutableSampler::~MutableSampler() { for (unsigned int ch = 0; ch < _methods.size(); ++ch) { delete _methods[ch]; } } void MutableSampler::update(vector const &rngs) { for (unsigned int ch = 0; ch < rngs.size(); ++ch) { _methods[ch]->update(rngs[ch]); } } void MutableSampler::adaptOff() { for (unsigned int ch = 0; ch < _methods.size(); ++ch) { _methods[ch]->adaptOff(); } } bool MutableSampler::checkAdaptation() const { for (unsigned int ch = 0; ch < _methods.size(); ++ch) { if (!_methods[ch]->checkAdaptation()) return false; } return true; } bool MutableSampler::isAdaptive() const { for (unsigned int ch = 0; ch < _methods.size(); ++ch) { if (_methods[ch]->isAdaptive()) return true; } return false; } string MutableSampler::name() const { return _name; } } //namespace jags JAGS-4.3.2/src/lib/sampler/ImmutableSampler.cc0000664000175000017500000000166414224052514015747 00000000000000#include #include //Needed for name #include //Needed for nchain #include using std::vector; using std::string; namespace jags { ImmutableSampler::ImmutableSampler(GraphView *gv, ImmutableSampleMethod *method, std::string const &name) : Sampler(gv), _method(method), _nchain(nchain(gv)), _name(name) { } ImmutableSampler::~ImmutableSampler() { delete _method; } void ImmutableSampler::update(vector const &rngs) { for (unsigned int ch = 0; ch < _nchain; ++ch) { _method->update(ch, rngs[ch]); } } bool ImmutableSampler::isAdaptive() const { return false; } void ImmutableSampler::adaptOff() { } bool ImmutableSampler::checkAdaptation() const { return true; } string ImmutableSampler::name() const { return _name; } } JAGS-4.3.2/src/lib/graph/0000755000175000017500000000000014400711324011677 500000000000000JAGS-4.3.2/src/lib/graph/Makefile.am0000664000175000017500000000070414224052514013661 00000000000000noinst_LTLIBRARIES = libgraph.la libgraph_la_CPPFLAGS = -I$(top_srcdir)/src/include libgraph_la_SOURCES = Node.cc DeterministicNode.cc AggNode.cc \ MixtureNode.cc MixTab.cc LogicalNode.cc ConstantNode.cc \ StochasticNode.cc Graph.cc GraphMarks.cc NodeError.cc \ ScalarLogicalNode.cc LinkNode.cc VectorLogicalNode.cc \ ArrayLogicalNode.cc VSLogicalNode.cc ScalarStochasticNode.cc \ VectorStochasticNode.cc ArrayStochasticNode.cc ParentError.cc JAGS-4.3.2/src/lib/graph/Makefile.in0000644000175000017500000013552214400675235013706 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/graph ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libgraph_la_LIBADD = am_libgraph_la_OBJECTS = libgraph_la-Node.lo \ libgraph_la-DeterministicNode.lo libgraph_la-AggNode.lo \ libgraph_la-MixtureNode.lo libgraph_la-MixTab.lo \ libgraph_la-LogicalNode.lo libgraph_la-ConstantNode.lo \ libgraph_la-StochasticNode.lo libgraph_la-Graph.lo \ libgraph_la-GraphMarks.lo libgraph_la-NodeError.lo \ libgraph_la-ScalarLogicalNode.lo libgraph_la-LinkNode.lo \ libgraph_la-VectorLogicalNode.lo \ libgraph_la-ArrayLogicalNode.lo libgraph_la-VSLogicalNode.lo \ libgraph_la-ScalarStochasticNode.lo \ libgraph_la-VectorStochasticNode.lo \ libgraph_la-ArrayStochasticNode.lo libgraph_la-ParentError.lo libgraph_la_OBJECTS = $(am_libgraph_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libgraph_la-AggNode.Plo \ ./$(DEPDIR)/libgraph_la-ArrayLogicalNode.Plo \ ./$(DEPDIR)/libgraph_la-ArrayStochasticNode.Plo \ ./$(DEPDIR)/libgraph_la-ConstantNode.Plo \ ./$(DEPDIR)/libgraph_la-DeterministicNode.Plo \ ./$(DEPDIR)/libgraph_la-Graph.Plo \ ./$(DEPDIR)/libgraph_la-GraphMarks.Plo \ ./$(DEPDIR)/libgraph_la-LinkNode.Plo \ ./$(DEPDIR)/libgraph_la-LogicalNode.Plo \ ./$(DEPDIR)/libgraph_la-MixTab.Plo \ ./$(DEPDIR)/libgraph_la-MixtureNode.Plo \ ./$(DEPDIR)/libgraph_la-Node.Plo \ ./$(DEPDIR)/libgraph_la-NodeError.Plo \ ./$(DEPDIR)/libgraph_la-ParentError.Plo \ ./$(DEPDIR)/libgraph_la-ScalarLogicalNode.Plo \ ./$(DEPDIR)/libgraph_la-ScalarStochasticNode.Plo \ ./$(DEPDIR)/libgraph_la-StochasticNode.Plo \ ./$(DEPDIR)/libgraph_la-VSLogicalNode.Plo \ ./$(DEPDIR)/libgraph_la-VectorLogicalNode.Plo \ ./$(DEPDIR)/libgraph_la-VectorStochasticNode.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libgraph_la_SOURCES) DIST_SOURCES = $(libgraph_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libgraph.la libgraph_la_CPPFLAGS = -I$(top_srcdir)/src/include libgraph_la_SOURCES = Node.cc DeterministicNode.cc AggNode.cc \ MixtureNode.cc MixTab.cc LogicalNode.cc ConstantNode.cc \ StochasticNode.cc Graph.cc GraphMarks.cc NodeError.cc \ ScalarLogicalNode.cc LinkNode.cc VectorLogicalNode.cc \ ArrayLogicalNode.cc VSLogicalNode.cc ScalarStochasticNode.cc \ VectorStochasticNode.cc ArrayStochasticNode.cc ParentError.cc all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/graph/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/graph/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libgraph.la: $(libgraph_la_OBJECTS) $(libgraph_la_DEPENDENCIES) $(EXTRA_libgraph_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libgraph_la_OBJECTS) $(libgraph_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-AggNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-ArrayLogicalNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-ArrayStochasticNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-ConstantNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-DeterministicNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-Graph.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-GraphMarks.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-LinkNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-LogicalNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-MixTab.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-MixtureNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-Node.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-NodeError.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-ParentError.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-ScalarLogicalNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-ScalarStochasticNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-StochasticNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-VSLogicalNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-VectorLogicalNode.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgraph_la-VectorStochasticNode.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libgraph_la-Node.lo: Node.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-Node.lo -MD -MP -MF $(DEPDIR)/libgraph_la-Node.Tpo -c -o libgraph_la-Node.lo `test -f 'Node.cc' || echo '$(srcdir)/'`Node.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-Node.Tpo $(DEPDIR)/libgraph_la-Node.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Node.cc' object='libgraph_la-Node.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-Node.lo `test -f 'Node.cc' || echo '$(srcdir)/'`Node.cc libgraph_la-DeterministicNode.lo: DeterministicNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-DeterministicNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-DeterministicNode.Tpo -c -o libgraph_la-DeterministicNode.lo `test -f 'DeterministicNode.cc' || echo '$(srcdir)/'`DeterministicNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-DeterministicNode.Tpo $(DEPDIR)/libgraph_la-DeterministicNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DeterministicNode.cc' object='libgraph_la-DeterministicNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-DeterministicNode.lo `test -f 'DeterministicNode.cc' || echo '$(srcdir)/'`DeterministicNode.cc libgraph_la-AggNode.lo: AggNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-AggNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-AggNode.Tpo -c -o libgraph_la-AggNode.lo `test -f 'AggNode.cc' || echo '$(srcdir)/'`AggNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-AggNode.Tpo $(DEPDIR)/libgraph_la-AggNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='AggNode.cc' object='libgraph_la-AggNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-AggNode.lo `test -f 'AggNode.cc' || echo '$(srcdir)/'`AggNode.cc libgraph_la-MixtureNode.lo: MixtureNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-MixtureNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-MixtureNode.Tpo -c -o libgraph_la-MixtureNode.lo `test -f 'MixtureNode.cc' || echo '$(srcdir)/'`MixtureNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-MixtureNode.Tpo $(DEPDIR)/libgraph_la-MixtureNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MixtureNode.cc' object='libgraph_la-MixtureNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-MixtureNode.lo `test -f 'MixtureNode.cc' || echo '$(srcdir)/'`MixtureNode.cc libgraph_la-MixTab.lo: MixTab.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-MixTab.lo -MD -MP -MF $(DEPDIR)/libgraph_la-MixTab.Tpo -c -o libgraph_la-MixTab.lo `test -f 'MixTab.cc' || echo '$(srcdir)/'`MixTab.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-MixTab.Tpo $(DEPDIR)/libgraph_la-MixTab.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MixTab.cc' object='libgraph_la-MixTab.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-MixTab.lo `test -f 'MixTab.cc' || echo '$(srcdir)/'`MixTab.cc libgraph_la-LogicalNode.lo: LogicalNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-LogicalNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-LogicalNode.Tpo -c -o libgraph_la-LogicalNode.lo `test -f 'LogicalNode.cc' || echo '$(srcdir)/'`LogicalNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-LogicalNode.Tpo $(DEPDIR)/libgraph_la-LogicalNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LogicalNode.cc' object='libgraph_la-LogicalNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-LogicalNode.lo `test -f 'LogicalNode.cc' || echo '$(srcdir)/'`LogicalNode.cc libgraph_la-ConstantNode.lo: ConstantNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-ConstantNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-ConstantNode.Tpo -c -o libgraph_la-ConstantNode.lo `test -f 'ConstantNode.cc' || echo '$(srcdir)/'`ConstantNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-ConstantNode.Tpo $(DEPDIR)/libgraph_la-ConstantNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ConstantNode.cc' object='libgraph_la-ConstantNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-ConstantNode.lo `test -f 'ConstantNode.cc' || echo '$(srcdir)/'`ConstantNode.cc libgraph_la-StochasticNode.lo: StochasticNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-StochasticNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-StochasticNode.Tpo -c -o libgraph_la-StochasticNode.lo `test -f 'StochasticNode.cc' || echo '$(srcdir)/'`StochasticNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-StochasticNode.Tpo $(DEPDIR)/libgraph_la-StochasticNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='StochasticNode.cc' object='libgraph_la-StochasticNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-StochasticNode.lo `test -f 'StochasticNode.cc' || echo '$(srcdir)/'`StochasticNode.cc libgraph_la-Graph.lo: Graph.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-Graph.lo -MD -MP -MF $(DEPDIR)/libgraph_la-Graph.Tpo -c -o libgraph_la-Graph.lo `test -f 'Graph.cc' || echo '$(srcdir)/'`Graph.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-Graph.Tpo $(DEPDIR)/libgraph_la-Graph.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Graph.cc' object='libgraph_la-Graph.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-Graph.lo `test -f 'Graph.cc' || echo '$(srcdir)/'`Graph.cc libgraph_la-GraphMarks.lo: GraphMarks.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-GraphMarks.lo -MD -MP -MF $(DEPDIR)/libgraph_la-GraphMarks.Tpo -c -o libgraph_la-GraphMarks.lo `test -f 'GraphMarks.cc' || echo '$(srcdir)/'`GraphMarks.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-GraphMarks.Tpo $(DEPDIR)/libgraph_la-GraphMarks.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GraphMarks.cc' object='libgraph_la-GraphMarks.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-GraphMarks.lo `test -f 'GraphMarks.cc' || echo '$(srcdir)/'`GraphMarks.cc libgraph_la-NodeError.lo: NodeError.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-NodeError.lo -MD -MP -MF $(DEPDIR)/libgraph_la-NodeError.Tpo -c -o libgraph_la-NodeError.lo `test -f 'NodeError.cc' || echo '$(srcdir)/'`NodeError.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-NodeError.Tpo $(DEPDIR)/libgraph_la-NodeError.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='NodeError.cc' object='libgraph_la-NodeError.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-NodeError.lo `test -f 'NodeError.cc' || echo '$(srcdir)/'`NodeError.cc libgraph_la-ScalarLogicalNode.lo: ScalarLogicalNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-ScalarLogicalNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-ScalarLogicalNode.Tpo -c -o libgraph_la-ScalarLogicalNode.lo `test -f 'ScalarLogicalNode.cc' || echo '$(srcdir)/'`ScalarLogicalNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-ScalarLogicalNode.Tpo $(DEPDIR)/libgraph_la-ScalarLogicalNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ScalarLogicalNode.cc' object='libgraph_la-ScalarLogicalNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-ScalarLogicalNode.lo `test -f 'ScalarLogicalNode.cc' || echo '$(srcdir)/'`ScalarLogicalNode.cc libgraph_la-LinkNode.lo: LinkNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-LinkNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-LinkNode.Tpo -c -o libgraph_la-LinkNode.lo `test -f 'LinkNode.cc' || echo '$(srcdir)/'`LinkNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-LinkNode.Tpo $(DEPDIR)/libgraph_la-LinkNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LinkNode.cc' object='libgraph_la-LinkNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-LinkNode.lo `test -f 'LinkNode.cc' || echo '$(srcdir)/'`LinkNode.cc libgraph_la-VectorLogicalNode.lo: VectorLogicalNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-VectorLogicalNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-VectorLogicalNode.Tpo -c -o libgraph_la-VectorLogicalNode.lo `test -f 'VectorLogicalNode.cc' || echo '$(srcdir)/'`VectorLogicalNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-VectorLogicalNode.Tpo $(DEPDIR)/libgraph_la-VectorLogicalNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='VectorLogicalNode.cc' object='libgraph_la-VectorLogicalNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-VectorLogicalNode.lo `test -f 'VectorLogicalNode.cc' || echo '$(srcdir)/'`VectorLogicalNode.cc libgraph_la-ArrayLogicalNode.lo: ArrayLogicalNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-ArrayLogicalNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-ArrayLogicalNode.Tpo -c -o libgraph_la-ArrayLogicalNode.lo `test -f 'ArrayLogicalNode.cc' || echo '$(srcdir)/'`ArrayLogicalNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-ArrayLogicalNode.Tpo $(DEPDIR)/libgraph_la-ArrayLogicalNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArrayLogicalNode.cc' object='libgraph_la-ArrayLogicalNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-ArrayLogicalNode.lo `test -f 'ArrayLogicalNode.cc' || echo '$(srcdir)/'`ArrayLogicalNode.cc libgraph_la-VSLogicalNode.lo: VSLogicalNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-VSLogicalNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-VSLogicalNode.Tpo -c -o libgraph_la-VSLogicalNode.lo `test -f 'VSLogicalNode.cc' || echo '$(srcdir)/'`VSLogicalNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-VSLogicalNode.Tpo $(DEPDIR)/libgraph_la-VSLogicalNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='VSLogicalNode.cc' object='libgraph_la-VSLogicalNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-VSLogicalNode.lo `test -f 'VSLogicalNode.cc' || echo '$(srcdir)/'`VSLogicalNode.cc libgraph_la-ScalarStochasticNode.lo: ScalarStochasticNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-ScalarStochasticNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-ScalarStochasticNode.Tpo -c -o libgraph_la-ScalarStochasticNode.lo `test -f 'ScalarStochasticNode.cc' || echo '$(srcdir)/'`ScalarStochasticNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-ScalarStochasticNode.Tpo $(DEPDIR)/libgraph_la-ScalarStochasticNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ScalarStochasticNode.cc' object='libgraph_la-ScalarStochasticNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-ScalarStochasticNode.lo `test -f 'ScalarStochasticNode.cc' || echo '$(srcdir)/'`ScalarStochasticNode.cc libgraph_la-VectorStochasticNode.lo: VectorStochasticNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-VectorStochasticNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-VectorStochasticNode.Tpo -c -o libgraph_la-VectorStochasticNode.lo `test -f 'VectorStochasticNode.cc' || echo '$(srcdir)/'`VectorStochasticNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-VectorStochasticNode.Tpo $(DEPDIR)/libgraph_la-VectorStochasticNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='VectorStochasticNode.cc' object='libgraph_la-VectorStochasticNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-VectorStochasticNode.lo `test -f 'VectorStochasticNode.cc' || echo '$(srcdir)/'`VectorStochasticNode.cc libgraph_la-ArrayStochasticNode.lo: ArrayStochasticNode.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-ArrayStochasticNode.lo -MD -MP -MF $(DEPDIR)/libgraph_la-ArrayStochasticNode.Tpo -c -o libgraph_la-ArrayStochasticNode.lo `test -f 'ArrayStochasticNode.cc' || echo '$(srcdir)/'`ArrayStochasticNode.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-ArrayStochasticNode.Tpo $(DEPDIR)/libgraph_la-ArrayStochasticNode.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArrayStochasticNode.cc' object='libgraph_la-ArrayStochasticNode.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-ArrayStochasticNode.lo `test -f 'ArrayStochasticNode.cc' || echo '$(srcdir)/'`ArrayStochasticNode.cc libgraph_la-ParentError.lo: ParentError.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libgraph_la-ParentError.lo -MD -MP -MF $(DEPDIR)/libgraph_la-ParentError.Tpo -c -o libgraph_la-ParentError.lo `test -f 'ParentError.cc' || echo '$(srcdir)/'`ParentError.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgraph_la-ParentError.Tpo $(DEPDIR)/libgraph_la-ParentError.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ParentError.cc' object='libgraph_la-ParentError.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgraph_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libgraph_la-ParentError.lo `test -f 'ParentError.cc' || echo '$(srcdir)/'`ParentError.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libgraph_la-AggNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-ArrayLogicalNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-ArrayStochasticNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-ConstantNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-DeterministicNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-Graph.Plo -rm -f ./$(DEPDIR)/libgraph_la-GraphMarks.Plo -rm -f ./$(DEPDIR)/libgraph_la-LinkNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-LogicalNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-MixTab.Plo -rm -f ./$(DEPDIR)/libgraph_la-MixtureNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-Node.Plo -rm -f ./$(DEPDIR)/libgraph_la-NodeError.Plo -rm -f ./$(DEPDIR)/libgraph_la-ParentError.Plo -rm -f ./$(DEPDIR)/libgraph_la-ScalarLogicalNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-ScalarStochasticNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-StochasticNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-VSLogicalNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-VectorLogicalNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-VectorStochasticNode.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libgraph_la-AggNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-ArrayLogicalNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-ArrayStochasticNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-ConstantNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-DeterministicNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-Graph.Plo -rm -f ./$(DEPDIR)/libgraph_la-GraphMarks.Plo -rm -f ./$(DEPDIR)/libgraph_la-LinkNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-LogicalNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-MixTab.Plo -rm -f ./$(DEPDIR)/libgraph_la-MixtureNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-Node.Plo -rm -f ./$(DEPDIR)/libgraph_la-NodeError.Plo -rm -f ./$(DEPDIR)/libgraph_la-ParentError.Plo -rm -f ./$(DEPDIR)/libgraph_la-ScalarLogicalNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-ScalarStochasticNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-StochasticNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-VSLogicalNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-VectorLogicalNode.Plo -rm -f ./$(DEPDIR)/libgraph_la-VectorStochasticNode.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/graph/Node.cc0000664000175000017500000001175014224052514013024 00000000000000#include #include #include #include #include #include #include using std::string; using std::vector; using std::logic_error; using std::copy; using std::find; using std::list; namespace jags { class DeterminsticNode; class StochasticNode; Node::Node(vector const &dim, unsigned int nchain) : _parents(0), _stoch_children(0), _dtrm_children(0), _dim(getUnique(dim)), _length(product(dim)), _nchain(nchain), _data(0) { if (nchain==0) throw logic_error("Node must have at least one chain"); unsigned int N = _length * _nchain; _data = new double[N]; for (unsigned int i = 0; i < N; ++i) { _data[i] = JAGS_NA; } _dtrm_children = new list; _stoch_children = new list; } Node::Node(vector const &dim, unsigned int nchain, vector const &parents) : _parents(parents), _stoch_children(0), _dtrm_children(0), _dim(getUnique(dim)), _length(product(dim)), _nchain(nchain), _data(0) { if (nchain==0) throw logic_error("Node must have at least one chain"); unsigned int N = _length * _nchain; _data = new double[N]; for (unsigned int i = 0; i < N; ++i) { _data[i] = JAGS_NA; } _stoch_children = new list; _dtrm_children = new list; } Node::~Node() { delete [] _data; delete _stoch_children; delete _dtrm_children; } vector const &Node::parents() const { return _parents; } list const *Node::stochasticChildren() { return _stoch_children; } list const *Node::deterministicChildren() { return _dtrm_children; } static bool isInitialized(Node const *node, unsigned int n) { double const *value = node->value(n); for (unsigned int i = 0; i < node->length(); ++i) { if (value[i] == JAGS_NA) return false; } return true; } bool Node::initialize(unsigned int n) { // Test whether node is already initialized and, if so, skip it if (isInitialized(this, n)) return true; // Check that parents are initialized for (unsigned int i = 0; i < _parents.size(); ++i) { if (!isInitialized(_parents[i], n)) { return false; // Uninitialized parent } } deterministicSample(n); return true; } unsigned int Node::nchain() const { return _nchain; } unsigned int countChains(vector const ¶meters) { unsigned int nchain = parameters.empty() ? 0 : parameters[0]->nchain(); for (unsigned int i = 1; i < parameters.size(); ++i) { if (parameters[i]->nchain() != nchain) { nchain = 0; break; } } return nchain; } void Node::setValue(double const *value, unsigned int length, unsigned int chain) { if (length != _length) throw NodeError(this, "Length mismatch in Node::setValue"); if (chain >= _nchain) throw NodeError(this, "Invalid chain in Node::setValue"); copy(value, value + _length, _data + chain * _length); } void Node::swapValue(unsigned int chain1, unsigned int chain2) { double *value1 = _data + chain1 * _length; double *value2 = _data + chain2 * _length; for (unsigned int i = 0; i < _length; ++i) { double v = value1[i]; value1[i] = value2[i]; value2[i] = v; } } double const *Node::value(unsigned int chain) const { return _data + chain * _length; } vector const &Node::dim() const { return _dim; } unsigned int Node::length() const { return _length; } void Node::addChild(DeterministicNode *node) const { _dtrm_children->push_back(node); } void Node::addChild(StochasticNode *node) const { _stoch_children->push_back(node); } void Node::removeChild(DeterministicNode *node) const { /* Removes the given node from the list of deterministic children. When Model::~Model is called, all nodes are deleted in reverse order of construction. In this case, the element of _dtrm_node to remove is the last one. For efficiency, we therefore search for the element of _dtrm_node to remove starting at the end. (NB Searching from the beginning results in quadratic complexity in the size of _dtrm_node, which can cause real efficiency problems when deleting a model) */ list::reverse_iterator p = find(_dtrm_children->rbegin(), _dtrm_children->rend(), node); if (p != _dtrm_children->rend()) { //The erase function only accepts iterators. Some shennanigans //are required to convert the reverse iterator correctly. _dtrm_children->erase((++p).base()); } } void Node::removeChild(StochasticNode *node) const { /* See comments in removeChild for DeterministicNodes */ list::reverse_iterator p = find(_stoch_children->rbegin(), _stoch_children->rend(), node); if (p != _stoch_children->rend()) { _stoch_children->erase((++p).base()); } } } //namespace jags JAGS-4.3.2/src/lib/graph/DeterministicNode.cc0000664000175000017500000000310614224052514015544 00000000000000#include #include using std::vector; using std::set; namespace jags { DeterministicNode::DeterministicNode(vector const &dim, unsigned int nchain, vector const &parents) : Node(dim, nchain, parents), _fixed(true) { //Add this node as a deterministic child of its parents //taking care to avoid repeats set pset; for (unsigned int i = 0; i < parents.size(); ++i) { Node const *p = parents[i]; if (pset.insert(p).second) { p->addChild(this); } } //Deterministic nodes are not fixed if any parents are not fixed vector::const_iterator p; for (p = parents.begin(); p != parents.end(); ++p) { if (!(*p)->isFixed()) { _fixed = false; break; } } /* Fixed deterministic nodes should be immediately initialized by calling deterministicSample. We can't do this here because this is a virtual function. So we have to do it in whatever sub-class defines the deterministicSample member function. */ } DeterministicNode::~DeterministicNode() { } void DeterministicNode::randomSample(RNG*, unsigned int chain) { deterministicSample(chain); } RVStatus DeterministicNode::randomVariableStatus() const { return RV_FALSE; } bool DeterministicNode::isFixed() const { return _fixed; } void DeterministicNode::unlinkParents() { for (unsigned int i = 0; i < parents().size(); ++i) { parents()[i]->removeChild(this); } } } //namespace jags JAGS-4.3.2/src/lib/graph/AggNode.cc0000664000175000017500000001335414224052514013445 00000000000000 #include #include #include #include #include #include using std::vector; using std::set; using std::logic_error; using std::length_error; using std::out_of_range; using std::string; namespace jags { /* Two utility functions "substitute_parents" and "substitute_offsets" ensure that an AggNode is never the parent of another AggNode, even if it was originally defined this way. The substitution makes subsetting of aggregate nodes more efficient. For example: X <- A[4:8] Y <- X[3:4] is equivalent to X <- A[4:8] Y <- A[7:8] Without the substitute_* functions, node A would be a grand-parent of node Y instead of a parent. */ static vector sub_parents(vector const &parents, vector const &offsets) { // Substitute parent nodes that are themselves AggNodes vector newparents(parents); for (unsigned int i = 0; i < parents.size(); i++) { AggNode const *aggpar = dynamic_cast(parents[i]); if (aggpar) { newparents[i] = aggpar->parents()[offsets[i]]; } } return newparents; } static vector sub_offsets(vector const &parents, vector const &offsets) { // Substitute offsets for parents that are themselves AggNodes vector newoffsets(offsets); for (unsigned int i = 0; i < offsets.size(); i++) { AggNode const *aggpar = dynamic_cast(parents[i]); if (aggpar) { newoffsets[i] = aggpar->offsets()[offsets[i]]; } } return newoffsets; } AggNode::AggNode(vector const &dim, unsigned int nchain, vector const &parents, vector const &offsets) : DeterministicNode(dim, nchain, sub_parents(parents, offsets)), _offsets(sub_offsets(parents, offsets)), _parent_values(_length * nchain), _discrete(true) { // Check argument lengths if (_length != parents.size() || _length != offsets.size()) { throw length_error ("Length mismatch in Aggregate Node constructor"); } /* Note that we cannot use the original arguments "parents" and "offsets" due to possible substitution. Use this->parents() and _offsets instead. */ vector const &par = this->parents(); // Check that offsets are valid for (unsigned int i = 0; i < _length; i++) { if (_offsets[i] >= par[i]->length()) throw out_of_range("Invalid offset in Aggregate Node constructor"); } // Setup parent values for (unsigned int ch = 0; ch < _nchain; ++ch) { for (unsigned int i = 0; i < _length; ++i) { _parent_values[i + ch * _length] = par[i]->value(ch) + _offsets[i]; } } // Check discreteness for (unsigned int i = 0; i < par.size(); ++i) { if (!par[i]->isDiscreteValued()) { _discrete = false; break; } } // Initialize if fixed. See comments in the DeterministicNode constructor if (isFixed()) { for (unsigned int ch = 0; ch < _nchain; ++ch) { deterministicSample(ch); } } } AggNode::~AggNode() { } void AggNode::deterministicSample(unsigned int chain) { unsigned int N = _length * chain; for (unsigned int i = 0; i < _length; ++i) { _data[i + N] = *_parent_values[i + N]; } } AggNode const *asAggregate(Node *node) { return dynamic_cast(node); } /* bool AggNode::isLinear(GraphMarks const &linear_marks, bool fixed) const { vector const &par = parents(); for (unsigned int i = 0; i < par.size(); ++i) { if (linear_marks.graph().contains(par[i])) { switch(linear_marks.mark(par[i])) { case MARK_NULL: case MARK_TRUE: break; case MARK_FALSE: return false; break; default: throw logic_error("Invalid graphmarks in AggNode::isLinear"); } } } return true; } */ bool AggNode::isClosed(set const &ancestors, ClosedFuncClass fc, bool fixed) const { switch(fc) { case DNODE_ADDITIVE: { //Only one parent may be additive, and it must be completely //embedded in the AggNode Node const *pnode = 0; vector pmask; vector const &par = parents(); for (unsigned int i = 0; i < par.size(); ++i) { if (ancestors.count(par[i])) { if (pnode == 0) { pnode = par[i]; pmask = vector(pnode->length(), false); } else { if (par[i] != pnode) return false; if (pmask[_offsets[i]]) return false; } pmask[_offsets[i]] = true; } else if (fixed) { if (!par[i]->isFixed()) return false; } } if (!allTrue(pmask)) return false; } break; case DNODE_SCALE: //All parents must be scale transformations for (unsigned int i = 0; i < parents().size(); ++i) { if (ancestors.count(parents()[i]) == 0) { return false; } } break; case DNODE_SCALE_MIX: //The aggnode must be a subset so only one distinct parent if (ancestors.count(parents()[0]) == 0) return false; for (unsigned int i = 1; i < parents().size(); ++i) { if (parents()[i] != parents()[0]) return false; } break; case DNODE_LINEAR: break; case DNODE_POWER: return false; break; } return true; } bool AggNode::checkParentValues(unsigned int) const { return true; } string AggNode::deparse(vector const &parents) const { return string("aggregate(") + parents.front() + "..." + parents.back() + ")"; } /* DeterministicNode * AggNode::clone(vector const &parents) const { return new AggNode(this->dim(), parents, _offsets); } */ bool AggNode::isDiscreteValued() const { return _discrete; } vector const &AggNode::offsets() const { return _offsets; } } //namespace jags JAGS-4.3.2/src/lib/graph/MixtureNode.cc0000664000175000017500000002031414224052514014376 00000000000000#include #include #include #include #include #include #include #include #include using std::vector; using std::map; using std::invalid_argument; using std::logic_error; using std::set; using std::string; using std::pair; namespace jags { typedef map > MixTabMap; static MixTabMap &mixTabMap() { // Repository of MixTab objects that are shared between // MixtureNodes. We use reference counting to keep track of // whether a MixTab is in use. static MixTabMap _map; return _map; } static MixTab const *getTable(MixMap const &mixmap) { // Returns a MixTab object from the repository corresponding // to the given MixMap. // N.B. This must be called only by the MixtureNode // constructor! MixTabMap &tabmap = mixTabMap(); MixTabMap::iterator p = tabmap.find(mixmap); if (p == tabmap.end()) { //MixTab does not exist in repository; create and //insert a new one. MixTab *newtab = new MixTab(mixmap); MixTabMap::mapped_type newentry(newtab, 1); p = tabmap.insert(MixTabMap::value_type(mixmap, newentry)).first; } else { //MixTab already exists in the repository; increment //reference count p->second.second++; } return p->second.first; } static MixTabMap::iterator findTable(MixTab const *table) { // Inverse lookup of the MixTab repository using the MixTab MixTabMap &tabmap = mixTabMap(); MixTabMap::iterator p = tabmap.begin(); for( ; p != tabmap.end(); ++p) { if (p->second.first == table) { return p; } } throw logic_error("Failed to find MixTab in MixtureNode"); return p; //Wall } static void removeTable(MixTab const *table) { // Decrements the reference count of a MixTab in the shared // repository. When the reference count reaches zero, the MixTab // is removed. // N.B. This must be called only by the MixtureNode destructor! MixTabMap::iterator p = findTable(table); p->second.second--; if (p->second.second == 0) { mixTabMap().erase(p); } } /* Calculates the dimensions of a mixture node given its possible parent values. If the parents have inconsistent dimensions, then a logic error is thrown. */ static vector const &mkDim(MixMap const &mixmap) { MixMap::const_iterator p = mixmap.begin(); vector const &dim = p->second->dim(); for (++p ; p != mixmap.end(); ++p) { if (p->second->dim() != dim) { throw logic_error("Dimension mismatch in MixtureNode parents"); } } return dim; } /* Creates a vector of parent nodes from the arguments passed to the constructor. The index nodes come first, in the order supplied, then the parents supplied in the mixmap parameter, in the order determined by the corresponding indices. */ static vector mkParents(vector const &index, MixMap const &mixmap) { vector parents; parents.reserve(index.size() + mixmap.size()); for (unsigned int i = 0; i < index.size(); ++i) { parents.push_back(index[i]); } for (map, Node const *>::const_iterator p = mixmap.begin(); p != mixmap.end(); ++p) { parents.push_back(p->second); } return parents; } MixtureNode::MixtureNode (vector const &index, unsigned int nchain, MixMap const &mixmap) : DeterministicNode(mkDim(mixmap), nchain, mkParents(index, mixmap)), _table(getTable(mixmap)), _Nindex(index.size()), _discrete(true), _active_parents(nchain) { // Check validity of index argument if (index.empty()) throw invalid_argument("NULL index in MixtureNode constructor"); for (vector::const_iterator i = index.begin(); i != index.end(); ++i) { Node const *node = *i; if (node->length() != 1 || !node->isDiscreteValued() || node->isFixed()) { throw invalid_argument("Invalid index in MixtureNode constructor"); } } // Check validity of MixMap argument if (mixmap.size() < 2) throw invalid_argument("Trivial MixMap in MixtureNode constructor"); // Check consistency of arguments if (index.size() != mixmap.begin()->first.size()) { throw invalid_argument("Dimension mismatch in MixtureNode constructor"); } //Check discreteness vector const &par = parents(); for (unsigned int i = _Nindex; i < par.size(); ++i) { if (!par[i]->isDiscreteValued()) { _discrete = false; break; } } } MixtureNode::~MixtureNode() { removeTable(_table); } /* Do not delete commented sections: they are useful for debugging #include #include #include #include */ void MixtureNode::updateActive(unsigned int chain) { vector i(_Nindex); vector const &par = parents(); for (unsigned int j = 0; j < _Nindex; ++j) { i[j] = static_cast(*par[j]->value(chain)); } _active_parents[chain] = _table->getNode(i); if (_active_parents[chain] == 0) { /* std::cout << "Got " << print(Range(i)) << "\nOriginally\n"; for (unsigned int j = 0; j < _Nindex; ++j) { std::cout << par[j]->value(chain)[0] << "\n"; if (par[j]->value(chain)[0] == JAGS_NA) std::cout << "(which is missing)\n"; } */ throw NodeError(this, "Invalid index in MixtureNode"); } } void MixtureNode::deterministicSample(unsigned int chain) { updateActive(chain); setValue(_active_parents[chain]->value(chain), length(), chain); } Node const *MixtureNode::activeParent(unsigned int chain) const { return _active_parents[chain]; } unsigned int MixtureNode::index_size() const { return _Nindex; } string MixtureNode::deparse(vector const &parents) const { string name = "mixture(index=["; vector i(_Nindex); for (unsigned int j = 0; j < _Nindex; ++j) { if (j > 0) { name.append(","); } name.append(parents[j]); } name.append("], parents= "); /* We can't list all possible parents in a name, since there is no limit on the number. So we take the first and last */ name.append(parents[_Nindex]); //first parent if (parents.size() > _Nindex + 2) { name.append("..."); } else { name.append(","); } name.append(parents.back()); //last parent name.append(")"); return name; } MixtureNode const *asMixture(Node const *node) { return dynamic_cast(node); } bool isMixture(Node const *node) { return dynamic_cast(node); } bool MixtureNode::isClosed(set const &ancestors, ClosedFuncClass fc, bool fixed) const { if (fixed) return false; //Check that none of the indices are in the ancestor set vector const &par = parents(); for (unsigned int i = 0; i < _Nindex; ++i) { if (ancestors.count(par[i])) { return false; } } switch(fc) { case DNODE_LINEAR: case DNODE_SCALE_MIX: case DNODE_POWER: break; case DNODE_SCALE: case DNODE_ADDITIVE: //Only a scale or additive function if all possible parents are scale //or additive functions, respectively. for (unsigned int i = _Nindex; i < par.size(); ++i) { if (ancestors.count(par[i])==0) return false; } break; } return true; } bool MixtureNode::checkParentValues(unsigned int chain) const { return true; } /* DeterministicNode *MixtureNode::clone(vector const &parents) const { vector index(_Nindex); vector::const_iterator p = parents.begin(); for (unsigned int i = 0; i < _Nindex; ++i) { index[i] = *p; ++p; } // Find the MixMap corresponding to this node, and copy it MixMap mixmap = findTable(_table)->first; // Replace entries in the copy MixMap::const_iterator q = mixmap.begin(); while (p != parents.end() && q != mixmap.end()) { mixmap[q->first] = *p; ++q; ++p; } return new MixtureNode(index, mixmap); } */ bool MixtureNode::isDiscreteValued() const { return _discrete; } MixTab const *MixtureNode::mixTab() const { return _table; } } //namespace jags JAGS-4.3.2/src/lib/graph/MixTab.cc0000664000175000017500000000414114224052514013317 00000000000000#include #include #include using std::vector; using std::map; using std::logic_error; namespace jags { static SimpleRange mkRange(map, Node const *> const &mixmap) { /* Calculates the smallest SimpleRange enclosing the index values in the MixMap. Also checks for consistency in the lengths of the index values. */ map, Node const *>::const_iterator p = mixmap.begin(); unsigned int N = p->first.size(); vector lower(p->first), upper(p->first); for (++p ; p != mixmap.end(); ++p) { if (p->first.size() != N) { throw logic_error("index size mismatch in MixTab"); } for (unsigned int j = 0; j < N; ++j) { int i = p->first[j]; if (i < lower[j]) lower[j] = i; if (i > upper[j]) upper[j] = i; } } return SimpleRange(lower, upper); } MixTab::MixTab(map, Node const *> const &mixmap) : _range(mkRange(mixmap)), _nodes(_range.length(), 0) { for (map, Node const *>::const_iterator p = mixmap.begin(); p != mixmap.end(); ++p) { _nodes[_range.leftOffset(p->first)] = p->second; } } Node const * MixTab::getNode(vector const &index) const { //FIXME: This needs an API change. See src/lib/SimpleRange.cc //if (!_range.contains(index)) return 0; unsigned int offset = _range.leftOffset(index); return _nodes[offset]; } Range const &MixTab::range() const { return _range; } /* double MixTab::density() { MixTab::const_iterator p = _map.begin(); vector lower(p->first), upper(p->first); unsigned int N = p->first.size(); // Find a range containing the indices for (++p ; p != _map.end(); ++p) { for (unsigned int j = 0; j < N; ++j) { int i = p->first[j]; if (i < lower[j]) lower[j] = i; if (i > upper[j]) upper[j] = i; } } // Density is the number of indices actually used divided by // the number of possible indices in the enclosing range. double numerator = _map.size(); double denominator = Range(lower, upper).length(); return numerator / denominator; } */ } JAGS-4.3.2/src/lib/graph/LogicalNode.cc0000664000175000017500000000530614224052514014317 00000000000000#include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::string; using std::set; using std::logic_error; namespace jags { static vector > mkParams(vector const &parents, unsigned int nchain) { vector > ans(nchain); for (unsigned int n = 0; n < nchain; ++n) { ans[n].reserve(parents.size()); for (unsigned long j = 0; j < parents.size(); ++j) { ans[n].push_back(parents[j]->value(n)); } } return ans; } LogicalNode::LogicalNode(vector const &dim, unsigned int nchain, vector const ¶meters, Function const *function) : DeterministicNode(dim, nchain, parameters), _func(function), _discrete(false), _parameters(mkParams(parameters, nchain)) { if (!checkNPar(function, parameters.size())) { throw FuncError(function, "Incorrect number of arguments"); } vector mask(parents().size()); for (unsigned long j = 0; j < parents().size(); ++j) { mask[j] = parents()[j]->isDiscreteValued(); } if (!_func->checkParameterDiscrete(mask)) { throw FuncError(function, "Failed check for discrete-valued arguments"); } _discrete = _func->isDiscreteValued(mask); } string LogicalNode::deparse(vector const &parents) const { string name = "("; name.append(_func->deparse(parents)); name.append(")"); return name; } bool LogicalNode::isClosed(set const &ancestors, ClosedFuncClass fc, bool fixed) const { vector const &par = parents(); vector mask(par.size()); vector fixed_mask; unsigned int nmask = 0; for (unsigned int i = 0; i < par.size(); ++i) { mask[i] = ancestors.count(par[i]); if (mask[i]) { ++nmask; } if (fixed) { fixed_mask.push_back(par[i]->isFixed()); } } if (nmask == 0) { throw logic_error("Invalid mask in LogicalNode::isClosed"); } switch(fc) { case DNODE_ADDITIVE: return _func->isAdditive(mask, fixed_mask); break; case DNODE_LINEAR: return _func->isLinear(mask, fixed_mask); break; case DNODE_SCALE: return _func->isScale(mask, fixed_mask); break; case DNODE_SCALE_MIX: return (nmask == 1) && _func->isScale(mask, fixed_mask); break; case DNODE_POWER: return _func->isPower(mask, fixed_mask); break; } return false; //Wall } bool LogicalNode::isDiscreteValued() const { return _discrete; } } //namespace jags JAGS-4.3.2/src/lib/graph/ConstantNode.cc0000664000175000017500000000340114224052514014530 00000000000000#include #include #include #include #include using std::vector; using std::string; using std::ostringstream; using std::floor; using std::logic_error; namespace jags { ConstantNode::ConstantNode(double value, unsigned int nchain, bool observed) : Node(vector(1,1), nchain), _observed(observed) { for (unsigned int n = 0; n < nchain; ++n) { setValue(&value, 1, n); } } ConstantNode::ConstantNode(vector const &dim, vector const &value, unsigned int nchain, bool observed) : Node(dim, nchain), _observed(observed) { if (value.size() != _length) { throw logic_error("Invalid value in ConstantNode"); } for (unsigned int n = 0; n < nchain; ++n) { setValue(&value[0], _length, n); } } bool ConstantNode::isDiscreteValued() const { double const *val = value(0); for (unsigned int i = 0; i < _length; ++i) { if (val[i] != floor(val[i])) return false; } return true; } void ConstantNode::deterministicSample(unsigned int) {} void ConstantNode::randomSample(RNG*, unsigned int) {} string ConstantNode::deparse(vector const &parents) const { ostringstream os; if (length() == 1) { os << *value(0); } else { os << "c(" << value(0)[0] << "..." << value(0)[length() - 1] << ")"; } return os.str(); } bool ConstantNode::checkParentValues(unsigned int) const { return true; } bool ConstantNode::isFixed() const { return true; } RVStatus ConstantNode::randomVariableStatus() const { return _observed ? RV_TRUE_OBSERVED : RV_FALSE; } void ConstantNode::unlinkParents() { } } //namespace jags JAGS-4.3.2/src/lib/graph/StochasticNode.cc0000664000175000017500000001476614224052514015063 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::string; using std::runtime_error; using std::logic_error; using std::set; namespace jags { static vector mkParents(vector const ¶meters, Node const *lower, Node const *upper) { //Add bounds to vector of parents, if they are non-zero vector parents = parameters; if (lower) { parents.push_back(lower); } if (upper) { parents.push_back(upper); } return parents; } static bool mkDiscrete(Distribution const *dist, vector const ¶meters) { //Determine whether node is discrete-valued vector mask(parameters.size()); for (unsigned int i = 0; i < parameters.size(); ++i) { mask[i] = parameters[i]->isDiscreteValued(); } if (!dist->checkParameterDiscrete(mask)) { throw DistError(dist, "Failed check for discrete-valued parameters"); } return(dist->isDiscreteValued(mask)); } StochasticNode::StochasticNode(vector const &dim, unsigned int nchain, Distribution const *dist, vector const ¶meters, Node const *lower, Node const *upper) : Node(dim, nchain, mkParents(parameters, lower, upper)), _dist(dist), _lower(lower), _upper(upper), _observed(false), _discrete(mkDiscrete(dist, parameters)), _parameters(nchain) { if (!checkNPar(dist, parameters.size())) { throw DistError(_dist, "Incorrect number of parameters"); } //check boundaries if ((lower && lower->dim() != this->dim()) || (upper && upper->dim() != this->dim())) { throw DistError(_dist, "Dimension mismatch when setting bounds"); } if (!_dist->canBound() && (lower || upper)) { throw DistError(_dist, "Distribution cannot be bounded"); } //Set up parameter vectors for (unsigned int n = 0; n < nchain; ++n) { _parameters[n].reserve(parameters.size()); for (unsigned int i = 0; i < parameters.size(); ++i) { _parameters[n].push_back(parameters[i]->value(n)); } } //Insert the current node as a child in all its parents //taking care to avoid repeats set pset; for (unsigned int i = 0; i < parents().size(); ++i) { Node const *p = parents()[i]; if (pset.insert(p).second) { p->addChild(this); } } } StochasticNode::~StochasticNode() { } Distribution const *StochasticNode::distribution() const { return _dist; } bool StochasticNode::isDiscreteValued() const { return _discrete; } bool StochasticNode::isFixed() const { return _observed; } RVStatus StochasticNode::randomVariableStatus() const { return _observed ? RV_TRUE_OBSERVED : RV_TRUE_UNOBSERVED; } string StochasticNode::deparse(vector const &parnames) const { unsigned int npar = parnames.size(); if (_upper) --npar; if (_lower) --npar; if (!checkNPar(_dist, npar)) { //We might be deparsing after throwing a NodeError, so we //don't want to throw another exception. return _dist->name() + "(deparse error)"; } string name = _dist->name(); name.append("("); unsigned int i = 0; for ( ; i < npar; ++i) { if (i != 0) { name.append(","); } name.append(parnames[i]); } name.append(")"); if (_lower || _upper) { name.append(" T("); if (_lower) { name.append(parnames[i++]); } name.append(","); if (_upper) { name.append(parnames[i++]); } name.append(")"); } return name; } Node const *StochasticNode::lowerBound() const { return _lower; } Node const *StochasticNode::upperBound() const { return _upper; } /* StochasticNode * StochasticNode::clone(vector const &parents) const { vector param(parents); //Peel off upper and lower bounds Node const *lower = lowerBound(); Node const *upper = upperBound(); if (upper) { param.pop_back(); } if (lower) { param.pop_back(); } return clone(param, lower, upper); } */ double const *StochasticNode::lowerLimit(unsigned int chain) const { return _lower ? _lower->value(chain) : 0; } double const *StochasticNode::upperLimit(unsigned int chain) const { return _upper ? _upper->value(chain) : 0; } bool isSupportFixed(StochasticNode const *node) { if (node->lowerBound() && !node->lowerBound()->isFixed()) return false; if (node->upperBound() && !node->upperBound()->isFixed()) return false; vector parents = node->parents(); if (node->upperBound()) parents.pop_back(); if (node->lowerBound()) parents.pop_back(); vector fixmask(parents.size()); for (unsigned int i = 0; i < parents.size(); ++i) { fixmask[i] = parents[i]->isFixed(); } return node->distribution()->isSupportFixed(fixmask); } void StochasticNode::support(double *lower, double *upper, unsigned int length, unsigned int chain) const { if (length != _length) { throw logic_error("Length mismatch in StochasticNode support"); } // Get support without bounds sp(lower, upper, length, chain); if (_lower || _upper) { if (!distribution()->canBound()) { throw logic_error("Bounded node has non-boundable distribution"); } if (_lower) { double const *lb = _lower->value(chain); for (unsigned int i = 0; i < length; ++i) { if (lower[i] < lb[i]) lower[i] = lb[i]; } } if (_upper) { double const *ub = _upper->value(chain); for (unsigned int i = 0; i < length; ++i) { if (upper[i] > ub[i]) upper[i] = ub[i]; } } } } bool isBounded(StochasticNode const *node) { return node->lowerBound() || node->upperBound(); } void StochasticNode::setData(double const *value, unsigned int length) { for (unsigned int n = 0; n < _nchain; ++n) { setValue(value, length, n); } _observed = true; } void StochasticNode::unlinkParents() { for (unsigned int i = 0; i < parents().size(); ++i) { parents()[i]->removeChild(this); } } } //namespace jags JAGS-4.3.2/src/lib/graph/Graph.cc0000664000175000017500000000077614224052371013207 00000000000000#include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::invalid_argument; using std::logic_error; using std::reverse; namespace jags { Graph::Graph() {} bool Graph::contains(Node const *node) const { return find(const_cast(node)) != end(); } } JAGS-4.3.2/src/lib/graph/GraphMarks.cc0000664000175000017500000001016214224052514014172 00000000000000#include #include #include #include #include #include #include #include #include using std::map; using std::vector; using std::set; using std::logic_error; using std::pair; using std::list; namespace jags { /* This is a helper class for the markAncestors member function. A GMIterator moves across a vector of Nodes. A dereferencing operator and a prefix increment operator are provided so that it behaves like an STL iterator. Unlike an STL iterator, however, a GMIterator stores its end position. The atEnd member function can be used to test whether the iterator has moved beyond the last element of the vector. */ class GMIterator { vector::const_iterator _begin, _end; public: GMIterator(vector const &v) : _begin(v.begin()), _end(v.end()) {} inline Node const * operator*() const { return *_begin; } inline bool atEnd() const { return _begin == _end; } inline void operator++() { ++_begin; } }; GraphMarks::GraphMarks(Graph const &graph) : _graph(graph) { } GraphMarks::~GraphMarks() {} Graph const &GraphMarks::graph() const { return _graph; } void GraphMarks::mark(Node const *node, int m) { if (!_graph.contains(node)) { throw logic_error("Attempt to set mark of node not in graph"); } if (m == 0) { _marks.erase(node); } else { _marks[node] = m; } } int GraphMarks::mark(Node const *node) const { if (!_graph.contains(node)) { throw logic_error("Attempt to get mark of node not in Graph"); } map::const_iterator i = _marks.find(node); if (i == _marks.end()) { return 0; } else { return i->second; } } void GraphMarks::clear() { _marks.clear(); } void GraphMarks::markParents(Node const *node, int m) { if (!_graph.contains(node)) { throw logic_error("Can't mark parents of node: not in Graph"); } else { vector const &parents = node->parents(); for (vector::const_iterator p = parents.begin(); p != parents.end(); ++p) { if (_graph.contains(*p)) { _marks[*p] = m; } } } } //FIXME //Used by MixtureSampler factory void GraphMarks::markParents(Node const *node, bool (*test)(Node const *), int m) { if (!_graph.contains(node)) { throw logic_error("Can't mark parents of node: not in Graph"); } vector const &parents = node->parents(); for (vector::const_iterator p = parents.begin(); p != parents.end(); ++p) { Node const *parent = *p; if (_graph.contains(parent)) { if (test(parent)) { _marks[parent] = m; } else { markParents(parent, test, m); } } } } void GraphMarks::markAncestors(vector const &nodes, int m) { set visited; //visited nodes vector ancestors; //ancestor nodes /* Do a depth-first search of the graph to find all the ancestors of the given Nodes in the graph. The set "visited" keeps track of previously visited nodes for efficiency. Ancestors are pushed back on to the vector "ancestors" in the order they are found. We could do this with a recursive helper function, but it is safer to iterate. So we keep our own stack of GMIterators to record the current position on the graph. The GMIterator class is defined above. */ vector stack; stack.push_back(GMIterator(nodes)); while (!stack.empty()) { for (GMIterator &p = stack.back(); !p.atEnd(); ++p) { if (visited.count(*p) == 0 && _graph.contains(*p)) { visited.insert(*p); ancestors.push_back(*p); stack.push_back(GMIterator((*p)->parents())); break; } } if (stack.back().atEnd()) { stack.pop_back(); } } /* Now set the marks of all ancestors */ for(vector::const_iterator p = ancestors.begin(); p != ancestors.end(); ++p) { if (m == 0) { _marks.erase(*p); } else { _marks[*p] = m; } } } } //namespace jags JAGS-4.3.2/src/lib/graph/NodeError.cc0000664000175000017500000000071014224052514014030 00000000000000#include #include #include using std::string; using std::ostream; using std::endl; namespace jags { NodeError::NodeError(Node const *node, string const &msg) : runtime_error(msg), _node(node) { } void NodeError::printMessage(ostream &out, SymTab const &symtab) const { out << "Error in node " << symtab.getName(_node) << "\n" << what() << endl; } } //namespace jags JAGS-4.3.2/src/lib/graph/ScalarLogicalNode.cc0000664000175000017500000000324314224052514015443 00000000000000#include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::string; using std::set; using std::logic_error; namespace jags { ScalarLogicalNode::ScalarLogicalNode(ScalarFunction const *function, unsigned int nchain, vector const ¶meters) : LogicalNode(vector(1,1), nchain, parameters, function), _func(function) { if (!function) { throw logic_error("NULL function in ScalarLogicalNode constructor"); } for (unsigned int j = 0; j < parameters.size(); ++j) { if (isFlat(parameters[j]->dim())) { string msg("Invalid zero-length parameter to function "); msg.append(function->name()); throw NodeError(parameters[j], msg); } else if (!isScalar(parameters[j]->dim())) { string msg("Invalid non-scalar parameter to function "); msg.append(function->name()); throw NodeError(parameters[j], msg); } } if (isFixed()) { for (unsigned int ch = 0; ch < nchain; ++ch) { deterministicSample(ch); } } } void ScalarLogicalNode::deterministicSample(unsigned int chain) { _data[chain] = _func->evaluate(_parameters[chain]); } bool ScalarLogicalNode::checkParentValues(unsigned int chain) const { return _func->checkParameterValue(_parameters[chain]); } /* DeterministicNode * ScalarLogicalNode::clone(vector const &parents) const { return new ScalarLogicalNode(_func, parents); } */ } //namespace jags JAGS-4.3.2/src/lib/graph/LinkNode.cc0000664000175000017500000000261114224052514013636 00000000000000#include #include #include #include #include #include #include #include using std::vector; using std::string; using std::set; using std::logic_error; using std::runtime_error; namespace jags { class GraphMarks; LinkNode::LinkNode(LinkFunction const *function, unsigned int nchain, vector const &parents) : LogicalNode(vector(1,1), nchain, parents, function), _func(function) { if (!isScalar(parents[0]->dim())) { throw runtime_error("Invalid parent dims in LinkNode"); } // Initialize if fully observed if (isFixed()) { for (unsigned int ch = 0; ch < _nchain; ++ch) { deterministicSample(ch); } } } void LinkNode::deterministicSample(unsigned int chain) { _data[chain] = _func->inverseLink(*_parameters[chain][0]); } bool LinkNode::checkParentValues(unsigned int chain) const { return true; } /* DeterministicNode * LinkNode::clone(vector const &parents) const { return new LinkNode(_func, parents); } */ double LinkNode::eta(unsigned int chain) const { return *_parameters[chain][0]; } double LinkNode::grad(unsigned int chain) const { return _func->grad(*_parameters[chain][0]); } string const &LinkNode::linkName() const { return _func->linkName(); } } //namespace jags JAGS-4.3.2/src/lib/graph/VectorLogicalNode.cc0000664000175000017500000000524714224052514015506 00000000000000#include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::string; using std::set; using std::logic_error; namespace jags { static unsigned int valueLength(VectorFunction const *func, vector const &parents) { /* Calculates length of vector logical node as a function of its parents. */ unsigned long N = parents.size(); vector lengths(N); vector fixed(N), discrete(N); vector values(N); for (unsigned int j = 0; j < N; ++j) { lengths[j] = parents[j]->length(); fixed[j] = parents[j]->isFixed(); values[j] = parents[j]->value(0); discrete[j] = parents[j]->isDiscreteValued(); } if (!func) { throw logic_error("NULL function in VectorLogicalNode constructor"); } if (!checkNPar(func, N)) { throw FuncError(func, "Incorrect number of parameters"); } if (!func->checkParameterLength(lengths)) { throw FuncError(func, "Non-conforming parameters"); } if (!func->checkParameterFixed(fixed)) { throw FuncError(func, "Expected parameters with fixed values"); } if (!func->checkParameterDiscrete(discrete)) { throw FuncError(func, "Failed check for discrete-valued parameters"); } return func->length(lengths, values); } static vector const & parameterLengths(vector const ¶meters) { vector lengths(parameters.size()); for (unsigned int j = 0; j < parameters.size(); ++j) { lengths[j] = parameters[j]->length(); } return getUnique(lengths); } VectorLogicalNode::VectorLogicalNode(VectorFunction const *function, unsigned int nchain, vector const ¶meters) : LogicalNode(vector(1,valueLength(function, parameters)), nchain, parameters, function), _func(function), _lengths(parameterLengths(parameters)) { if (isFixed()) { for (unsigned int ch = 0; ch < _nchain; ++ch) { deterministicSample(ch); } } } void VectorLogicalNode::deterministicSample(unsigned int chain) { _func->evaluate(_data + chain * _length, _parameters[chain], _lengths); } bool VectorLogicalNode::checkParentValues(unsigned int chain) const { return _func->checkParameterValue(_parameters[chain], _lengths); } /* DeterministicNode * VectorLogicalNode::clone(vector const &parents) const { return new VectorLogicalNode(_func, parents); } */ } //namespace jags JAGS-4.3.2/src/lib/graph/ArrayLogicalNode.cc0000664000175000017500000000501514224052514015313 00000000000000#include #include #include #include #include #include #include #include using std::vector; using std::string; using std::logic_error; namespace jags { static vector mkDim(ArrayFunction const *func, vector const &parents) { /* Calculates dimension of logical node as a function of its parameters. */ unsigned long N = parents.size(); vector > dims(N); vector fixed(N), discrete(N); vector values(N); for (unsigned int j = 0; j < N; ++j) { dims[j] = parents[j]->dim(); fixed[j] = parents[j]->isFixed(); values[j] = parents[j]->value(0); discrete[j] = parents[j]->isDiscreteValued(); } if (!func) { throw logic_error("NULL function in ArrayLogicalNode constructor"); } if (!checkNPar(func, dims.size())) { throw FuncError(func, "Incorrect number of parameters"); } if (!func->checkParameterDim(dims)) { throw FuncError(func, "Non-conforming parameters"); } if (!func->checkParameterFixed(fixed)) { throw FuncError(func, "Expected parameters with fixed values"); } if (!func->checkParameterDiscrete(discrete)) { throw FuncError(func, "Failed check for discrete-valued parameters"); } return func->dim(dims, values); } static vector > const & mkParameterDims(vector const ¶meters) { vector > dims(parameters.size()); for (unsigned int j = 0; j < parameters.size(); ++j) { dims[j] = parameters[j]->dim(); } return getUnique(dims); } ArrayLogicalNode::ArrayLogicalNode(ArrayFunction const *function, unsigned int nchain, vector const ¶meters) : LogicalNode(mkDim(function,parameters), nchain, parameters, function), _func(function), _dims(mkParameterDims(parameters)) { if (isFixed()) { for (unsigned int ch = 0; ch < _nchain; ++ch) { deterministicSample(ch); } } } void ArrayLogicalNode::deterministicSample(unsigned int chain) { _func->evaluate(_data + chain * _length, _parameters[chain], _dims); } bool ArrayLogicalNode::checkParentValues(unsigned int chain) const { return _func->checkParameterValue(_parameters[chain], _dims); } /* DeterministicNode * ArrayLogicalNode::clone(vector const &parents) const { return new ArrayLogicalNode(_func, parents); } */ } //namespace jags JAGS-4.3.2/src/lib/graph/VSLogicalNode.cc0000664000175000017500000000410514224052514014564 00000000000000#include #include #include #include #include #include using std::vector; using std::logic_error; namespace jags { static vector mkDim(vector const ¶meters) { vector dim(1,1); bool scalar = true; for (unsigned int i = 0; i < parameters.size(); ++i) { if (parameters[i]->length() > 1) { if (scalar) { dim = parameters[i]->dim(); scalar = false; } else if (dim != parameters[i]->dim()) { throw logic_error("Incompatible dimensions in VSLogicalNode"); } } } return dim; } static vector mkIsVector(vector const ¶meters) { vector ans(parameters.size()); for (unsigned int i = 0; i < parameters.size(); ++i) { ans[i] = (parameters[i]->length() > 1); } return ans; } VSLogicalNode::VSLogicalNode(ScalarFunction const *function, unsigned int nchain, vector const ¶meters) : LogicalNode(mkDim(parameters), nchain, parameters, function), _func(function), _isvector(mkIsVector(parameters)) { if (isFixed()) { for (unsigned int ch = 0; ch < nchain; ++ch) { deterministicSample(ch); } } } void VSLogicalNode::deterministicSample(unsigned int chain) { double *ans = _data + chain * _length; vector par(_parameters[chain]); for (unsigned int i = 0; i < _length; ++i) { ans[i] = _func->evaluate(par); for (unsigned int j = 0; j < par.size(); ++j) { if (_isvector[j]) ++par[j]; } } } bool VSLogicalNode::checkParentValues(unsigned int chain) const { vector par(_parameters[chain]); for (unsigned int i = 0; i < _length; ++i) { if (!_func->checkParameterValue(par)) return false; for (unsigned int j = 0; j < par.size(); ++j) { if (_isvector[j]) ++par[j]; } } return true; } /* DeterministicNode * VSLogicalNode::clone(vector const &parents) const { return new VSLogicalNode(_func, parents); } */ } //namespace jags JAGS-4.3.2/src/lib/graph/ScalarStochasticNode.cc0000664000175000017500000000775014224052514016204 00000000000000#include #include #include #include #include #include #include using std::vector; using std::string; namespace jags { ScalarStochasticNode::ScalarStochasticNode(ScalarDist const *dist, unsigned int nchain, vector const ¶ms, Node const *lower, Node const *upper) : StochasticNode(vector(1,1), nchain, dist, params, lower, upper), _dist(dist) { for(vector::const_iterator p = params.begin(); p != params.end(); ++p) { if ((*p)->length()==0) { string msg("Invalid zero-length parameter in distribution "); msg.append(dist->name()); throw NodeError(*p, msg); } else if ((*p)->length() > 1) { string msg("Invalid vector parameter in distribution "); msg.append(dist->name()); throw NodeError(*p, msg); } } } double ScalarStochasticNode::logDensity(unsigned int chain, PDFType type) const { if(!_dist->checkParameterValue(_parameters[chain])) return JAGS_NEGINF; double const *l = lowerLimit(chain); double const *u = upperLimit(chain); if (l && u && *l > *u) return JAGS_NEGINF; return _dist->logDensity(_data[chain], type, _parameters[chain], l, u); } void ScalarStochasticNode::deterministicSample(unsigned int chain) { double const *l = lowerLimit(chain); double const *u = upperLimit(chain); if (l && u && *l > *u) throw NodeError(this, "Inconsistent bounds"); _data[chain] = _dist->typicalValue(_parameters[chain], l, u); } void ScalarStochasticNode::randomSample(RNG *rng, unsigned int chain) { double const *l = lowerLimit(chain); double const *u = upperLimit(chain); if (l && u && *l > *u) throw NodeError(this, "Inconsistent bounds"); _data[chain] = _dist->randomSample(_parameters[chain], l, u, rng); } void ScalarStochasticNode::truncatedSample(RNG *rng, unsigned int chain, double const *lb, double const *ub) { double const *l = lowerLimit(chain); if (lb) { if (l == 0 || (l && (*lb < *l))) l = lb; } double const *u = upperLimit(chain); if (ub) { if (u == 0 || (u && (*ub > *u))) u = ub; } if (l && u && *l > *u) throw NodeError(this, "Inconsistent bounds"); _data[chain] = _dist->randomSample(_parameters[chain], l, u, rng); } bool ScalarStochasticNode::checkParentValues(unsigned int chain) const { double const *l = lowerLimit(chain); double const *u = upperLimit(chain); if (l && u && *l > *u) { return false; //Inconsistent bounds } else { return _dist->checkParameterValue(_parameters[chain]); } } bool isBounded(ScalarStochasticNode const *node) { return node->lowerBound() || node->upperBound(); } void ScalarStochasticNode::sp(double *lower, double *upper, unsigned int length, unsigned int chain) const { *lower = _dist->l(_parameters[chain]); *upper = _dist->u(_parameters[chain]); } /* StochasticNode * ScalarStochasticNode::clone(vector const ¶meters, Node const *lower, Node const *upper) const { return new ScalarStochasticNode(_dist, parameters, lower, upper); } */ unsigned int ScalarStochasticNode::df() const { return _dist->df(); } double ScalarStochasticNode::KL(unsigned int ch1, unsigned int ch2, RNG *rng, unsigned int nrep) const { if (lowerBound() || upperBound()) { Node const *ll = lowerBound(); Node const *uu = upperBound(); if (ll && !ll->isFixed()) { return JAGS_POSINF; } if (uu && !uu->isFixed()) { return JAGS_POSINF; } return _dist->KL(_parameters[ch1], _parameters[ch2], lowerLimit(ch1), upperLimit(ch1), rng, nrep); } else { double kl = _dist->KL(_parameters[ch1], _parameters[ch2]); if (kl == JAGS_NA) { return _dist->KL(_parameters[ch1], _parameters[ch2], 0, 0, rng, nrep); } else { return kl; } } } } //namespace jags JAGS-4.3.2/src/lib/graph/VectorStochasticNode.cc0000664000175000017500000001144014224052514016230 00000000000000#include #include #include #include #include #include #include #include #include #include using std::vector; using std::string; using std::max; using std::min; using std::copy; namespace jags { static unsigned int mkLength(VectorDist const *dist, vector const &parents) { /* Calculates length of stochastic node as a function of its parents */ if (!checkNPar(dist, parents.size())) { throw DistError(dist, "Incorrect number of parameters"); } vector parameter_lengths(parents.size()); for (unsigned long j = 0; j < parents.size(); ++j) { parameter_lengths[j] = parents[j]->length(); } if (!dist->checkParameterLength(parameter_lengths)) { throw DistError(dist, "Invalid parameter lengths"); } return dist->length(parameter_lengths); } static vector const & mkParameterLengths(vector const ¶meters) { vector lengths(parameters.size()); for (unsigned int j = 0; j < parameters.size(); ++j) { lengths[j] = parameters[j]->length(); } return getUnique(lengths); } VectorStochasticNode::VectorStochasticNode(VectorDist const *dist, unsigned int nchain, vector const ¶ms, Node const *lower, Node const *upper) : StochasticNode(vector(1,mkLength(dist, params)), nchain, dist, params, lower, upper), _dist(dist), _lengths(mkParameterLengths(params)) { if (!dist->checkParameterLength(_lengths)) { throw DistError(dist, "Invalid parameter lengths"); } } double VectorStochasticNode::logDensity(unsigned int chain, PDFType type) const { if(!_dist->checkParameterValue(_parameters[chain], _lengths)) return JAGS_NEGINF; return _dist->logDensity(_data + _length * chain, _length, type, _parameters[chain], _lengths, lowerLimit(chain), upperLimit(chain)); } void VectorStochasticNode::deterministicSample(unsigned int chain) { _dist->typicalValue(_data + _length * chain, _length, _parameters[chain], _lengths, lowerLimit(chain), upperLimit(chain)); } void VectorStochasticNode::randomSample(RNG *rng, unsigned int chain) { _dist->randomSample(_data + _length * chain, _length, _parameters[chain], _lengths, lowerLimit(chain), upperLimit(chain), rng); } void VectorStochasticNode::truncatedSample(RNG *rng, unsigned int chain, double const *lower, double const *upper) { double const *l = lowerLimit(chain); double *lv = 0; if (l || lower) { lv = new double[_length]; if (l && lower) { for (unsigned int i = 0; i < _length; ++i) { lv[i] = min(l[i], lower[i]); } } else if (l) { copy(l, l + _length, lv); } else if (lower) { copy(lower, lower + _length, lv); } } double const *u = upperLimit(chain); double *uv = 0; if (u || upper) { uv = new double[_length]; if (u && upper) { for (unsigned int i = 0; i < _length; ++i) { uv[i] = max(u[i], upper[i]); } } else if (u) { copy(u, u + _length, uv); } else if (upper) { copy(upper, upper + _length, uv); } } _dist->randomSample(_data + _length * chain, _length, _parameters[chain], _lengths, lv, uv, rng); delete [] lv; delete [] uv; } bool VectorStochasticNode::checkParentValues(unsigned int chain) const { return _dist->checkParameterValue(_parameters[chain], _lengths); } /* StochasticNode * VectorStochasticNode::clone(vector const ¶meters, Node const *lower, Node const *upper) const { return new VectorStochasticNode(_dist, parameters, lower, upper); } */ unsigned int VectorStochasticNode::df() const { return _dist->df(_lengths); } void VectorStochasticNode::sp(double *lower, double *upper, unsigned int length, unsigned int chain) const { _dist->support(lower, upper, length, _parameters[chain], _lengths); } double VectorStochasticNode::KL(unsigned int ch1, unsigned int ch2, RNG *rng, unsigned int nrep) const { if (lowerBound() || upperBound()) { Node const *ll = lowerBound(); Node const *uu = upperBound(); if (ll && !ll->isFixed()) { return JAGS_POSINF; } if (uu && !uu->isFixed()) { return JAGS_POSINF; } return _dist->KL(_parameters[ch1], _parameters[ch2], _lengths, lowerLimit(0), upperLimit(0), rng, nrep); } else { double kl = _dist->KL(_parameters[ch1], _parameters[ch2], _lengths); if (kl == JAGS_NA) { return _dist->KL(_parameters[ch1], _parameters[ch2], _lengths, 0, 0, rng, nrep); } else { return kl; } } } } //namespace jags JAGS-4.3.2/src/lib/graph/ArrayStochasticNode.cc0000664000175000017500000001106714224052514016051 00000000000000#include #include #include #include #include #include #include #include #include using std::vector; using std::string; using std::copy; using std::min; using std::max; namespace jags { static vector mkDim(ArrayDist const *dist, vector const &parents) { /* Calculates dimension of array stochastic node as a function of its parents */ if (!checkNPar(dist, parents.size())) { throw DistError(dist, "Incorrect number of parameters"); } vector > parameter_dims(parents.size()); for (unsigned long j = 0; j < parents.size(); ++j) { parameter_dims[j] = parents[j]->dim(); } if (!dist->checkParameterDim(parameter_dims)) { throw DistError(dist, "Non-conforming parameters"); } return dist->dim(parameter_dims); } static vector > const & mkParameterDims(vector const ¶meters) { vector > dims(parameters.size()); for (unsigned int j = 0; j < parameters.size(); ++j) { dims[j] = parameters[j]->dim(); } return getUnique(dims); } ArrayStochasticNode::ArrayStochasticNode(ArrayDist const *dist, unsigned int nchain, vector const ¶ms, Node const *lower, Node const *upper, double const *data, unsigned int length) : StochasticNode(mkDim(dist, params), nchain, dist, params, lower, upper), _dist(dist), _dims(mkParameterDims(params)) { if (!dist->checkParameterDim(_dims)) { throw DistError(dist, "Invalid parameter dimensions"); } } double ArrayStochasticNode::logDensity(unsigned int chain, PDFType type) const { if(!_dist->checkParameterValue(_parameters[chain], _dims)) return JAGS_NEGINF; return _dist->logDensity(_data + _length * chain, _length, type, _parameters[chain], _dims, lowerLimit(chain), upperLimit(chain)); } void ArrayStochasticNode::deterministicSample(unsigned int chain) { _dist->typicalValue(_data + _length * chain, _length, _parameters[chain], _dims, lowerLimit(chain), upperLimit(chain)); } void ArrayStochasticNode::randomSample(RNG *rng, unsigned int chain) { _dist->randomSample(_data + _length * chain, _length, _parameters[chain], _dims, lowerLimit(chain), upperLimit(chain), rng); } void ArrayStochasticNode::truncatedSample(RNG *rng, unsigned int chain, double const *lower, double const *upper) { /* Some complexity required to deal with case where node is already truncated. Note that this code is identical to that in VectorStochasticNode */ double const *l = lowerLimit(chain); double *lv = 0; if (l || lower) { lv = new double[_length]; if (l && lower) { for (unsigned int i = 0; i < _length; ++i) { lv[i] = min(l[i], lower[i]); } } else if (l) { copy(l, l + _length, lv); } else if (lower) { copy(lower, lower + _length, lv); } } double const *u = upperLimit(chain); double *uv = 0; if (u || upper) { uv = new double[_length]; if (u && upper) { for (unsigned int i = 0; i < _length; ++i) { uv[i] = max(u[i], upper[i]); } } else if (u) { copy(u, u + _length, uv); } else if (upper) { copy(upper, upper + _length, uv); } } _dist->randomSample(_data + _length * chain, _length, _parameters[chain], _dims, lv, uv, rng); delete [] lv; delete [] uv; } bool ArrayStochasticNode::checkParentValues(unsigned int chain) const { return _dist->checkParameterValue(_parameters[chain], _dims); } /* StochasticNode * ArrayStochasticNode::clone(vector const ¶meters, Node const *lower, Node const *upper) const { return new ArrayStochasticNode(_dist, parameters, lower, upper); } */ unsigned int ArrayStochasticNode::df() const { return _dist->df(_dims); } void ArrayStochasticNode::sp(double *lower, double *upper, unsigned int length, unsigned int chain) const { _dist->support(lower, upper, length, _parameters[chain], _dims); } double ArrayStochasticNode::KL(unsigned int ch1, unsigned int ch2, RNG *rng, unsigned int nrep) const { if (lowerBound() && !lowerBound()->isFixed()) { return JAGS_POSINF; } if (upperBound() && !upperBound()->isFixed()) { return JAGS_POSINF; } return _dist->KL(_parameters[ch1], _parameters[ch2], _dims, lowerLimit(ch1), upperLimit(ch1), rng, nrep); } } //namespace jags JAGS-4.3.2/src/lib/graph/ParentError.cc0000664000175000017500000000456514224052514014410 00000000000000#include #include #include #include #include #include #include using std::vector; using std::string; using std::ostream; using std::endl; /* Print a vector as a sequence of space-separated values */ static void printVector(ostream &out, double const *values, unsigned int length) { for (unsigned int i = 0; i < length; ++i) { out << " " << values[i]; } out << "\n"; } /* Print a matrix by row, bearing in mind that the values are stored in column-major order */ static void printMatrix(ostream &out, double const *values, unsigned int nrow, unsigned int ncol) { out << "\n"; for (unsigned int r = 0; r < nrow; ++r) { for (unsigned int c = 0; c < ncol; ++c) { out << " " << values[c * nrow + r]; } out << "\n"; } } /* Print a multi-dimensional array as a sequence of matrices, each representing a 2-D slice through the array */ static void printArray(ostream &out, double const *value, vector const &dim) { if (dim.size() <= 2) return; jags::SimpleRange range(dim); jags::RangeIterator r(range); while(!r.atEnd()) { //Header for each slice out << " , "; for (unsigned int i = 2; i < dim.size(); ++i) { out << ", " << r[i]; } //Print this slice printMatrix(out, value + range.leftOffset(r), dim[0], dim[1]); //Go to the next slice do { r.nextLeft(); } while(r[0] != 1 || r[1] != 1); } } namespace jags { ParentError::ParentError(Node const *node, unsigned int chain) : runtime_error("Invalid parent values"), _node(node), _chain(chain) { } void ParentError::printMessage(ostream &out, SymTab const &symtab) const { out << "Error in node " << symtab.getName(_node) << "\n" << "Invalid parent values" << "\n"; for (vector::const_iterator p = _node->parents().begin(); p != _node->parents().end(); ++p) { out << symtab.getName(*p) << " = "; double const *v = (*p)->value(_chain); vector dim = drop((*p)->dim()); switch(dim.size()) { case 0: out << endl; break; case 1: printVector(out, v, (*p)->length()); break; case 2: printMatrix(out, v, dim[0], dim[1]); break; default: printArray(out, v, dim); break; } } out << endl; } } //namespace jags JAGS-4.3.2/src/lib/model/0000755000175000017500000000000014400711324011676 500000000000000JAGS-4.3.2/src/lib/model/Makefile.am0000664000175000017500000000041714224052514013661 00000000000000noinst_LTLIBRARIES = libmodel.la libmodel_la_CPPFLAGS = -I$(top_srcdir)/src/include libmodel_la_SOURCES = SymTab.cc NodeArray.cc Model.cc Monitor.cc \ BUGSModel.cc MonitorFactory.cc MonitorControl.cc MonitorInfo.cc \ CODA.cc NodeArraySubset.cc noinst_HEADERS = CODA.h JAGS-4.3.2/src/lib/model/CODA.h0000664000175000017500000000467214224052514012513 00000000000000#ifndef CODA_H_ #define CODA_H_ #include #include #include namespace jags { /** * CODA output for monitors that have a separate value for each chain * This function opens up an index file "index.txt" and one * output file for each parallel chain with names "chain1.txt" * ... "chain.txt" * * @param mvec List of MonitorControl objects containing monitors to be * written out. * @param prefix Prefix to be added to index and output file names. * @param nchain Number of chains. * @param warn String that will contain warning messages on exit. It is * cleared on entry. */ void CODA(std::list const &mvec, std::string const &prefix, unsigned int nchain, std::string &warn); /** * CODA output for monitors that pool values over chains. * This function opens up an index file "index0.txt" * and one output file "chain0.txt". * * @param mvec List of MonitorControl objects containing monitors to be * written out. * @param Prefix to be prepended to index and output file names * @param warn String that will contain warning messages on exit. It is * cleared on entry. */ void CODA0(std::list const &mvec, std::string const &prefix, std::string &warn); /** * CODA output for monitors that have a separate value for each chain * but pool values over iterations. This function opens files with names * "table1.txt" ... "table.txt" * * @param mvec List of MonitorControl objects containing monitors to be * written out. * @param prefix Prefix to be added to index and output file names. * @param nchain Number of chains. * @param warn String that will contain warning messages on exit. It is * cleared on entry. */ void TABLE(std::list const &mvec, std::string const &prefix, unsigned int nchain, std::string &warn); /** * CODA output for monitors that pool values over chains and iterations. * This function opens up one output file "table0.txt". * * @param mvec List of MonitorControl objects containing monitors to be * written out. * @param Prefix to be prepended to index and output file names * @param warn String that will contain warning messages on exit. It is * cleared on entry. */ void TABLE0(std::list const &mvec, std::string const &prefix, std::string &warn); } //namespace jags #endif /* CODA_H_ */ JAGS-4.3.2/src/lib/model/Makefile.in0000644000175000017500000010036014400675235013675 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/model ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmodel_la_LIBADD = am_libmodel_la_OBJECTS = libmodel_la-SymTab.lo \ libmodel_la-NodeArray.lo libmodel_la-Model.lo \ libmodel_la-Monitor.lo libmodel_la-BUGSModel.lo \ libmodel_la-MonitorFactory.lo libmodel_la-MonitorControl.lo \ libmodel_la-MonitorInfo.lo libmodel_la-CODA.lo \ libmodel_la-NodeArraySubset.lo libmodel_la_OBJECTS = $(am_libmodel_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libmodel_la-BUGSModel.Plo \ ./$(DEPDIR)/libmodel_la-CODA.Plo \ ./$(DEPDIR)/libmodel_la-Model.Plo \ ./$(DEPDIR)/libmodel_la-Monitor.Plo \ ./$(DEPDIR)/libmodel_la-MonitorControl.Plo \ ./$(DEPDIR)/libmodel_la-MonitorFactory.Plo \ ./$(DEPDIR)/libmodel_la-MonitorInfo.Plo \ ./$(DEPDIR)/libmodel_la-NodeArray.Plo \ ./$(DEPDIR)/libmodel_la-NodeArraySubset.Plo \ ./$(DEPDIR)/libmodel_la-SymTab.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libmodel_la_SOURCES) DIST_SOURCES = $(libmodel_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libmodel.la libmodel_la_CPPFLAGS = -I$(top_srcdir)/src/include libmodel_la_SOURCES = SymTab.cc NodeArray.cc Model.cc Monitor.cc \ BUGSModel.cc MonitorFactory.cc MonitorControl.cc MonitorInfo.cc \ CODA.cc NodeArraySubset.cc noinst_HEADERS = CODA.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/model/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/model/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libmodel.la: $(libmodel_la_OBJECTS) $(libmodel_la_DEPENDENCIES) $(EXTRA_libmodel_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libmodel_la_OBJECTS) $(libmodel_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodel_la-BUGSModel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodel_la-CODA.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodel_la-Model.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodel_la-Monitor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodel_la-MonitorControl.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodel_la-MonitorFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodel_la-MonitorInfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodel_la-NodeArray.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodel_la-NodeArraySubset.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodel_la-SymTab.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libmodel_la-SymTab.lo: SymTab.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodel_la-SymTab.lo -MD -MP -MF $(DEPDIR)/libmodel_la-SymTab.Tpo -c -o libmodel_la-SymTab.lo `test -f 'SymTab.cc' || echo '$(srcdir)/'`SymTab.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodel_la-SymTab.Tpo $(DEPDIR)/libmodel_la-SymTab.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SymTab.cc' object='libmodel_la-SymTab.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodel_la-SymTab.lo `test -f 'SymTab.cc' || echo '$(srcdir)/'`SymTab.cc libmodel_la-NodeArray.lo: NodeArray.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodel_la-NodeArray.lo -MD -MP -MF $(DEPDIR)/libmodel_la-NodeArray.Tpo -c -o libmodel_la-NodeArray.lo `test -f 'NodeArray.cc' || echo '$(srcdir)/'`NodeArray.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodel_la-NodeArray.Tpo $(DEPDIR)/libmodel_la-NodeArray.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='NodeArray.cc' object='libmodel_la-NodeArray.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodel_la-NodeArray.lo `test -f 'NodeArray.cc' || echo '$(srcdir)/'`NodeArray.cc libmodel_la-Model.lo: Model.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodel_la-Model.lo -MD -MP -MF $(DEPDIR)/libmodel_la-Model.Tpo -c -o libmodel_la-Model.lo `test -f 'Model.cc' || echo '$(srcdir)/'`Model.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodel_la-Model.Tpo $(DEPDIR)/libmodel_la-Model.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Model.cc' object='libmodel_la-Model.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodel_la-Model.lo `test -f 'Model.cc' || echo '$(srcdir)/'`Model.cc libmodel_la-Monitor.lo: Monitor.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodel_la-Monitor.lo -MD -MP -MF $(DEPDIR)/libmodel_la-Monitor.Tpo -c -o libmodel_la-Monitor.lo `test -f 'Monitor.cc' || echo '$(srcdir)/'`Monitor.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodel_la-Monitor.Tpo $(DEPDIR)/libmodel_la-Monitor.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Monitor.cc' object='libmodel_la-Monitor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodel_la-Monitor.lo `test -f 'Monitor.cc' || echo '$(srcdir)/'`Monitor.cc libmodel_la-BUGSModel.lo: BUGSModel.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodel_la-BUGSModel.lo -MD -MP -MF $(DEPDIR)/libmodel_la-BUGSModel.Tpo -c -o libmodel_la-BUGSModel.lo `test -f 'BUGSModel.cc' || echo '$(srcdir)/'`BUGSModel.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodel_la-BUGSModel.Tpo $(DEPDIR)/libmodel_la-BUGSModel.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='BUGSModel.cc' object='libmodel_la-BUGSModel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodel_la-BUGSModel.lo `test -f 'BUGSModel.cc' || echo '$(srcdir)/'`BUGSModel.cc libmodel_la-MonitorFactory.lo: MonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodel_la-MonitorFactory.lo -MD -MP -MF $(DEPDIR)/libmodel_la-MonitorFactory.Tpo -c -o libmodel_la-MonitorFactory.lo `test -f 'MonitorFactory.cc' || echo '$(srcdir)/'`MonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodel_la-MonitorFactory.Tpo $(DEPDIR)/libmodel_la-MonitorFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MonitorFactory.cc' object='libmodel_la-MonitorFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodel_la-MonitorFactory.lo `test -f 'MonitorFactory.cc' || echo '$(srcdir)/'`MonitorFactory.cc libmodel_la-MonitorControl.lo: MonitorControl.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodel_la-MonitorControl.lo -MD -MP -MF $(DEPDIR)/libmodel_la-MonitorControl.Tpo -c -o libmodel_la-MonitorControl.lo `test -f 'MonitorControl.cc' || echo '$(srcdir)/'`MonitorControl.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodel_la-MonitorControl.Tpo $(DEPDIR)/libmodel_la-MonitorControl.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MonitorControl.cc' object='libmodel_la-MonitorControl.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodel_la-MonitorControl.lo `test -f 'MonitorControl.cc' || echo '$(srcdir)/'`MonitorControl.cc libmodel_la-MonitorInfo.lo: MonitorInfo.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodel_la-MonitorInfo.lo -MD -MP -MF $(DEPDIR)/libmodel_la-MonitorInfo.Tpo -c -o libmodel_la-MonitorInfo.lo `test -f 'MonitorInfo.cc' || echo '$(srcdir)/'`MonitorInfo.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodel_la-MonitorInfo.Tpo $(DEPDIR)/libmodel_la-MonitorInfo.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MonitorInfo.cc' object='libmodel_la-MonitorInfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodel_la-MonitorInfo.lo `test -f 'MonitorInfo.cc' || echo '$(srcdir)/'`MonitorInfo.cc libmodel_la-CODA.lo: CODA.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodel_la-CODA.lo -MD -MP -MF $(DEPDIR)/libmodel_la-CODA.Tpo -c -o libmodel_la-CODA.lo `test -f 'CODA.cc' || echo '$(srcdir)/'`CODA.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodel_la-CODA.Tpo $(DEPDIR)/libmodel_la-CODA.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CODA.cc' object='libmodel_la-CODA.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodel_la-CODA.lo `test -f 'CODA.cc' || echo '$(srcdir)/'`CODA.cc libmodel_la-NodeArraySubset.lo: NodeArraySubset.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodel_la-NodeArraySubset.lo -MD -MP -MF $(DEPDIR)/libmodel_la-NodeArraySubset.Tpo -c -o libmodel_la-NodeArraySubset.lo `test -f 'NodeArraySubset.cc' || echo '$(srcdir)/'`NodeArraySubset.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodel_la-NodeArraySubset.Tpo $(DEPDIR)/libmodel_la-NodeArraySubset.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='NodeArraySubset.cc' object='libmodel_la-NodeArraySubset.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodel_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodel_la-NodeArraySubset.lo `test -f 'NodeArraySubset.cc' || echo '$(srcdir)/'`NodeArraySubset.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libmodel_la-BUGSModel.Plo -rm -f ./$(DEPDIR)/libmodel_la-CODA.Plo -rm -f ./$(DEPDIR)/libmodel_la-Model.Plo -rm -f ./$(DEPDIR)/libmodel_la-Monitor.Plo -rm -f ./$(DEPDIR)/libmodel_la-MonitorControl.Plo -rm -f ./$(DEPDIR)/libmodel_la-MonitorFactory.Plo -rm -f ./$(DEPDIR)/libmodel_la-MonitorInfo.Plo -rm -f ./$(DEPDIR)/libmodel_la-NodeArray.Plo -rm -f ./$(DEPDIR)/libmodel_la-NodeArraySubset.Plo -rm -f ./$(DEPDIR)/libmodel_la-SymTab.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libmodel_la-BUGSModel.Plo -rm -f ./$(DEPDIR)/libmodel_la-CODA.Plo -rm -f ./$(DEPDIR)/libmodel_la-Model.Plo -rm -f ./$(DEPDIR)/libmodel_la-Monitor.Plo -rm -f ./$(DEPDIR)/libmodel_la-MonitorControl.Plo -rm -f ./$(DEPDIR)/libmodel_la-MonitorFactory.Plo -rm -f ./$(DEPDIR)/libmodel_la-MonitorInfo.Plo -rm -f ./$(DEPDIR)/libmodel_la-NodeArray.Plo -rm -f ./$(DEPDIR)/libmodel_la-NodeArraySubset.Plo -rm -f ./$(DEPDIR)/libmodel_la-SymTab.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/model/SymTab.cc0000664000175000017500000001052014224052514013327 00000000000000#include #include #include #include #include #include #include #include #include #include using std::vector; using std::map; using std::pair; using std::string; using std::runtime_error; using std::logic_error; using std::set; namespace jags { SymTab::SymTab(Model *model) : _model(model) { } SymTab::~SymTab() { map::iterator p; for (p = _varTable.begin(); p != _varTable.end(); ++p) { delete p->second; } } void SymTab::addVariable(string const &name, vector const &dim) { if (_varTable.find(name) != _varTable.end()) { string msg("Name "); msg.append(name); msg.append(" already in use in symbol table"); throw runtime_error(msg); } if (isFlat(dim)) { string msg = string("Cannot create variable ") + name + " with zero dimension"; throw runtime_error(msg); } NodeArray *array = new NodeArray(name, dim, _model->nchain()); _varTable[name] = array; } NodeArray* SymTab::getVariable(string const &name) const { map::const_iterator p = _varTable.find(name); if (p == _varTable.end()) { return 0; } else { return p->second; } } void SymTab::writeData(map const &data_table) { for(map::const_iterator p(data_table.begin()); p != data_table.end(); ++p) { NodeArray *array = getVariable(p->first); if (array) { if (array->range().dim(false) != p->second.dim(false)) { string msg("Dimension mismatch in values supplied for "); msg.append(p->first); throw runtime_error(msg); } array->setData(p->second, _model); } } } void SymTab::writeValues(map const &data_table, unsigned int chain) { for(map::const_iterator p(data_table.begin()); p != data_table.end(); ++p) { //set psetnodes; NodeArray *array = getVariable(p->first); if (array) { if (array->range().dim(false) != p->second.dim(false)) { string msg("Dimension mismatch in values supplied for "); msg.append(p->first); throw runtime_error(msg); } //array->setValue(p->second, chain, psetnodes); array->setValue(p->second, chain); //setnodes.insert(psetnodes.begin(), psetnodes.end()); } } } static bool allMissing(SArray const &sarray) { unsigned int N=sarray.length(); vector const &v = sarray.value(); for (unsigned int i = 0; i < N; ++i) { if (v[i] != JAGS_NA) return false; } return true; } void SymTab::readValues(map &data_table, unsigned int chain, bool (*condition)(Node const *)) const { if (chain > _model->nchain()) throw logic_error("Invalid chain in SymTab::readValues"); if (!condition) throw logic_error("NULL condition in Symtab::readValues"); map::const_iterator p; for (p = _varTable.begin(); p != _varTable.end(); ++p) { /* Create a new SArray to hold the values from the symbol table */ SArray read_values(p->second->range().dim(false)); p->second->getValue(read_values, chain, condition); /* Only write to the data table if we can find at least one non-missing value */ if (!allMissing(read_values)) { string const &name = p->first; if (data_table.find(name) != data_table.end()) { //Replace any existing entry data_table.erase(name); } data_table.insert(pair(name, read_values)); } } } unsigned int SymTab::size() const { return _varTable.size(); } void SymTab::clear() { _varTable.clear(); } string SymTab::getName(Node const *node) const { map::const_iterator p; for (p = _varTable.begin(); p != _varTable.end(); ++p) { NodeArray *array = p->second; Range node_range = array->getRange(node); if (!isNULL(node_range)) { if (node_range == array->range()) { return p->first; } else { return p->first + print(array->getRange(node)); } } } //Name not in symbol table: calculate name from parents vector const &parents = node->parents(); vector parnames(parents.size()); for (unsigned int i = 0; i < parents.size(); ++i) { parnames[i] = getName(parents[i]); } return node->deparse(parnames); } } //namespace jags JAGS-4.3.2/src/lib/model/NodeArray.cc0000664000175000017500000002074614224052514014027 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::pair; using std::vector; using std::map; using std::string; using std::runtime_error; using std::logic_error; using std::set; using std::numeric_limits; static bool hasRepeats(jags::Range const &target_range) { /* Returns true if the target range has any repeated indices We choose the vectorized version of set::insert as it is amortized linear time in the length of the index vector scope[i] if the indices are in increasing order, which should be true most of the time. */ vector > const &scope = target_range.scope(); for (unsigned int i = 0; i < scope.size(); ++i) { set seen; seen.insert(scope[i].begin(), scope[i].end()); if (seen.size() != scope[i].size()) return true; } return false; } namespace jags { NodeArray::NodeArray(string const &name, vector const &dim, unsigned int nchain) : _name(name), _range(dim), _nchain(nchain), _node_pointers(product(dim), 0), _offsets(product(dim), numeric_limits::max()) { } void NodeArray::insert(Node *node, Range const &target_range) { if (!node) { throw logic_error(string("Attempt to insert NULL node at ") + name() + print(target_range)); } if (node->dim() != target_range.dim(true)) { throw runtime_error(string("Cannot insert node into ") + name() + print(target_range) + ". Dimension mismatch"); } if (!_range.contains(target_range)) { throw runtime_error(string("Cannot insert node into ") + name() + print(target_range) + ". Range out of bounds"); } if (hasRepeats(target_range)) { throw runtime_error(string("Cannot insert node into ") + name() + print(target_range) + ". Range has repeat indices"); } /* Check that the range is not already occupied, even partially */ for (RangeIterator p(target_range); !p.atEnd(); p.nextLeft()) { if (_node_pointers[_range.leftOffset(p)] != 0) { throw runtime_error(string("Node ") + name() + print(target_range) + " overlaps previously defined nodes"); } } /* Set the _node_pointers array and the offset array */ unsigned int k = 0; for (RangeIterator p(target_range); !p.atEnd(); p.nextLeft()) { unsigned int i = _range.leftOffset(p); _node_pointers[i] = node; _offsets[i] = k++; } /* Add multivariate nodes to range map */ if (node->length() > 1) { _mv_nodes[target_range] = node; } /* Add node to the graph */ _member_graph.insert(node); } Node *NodeArray::getSubset(Range const &target_range, Model &model) { //Check validity of target range if (!_range.contains(target_range)) { throw runtime_error(string("Cannot get subset ") + name() + print(target_range) + ". Range out of bounds"); } if (target_range.length() == 1) { unsigned int start = _range.leftOffset(target_range.first()); Node *node = _node_pointers[start]; if (node && node->length() == 1) { if (_offsets[start] != 0) { throw logic_error("Invalid scalar node in NodeArray"); } return node; } } else { map::const_iterator p = _mv_nodes.find(target_range); if (p != _mv_nodes.end()) { return p->second; } } /* If range corresponds to a previously created subset, then * return this */ map::iterator p = _generated_nodes.find(target_range); if (p != _generated_nodes.end()) { return p->second; } /* Otherwise create an aggregate node */ vector nodes; vector offsets; for (RangeIterator p(target_range); !p.atEnd(); p.nextLeft()) { unsigned int i = _range.leftOffset(p); if (_node_pointers[i] == 0) { return 0; } nodes.push_back(_node_pointers[i]); offsets.push_back(_offsets[i]); } AggNode *anode = new AggNode(target_range.dim(true), _nchain, nodes, offsets); _generated_nodes[target_range] = anode; model.addNode(anode); _member_graph.insert(anode); return anode; } void NodeArray::setValue(SArray const &value, unsigned int chain) { if (!(_range == value.range())) { throw runtime_error(string("Dimension mismatch in ") + name()); } vector const &x = value.value(); unsigned int N = value.length(); //Gather all the nodes for which a data value is supplied set setnodes; for (unsigned int i = 0; i < _range.length(); ++i) { if (x[i] != JAGS_NA) { Node *node = _node_pointers[i]; if (node == 0) { string msg = "Attempt to set value of undefined node "; throw runtime_error(msg + name() + print(value.range().leftIndex(i))); } switch(node->randomVariableStatus()) { case RV_FALSE: throw NodeError(node, "Cannot set value of non-variable node"); break; case RV_TRUE_OBSERVED: throw NodeError(node, "Cannot overwrite value of observed node"); break; case RV_TRUE_UNOBSERVED: setnodes.insert(node); break; } } } for (set::const_iterator p = setnodes.begin(); p != setnodes.end(); ++p) { //Step through each node Node *node = *p; vector node_value(node->length()); //Get vector of values for this node for (unsigned int i = 0; i < N; ++i) { if (_node_pointers[i] == node) { if (_offsets[i] > node->length()) { throw logic_error("Invalid offset in NodeArray::setValue"); } else { node_value[_offsets[i]] = x[i]; } } } // If there are any missing values, they must all be missing bool missing = node_value[0] == JAGS_NA; for (unsigned int j = 1; j < node->length(); ++j) { if ((node_value[j] == JAGS_NA) != missing) { throw NodeError(node,"Values supplied for node are partially missing"); } } if (!missing) { node->setValue(&node_value[0], node->length(), chain); } } } void NodeArray::getValue(SArray &value, unsigned int chain, bool (*condition)(Node const *)) const { if (!(_range == value.range())) { string msg("Dimension mismatch when getting value of node array "); msg.append(name()); throw runtime_error(msg); } unsigned int array_length = _range.length(); vector array_value(array_length); for (unsigned int j = 0; j < array_length; ++j) { Node const *node = _node_pointers[j]; if (node && condition(node)) { array_value[j] = node->value(chain)[_offsets[j]]; } else { array_value[j] = JAGS_NA; } } value.setValue(array_value); } void NodeArray::setData(SArray const &value, Model *model) { if (!(_range == value.range())) { throw runtime_error(string("Dimension mismatch when setting value of node array ") + name()); } vector const &x = value.value(); //Gather all the nodes for which a data value is supplied for (unsigned int i = 0; i < _range.length(); ++i) { if (x[i] != JAGS_NA) { if (_node_pointers[i] == 0) { //Insert a new constant data node ConstantNode *cnode = new ConstantNode(x[i], _nchain, true); model->addNode(cnode); SimpleRange target_range(_range.leftIndex(i)); insert(cnode, target_range); } else { throw logic_error("Error in NodeArray::setData"); } } } } string const &NodeArray::name() const { return _name; } SimpleRange const &NodeArray::range() const { return _range; } Range NodeArray::getRange(Node const *node) const { if (!_member_graph.contains(node)) { return Range(); } //Look among inserted nodes first if (node->length() == 1) { for (unsigned int i = 0; i < _range.length(); ++i) { if (_node_pointers[i] == node) { return SimpleRange(_range.leftIndex(i)); } } } else { for (map::const_iterator p = _mv_nodes.begin(); p != _mv_nodes.end(); ++p) { if (node == p->second) { return p->first; } } } //Then among generated nodes for (map::const_iterator p = _generated_nodes.begin(); p != _generated_nodes.end(); ++p) { if (node == p->second) { return p->first; } } throw logic_error("Failed to find Node range"); return Range(); //Wall } unsigned int NodeArray::nchain() const { return _nchain; } } //namespace jags JAGS-4.3.2/src/lib/model/Model.cc0000664000175000017500000003527314400705744013212 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::map; using std::pair; using std::sort; using std::vector; using std::list; using std::set; using std::ofstream; using std::logic_error; using std::runtime_error; using std::string; using std::ostringstream; using std::stable_sort; using std::copy; using std::min; using std::max; using std::reverse; using std::find; namespace jags { static bool checkClosure(vector const &nodes) { // Determine whether a model is closed, i.e. that the nodes in // the model do not have any parents or children outside the model. set graph; for (unsigned int i = 0; i < nodes.size(); ++i) { graph.insert(nodes[i]); } for (vector::const_iterator i = nodes.begin(); i != nodes.end(); i++) { // Check parents vector const &parents = (*i)->parents(); for (vector::const_iterator j = parents.begin(); j != parents.end(); j++) { if (graph.find(*j) == graph.end()) return false; } // Check children list const *sch = (*i)->stochasticChildren(); for (list::const_iterator k = sch->begin(); k != sch->end(); k++) { if (graph.find(*k) == graph.end()) return false; } list const *dch = (*i)->deterministicChildren(); for (list::const_iterator k = dch->begin(); k != dch->end(); k++) { if (graph.find(*k) == graph.end()) return false; } } return true; } Model::Model(unsigned int nchain) : _samplers(0), _nchain(nchain), _rng(nchain, 0), _iteration(0), _is_initialized(false), _adapt(false), _data_gen(false) { } Model::~Model() { while(!_samplers.empty()) { Sampler *sampler0 = _samplers.back(); delete sampler0; _samplers.pop_back(); } //Delete nodes in reverse sampling order while(!_nodes.empty()) { Node *node = _nodes.back(); delete node; _nodes.pop_back(); } } bool Model::isInitialized() { return _is_initialized; } void Model::chooseRNGs() { /* Assign default RNG objects for any chain that does not currently have one */ //Count number of unassigned RNGs unsigned int n = 0; for (unsigned int i = 0; i < _nchain; ++i) { if (_rng[i] == 0) ++n; } vector new_rngs; list >::const_iterator p; for (p = rngFactories().begin(); p != rngFactories().end(); ++p) { if (p->second) { vector rngs = p->first->makeRNGs(n); if (rngs.size() > n) { throw logic_error("Too many rngs produced by RNG factory"); } else { n -= rngs.size(); } for (unsigned int j = 0; j < rngs.size(); ++j) { new_rngs.push_back(rngs[j]); } if (n == 0) break; } } if (n > 0) { throw runtime_error("Cannot generate sufficient RNGs"); } else { unsigned int j = 0; for (unsigned int i = 0; i < _nchain; ++i) { if (_rng[i] == 0) { _rng[i] = new_rngs[j++]; } } } } void Model::initialize(bool datagen) { if (_is_initialized) throw logic_error("Model already initialized"); if (!checkClosure(_nodes)) throw runtime_error("Graph not closed"); // Choose random number generators chooseRNGs(); //Initialize nodes initializeNodes(); // Choose Samplers chooseSamplers(); if (datagen) { //All extra nodes are sampled _sampled_extra = _extra_nodes; _data_gen = true; } // Switch to adaptive mode if we find an adaptive sampler for (unsigned int i = 0; i < _samplers.size(); ++i) { if (_samplers[i]->isAdaptive()) { _adapt = true; break; } } _is_initialized = true; } void Model::initializeNodes() { vector::const_iterator i; for (i = _nodes.begin(); i != _nodes.end(); ++i) { Node *node = *i; for (unsigned int n = 0; n < _nchain; ++n) { if (!node->checkParentValues(n)) { throw NodeError(node, "Invalid parent values"); } if (!node->initialize(n)) { throw NodeError(node, "Initialization failure"); } } } } struct less_sampler { /* Comparison operator for Samplers which sorts them in order according to the supplied sampler map */ map const & _sampler_map; less_sampler(map const &sampler_map) : _sampler_map(sampler_map) {}; bool operator()(Sampler const *x, Sampler const *y) const { return _sampler_map.find(x)->second < _sampler_map.find(y)->second; }; }; void Model::chooseSamplers() { /* * Selects samplers. Samplers are selected by traversing the list * of SamplerFactories in order. If there are any informative * stochastic nodes left without samplers after all factories have * been tried, then a runtime error is thrown * * @see Model#samplerFactories */ Graph full_graph; for (unsigned int i = 0; i < _nodes.size(); ++i) { full_graph.insert(_nodes[i]); } GraphMarks marks(full_graph); Graph sample_graph; // Add observed stochastic nodes to the sample graph and mark // the informative nodes vector informative; vector::const_iterator p; for (p = _stochastic_nodes.begin(); p != _stochastic_nodes.end(); ++p) { if (isObserved(*p)) { sample_graph.insert(*p); informative.push_back(*p); } } marks.markAncestors(informative, 1); for (p = _stochastic_nodes.begin(); p != _stochastic_nodes.end(); ++p) { if (isObserved(*p)) { marks.mark(*p, 2); } } //Triage on marked nodes. We do this twice: once for stochastic //nodes and once for all nodes. list slist; //List of nodes to be sampled for(p = _stochastic_nodes.begin(); p != _stochastic_nodes.end(); ++p) { if (marks.mark(*p) == 1) { //Unobserved stochastic nodes: to be sampled slist.push_back(*p); } } for (vector::const_iterator j = _nodes.begin(); j != _nodes.end(); ++j) { switch(marks.mark(*j)) { case 0: _extra_nodes.push_back(*j); break; case 1: case 2: sample_graph.insert(*j); break; } } // Traverse the list of samplers, selecting nodes that can be sampled list > const &sf = samplerFactories(); for(list >::const_iterator q = sf.begin(); q != sf.end(); ++q) { if (!q->second) continue; vector svec = q->first->makeSamplers(slist, sample_graph); while (!svec.empty()) { for (unsigned int i = 0; i < svec.size(); ++i) { vector const &nodes = svec[i]->nodes(); for (unsigned int j = 0; j < nodes.size(); ++j) { /* FIXME: This is a potential bottleneck if slist is large */ list::iterator p = find(slist.begin(), slist.end(), nodes[j]); if (p == slist.end()) { throw logic_error("Unable to find sampled node"); } slist.erase(p); } _samplers.push_back(svec[i]); } svec = q->first->makeSamplers(slist, sample_graph); } } // Make sure we found a sampler for all the nodes if (!slist.empty()) { throw NodeError(*slist.begin(), "Unable to find appropriate sampler"); } // Samplers are sorted in reverse sampling order: i.e. samplers // that are closer to the data are updated before samplers that // only affect higher-order parameters // Create a map associating each stochastic node with its index // in the vector _stochastic_nodes, corresponding to the order // in which they were added to the model map snode_map; for (unsigned int i = 0; i < _stochastic_nodes.size(); ++i) { snode_map[_stochastic_nodes[i]] = i; } // Create a map associating each sampler with the minimal index // of its sampled nodes. map sampler_map; for (unsigned int i = 0; i < _samplers.size(); ++i) { unsigned int min_index = _stochastic_nodes.size(); vector const &snodes = _samplers[i]->nodes(); for (unsigned int j = 0; j < snodes.size(); ++j) { map::const_iterator p = snode_map.find(snodes[j]); if (p == snode_map.end()) { throw logic_error("Invalid stochastic node map"); } if (p->second < min_index) { min_index = p->second; } } sampler_map[_samplers[i]] = min_index; } stable_sort(_samplers.begin(), _samplers.end(), less_sampler(sampler_map)); reverse(_samplers.begin(), _samplers.end()); } void Model::update(unsigned int niter) { if (!_is_initialized) { throw logic_error("Attempt to update uninitialized model"); } for (unsigned int iter = 0; iter < niter; ++iter) { for (vector::iterator i = _samplers.begin(); i != _samplers.end(); ++i) { (*i)->update(_rng); } for (unsigned int n = 0; n < _nchain; ++n) { for (vector::const_iterator k = _sampled_extra.begin(); k != _sampled_extra.end(); ++k) { if (!(*k)->checkParentValues(n)) { throw NodeError(*k, "Invalid parent values"); } (*k)->randomSample(_rng[n], n); } } _iteration++; for (list::iterator k = _monitors.begin(); k != _monitors.end(); k++) { k->update(_iteration); } } } unsigned int Model::iteration() const { return _iteration; } void Model::adaptOff() { for (vector::const_iterator p = _samplers.begin(); p != _samplers.end(); ++p) { (*p)->adaptOff(); } _adapt = false; } bool Model::checkAdaptation() const { for (vector::const_iterator p = _samplers.begin(); p != _samplers.end(); ++p) { if (!(*p)->checkAdaptation()) return false; } return true; } bool Model::isAdapting() const { return _adapt; } void Model::setSampledExtra() { /* If a mode is not a data generating model, uninformative nodes do not need to be updated, unless they have a descendant that is being monitored. This function finds those nodes and adds them to the vector _sampled_extra. */ if (_data_gen) { // In a data generating model, all uninformative nodes are // sampled, so nothing to be done return; } // Recalculate the vector of uninformative nodes that need sampling //Insert extra nodes into a new graph Graph egraph; for (vector::const_iterator p = _extra_nodes.begin(); p != _extra_nodes.end(); ++p) { egraph.insert(*p); } //Mark the ancestors of all monitored nodes in this graph GraphMarks emarks(egraph); vector monitored_nodes; for (list::const_iterator p = _monitors.begin(); p != _monitors.end(); ++p) { vector const &pnodes = p->monitor()->nodes(); for (vector::const_iterator i = pnodes.begin(); i != pnodes.end(); ++i) { if (egraph.contains(*i)) { emarks.mark(*i, 1); monitored_nodes.push_back(*i); } } } emarks.markAncestors(monitored_nodes, 1); //Add marked nodes to the vector of sampled extra nodes _sampled_extra.clear(); for(vector::const_iterator p = _extra_nodes.begin(); p != _extra_nodes.end(); ++p) { if (emarks.mark(*p)) { _sampled_extra.push_back(*p); } } } void Model::addMonitor(Monitor *monitor, unsigned int thin) { if (_adapt) { throw runtime_error("Turn off adaptive mode before setting monitors"); } _monitors.push_back(MonitorControl(monitor, _iteration+1, thin)); setSampledExtra(); } void Model::removeMonitor(Monitor *monitor) { for(list::iterator p = _monitors.begin(); p != _monitors.end(); ++p) { if (p->monitor() == monitor) { _monitors.erase(p); break; } } setSampledExtra(); } /* We use construct-on-first-use for the factory lists used by model objects. By dynamically allocating a list, we ensure that its destructor is never called - the memory is simply returned to the OS on exit. This fixes a nasty exit bug. We cannot guarantee the order that static destructors are called in. Therefore, a segfault can occur if a module tries to remove entries from a list that has already been destroyed. See also Compiler.cc, where the same technique is used for lookup tables used by the compiler. */ list > &Model::samplerFactories() { static list > *_samplerfac = new list >(); return *_samplerfac; } list > &Model::rngFactories() { static list > *_rngfac = new list >(); return *_rngfac; } list > &Model::monitorFactories() { static list > *_monitorfac = new list >(); return *_monitorfac; } unsigned int Model::nchain() const { return _nchain; } RNG *Model::rng(unsigned int chain) const { return _rng[chain]; } bool Model::setRNG(string const &name, unsigned int chain) { if (chain >= _nchain) throw logic_error("Invalid chain number in Model::setRNG"); list >::const_iterator p; for (p = rngFactories().begin(); p != rngFactories().end(); ++p) { if (p->second) { RNG *rng = p->first->makeRNG(name); if (rng) { /* NO! RNGs are owned by the factory, not the model if (_rng[chain]) delete _rng[chain]; */ _rng[chain] = rng; return true; } } } return false; } bool Model::setRNG(RNG *rng, unsigned int chain) { if (chain >= _nchain) throw logic_error("Invalid chain number in Model::setRNG"); _rng[chain] = rng; return true; } list const &Model::monitors() const { return _monitors; } void Model::addNode(StochasticNode *node) { _nodes.push_back(node); _stochastic_nodes.push_back(node); } void Model::addNode(DeterministicNode *node) { _nodes.push_back(node); } void Model::addNode(ConstantNode *node) { _nodes.push_back(node); } vector const &Model::stochasticNodes() const { return _stochastic_nodes; } vector const &Model::nodes() const { return _nodes; } } //namespace jags JAGS-4.3.2/src/lib/model/Monitor.cc0000664000175000017500000000377014224052514013570 00000000000000#include #include #include #include #include #include using std::string; using std::vector; using std::logic_error; using std::copy; namespace jags { Monitor::Monitor(string const &type, vector const &nodes) : _type(type), _nodes(nodes) { } Monitor::Monitor(string const &type, Node const *node) : _type(type), _nodes(vector(1,node)) { } Monitor::~Monitor() {} string const &Monitor::type() const { return _type; } vector const &Monitor::nodes() const { return _nodes; } string const &Monitor::name() const { return _name; } void Monitor::setName(string const &name) { _name = name; } vector const &Monitor::elementNames() const { return _elt_names; } void Monitor::setElementNames(vector const &names) { _elt_names = names; } SArray Monitor::dump(bool flat) const { unsigned int nchain = poolChains() ? 1 : nodes()[0]->nchain(); unsigned int nvalue = value(0).size(); vector v(nvalue * nchain); vector::iterator p = v.begin(); for (unsigned int ch = 0; ch < nchain; ++ch) { p = copy(value(ch).begin(), value(ch).end(), p); } vector vdim = dim(); unsigned int vlen = product(vdim); if (nvalue % vlen != 0) { throw logic_error("Inconsistent dimensions in Monitor"); } unsigned int niter = nvalue / vlen; if (poolIterations() && niter != 1) { throw logic_error("Invalid number of iterations in Monitor"); } if (flat) { vdim = vector(1, vlen); } vector names(vdim.size(), ""); if (!poolIterations()) { vdim.push_back(niter); names.push_back("iteration"); } if (!poolChains()) { vdim.push_back(nchain); names.push_back("chain"); } SArray ans(vdim); ans.setValue(v); ans.setDimNames(names); if (flat) { ans.setSDimNames(_elt_names, 0); } return(ans); } } //namespace jags JAGS-4.3.2/src/lib/model/BUGSModel.cc0000664000175000017500000001340314224052514013654 00000000000000#include #include "CODA.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::ofstream; using std::list; using std::pair; using std::string; using std::logic_error; using std::runtime_error; using std::map; namespace jags { /* Nodes accessible to the user in a BUGSModel are identified by a variable name and range of indices */ typedef pair NodeId; BUGSModel::BUGSModel(unsigned int nchain) : Model(nchain), _symtab(this) { } BUGSModel::~BUGSModel() { for (list::iterator i = _bugs_monitors.begin(); i != _bugs_monitors.end(); ++i) { Monitor const *monitor = i->monitor(); delete monitor; //FIXME: constant pointer } } SymTab &BUGSModel::symtab() { return _symtab; } void BUGSModel::coda(vector const &node_ids, string const &stem, string &warn) { warn.clear(); list dump_nodes; for (unsigned int i = 0; i < node_ids.size(); ++i) { string const &name = node_ids[i].first; Range const &range = node_ids[i].second; list::const_iterator p; for (p = _bugs_monitors.begin(); p != _bugs_monitors.end(); ++p) { if (p->name() == name && p->range() == range) { break; } } if (p == _bugs_monitors.end()) { string msg = string("No Monitor ") + name + print(range) + " found.\n"; warn.append(msg); } else { list::const_iterator q; for (q = monitors().begin(); q != monitors().end(); ++q) { if (q->monitor() == p->monitor()) { dump_nodes.push_back(*q); break; } } if (q == monitors().end()) { throw logic_error(string("Monitor ") + name + print(range) + "not found"); } } } if (dump_nodes.empty()) { warn.append("There are no matching monitors\n"); return; } CODA0(dump_nodes, stem, warn); CODA(dump_nodes, stem, nchain(), warn); TABLE0(dump_nodes, stem, warn); TABLE(dump_nodes, stem, nchain(), warn); } void BUGSModel::coda(string const &stem, string &warn) { warn.clear(); if (monitors().empty()) { warn.append("There are no monitors\n"); return; } CODA0(monitors(), stem, warn); CODA(monitors(), stem, nchain(), warn); TABLE0(monitors(), stem, warn); TABLE(monitors(), stem, nchain(), warn); } void BUGSModel::setParameters(map const ¶m_table, unsigned int chain) { _symtab.writeValues(param_table, chain); //Strip off .RNG.seed (user-supplied random seed) if (param_table.find(".RNG.seed") != param_table.end()) { if (rng(chain) == 0) { throw runtime_error(".RNG.seed supplied but RNG type not set"); } SArray const &seed = param_table.find(".RNG.seed")->second; if (seed.length() != 1) { throw runtime_error(".RNG.seed must be a single integer"); } if (seed.value()[0] < 0) { throw runtime_error(".RNG.seed must be non-negative"); } int iseed = static_cast(seed.value()[0]); rng(chain)->init(iseed); } //Strip off .RNG.state (saved state from previous run) if (param_table.find(".RNG.state") != param_table.end()) { if (rng(chain) == 0) { throw runtime_error(".RNG.state supplied, but RNG type not set"); } SArray const &state = param_table.find(".RNG.state")->second; vector(istate); //double const *value = state.value(); vector const &value = state.value(); for (unsigned int i = 0; i < state.length(); ++i) { istate.push_back(static_cast(value[i])); } if (rng(chain)->setState(istate) == false) { throw runtime_error("Invalid .RNG.state"); } } } bool BUGSModel::setMonitor(string const &name, Range const &range, unsigned int thin, string const &type, string &msg) { for (list::const_iterator i = _bugs_monitors.begin(); i != _bugs_monitors.end(); ++i) { if (i->name() == name && i->range() == range && i->type() == type) { msg = "Monitor already exists and cannot be duplicated"; return false; } } msg.clear(); Monitor *monitor = 0; list > const &faclist = monitorFactories(); for(list >::const_iterator j = faclist.begin(); j != faclist.end(); ++j) { if (j->second) { monitor = j->first->getMonitor(name, range, this, type, msg); if (monitor || !msg.empty()) break; } } if (monitor) { addMonitor(monitor, thin); _bugs_monitors.push_back(MonitorInfo(monitor, name, range, type)); return true; } else { return false; } } bool BUGSModel::deleteMonitor(string const &name, Range const &range, string const &type) { for (list::iterator i = _bugs_monitors.begin(); i != _bugs_monitors.end(); ++i) { if (i->name() == name && i->range() == range && i->type() == type) { Monitor *monitor = i->monitor(); removeMonitor(monitor); _bugs_monitors.erase(i); delete monitor; return true; } } return false; } void BUGSModel::samplerNames(vector > &sampler_names) const { sampler_names.clear(); sampler_names.reserve(_samplers.size()); for (unsigned int i = 0; i < _samplers.size(); ++i) { vector names; vector const &nodes = _samplers[i]->nodes(); names.reserve(nodes.size()+1); names.push_back(_samplers[i]->name()); for (unsigned int j = 0; j < nodes.size(); ++j) { names.push_back(_symtab.getName(nodes[j])); } sampler_names.push_back(names); } } } //namespace jags JAGS-4.3.2/src/lib/model/MonitorFactory.cc0000664000175000017500000000016214224052514015110 00000000000000#include using std::string; namespace jags { MonitorFactory::~MonitorFactory() { } } JAGS-4.3.2/src/lib/model/MonitorControl.cc0000664000175000017500000000222014224052371015117 00000000000000#include #include #include #include using std::invalid_argument; using std::string; namespace jags { MonitorControl::MonitorControl (Monitor *monitor, unsigned int start, unsigned int thin) : _monitor(monitor), _start(start), _thin(thin), _niter(0) { if (thin == 0) { throw invalid_argument("Illegal thinning interval"); } } unsigned int MonitorControl::start() const { return _start; } unsigned int MonitorControl::end() const { return _start + _thin * _niter; } unsigned int MonitorControl::niter() const { return _niter; } unsigned int MonitorControl::thin() const { return _thin; } Monitor const *MonitorControl::monitor() const { return _monitor; } void MonitorControl::update(unsigned int iteration) { if (iteration < _start || (iteration - _start) % _thin != 0) { return; } else { _monitor->update(); _niter++; } } bool MonitorControl::operator==(MonitorControl const &rhs) const { return (_monitor == rhs._monitor && _start == rhs._start && _thin == rhs._thin && _niter == rhs._niter); } } //namespace jags JAGS-4.3.2/src/lib/model/MonitorInfo.cc0000664000175000017500000000131414224052371014375 00000000000000#include #include using std::string; namespace jags { MonitorInfo::MonitorInfo(Monitor *monitor, string const &name, Range const &range, string const &type) : _monitor(monitor), _name(name), _range(range), _type(type) { } Monitor *MonitorInfo::monitor() const { return _monitor; } string const &MonitorInfo::name() const { return _name; } string const &MonitorInfo::type() const { return _type; } Range const &MonitorInfo::range() const { return _range; } bool MonitorInfo::operator==(MonitorInfo const &rhs) const { return (_name == rhs._name && _type == rhs._type && _range == rhs._range && _monitor == rhs._monitor); } } //namespace jags JAGS-4.3.2/src/lib/model/CODA.cc0000664000175000017500000002076214224052514012647 00000000000000#include #include "CODA.h" #include #include #include #include #include #include using std::list; using std::vector; using std::string; using std::ostringstream; using std::ofstream; using std::ostream; namespace jags { static void writeDouble(double x, ostream &out) { if (x == JAGS_NA) { out << "NA"; } else if (jags_isnan(x)) { out << "NaN"; } else if (!jags_finite(x)) { if (x > 0) out << "Inf"; else out << "-Inf"; } else { out << x; } } static vector missingValues(MonitorControl const &control, unsigned int nchain) { /* Returns a boolean vector that indicates which variables have at least one missing value in at least one chain. Such variables are omitted when writing the index and output files. */ Monitor const *monitor = control.monitor(); unsigned int nvar = product(monitor->dim()); vector ans(nvar, false); for (unsigned int ch = 0; ch < nchain; ++ch) { vector const &y = monitor->value(ch); for (unsigned int v = 0; v < nvar; ++v) { if (ans[v]) continue; if (monitor->poolIterations()) { if (y[v] == JAGS_NA) { ans[v] = true; } } else { for (unsigned int k = 0; k < control.niter(); ++k) { if (y[k * nvar + v] == JAGS_NA) { ans[v] = true; break; } } } } } return ans; } static void WriteIndex(MonitorControl const &control, vector const &missing, ofstream &index, unsigned int &lineno) { /* Writes to a coda index file and augments the current line number in the corresponding coda output file(s) */ Monitor const *monitor = control.monitor(); if (monitor->poolIterations()) { return; } unsigned int nvar = product(monitor->dim()); vector const &enames = monitor->elementNames(); for (unsigned int v = 0; v < nvar; ++v) { if (missing[v]) continue; index << enames[v] << " " << lineno + 1 << " " << lineno + control.niter() << '\n'; lineno += control.niter(); } } //Write output file static void WriteOutput(MonitorControl const &control, int chain, vector const &missing, ofstream &output) { Monitor const *monitor = control.monitor(); if (monitor->poolIterations()) { return; } vector const &y = monitor->value(chain); unsigned int nvar = product(monitor->dim()); for (unsigned int v = 0; v < nvar; ++v) { if (missing[v]) continue; unsigned int iter = control.start(); for (unsigned int k = 0; k < control.niter(); ++k) { output << iter << " "; writeDouble(y[k * nvar + v], output); output << '\n'; iter += control.thin(); } } } static void WriteTable(MonitorControl const &control, int chain, vector const &missing, ofstream &index) { Monitor const *monitor = control.monitor(); if (!monitor->poolIterations()) { return; } vector const &y = monitor->value(chain); vector const &enames = monitor->elementNames(); unsigned int nvar = product(monitor->dim()); for (unsigned int v = 0; v < nvar; ++v) { if (missing[v]) continue; index << enames[v] << " "; writeDouble(y[v], index); index << '\n'; } } static bool AnyMonitors(list const &mvec, bool pooliter, bool poolchains) { /* Check for eligible monitors satisfying poolChains and * poolIterations */ list::const_iterator p; for (p = mvec.begin(); p != mvec.end(); ++p) { if (p->monitor()->poolIterations() == pooliter && p->monitor()->poolChains() == poolchains) { return true; } } return false; } /* CODA output for monitors that do not pool over chains */ void CODA(list const &mvec, string const &stem, unsigned int nchain, string &warn) { /* Check for eligible monitors */ if (!AnyMonitors(mvec, false, false)) return; /* Open index file */ string iname = stem + "index.txt"; ofstream index(iname.c_str()); if (!index) { string msg = string("Failed to open file ") + iname + "\n"; warn.append(msg); return; } /* Open output files */ vector output; for (unsigned int n = 0; n < nchain; ++n) { ostringstream outstream; outstream << stem << "chain" << n + 1 << ".txt"; string oname = outstream.str(); ofstream *out = new ofstream(oname.c_str()); if (out) { output.push_back(out); } else { //In case of error, close opened files and return index.close(); while(!output.empty()) { output.back()->close(); delete output.back(); output.pop_back(); } string msg = string("Failed to open file ") + oname + "\n"; warn.append(msg); return; } } unsigned int lineno = 0; list::const_iterator p; for (p = mvec.begin(); p != mvec.end(); ++p) { Monitor const *monitor = p->monitor(); if (!monitor->poolChains() && !monitor->poolIterations()) { vector missing = missingValues(*p, nchain); WriteIndex(*p, missing, index, lineno); for (unsigned int ch = 0; ch < nchain; ++ch) { WriteOutput(*p, ch, missing, *output[ch]); } } } index.close(); for (unsigned int i = 0; i < nchain; ++i) { output[i]->close(); delete output[i]; } } /* CODA output for monitors that pool over chains */ void CODA0(list const &mvec, string const &stem, string &warn) { /* Check for eligible monitors */ if (!AnyMonitors(mvec, false, true)) return; /* Open index file */ string iname = stem + "index0.txt"; ofstream index(iname.c_str()); if (!index) { string msg = string("Failed to open file ") + iname + "\n"; warn.append(msg); return; } /* Open output files */ string oname = stem + "chain0.txt"; ofstream output(oname.c_str()); if (!output) { index.close(); string msg = string("Failed to open file ") + oname + "\n"; warn.append(msg); return; } unsigned int lineno = 0; list::const_iterator p; for (p = mvec.begin(); p != mvec.end(); ++p) { Monitor const *monitor = p->monitor(); if (monitor->poolChains() && !monitor->poolIterations()) { vector missing = missingValues(*p, 1); WriteIndex(*p, missing, index, lineno); WriteOutput(*p, 0, missing, output); } } index.close(); output.close(); } /* TABLE output for monitors that pool over iterations but not over chains */ void TABLE(list const &mvec, string const &stem, unsigned int nchain, string &warn) { /* Check for eligible monitors */ if (!AnyMonitors(mvec, true, false)) return; /* Open output files */ vector output; for (unsigned int n = 0; n < nchain; ++n) { ostringstream outstream; outstream << stem << "table" << n + 1 << ".txt"; string oname = outstream.str(); ofstream *out = new ofstream(oname.c_str()); if (out) { output.push_back(out); } else { //In case of error, close opened files and return while(!output.empty()) { output.back()->close(); delete output.back(); output.pop_back(); } string msg = string("Failed to open file ") + oname + "\n"; warn.append(msg); return; } } list::const_iterator p; for (p = mvec.begin(); p != mvec.end(); ++p) { Monitor const *monitor = p->monitor(); if (!monitor->poolChains() && monitor->poolIterations()) { vector missing = missingValues(*p, nchain); for (unsigned int ch = 0; ch < nchain; ++ch) { WriteTable(*p, ch, missing, *output[ch]); } } } for (unsigned int i = 0; i < nchain; ++i) { output[i]->close(); delete output[i]; } } /* TABLE output for monitors that pool over chains and iterations */ void TABLE0(list const &mvec, string const &stem, string &warn) { /* Check for eligible monitors */ if (!AnyMonitors(mvec, true, true)) return; /* Open output file */ string iname = stem + "table0.txt"; ofstream output(iname.c_str()); if (!output) { string msg = string("Failed to open file ") + iname + "\n"; warn.append(msg); return; } list::const_iterator p; for (p = mvec.begin(); p != mvec.end(); ++p) { Monitor const *monitor = p->monitor(); if (monitor->poolChains() && monitor->poolIterations()) { vector missing = missingValues(*p, 1); WriteTable(*p, 0, missing, output); } } output.close(); } } //namespace jags JAGS-4.3.2/src/lib/model/NodeArraySubset.cc0000664000175000017500000000417614224052514015214 00000000000000#include #include #include #include #include #include #include #include using std::set; using std::vector; using std::runtime_error; using std::string; namespace jags { NodeArraySubset::NodeArraySubset(NodeArray const *array, Range const &range) : _dim(range.dim(true)), _nchain(array->nchain()) { if (isNULL(range)) { // Special syntax rule: a NULL range means the whole array _dim = array->range().dim(false); _node_pointers = array->_node_pointers; _offsets = array->_offsets; } else { //Check validity of target range if (!array->_range.contains(range)) { throw runtime_error(string("Cannot get subset ") + array->_name + print(range) + ". Range out of bounds"); } for (RangeIterator p(range); !p.atEnd(); p.nextLeft()) { unsigned int i = array->_range.leftOffset(p); _node_pointers.push_back(array->_node_pointers[i]); _offsets.push_back(array->_offsets[i]); } } } vector NodeArraySubset::value(unsigned int chain) const { vector ans; Node const *node = 0; double const *values = 0; for (unsigned int i = 0; i < _node_pointers.size(); ++i) { if (_node_pointers[i]) { if (node != _node_pointers[i]) { node = _node_pointers[i]; values = node->value(chain); } ans.push_back(values[_offsets[i]]); } else { ans.push_back(JAGS_NA); } } return ans; } vector const &NodeArraySubset::dim() const { return _dim; } vector NodeArraySubset::nodes() const { vector ans; set nodeset; for (unsigned int i = 0; i < _node_pointers.size(); ++i) { Node const * node = _node_pointers[i]; if (node && nodeset.insert(node).second) { ans.push_back(node); } } return ans; } unsigned int NodeArraySubset::nchain() const { return _nchain; } unsigned int NodeArraySubset::length() const { return _node_pointers.size(); } } /* namespace jags */ JAGS-4.3.2/src/lib/compiler/0000755000175000017500000000000014400711324012410 500000000000000JAGS-4.3.2/src/lib/compiler/Makefile.am0000664000175000017500000000066214224052371014376 00000000000000noinst_LTLIBRARIES = libcompiler.la AM_YFLAGS = -d BUILT_SOURCES = parser.hh libcompiler_la_CPPFLAGS = -I$(top_srcdir)/src/include libcompiler_la_SOURCES = parser.yy scanner.ll Compiler.cc \ LogicalFactory.cc ParseTree.cc Counter.cc CounterTab.cc \ MixtureFactory.cc MixCompiler.cc NodeFactory.cc ObsFuncTab.cc noinst_HEADERS = parser.hh parser_extra.h remap.h MixCompiler.h MAINTAINERCLEANFILES = parser.cc scanner.cc parser.hh JAGS-4.3.2/src/lib/compiler/parser.hh0000664000175000017500000001143014224054310014145 00000000000000/* A Bison parser, made by GNU Bison 3.7.6. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 3 of the License, 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ #ifndef YY_YY_PARSER_HH_INCLUDED # define YY_YY_PARSER_HH_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ VAR = 258, /* VAR */ DATA = 259, /* DATA */ MODEL = 260, /* MODEL */ NAME = 261, /* NAME */ FUNC = 262, /* FUNC */ SPECIAL = 263, /* SPECIAL */ BADCHAR = 264, /* BADCHAR */ IN = 265, /* IN */ ARROW = 266, /* ARROW */ FOR = 267, /* FOR */ GT = 268, /* GT */ GE = 269, /* GE */ LT = 270, /* LT */ LE = 271, /* LE */ EQ = 272, /* EQ */ NE = 273, /* NE */ AND = 274, /* AND */ OR = 275, /* OR */ LENGTH = 276, /* LENGTH */ DIM = 277, /* DIM */ DOUBLE = 278, /* DOUBLE */ INT = 279, /* INT */ NOT = 280, /* NOT */ NEG = 281, /* NEG */ ENDL = 282, /* ENDL */ UREPCHAR = 283 /* UREPCHAR */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ #define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 #define VAR 258 #define DATA 259 #define MODEL 260 #define NAME 261 #define FUNC 262 #define SPECIAL 263 #define BADCHAR 264 #define IN 265 #define ARROW 266 #define FOR 267 #define GT 268 #define GE 269 #define LT 270 #define LE 271 #define EQ 272 #define NE 273 #define AND 274 #define OR 275 #define LENGTH 276 #define DIM 277 #define DOUBLE 278 #define INT 279 #define NOT 280 #define NEG 281 #define ENDL 282 #define UREPCHAR 283 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 42 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" /* We can't put any C++ class that requires a constructor in union. In particular, we can't have strings. To get round this limitation, we put a pointer to a string in the union, and then get the lexical analyzer to return a pointer to a dynamically allocated string. The parser frees the memory when it is done. This is tedious, but the alternative is to copy character arrays using, e.g. strncpy instead. */ double val; std::string *stringptr; jags::ParseTree *ptree; std::vector *pvec; #line 139 "parser.hh" }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_PARSER_HH_INCLUDED */ JAGS-4.3.2/src/lib/compiler/parser_extra.h0000664000175000017500000000155214224052514015210 00000000000000#ifndef PARSER_EXTRA_H_ #define PARSER_EXTRA_H_ #include #include #include /** * Parse a model file that describes the graphical model using the * BUGS language. @param file File containing the model description * * @param pvariables Pointer to a vector of ParseTree pointers. After * calling parse_bugs pvariables will point to a newly allocated * ParseTree representing the list of declared variables. * * @param pvariables Pointer to a ParseTree. After calling parse_bugs * pvariables will point to a newly allocated ParseTree representing * the stochastic and logical relationships between declared nodes. */ int parse_bugs(std::FILE *file, std::vector * &pvariables, jags::ParseTree * &pdata, jags::ParseTree * &prelations, std::string &message); #endif /* PARSER_EXTRA_H_ */ JAGS-4.3.2/src/lib/compiler/remap.h0000664000175000017500000000200214224052371013605 00000000000000#define yymaxdepth jags_maxdepth #define yyparse jags_parse #define yylex jags_lex #define yyerror jags_error #define yylval jags_lval #define yychar jags_char #define yydebug jags_debug #define yypact jags_pact #define yyr1 jags_r1 #define yyr2 jags_r2 #define yydef jags_def #define yychk jags_chk #define yypgo jags_pgo #define yyact jags_act #define yyexca jags_exca #define yyerrflag jags_errflag #define yynerrs jags_nerrs #define yyps jags_ps #define yypv jags_pv #define yys jags_s #define yy_yys jags_yys #define yystate jags_state #define yytmp jags_tmp #define yyv jags_v #define yy_yyv jags_yyv #define yyval jags_val #define yylloc jags_lloc #define yyreds jags_reds #define yytoks jags_toks #define yylhs jags_yylhs #define yylen jags_yylen #define yydefred jags_yydefred #define yydgoto jags_yydgoto #define yysindex jags_yysindex #define yyrindex jags_yyrindex #define yygindex jags_yygindex #define yytable jags_yytable #define yycheck jags_yycheck #define yyname jags_yyname #define yyrule jags_yyrule JAGS-4.3.2/src/lib/compiler/MixCompiler.h0000664000175000017500000000072414224052514014741 00000000000000#ifndef MIX_COMPILER_H_ #define MIX_COMPILER_H_ class Node; class ParseTree; class Compiler; #include #include #include #include namespace jags { typedef std::map, std::set > UMap; Node * getMixtureNode(ParseTree const * var, Compiler *compiler); void getMissingMixParams(ParseTree const * var, UMap &umap, Compiler *compiler); } #endif /* MIX_COMPILER_H_ */ JAGS-4.3.2/src/lib/compiler/Makefile.in0000644000175000017500000011104114400675235014405 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/compiler ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libcompiler_la_LIBADD = am_libcompiler_la_OBJECTS = libcompiler_la-parser.lo \ libcompiler_la-scanner.lo libcompiler_la-Compiler.lo \ libcompiler_la-LogicalFactory.lo libcompiler_la-ParseTree.lo \ libcompiler_la-Counter.lo libcompiler_la-CounterTab.lo \ libcompiler_la-MixtureFactory.lo libcompiler_la-MixCompiler.lo \ libcompiler_la-NodeFactory.lo libcompiler_la-ObsFuncTab.lo libcompiler_la_OBJECTS = $(am_libcompiler_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libcompiler_la-Compiler.Plo \ ./$(DEPDIR)/libcompiler_la-Counter.Plo \ ./$(DEPDIR)/libcompiler_la-CounterTab.Plo \ ./$(DEPDIR)/libcompiler_la-LogicalFactory.Plo \ ./$(DEPDIR)/libcompiler_la-MixCompiler.Plo \ ./$(DEPDIR)/libcompiler_la-MixtureFactory.Plo \ ./$(DEPDIR)/libcompiler_la-NodeFactory.Plo \ ./$(DEPDIR)/libcompiler_la-ObsFuncTab.Plo \ ./$(DEPDIR)/libcompiler_la-ParseTree.Plo \ ./$(DEPDIR)/libcompiler_la-parser.Plo \ ./$(DEPDIR)/libcompiler_la-scanner.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libcompiler_la_SOURCES) DIST_SOURCES = $(libcompiler_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/ylwrap parser.cc parser.hh scanner.cc DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libcompiler.la AM_YFLAGS = -d BUILT_SOURCES = parser.hh libcompiler_la_CPPFLAGS = -I$(top_srcdir)/src/include libcompiler_la_SOURCES = parser.yy scanner.ll Compiler.cc \ LogicalFactory.cc ParseTree.cc Counter.cc CounterTab.cc \ MixtureFactory.cc MixCompiler.cc NodeFactory.cc ObsFuncTab.cc noinst_HEADERS = parser.hh parser_extra.h remap.h MixCompiler.h MAINTAINERCLEANFILES = parser.cc scanner.cc parser.hh all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .cc .ll .lo .o .obj .yy $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/compiler/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/compiler/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } parser.hh: parser.cc @if test ! -f $@; then rm -f parser.cc; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) parser.cc; else :; fi libcompiler.la: $(libcompiler_la_OBJECTS) $(libcompiler_la_DEPENDENCIES) $(EXTRA_libcompiler_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libcompiler_la_OBJECTS) $(libcompiler_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-Compiler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-Counter.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-CounterTab.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-LogicalFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-MixCompiler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-MixtureFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-NodeFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-ObsFuncTab.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-ParseTree.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-parser.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libcompiler_la-scanner.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libcompiler_la-parser.lo: parser.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-parser.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-parser.Tpo -c -o libcompiler_la-parser.lo `test -f 'parser.cc' || echo '$(srcdir)/'`parser.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-parser.Tpo $(DEPDIR)/libcompiler_la-parser.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='parser.cc' object='libcompiler_la-parser.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-parser.lo `test -f 'parser.cc' || echo '$(srcdir)/'`parser.cc libcompiler_la-scanner.lo: scanner.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-scanner.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-scanner.Tpo -c -o libcompiler_la-scanner.lo `test -f 'scanner.cc' || echo '$(srcdir)/'`scanner.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-scanner.Tpo $(DEPDIR)/libcompiler_la-scanner.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='scanner.cc' object='libcompiler_la-scanner.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-scanner.lo `test -f 'scanner.cc' || echo '$(srcdir)/'`scanner.cc libcompiler_la-Compiler.lo: Compiler.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-Compiler.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-Compiler.Tpo -c -o libcompiler_la-Compiler.lo `test -f 'Compiler.cc' || echo '$(srcdir)/'`Compiler.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-Compiler.Tpo $(DEPDIR)/libcompiler_la-Compiler.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Compiler.cc' object='libcompiler_la-Compiler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-Compiler.lo `test -f 'Compiler.cc' || echo '$(srcdir)/'`Compiler.cc libcompiler_la-LogicalFactory.lo: LogicalFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-LogicalFactory.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-LogicalFactory.Tpo -c -o libcompiler_la-LogicalFactory.lo `test -f 'LogicalFactory.cc' || echo '$(srcdir)/'`LogicalFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-LogicalFactory.Tpo $(DEPDIR)/libcompiler_la-LogicalFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LogicalFactory.cc' object='libcompiler_la-LogicalFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-LogicalFactory.lo `test -f 'LogicalFactory.cc' || echo '$(srcdir)/'`LogicalFactory.cc libcompiler_la-ParseTree.lo: ParseTree.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-ParseTree.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-ParseTree.Tpo -c -o libcompiler_la-ParseTree.lo `test -f 'ParseTree.cc' || echo '$(srcdir)/'`ParseTree.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-ParseTree.Tpo $(DEPDIR)/libcompiler_la-ParseTree.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ParseTree.cc' object='libcompiler_la-ParseTree.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-ParseTree.lo `test -f 'ParseTree.cc' || echo '$(srcdir)/'`ParseTree.cc libcompiler_la-Counter.lo: Counter.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-Counter.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-Counter.Tpo -c -o libcompiler_la-Counter.lo `test -f 'Counter.cc' || echo '$(srcdir)/'`Counter.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-Counter.Tpo $(DEPDIR)/libcompiler_la-Counter.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Counter.cc' object='libcompiler_la-Counter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-Counter.lo `test -f 'Counter.cc' || echo '$(srcdir)/'`Counter.cc libcompiler_la-CounterTab.lo: CounterTab.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-CounterTab.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-CounterTab.Tpo -c -o libcompiler_la-CounterTab.lo `test -f 'CounterTab.cc' || echo '$(srcdir)/'`CounterTab.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-CounterTab.Tpo $(DEPDIR)/libcompiler_la-CounterTab.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CounterTab.cc' object='libcompiler_la-CounterTab.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-CounterTab.lo `test -f 'CounterTab.cc' || echo '$(srcdir)/'`CounterTab.cc libcompiler_la-MixtureFactory.lo: MixtureFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-MixtureFactory.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-MixtureFactory.Tpo -c -o libcompiler_la-MixtureFactory.lo `test -f 'MixtureFactory.cc' || echo '$(srcdir)/'`MixtureFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-MixtureFactory.Tpo $(DEPDIR)/libcompiler_la-MixtureFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MixtureFactory.cc' object='libcompiler_la-MixtureFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-MixtureFactory.lo `test -f 'MixtureFactory.cc' || echo '$(srcdir)/'`MixtureFactory.cc libcompiler_la-MixCompiler.lo: MixCompiler.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-MixCompiler.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-MixCompiler.Tpo -c -o libcompiler_la-MixCompiler.lo `test -f 'MixCompiler.cc' || echo '$(srcdir)/'`MixCompiler.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-MixCompiler.Tpo $(DEPDIR)/libcompiler_la-MixCompiler.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MixCompiler.cc' object='libcompiler_la-MixCompiler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-MixCompiler.lo `test -f 'MixCompiler.cc' || echo '$(srcdir)/'`MixCompiler.cc libcompiler_la-NodeFactory.lo: NodeFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-NodeFactory.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-NodeFactory.Tpo -c -o libcompiler_la-NodeFactory.lo `test -f 'NodeFactory.cc' || echo '$(srcdir)/'`NodeFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-NodeFactory.Tpo $(DEPDIR)/libcompiler_la-NodeFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='NodeFactory.cc' object='libcompiler_la-NodeFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-NodeFactory.lo `test -f 'NodeFactory.cc' || echo '$(srcdir)/'`NodeFactory.cc libcompiler_la-ObsFuncTab.lo: ObsFuncTab.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcompiler_la-ObsFuncTab.lo -MD -MP -MF $(DEPDIR)/libcompiler_la-ObsFuncTab.Tpo -c -o libcompiler_la-ObsFuncTab.lo `test -f 'ObsFuncTab.cc' || echo '$(srcdir)/'`ObsFuncTab.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libcompiler_la-ObsFuncTab.Tpo $(DEPDIR)/libcompiler_la-ObsFuncTab.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ObsFuncTab.cc' object='libcompiler_la-ObsFuncTab.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcompiler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcompiler_la-ObsFuncTab.lo `test -f 'ObsFuncTab.cc' || echo '$(srcdir)/'`ObsFuncTab.cc .ll.cc: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .yy.cc: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f parser.cc -rm -f parser.hh -rm -f scanner.cc -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libcompiler_la-Compiler.Plo -rm -f ./$(DEPDIR)/libcompiler_la-Counter.Plo -rm -f ./$(DEPDIR)/libcompiler_la-CounterTab.Plo -rm -f ./$(DEPDIR)/libcompiler_la-LogicalFactory.Plo -rm -f ./$(DEPDIR)/libcompiler_la-MixCompiler.Plo -rm -f ./$(DEPDIR)/libcompiler_la-MixtureFactory.Plo -rm -f ./$(DEPDIR)/libcompiler_la-NodeFactory.Plo -rm -f ./$(DEPDIR)/libcompiler_la-ObsFuncTab.Plo -rm -f ./$(DEPDIR)/libcompiler_la-ParseTree.Plo -rm -f ./$(DEPDIR)/libcompiler_la-parser.Plo -rm -f ./$(DEPDIR)/libcompiler_la-scanner.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libcompiler_la-Compiler.Plo -rm -f ./$(DEPDIR)/libcompiler_la-Counter.Plo -rm -f ./$(DEPDIR)/libcompiler_la-CounterTab.Plo -rm -f ./$(DEPDIR)/libcompiler_la-LogicalFactory.Plo -rm -f ./$(DEPDIR)/libcompiler_la-MixCompiler.Plo -rm -f ./$(DEPDIR)/libcompiler_la-MixtureFactory.Plo -rm -f ./$(DEPDIR)/libcompiler_la-NodeFactory.Plo -rm -f ./$(DEPDIR)/libcompiler_la-ObsFuncTab.Plo -rm -f ./$(DEPDIR)/libcompiler_la-ParseTree.Plo -rm -f ./$(DEPDIR)/libcompiler_la-parser.Plo -rm -f ./$(DEPDIR)/libcompiler_la-scanner.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: all check install install-am install-exec install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/compiler/parser.cc0000664000175000017500000024147414224054310014150 00000000000000/* A Bison parser, made by GNU Bison 3.7.6. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 3 of the License, 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ /* 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, and Bison version. */ #define YYBISON 30706 /* Bison version string. */ #define YYBISON_VERSION "3.7.6" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* First part of user prologue. */ #line 2 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" #include #include "remap.h" #include "parser_extra.h" #include #include #include #include #include #include using std::malloc; using std::free; using jags::ParseTree; void yyerror(const char *); int yylex(); int yylex_destroy(); extern int yylineno; #define YYDEBUG 1 static std::vector * _pvariables = 0; static ParseTree *_pdata = 0; static ParseTree *_prelations = 0; static void setName(ParseTree *p, std::string *name); static void setParameters(ParseTree *p, std::vector *parameters); static void setParameters(ParseTree *p, ParseTree *param1); static void setParameters(ParseTree *p, ParseTree *param1, ParseTree *param2); static void setParameters(ParseTree *p, ParseTree *param1, ParseTree *param2, ParseTree *param3); static ParseTree *Truncated (ParseTree *left, ParseTree *right); static ParseTree *Interval(ParseTree *left, ParseTree *right); #line 110 "parser.cc" # ifndef YY_CAST # ifdef __cplusplus # define YY_CAST(Type, Val) static_cast (Val) # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) # else # define YY_CAST(Type, Val) ((Type) (Val)) # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) # endif # endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Use api.header.include to #include this header instead of duplicating it here. */ #ifndef YY_YY_PARSER_HH_INCLUDED # define YY_YY_PARSER_HH_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ VAR = 258, /* VAR */ DATA = 259, /* DATA */ MODEL = 260, /* MODEL */ NAME = 261, /* NAME */ FUNC = 262, /* FUNC */ SPECIAL = 263, /* SPECIAL */ BADCHAR = 264, /* BADCHAR */ IN = 265, /* IN */ ARROW = 266, /* ARROW */ FOR = 267, /* FOR */ GT = 268, /* GT */ GE = 269, /* GE */ LT = 270, /* LT */ LE = 271, /* LE */ EQ = 272, /* EQ */ NE = 273, /* NE */ AND = 274, /* AND */ OR = 275, /* OR */ LENGTH = 276, /* LENGTH */ DIM = 277, /* DIM */ DOUBLE = 278, /* DOUBLE */ INT = 279, /* INT */ NOT = 280, /* NOT */ NEG = 281, /* NEG */ ENDL = 282, /* ENDL */ UREPCHAR = 283 /* UREPCHAR */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ #define YYEMPTY -2 #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 #define VAR 258 #define DATA 259 #define MODEL 260 #define NAME 261 #define FUNC 262 #define SPECIAL 263 #define BADCHAR 264 #define IN 265 #define ARROW 266 #define FOR 267 #define GT 268 #define GE 269 #define LT 270 #define LE 271 #define EQ 272 #define NE 273 #define AND 274 #define OR 275 #define LENGTH 276 #define DIM 277 #define DOUBLE 278 #define INT 279 #define NOT 280 #define NEG 281 #define ENDL 282 #define UREPCHAR 283 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 42 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" /* We can't put any C++ class that requires a constructor in union. In particular, we can't have strings. To get round this limitation, we put a pointer to a string in the union, and then get the lexical analyzer to return a pointer to a dynamically allocated string. The parser frees the memory when it is done. This is tedious, but the alternative is to copy character arrays using, e.g. strncpy instead. */ double val; std::string *stringptr; jags::ParseTree *ptree; std::vector *pvec; #line 235 "parser.cc" }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_PARSER_HH_INCLUDED */ /* Symbol kind. */ enum yysymbol_kind_t { YYSYMBOL_YYEMPTY = -2, YYSYMBOL_YYEOF = 0, /* "end of file" */ YYSYMBOL_YYerror = 1, /* error */ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ YYSYMBOL_VAR = 3, /* VAR */ YYSYMBOL_DATA = 4, /* DATA */ YYSYMBOL_MODEL = 5, /* MODEL */ YYSYMBOL_NAME = 6, /* NAME */ YYSYMBOL_FUNC = 7, /* FUNC */ YYSYMBOL_SPECIAL = 8, /* SPECIAL */ YYSYMBOL_BADCHAR = 9, /* BADCHAR */ YYSYMBOL_IN = 10, /* IN */ YYSYMBOL_ARROW = 11, /* ARROW */ YYSYMBOL_FOR = 12, /* FOR */ YYSYMBOL_GT = 13, /* GT */ YYSYMBOL_GE = 14, /* GE */ YYSYMBOL_LT = 15, /* LT */ YYSYMBOL_LE = 16, /* LE */ YYSYMBOL_EQ = 17, /* EQ */ YYSYMBOL_NE = 18, /* NE */ YYSYMBOL_AND = 19, /* AND */ YYSYMBOL_OR = 20, /* OR */ YYSYMBOL_LENGTH = 21, /* LENGTH */ YYSYMBOL_DIM = 22, /* DIM */ YYSYMBOL_DOUBLE = 23, /* DOUBLE */ YYSYMBOL_INT = 24, /* INT */ YYSYMBOL_NOT = 25, /* NOT */ YYSYMBOL_26_ = 26, /* '+' */ YYSYMBOL_27_ = 27, /* '-' */ YYSYMBOL_28_ = 28, /* '*' */ YYSYMBOL_29_ = 29, /* '/' */ YYSYMBOL_30_ = 30, /* ':' */ YYSYMBOL_NEG = 31, /* NEG */ YYSYMBOL_32_ = 32, /* '^' */ YYSYMBOL_ENDL = 33, /* ENDL */ YYSYMBOL_UREPCHAR = 34, /* UREPCHAR */ YYSYMBOL_35_ = 35, /* ';' */ YYSYMBOL_36_ = 36, /* ',' */ YYSYMBOL_37_ = 37, /* '[' */ YYSYMBOL_38_ = 38, /* ']' */ YYSYMBOL_39_ = 39, /* '{' */ YYSYMBOL_40_ = 40, /* '}' */ YYSYMBOL_41_ = 41, /* '(' */ YYSYMBOL_42_ = 42, /* ')' */ YYSYMBOL_43_ = 43, /* '=' */ YYSYMBOL_44_ = 44, /* '~' */ YYSYMBOL_45_T_ = 45, /* 'T' */ YYSYMBOL_46_I_ = 46, /* 'I' */ YYSYMBOL_YYACCEPT = 47, /* $accept */ YYSYMBOL_input = 48, /* input */ YYSYMBOL_var_stmt = 49, /* var_stmt */ YYSYMBOL_dec_list = 50, /* dec_list */ YYSYMBOL_node_dec = 51, /* node_dec */ YYSYMBOL_dim_list = 52, /* dim_list */ YYSYMBOL_data_stmt = 53, /* data_stmt */ YYSYMBOL_model_stmt = 54, /* model_stmt */ YYSYMBOL_relations = 55, /* relations */ YYSYMBOL_relation_list = 56, /* relation_list */ YYSYMBOL_relation = 57, /* relation */ YYSYMBOL_for_loop = 58, /* for_loop */ YYSYMBOL_counter = 59, /* counter */ YYSYMBOL_assignment = 60, /* assignment */ YYSYMBOL_determ_relation = 61, /* determ_relation */ YYSYMBOL_stoch_relation = 62, /* stoch_relation */ YYSYMBOL_product = 63, /* product */ YYSYMBOL_sum = 64, /* sum */ YYSYMBOL_expression = 65, /* expression */ YYSYMBOL_expression_list = 66, /* expression_list */ YYSYMBOL_range_list = 67, /* range_list */ YYSYMBOL_range_element = 68, /* range_element */ YYSYMBOL_distribution = 69, /* distribution */ YYSYMBOL_truncated = 70, /* truncated */ YYSYMBOL_interval = 71, /* interval */ YYSYMBOL_var = 72 /* var */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; #ifdef short # undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure and (if available) are included so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ # include /* INFRINGES ON USER NAME SPACE */ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YY_STDINT_H # endif #endif /* Narrow types that promote to a signed type and that can represent a signed or unsigned integer of at least N bits. In tables they can save space and decrease cache pressure. Promoting to a signed type helps avoid bugs in integer arithmetic. */ #ifdef __INT_LEAST8_MAX__ typedef __INT_LEAST8_TYPE__ yytype_int8; #elif defined YY_STDINT_H typedef int_least8_t yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef __INT_LEAST16_MAX__ typedef __INT_LEAST16_TYPE__ yytype_int16; #elif defined YY_STDINT_H typedef int_least16_t yytype_int16; #else typedef short yytype_int16; #endif /* Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants. This workaround can likely be removed in 2023, as HPE has promised support for HP-UX 11.23 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of . */ #ifdef __hpux # undef UINT_LEAST8_MAX # undef UINT_LEAST16_MAX # define UINT_LEAST8_MAX 255 # define UINT_LEAST16_MAX 65535 #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; #else typedef short yytype_uint8; #endif #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; #else typedef int yytype_uint16; #endif #ifndef YYPTRDIFF_T # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ # define YYPTRDIFF_T __PTRDIFF_TYPE__ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ # elif defined PTRDIFF_MAX # ifndef ptrdiff_t # include /* INFRINGES ON USER NAME SPACE */ # endif # define YYPTRDIFF_T ptrdiff_t # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX # else # define YYPTRDIFF_T long # define YYPTRDIFF_MAXIMUM LONG_MAX # endif #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM \ YY_CAST (YYPTRDIFF_T, \ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ ? YYPTRDIFF_MAXIMUM \ : YY_CAST (YYSIZE_T, -1))) #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) /* Stored state numbers (used for stacks). */ typedef yytype_uint8 yy_state_t; /* State numbers in computations. */ typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define YY_ATTRIBUTE_PURE # endif #endif #ifndef YY_ATTRIBUTE_UNUSED # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # else # define YY_ATTRIBUTE_UNUSED # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YY_USE(E) ((void) (E)) #else # define YY_USE(E) /* empty */ #endif #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ /* Suppress an incorrect diagnostic about yylval being uninitialized. */ # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ # define YY_IGNORE_USELESS_CAST_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") # define YY_IGNORE_USELESS_CAST_END \ _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_END #endif #define YY_ASSERT(E) ((void) (0 && (E))) #if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yy_state_t yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* 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_alloc, Stack) \ do \ { \ YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / YYSIZEOF (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYPTRDIFF_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 13 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 477 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 47 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 26 /* YYNRULES -- Number of rules. */ #define YYNRULES 77 /* YYNSTATES -- Number of states. */ #define YYNSTATES 157 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 283 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ (0 <= (YYX) && (YYX) <= YYMAXUTOK \ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_int8 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, 41, 42, 28, 26, 36, 27, 2, 29, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 30, 35, 2, 43, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 46, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 45, 2, 2, 2, 2, 2, 2, 37, 2, 38, 32, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 39, 2, 40, 44, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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, 31, 33, 34 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 105, 105, 106, 107, 108, 109, 112, 113, 116, 117, 120, 123, 129, 130, 133, 140, 147, 153, 154, 157, 158, 159, 160, 161, 164, 170, 176, 177, 180, 184, 200, 204, 208, 214, 219, 229, 234, 243, 244, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309, 313, 317, 321, 324, 325, 328, 329, 332, 333, 339, 344, 354, 355, 356, 357, 360, 361, 362, 363, 366, 369 }; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) #if YYDEBUG || 0 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "\"end of file\"", "error", "\"invalid token\"", "VAR", "DATA", "MODEL", "NAME", "FUNC", "SPECIAL", "BADCHAR", "IN", "ARROW", "FOR", "GT", "GE", "LT", "LE", "EQ", "NE", "AND", "OR", "LENGTH", "DIM", "DOUBLE", "INT", "NOT", "'+'", "'-'", "'*'", "'/'", "':'", "NEG", "'^'", "ENDL", "UREPCHAR", "';'", "','", "'['", "']'", "'{'", "'}'", "'('", "')'", "'='", "'~'", "'T'", "'I'", "$accept", "input", "var_stmt", "dec_list", "node_dec", "dim_list", "data_stmt", "model_stmt", "relations", "relation_list", "relation", "for_loop", "counter", "assignment", "determ_relation", "stoch_relation", "product", "sum", "expression", "expression_list", "range_list", "range_element", "distribution", "truncated", "interval", "var", YY_NULLPTR }; static const char * yysymbol_name (yysymbol_kind_t yysymbol) { return yytname[yysymbol]; } #endif #ifdef YYPRINT /* YYTOKNUM[NUM] -- (External) token number corresponding to the (internal) symbol number NUM (which must be that of a token). */ static const yytype_int16 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, 43, 45, 42, 47, 58, 281, 94, 282, 283, 59, 44, 91, 93, 123, 125, 40, 41, 61, 126, 84, 73 }; #endif #define YYPACT_NINF (-109) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) #define YYTABLE_NINF (-1) #define yytable_value_is_error(Yyn) \ ((Yyn) == YYTABLE_NINF) /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { 27, -4, -26, -21, 21, 78, 39, -109, 42, 139, -109, 149, 149, -109, 39, -109, -109, 160, -109, -4, 63, -8, 35, 5, -109, -109, 65, 76, 92, -7, 28, -109, 79, 91, 96, -109, 160, 160, -22, 120, 114, 376, -109, -109, 160, 156, 163, -109, -109, 149, -109, -109, -109, -109, -109, 164, 160, -109, 160, 156, 156, 141, 176, 160, -109, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 376, 85, -109, 134, 170, 86, 144, 133, 376, 376, 33, 155, 157, -109, 376, 117, -3, 106, 422, 422, 422, 422, 422, 422, 445, 399, -3, -3, 117, 117, 138, 141, 160, -109, 4, 160, -109, 1, 145, 147, -109, -109, 160, -109, -109, -109, -109, 160, 158, -109, 36, 74, 136, 376, 376, -109, -109, 64, 326, 67, 351, -109, 206, 112, -109, 236, 123, -109, -109, 266, -109, -109, 296, -109, -109 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_int8 yydefact[] = { 2, 0, 0, 0, 0, 0, 0, 3, 11, 7, 9, 0, 0, 1, 0, 4, 5, 0, 8, 0, 76, 0, 0, 0, 18, 22, 0, 21, 20, 0, 0, 6, 0, 0, 0, 39, 0, 0, 0, 43, 45, 13, 38, 10, 64, 0, 0, 15, 19, 0, 25, 24, 23, 27, 28, 0, 0, 16, 0, 0, 0, 47, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 65, 0, 62, 0, 0, 0, 0, 31, 29, 60, 0, 0, 0, 59, 14, 35, 37, 58, 49, 50, 51, 52, 53, 54, 55, 56, 36, 46, 34, 44, 48, 57, 64, 77, 0, 64, 17, 0, 0, 0, 32, 33, 0, 42, 40, 41, 63, 0, 0, 67, 0, 0, 0, 61, 30, 26, 66, 0, 0, 0, 0, 71, 0, 0, 75, 0, 0, 69, 70, 0, 73, 74, 0, 68, 72 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -109, -109, -109, -109, 179, -109, 202, 146, -109, -11, -20, -109, -109, 93, -109, -109, -109, -109, -17, 94, -109, -108, -109, -109, -109, 54 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { 0, 4, 5, 9, 10, 38, 6, 7, 50, 23, 24, 25, 26, 56, 27, 28, 39, 40, 82, 92, 83, 84, 89, 122, 123, 42 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 41, 30, 8, 48, 53, 67, 128, 20, 32, 130, 48, 20, 21, 11, 63, 53, 64, 22, 12, 61, 62, 13, 33, 34, 35, 78, 79, 80, 36, 81, 1, 2, 3, 45, 20, 21, 54, 55, 87, 90, 22, 91, 37, 131, 3, 47, 96, 54, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 29, 29, 48, 57, 124, 20, 32, 124, 20, 32, 125, 46, 29, 138, 17, 20, 32, 2, 3, 29, 33, 34, 35, 33, 34, 35, 36, 20, 21, 36, 33, 34, 35, 22, 85, 44, 36, 91, 29, 49, 37, 143, 135, 37, 146, 139, 51, 136, 93, 94, 37, 140, 142, 20, 32, 58, 114, 144, 115, 147, 67, 118, 52, 151, 20, 32, 154, 59, 33, 34, 35, 80, 60, 81, 36, 66, 29, 20, 32, 33, 34, 35, 80, 65, 81, 36, 15, 16, 37, 150, 20, 21, 33, 34, 35, 31, 22, 20, 36, 37, 153, 20, 32, -1, 86, 81, 88, 141, 81, 18, 19, 116, 37, 120, 121, 117, 33, 34, 35, 67, 119, 133, 36, 134, 68, 69, 70, 71, 72, 73, 74, 75, 126, 43, 127, 137, 37, 76, 77, 78, 79, 80, 14, 81, 129, 0, 0, 0, 132, 67, 0, 0, 0, 95, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 0, 81, 0, 0, 0, 0, 0, 67, 0, 0, 0, 149, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 0, 81, 0, 0, 0, 0, 0, 67, 0, 0, 0, 152, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 0, 81, 0, 0, 0, 0, 0, 67, 0, 0, 0, 155, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 0, 81, 0, 0, 0, 0, 0, 67, 0, 0, 0, 156, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 0, 81, 67, 0, 0, 145, 0, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 0, 81, 67, 0, 0, 148, 0, 68, 69, 70, 71, 72, 73, 74, 75, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 67, 81, 0, 0, 0, 68, 69, 70, 71, 72, 73, 74, 0, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 67, 81, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 67, 81, 0, 0, 0, 68, 69, 70, 71, 72, 73, 0, 0, 0, 0, 0, 0, 0, 76, 77, 78, 79, 80, 0, 81 }; static const yytype_int16 yycheck[] = { 17, 12, 6, 23, 11, 8, 114, 6, 7, 117, 30, 6, 7, 39, 36, 11, 38, 12, 39, 36, 37, 0, 21, 22, 23, 28, 29, 30, 27, 32, 3, 4, 5, 41, 6, 7, 43, 44, 49, 56, 12, 58, 41, 42, 5, 40, 63, 43, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 11, 12, 87, 40, 36, 6, 7, 36, 6, 7, 42, 41, 23, 42, 37, 6, 7, 4, 5, 30, 21, 22, 23, 21, 22, 23, 27, 6, 7, 27, 21, 22, 23, 12, 45, 37, 27, 119, 49, 39, 41, 42, 124, 41, 42, 36, 35, 129, 59, 60, 41, 133, 134, 6, 7, 41, 36, 139, 38, 141, 8, 40, 35, 145, 6, 7, 148, 41, 21, 22, 23, 30, 41, 32, 27, 26, 87, 6, 7, 21, 22, 23, 30, 28, 32, 27, 5, 6, 41, 42, 6, 7, 21, 22, 23, 14, 12, 6, 27, 41, 42, 6, 7, 30, 6, 32, 7, 36, 32, 35, 36, 42, 41, 45, 46, 10, 21, 22, 23, 8, 41, 41, 27, 41, 13, 14, 15, 16, 17, 18, 19, 20, 42, 19, 42, 42, 41, 26, 27, 28, 29, 30, 5, 32, 116, -1, -1, -1, 119, 8, -1, -1, -1, 42, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, -1, 32, -1, -1, -1, -1, -1, 8, -1, -1, -1, 42, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, -1, 32, -1, -1, -1, -1, -1, 8, -1, -1, -1, 42, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, -1, 32, -1, -1, -1, -1, -1, 8, -1, -1, -1, 42, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, -1, 32, -1, -1, -1, -1, -1, 8, -1, -1, -1, 42, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, -1, 32, 8, -1, -1, 36, -1, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, -1, 32, 8, -1, -1, 36, -1, 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 8, 32, -1, -1, -1, 13, 14, 15, 16, 17, 18, 19, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 8, 32, -1, -1, -1, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 8, 32, -1, -1, -1, 13, 14, 15, 16, 17, 18, -1, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, -1, 32 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_int8 yystos[] = { 0, 3, 4, 5, 48, 49, 53, 54, 6, 50, 51, 39, 39, 0, 53, 54, 54, 37, 35, 36, 6, 7, 12, 56, 57, 58, 59, 61, 62, 72, 56, 54, 7, 21, 22, 23, 27, 41, 52, 63, 64, 65, 72, 51, 37, 41, 41, 40, 57, 39, 55, 35, 35, 11, 43, 44, 60, 40, 41, 41, 41, 65, 65, 36, 38, 28, 26, 8, 13, 14, 15, 16, 17, 18, 19, 20, 26, 27, 28, 29, 30, 32, 65, 67, 68, 72, 6, 56, 7, 69, 65, 65, 66, 72, 72, 42, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 36, 38, 42, 10, 40, 41, 45, 46, 70, 71, 36, 42, 42, 42, 68, 60, 68, 42, 66, 41, 41, 65, 65, 42, 42, 36, 65, 36, 65, 42, 65, 36, 42, 65, 36, 42, 42, 65, 42, 42, 65, 42, 42 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_int8 yyr1[] = { 0, 47, 48, 48, 48, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 54, 55, 56, 56, 57, 57, 57, 57, 57, 58, 59, 60, 60, 61, 61, 62, 62, 62, 63, 63, 64, 64, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 70, 70, 71, 71, 71, 71, 72, 72 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 1, 2, 2, 3, 2, 3, 1, 3, 1, 4, 1, 3, 4, 4, 3, 1, 2, 1, 1, 1, 2, 2, 2, 6, 1, 1, 3, 6, 3, 4, 4, 3, 3, 3, 3, 1, 1, 4, 4, 4, 1, 3, 1, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 1, 3, 0, 1, 4, 3, 6, 5, 5, 4, 6, 5, 5, 4, 1, 4 }; enum { YYENOMEM = -2 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Backward compatibility with an undocumented macro. Use YYerror or YYUNDEF. */ #define YYERRCODE YYUNDEF /* 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) /* This macro is provided for backward compatibility. */ # ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Kind, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; YY_USE (yyoutput); if (!yyvaluep) return; # ifdef YYPRINT if (yykind < YYNTOKENS) YYPRINT (yyo, yytoknum[yykind], *yyvaluep); # endif YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); yy_symbol_value_print (yyo, yykind, yyvaluep); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), &yyvsp[(yyi + 1) - (yynrhs)]); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) ((void) 0) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #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 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus = 0; /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ YYPTRDIFF_T yystacksize = YYINITDEPTH; /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; yy_state_t *yyss = yyssa; yy_state_t *yyssp = yyss; /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp = yyvs; int yyn; /* The return value of yyparse. */ int yyresult; /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYEMPTY; /* Cause a token to be read. */ 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 -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YY_ASSERT (0 <= yystate && yystate < YYNSTATES); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE goto yyexhaustedlab; #else { /* Get the current used size of the three stacks, in elements. */ YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined 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. */ yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; /* 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 (YY_("memory exhausted"), &yyss1, yysize * YYSIZEOF (*yyssp), &yyvs1, yysize * YYSIZEOF (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yy_state_t *yyss1 = yyss; union yyalloc *yyptr = YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YY_IGNORE_USELESS_CAST_BEGIN YYDPRINTF ((stderr, "Stack size increased to %ld\n", YY_CAST (long, yystacksize))); YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ if (yystate == YYFINAL) YYACCEPT; 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. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (); } if (yychar <= YYEOF) { yychar = YYEOF; yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else if (yychar == YYerror) { /* The scanner already issued an error message, process directly to error recovery. But do not keep the error token as lookahead, it is too special and may lead us to an endless loop in error recovery. */ yychar = YYUNDEF; yytoken = YYSYMBOL_YYerror; goto yyerrlab1; } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Discard the shifted token. */ yychar = YYEMPTY; 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]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 7: /* var_stmt: VAR dec_list */ #line 112 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { _pvariables = (yyvsp[0].pvec); } #line 1457 "parser.cc" break; case 8: /* var_stmt: VAR dec_list ';' */ #line 113 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { _pvariables = (yyvsp[-1].pvec); } #line 1463 "parser.cc" break; case 9: /* dec_list: node_dec */ #line 116 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec) = new std::vector(1, (yyvsp[0].ptree)); } #line 1469 "parser.cc" break; case 10: /* dec_list: dec_list ',' node_dec */ #line 117 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec) = (yyvsp[-2].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 1475 "parser.cc" break; case 11: /* node_dec: NAME */ #line 120 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_VAR, yylineno); setName((yyval.ptree), (yyvsp[0].stringptr)); } #line 1483 "parser.cc" break; case 12: /* node_dec: NAME '[' dim_list ']' */ #line 123 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_VAR, yylineno); setName((yyval.ptree), (yyvsp[-3].stringptr)); setParameters((yyval.ptree), (yyvsp[-1].pvec)); } #line 1492 "parser.cc" break; case 13: /* dim_list: expression */ #line 129 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec) = new std::vector(1, (yyvsp[0].ptree)); } #line 1498 "parser.cc" break; case 14: /* dim_list: dim_list ',' expression */ #line 130 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec)=(yyvsp[-2].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 1504 "parser.cc" break; case 15: /* data_stmt: DATA '{' relation_list '}' */ #line 133 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { ParseTree *p = new ParseTree(jags::P_RELATIONS, yylineno); setParameters(p, (yyvsp[-1].pvec)); _pdata = p; } #line 1514 "parser.cc" break; case 16: /* model_stmt: MODEL '{' relation_list '}' */ #line 140 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { ParseTree *p = new ParseTree(jags::P_RELATIONS, yylineno); setParameters(p, (yyvsp[-1].pvec)); _prelations = p; } #line 1524 "parser.cc" break; case 17: /* relations: '{' relation_list '}' */ #line 147 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_RELATIONS, yylineno); setParameters((yyval.ptree), (yyvsp[-1].pvec)); } #line 1533 "parser.cc" break; case 18: /* relation_list: relation */ #line 153 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec) = new std::vector(1, (yyvsp[0].ptree)); } #line 1539 "parser.cc" break; case 19: /* relation_list: relation_list relation */ #line 154 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec)=(yyvsp[-1].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 1545 "parser.cc" break; case 25: /* for_loop: counter relations */ #line 164 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FOR, yylineno); setParameters((yyval.ptree), (yyvsp[-1].ptree), (yyvsp[0].ptree)); } #line 1554 "parser.cc" break; case 26: /* counter: FOR '(' NAME IN range_element ')' */ #line 170 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_COUNTER, yylineno); setName((yyval.ptree), (yyvsp[-3].stringptr)); setParameters((yyval.ptree), (yyvsp[-1].ptree)); } #line 1563 "parser.cc" break; case 29: /* determ_relation: var assignment expression */ #line 180 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_DETRMREL, yylineno); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1572 "parser.cc" break; case 30: /* determ_relation: FUNC '(' var ')' assignment expression */ #line 184 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { /* The link function is given using an S-style replacement function notation. We need to turn this round so the inverse link function is applied to the RHS of the deterministic relation */ ParseTree *p = new ParseTree(jags::P_LINK, yylineno); setName(p, (yyvsp[-5].stringptr)); setParameters(p, (yyvsp[0].ptree)); (yyval.ptree) = new ParseTree(jags::P_DETRMREL, yylineno); setParameters((yyval.ptree), (yyvsp[-3].ptree), p); } #line 1591 "parser.cc" break; case 31: /* stoch_relation: var '~' distribution */ #line 200 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_STOCHREL, yylineno); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1600 "parser.cc" break; case 32: /* stoch_relation: var '~' distribution truncated */ #line 204 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_STOCHREL, yylineno); setParameters((yyval.ptree), (yyvsp[-3].ptree), (yyvsp[-1].ptree), (yyvsp[0].ptree)); } #line 1609 "parser.cc" break; case 33: /* stoch_relation: var '~' distribution interval */ #line 208 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_STOCHREL, yylineno); setParameters((yyval.ptree), (yyvsp[-3].ptree), (yyvsp[-1].ptree), (yyvsp[0].ptree)); } #line 1618 "parser.cc" break; case 34: /* product: expression '*' expression */ #line 214 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec) = new std::vector; (yyval.pvec)->push_back((yyvsp[-2].ptree)); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 1628 "parser.cc" break; case 35: /* product: product '*' expression */ #line 219 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { // This creates a shift-reduce conflict because in the expression // A*B*C, (A*B) is a valid expression. By default, bison shifts, // which is what we want. The warning is suppressed with the %expect // declaration (See also sum: below). (yyval.pvec) = (yyvsp[-2].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 1641 "parser.cc" break; case 36: /* sum: expression '+' expression */ #line 229 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec) = new std::vector; (yyval.pvec)->push_back((yyvsp[-2].ptree)); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 1651 "parser.cc" break; case 37: /* sum: sum '+' expression */ #line 234 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { // This creates a shift-reduce conflict. By default, bison shifts, // which is what we want. The warning is suppressed with the %expect // declaration (See also product: above). (yyval.pvec) = (yyvsp[-2].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 1663 "parser.cc" break; case 39: /* expression: DOUBLE */ #line 244 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" {(yyval.ptree) = new ParseTree(jags::P_VALUE, yylineno); (yyval.ptree)->setValue((yyvsp[0].val));} #line 1669 "parser.cc" break; case 40: /* expression: LENGTH '(' var ')' */ #line 245 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_LENGTH, yylineno); setParameters((yyval.ptree),(yyvsp[-1].ptree)); } #line 1678 "parser.cc" break; case 41: /* expression: DIM '(' var ')' */ #line 249 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_DIM, yylineno); setParameters((yyval.ptree),(yyvsp[-1].ptree)); } #line 1687 "parser.cc" break; case 42: /* expression: FUNC '(' expression_list ')' */ #line 253 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); setName((yyval.ptree), (yyvsp[-3].stringptr)); setParameters((yyval.ptree), (yyvsp[-1].pvec)); } #line 1696 "parser.cc" break; case 43: /* expression: product */ #line 257 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("*"); setParameters((yyval.ptree), (yyvsp[0].pvec)); } #line 1705 "parser.cc" break; case 44: /* expression: expression '/' expression */ #line 261 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("/"); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1714 "parser.cc" break; case 45: /* expression: sum */ #line 265 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("+"); setParameters((yyval.ptree), (yyvsp[0].pvec)); } #line 1723 "parser.cc" break; case 46: /* expression: expression '-' expression */ #line 269 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("-"); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1732 "parser.cc" break; case 47: /* expression: '-' expression */ #line 273 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("NEG"); setParameters((yyval.ptree), (yyvsp[0].ptree)); } #line 1741 "parser.cc" break; case 48: /* expression: expression ':' expression */ #line 277 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName(":"); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1750 "parser.cc" break; case 49: /* expression: expression GT expression */ #line 281 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName(">"); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1759 "parser.cc" break; case 50: /* expression: expression GE expression */ #line 285 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName(">="); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1768 "parser.cc" break; case 51: /* expression: expression LT expression */ #line 289 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("<"); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1777 "parser.cc" break; case 52: /* expression: expression LE expression */ #line 293 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("<="); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1786 "parser.cc" break; case 53: /* expression: expression EQ expression */ #line 297 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("=="); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1795 "parser.cc" break; case 54: /* expression: expression NE expression */ #line 301 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("!="); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1804 "parser.cc" break; case 55: /* expression: expression AND expression */ #line 305 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("&&"); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1813 "parser.cc" break; case 56: /* expression: expression OR expression */ #line 309 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("||"); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1822 "parser.cc" break; case 57: /* expression: expression '^' expression */ #line 313 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); (yyval.ptree)->setName("^"); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1831 "parser.cc" break; case 58: /* expression: expression SPECIAL expression */ #line 317 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_FUNCTION, yylineno); setName((yyval.ptree), (yyvsp[-1].stringptr)); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 1840 "parser.cc" break; case 59: /* expression: '(' expression ')' */ #line 321 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = (yyvsp[-1].ptree); } #line 1846 "parser.cc" break; case 60: /* expression_list: expression */ #line 324 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec) = new std::vector(1, (yyvsp[0].ptree)); } #line 1852 "parser.cc" break; case 61: /* expression_list: expression_list ',' expression */ #line 325 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec)=(yyvsp[-2].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 1858 "parser.cc" break; case 62: /* range_list: range_element */ #line 328 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec) = new std::vector(1, (yyvsp[0].ptree)); } #line 1864 "parser.cc" break; case 63: /* range_list: range_list ',' range_element */ #line 329 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.pvec)=(yyvsp[-2].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 1870 "parser.cc" break; case 64: /* range_element: %empty */ #line 332 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" {(yyval.ptree) = new ParseTree(jags::P_RANGE, yylineno);} #line 1876 "parser.cc" break; case 65: /* range_element: expression */ #line 333 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_RANGE, yylineno); setParameters((yyval.ptree),(yyvsp[0].ptree)); } #line 1885 "parser.cc" break; case 66: /* distribution: FUNC '(' expression_list ')' */ #line 340 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_DENSITY, yylineno); setName((yyval.ptree), (yyvsp[-3].stringptr)); setParameters((yyval.ptree), (yyvsp[-1].pvec)); } #line 1894 "parser.cc" break; case 67: /* distribution: FUNC '(' ')' */ #line 345 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { //BUGS has a dflat() distribution with no parameters (yyval.ptree) = new ParseTree(jags::P_DENSITY, yylineno); setName((yyval.ptree), (yyvsp[-2].stringptr)); } #line 1903 "parser.cc" break; case 68: /* truncated: 'T' '(' expression ',' expression ')' */ #line 354 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" {(yyval.ptree) = Truncated((yyvsp[-3].ptree),(yyvsp[-1].ptree));} #line 1909 "parser.cc" break; case 69: /* truncated: 'T' '(' ',' expression ')' */ #line 355 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" {(yyval.ptree) = Truncated(0,(yyvsp[-1].ptree));} #line 1915 "parser.cc" break; case 70: /* truncated: 'T' '(' expression ',' ')' */ #line 356 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" {(yyval.ptree) = Truncated((yyvsp[-2].ptree),0);} #line 1921 "parser.cc" break; case 71: /* truncated: 'T' '(' ',' ')' */ #line 357 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" {(yyval.ptree) = Truncated(0,0);} #line 1927 "parser.cc" break; case 72: /* interval: 'I' '(' expression ',' expression ')' */ #line 360 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" {(yyval.ptree) = Interval((yyvsp[-3].ptree),(yyvsp[-1].ptree));} #line 1933 "parser.cc" break; case 73: /* interval: 'I' '(' ',' expression ')' */ #line 361 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" {(yyval.ptree) = Interval(0,(yyvsp[-1].ptree));} #line 1939 "parser.cc" break; case 74: /* interval: 'I' '(' expression ',' ')' */ #line 362 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" {(yyval.ptree) = Interval((yyvsp[-2].ptree),0);} #line 1945 "parser.cc" break; case 75: /* interval: 'I' '(' ',' ')' */ #line 363 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" {(yyval.ptree) = Interval(0,0);} #line 1951 "parser.cc" break; case 76: /* var: NAME */ #line 366 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_VAR, yylineno); setName((yyval.ptree), (yyvsp[0].stringptr)); } #line 1959 "parser.cc" break; case 77: /* var: NAME '[' range_list ']' */ #line 369 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" { (yyval.ptree) = new ParseTree(jags::P_VAR, yylineno); setName((yyval.ptree), (yyvsp[-3].stringptr)); setParameters((yyval.ptree), (yyvsp[-1].pvec)); } #line 1968 "parser.cc" break; #line 1972 "parser.cc" default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; *++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. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; yyerror (YY_("syntax error")); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYSYMBOL_YYerror; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", YY_ACCESSING_SYMBOL (yystate), yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; goto yyreturn; #endif /*-------------------------------------------------------. | yyreturn -- parsing is finished, clean up and return. | `-------------------------------------------------------*/ yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 375 "../../../../../jags-4-3_patched/src/lib/compiler/parser.yy" static std::string error_buf; void yyerror (const char *s) { extern char * yytext; extern int yylineno; std::ostringstream msg; msg << std::string(s) << " on line " << yylineno << " near \"" << std::string(yytext) << "\""; error_buf = msg.str(); } static ParseTree *Truncated (ParseTree *left, ParseTree *right) { //JAGS-Style truncation notation ParseTree *p = new ParseTree(jags::P_BOUNDS, yylineno); setParameters(p, left, right); return p; } static ParseTree *Interval (ParseTree *left, ParseTree *right) { //BUGS-Style interval censoring notation ParseTree *p = new ParseTree(jags::P_INTERVAL, yylineno); setParameters(p, left, right); return p; } void setName(ParseTree *p, std::string *name) { /* The scanner cannot return a string, because a string cannot be part of a union. So instead the scanner returns a pointer to a newly allocated string. This memory must be freed as soon as it is used. */ p->setName(*name); delete name; } void setParameters(ParseTree *p, std::vector *parameters) { /* Same as setName (above). The parser dynamically allocates vectors of (pointers to) parameters. These vectors must be deleted when we are done with them. */ p->setParameters(*parameters); delete parameters; } void setParameters(ParseTree *p, ParseTree *param1) { /* Wrapper function that creates a vector containing param1 to be passed to ParseTree::setParameters. */ std::vector parameters(1, param1); p->setParameters(parameters); } void setParameters(ParseTree *p, ParseTree *param1, ParseTree *param2) { /* Wrapper function that creates a vector containing param1 and param2, to be passed to ParseTree::setParameters */ std::vector parameters; parameters.push_back(param1); parameters.push_back(param2); p->setParameters(parameters); } void setParameters(ParseTree *p, ParseTree *param1, ParseTree *param2, ParseTree *param3) { /* Wrapper function that creates a vector containing param1, param2 and param3, to be passed to ParseTree::setParameters */ std::vector parameters; parameters.push_back(param1); parameters.push_back(param2); parameters.push_back(param3); p->setParameters(parameters); } int parse_bugs (std::FILE *file, std::vector * &dec_list, ParseTree * &data, ParseTree * &relations, std::string &message) { extern std::FILE *yyin; yyin = file; int val = 0; error_buf.clear(); if (yyparse() == 0) { dec_list = _pvariables; data = _pdata; relations = _prelations; } else { message = error_buf; delete _pvariables; delete _prelations; delete _pdata; val = 1; } _pvariables = 0; _prelations = 0; _pdata = 0; yylex_destroy(); return val; } JAGS-4.3.2/src/lib/compiler/scanner.cc0000664000175000017500000016772214224054310014310 00000000000000 #line 2 "scanner.cc" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* begin standard C++ headers. */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_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. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif 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 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int yyl;\ for ( yyl = n; yyl < yyleng; ++yyl )\ if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) #define YY_LINENO_REWIND_TO(dst) \ do {\ const char *p;\ for ( p = yy_cp-1; p >= (dst); --p)\ if ( *p == '\n' )\ --yylineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE 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. */ int 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; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* 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 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* 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". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* 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 = NULL; static int yy_init = 0; /* 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 ( FILE *input_file ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); void yy_delete_buffer ( YY_BUFFER_STATE b ); void yy_flush_buffer ( YY_BUFFER_STATE b ); void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); void yypop_buffer_state ( void ); static void yyensure_buffer_stack ( void ); static void yy_load_buffer_state ( void ); static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ typedef flex_uint8_t YY_CHAR; FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); static void yynoreturn yy_fatal_error ( const 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 52 #define YY_END_OF_BUFFER 53 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static const flex_int16_t yy_acclist[207] = { 0, 40, 40, 53, 51, 52, 43, 51, 52, 43, 52, 25, 51, 52, 51, 52, 51, 52, 51, 52, 14, 51, 52, 15, 51, 52, 34, 51, 52, 30, 51, 52, 10, 51, 52, 31, 51, 52, 51, 52, 35, 51, 52, 45, 51, 52, 11, 51, 52, 9, 51, 52, 19, 51, 52, 27, 51, 52, 21, 51, 52, 49, 51, 52,16432, 49, 51, 52,16432, 49, 51, 52,16432, 12, 51, 52, 13, 51, 52, 32, 51, 52, 49, 51, 52,16432, 49, 51, 52,16432, 49, 51, 52,16432, 49, 51, 52,16432, 49, 51, 52, 16432, 49, 51, 52,16432, 16, 51, 52, 51, 52, 17, 51, 52, 28, 51, 52, 51, 52, 40, 52, 41, 52, 43, 24, 44, 38, 22, 33, 47, 39, 46, 45, 29, 18, 26, 20, 8240, 49,16432, 49, 16432, 37, 8240, 36, 8240, 49,16432, 49,16432, 49, 16432, 8, 49,16432, 49,16432, 49,16432, 49,16432, 23, 40, 41, 41, 42, 38, 46, 45, 49,16432, 49,16432, 49,16432, 7, 8240, 49,16432, 49,16432, 1, 49,16432, 50, 47, 46, 2, 49,16432, 5, 8240, 6, 8240, 49,16432, 49,16432, 49,16432, 3, 49,16432, 49,16432, 4, 8240 } ; static const flex_int16_t yy_accept[117] = { 0, 1, 1, 1, 2, 3, 4, 6, 9, 11, 14, 16, 18, 20, 23, 26, 29, 32, 35, 38, 40, 43, 46, 49, 52, 55, 58, 61, 65, 69, 73, 76, 79, 82, 86, 90, 94, 98, 102, 106, 109, 111, 114, 117, 119, 121, 123, 124, 125, 125, 126, 126, 127, 128, 129, 130, 131, 132, 133, 133, 134, 135, 136, 137, 137, 138, 140, 142, 142, 144, 144, 146, 148, 150, 152, 155, 157, 159, 161, 162, 162, 163, 164, 165, 166, 167, 167, 168, 168, 168, 169, 171, 173, 175, 175, 177, 179, 181, 184, 185, 185, 186, 186, 187, 190, 190, 192, 192, 194, 196, 198, 200, 203, 205, 205, 207, 207 } ; static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 4, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 6, 1, 7, 1, 8, 9, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 22, 23, 1, 1, 24, 24, 24, 24, 25, 24, 24, 24, 26, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 27, 24, 24, 24, 24, 24, 24, 28, 1, 29, 30, 31, 1, 32, 24, 24, 33, 34, 35, 36, 37, 38, 24, 24, 39, 40, 41, 42, 24, 24, 43, 24, 44, 24, 45, 24, 24, 24, 24, 46, 47, 48, 49, 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, 50, 1, 51, 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, 52, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static const YY_CHAR yy_meta[53] = { 0, 1, 2, 3, 1, 3, 1, 1, 1, 1, 4, 1, 5, 1, 1, 1, 4, 1, 4, 1, 1, 1, 1, 1, 4, 4, 4, 4, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1 } ; static const flex_int16_t yy_base[123] = { 0, 0, 0, 206, 205, 216, 258, 51, 55, 193, 211, 205, 203, 258, 258, 199, 258, 258, 258, 192, 197, 45, 258, 258, 47, 186, 185, 62, 65, 63, 258, 258, 258, 66, 64, 75, 80, 82, 85, 258, 159, 258, 258, 150, 0, 74, 97, 258, 195, 258, 187, 168, 258, 258, 85, 258, 87, 93, 107, 258, 258, 258, 258, 87, 258, 105, 121, 124, 258, 126, 258, 127, 128, 130, 131, 133, 137, 140, 258, 125, 0, 96, 132, 258, 258, 133, 127, 140, 148, 145, 152, 154, 155, 157, 258, 167, 170, 176, 258, 142, 76, 70, 53, 177, 179, 258, 180, 258, 183, 186, 189, 190, 192, 195, 258, 258, 227, 232, 237, 241, 245, 249, 253 } ; static const flex_int16_t yy_def[123] = { 0, 115, 1, 116, 116, 115, 115, 115, 115, 115, 117, 118, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 119, 119, 28, 115, 115, 115, 28, 28, 28, 28, 28, 28, 115, 115, 115, 115, 115, 120, 121, 115, 115, 117, 115, 118, 118, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 122, 28, 115, 115, 115, 115, 28, 28, 28, 28, 28, 28, 28, 115, 115, 120, 121, 121, 115, 115, 115, 115, 115, 115, 115, 28, 28, 28, 115, 115, 28, 28, 28, 115, 115, 115, 115, 115, 28, 115, 115, 115, 115, 28, 28, 28, 28, 28, 115, 115, 0, 115, 115, 115, 115, 115, 115, 115 } ; static const flex_int16_t yy_nxt[311] = { 0, 6, 7, 8, 7, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 30, 31, 32, 6, 27, 33, 27, 34, 27, 27, 35, 36, 37, 27, 27, 27, 27, 38, 39, 40, 41, 42, 6, 6, 43, 46, 46, 46, 46, 46, 46, 46, 46, 56, 59, 57, 63, 69, 63, 67, 63, 60, 58, 102, 64, 70, 64, 68, 64, 63, 65, 58, 65, 65, 63, 65, 63, 64, 82, 63, 102, 63, 64, 83, 64, 65, 100, 64, 65, 64, 71, 46, 46, 46, 46, 54, 72, 86, 73, 63, 115, 56, 85, 57, 87, 115, 75, 64, 74, 77, 58, 85, 88, 87, 88, 63, 76, 89, 67, 58, 69, 63, 63, 64, 63, 93, 68, 63, 70, 64, 64, 63, 64, 94, 63, 64, 82, 86, 99, 64, 99, 83, 64, 100, 87, 101, 63, 101, 104, 106, 102, 93, 100, 87, 64, 89, 105, 107, 89, 94, 91, 63, 96, 90, 63, 92, 95, 98, 51, 64, 63, 63, 64, 104, 106, 97, 103, 63, 64, 64, 63, 105, 107, 63, 63, 64, 113, 84, 64, 113, 49, 64, 64, 79, 114, 108, 109, 114, 78, 62, 61, 55, 54, 53, 52, 51, 49, 47, 115, 45, 45, 115, 115, 115, 115, 115, 115, 111, 112, 110, 44, 44, 44, 44, 44, 48, 48, 48, 48, 48, 50, 115, 115, 50, 50, 66, 115, 66, 80, 80, 80, 80, 81, 81, 81, 81, 81, 65, 115, 65, 5, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115 } ; static const flex_int16_t yy_chk[311] = { 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, 1, 1, 7, 7, 7, 7, 8, 8, 8, 8, 21, 24, 21, 27, 29, 34, 28, 33, 24, 21, 102, 27, 29, 34, 28, 33, 35, 27, 21, 27, 28, 36, 28, 37, 35, 45, 38, 101, 63, 36, 45, 37, 27, 100, 38, 28, 63, 33, 46, 46, 46, 46, 54, 33, 56, 34, 65, 81, 57, 54, 57, 56, 81, 36, 65, 35, 38, 57, 54, 58, 56, 58, 66, 37, 58, 67, 57, 69, 71, 72, 66, 73, 74, 67, 75, 69, 71, 72, 76, 73, 74, 77, 75, 82, 86, 85, 76, 85, 82, 77, 85, 86, 87, 90, 87, 91, 92, 87, 93, 99, 86, 90, 89, 91, 92, 88, 93, 72, 95, 76, 71, 96, 73, 75, 79, 51, 95, 97, 103, 96, 104, 106, 77, 90, 108, 97, 103, 109, 104, 106, 110, 111, 108, 112, 50, 109, 113, 48, 110, 111, 43, 112, 95, 96, 113, 40, 26, 25, 20, 19, 15, 12, 11, 10, 9, 5, 4, 3, 0, 0, 0, 0, 0, 0, 109, 110, 108, 116, 116, 116, 116, 116, 117, 117, 117, 117, 117, 118, 0, 0, 118, 118, 119, 0, 119, 120, 120, 120, 120, 121, 121, 121, 121, 121, 122, 0, 122, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115 } ; /* Table of booleans, true if rule could match eol. */ static const flex_int32_t yy_rule_can_match_eol[53] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, }; extern int yy_flex_debug; int yy_flex_debug = 0; static yy_state_type *yy_state_buf=0, *yy_state_ptr=0; 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 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" /* -*-C++-*- */ #line 3 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" /* Note the use of trailing context in the rules for the functions, allowing function names to be used as variable names. This occurs in the "otree" example where "mean" is used as a variable name. */ #include #include "remap.h" #include "parser.hh" #include void jags_scanner_error(const char *msg); #define YY_FATAL_ERROR(msg) jags_scanner_error (msg) #line 630 "scanner.cc" #line 632 "scanner.cc" #define INITIAL 0 #define COMMENT 1 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy ( void ); int yyget_debug ( void ); void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); void yyset_extra ( YY_EXTRA_TYPE user_defined ); FILE *yyget_in ( void ); void yyset_in ( FILE * _in_str ); FILE *yyget_out ( void ); void yyset_out ( FILE * _out_str ); int yyget_leng ( void ); char *yyget_text ( void ); int yyget_lineno ( void ); void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap ( void ); #else extern int yywrap ( void ); #endif #endif #ifndef YY_NO_UNPUT #endif #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput ( void ); #else static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #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 do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #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_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int 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 \ { \ errno=0; \ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #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 /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* 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 /*LINTED*/break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif /* Create the reject buffer large enough to save one state per allowed character. */ if ( ! (yy_state_buf) ) (yy_state_buf) = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE ); if ( ! (yy_state_buf) ) YY_FATAL_ERROR( "out of dynamic memory in yylex()" ); if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_load_buffer_state( ); } { #line 28 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" #line 856 "scanner.cc" while ( /*CONSTCOND*/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 { 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 >= 116 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } while ( yy_base[yy_current_state] != 258 ); 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; if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { int yyl; for ( yyl = 0; yyl < yyleng; ++yyl ) if ( yytext[yyl] == '\n' ) yylineno++; ; } do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 1: YY_RULE_SETUP #line 29 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return VAR; YY_BREAK case 2: YY_RULE_SETUP #line 30 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return DATA; YY_BREAK case 3: YY_RULE_SETUP #line 31 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return MODEL; YY_BREAK case 4: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 6; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 32 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return LENGTH; YY_BREAK case 5: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 3; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 33 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return DIM; YY_BREAK case 6: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 3; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 34 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return FOR; YY_BREAK case 7: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 2; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 35 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return IN; YY_BREAK case 8: YY_RULE_SETUP #line 36 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return IN; YY_BREAK case 9: YY_RULE_SETUP #line 37 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return ';'; YY_BREAK case 10: YY_RULE_SETUP #line 38 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return ','; YY_BREAK case 11: YY_RULE_SETUP #line 39 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return ':'; YY_BREAK case 12: YY_RULE_SETUP #line 40 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '['; YY_BREAK case 13: YY_RULE_SETUP #line 41 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return ']'; YY_BREAK case 14: YY_RULE_SETUP #line 42 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '('; YY_BREAK case 15: YY_RULE_SETUP #line 43 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return ')'; YY_BREAK case 16: YY_RULE_SETUP #line 44 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '{'; YY_BREAK case 17: YY_RULE_SETUP #line 45 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '}'; YY_BREAK case 18: YY_RULE_SETUP #line 46 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return LE; YY_BREAK case 19: YY_RULE_SETUP #line 47 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return LT; YY_BREAK case 20: YY_RULE_SETUP #line 48 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return GE; YY_BREAK case 21: YY_RULE_SETUP #line 49 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return GT; YY_BREAK case 22: YY_RULE_SETUP #line 50 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return AND; YY_BREAK case 23: YY_RULE_SETUP #line 51 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return OR; YY_BREAK case 24: YY_RULE_SETUP #line 52 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return NE; YY_BREAK case 25: YY_RULE_SETUP #line 53 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return NOT; YY_BREAK case 26: YY_RULE_SETUP #line 54 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return EQ; YY_BREAK case 27: YY_RULE_SETUP #line 55 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '='; YY_BREAK case 28: YY_RULE_SETUP #line 56 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '~'; YY_BREAK case 29: YY_RULE_SETUP #line 57 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return ARROW; YY_BREAK case 30: YY_RULE_SETUP #line 58 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '+'; YY_BREAK case 31: YY_RULE_SETUP #line 59 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '-'; YY_BREAK case 32: YY_RULE_SETUP #line 60 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '^'; YY_BREAK case 33: YY_RULE_SETUP #line 61 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '^'; YY_BREAK case 34: YY_RULE_SETUP #line 62 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '*'; YY_BREAK case 35: YY_RULE_SETUP #line 63 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return '/'; YY_BREAK case 36: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 65 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return 'T'; YY_BREAK case 37: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 66 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" return 'I'; YY_BREAK case 38: YY_RULE_SETUP #line 68 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" { /* Special operators, e.g. %*% for matrix multiplication */ yylval.stringptr = new std::string(yytext); return SPECIAL; } YY_BREAK case 39: YY_RULE_SETUP #line 74 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" BEGIN(COMMENT); YY_BREAK case 40: /* rule 40 can match eol */ YY_RULE_SETUP #line 75 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" ; /* Eat up anything that's not a '*' */ YY_BREAK case 41: /* rule 41 can match eol */ YY_RULE_SETUP #line 76 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" ; /* Eat up '*'s not followed by a '/' */ YY_BREAK case 42: YY_RULE_SETUP #line 77 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" BEGIN(INITIAL); YY_BREAK case 43: /* rule 43 can match eol */ YY_RULE_SETUP #line 79 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" /* Eat whitespace */ YY_BREAK case 44: /* rule 44 can match eol */ YY_RULE_SETUP #line 80 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" /* Eat comments */ YY_BREAK case 45: YY_RULE_SETUP #line 83 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" { yylval.val = atof(yytext); return DOUBLE; } YY_BREAK case 46: YY_RULE_SETUP #line 86 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" { yylval.val = atof(yytext); return DOUBLE; } YY_BREAK case 47: YY_RULE_SETUP #line 89 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" { yylval.val = atof(yytext); return DOUBLE; } YY_BREAK case 48: YY_RULE_SETUP #line 93 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" { yylval.stringptr = new std::string(yytext); return FUNC; } YY_BREAK case 49: YY_RULE_SETUP #line 98 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" { yylval.stringptr = new std::string(yytext); return NAME; } YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): #line 103 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" yyterminate(); YY_BREAK case 50: YY_RULE_SETUP #line 105 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" { throw std::logic_error("Coding error in file (UTF-8 replacement char U+FFFD found by parser)"); } YY_BREAK case 51: YY_RULE_SETUP #line 109 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" { /* Default rule for unmatched input. We return a BADCHAR which is not matched by any grammar rule, and so causes a syntax error. */ return BADCHAR; } YY_BREAK case 52: YY_RULE_SETUP #line 117 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK #line 1257 "scanner.cc" 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_LVALUE->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_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->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_LVALUE->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_LVALUE->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 user's declarations */ } /* 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 (void) { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->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_LVALUE->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_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->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_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->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 (void) { yy_state_type yy_current_state; 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 ) { 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 >= 116 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + 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 ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { int yy_is_jam; 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 >= 116 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 115); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #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_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (int) ((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 ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return 0; 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); if ( c == '\n' ) yylineno++; ; return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_init_buffer( YY_CURRENT_BUFFER, input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); 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_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = 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; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc( 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 *) yyalloc( (yy_size_t) (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; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree( (void *) b->yy_ch_buf ); yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { 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( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { 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 NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = (int) (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 = NULL; 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; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr ) { return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_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; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yynoreturn yy_fatal_error (const char* msg ) { 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. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param _line_number line number * */ void yyset_lineno (int _line_number ) { yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * _in_str ) { yyin = _in_str ; } void yyset_out (FILE * _out_str ) { yyout = _out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int _bdebug ) { yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ /* We do not touch yylineno unless the option is enabled. */ yylineno = 1; (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; (yy_state_buf) = 0; (yy_state_ptr) = 0; (yy_full_match) = 0; (yy_lp) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = NULL; yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; yyfree ( (yy_state_buf) ); (yy_state_buf) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size ) { /* 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 realloc(ptr, size); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 117 "../../../../../jags-4-3_patched/src/lib/compiler/scanner.ll" int yywrap() { return 1; } void jags_scanner_error (char const *msg) { throw std::runtime_error(msg); } JAGS-4.3.2/src/lib/compiler/parser.yy0000664000175000017500000003071514224052514014222 00000000000000/* -*-C++-*- */ %{ #include #include "remap.h" #include "parser_extra.h" #include #include #include #include #include #include using std::malloc; using std::free; using jags::ParseTree; void yyerror(const char *); int yylex(); int yylex_destroy(); extern int yylineno; #define YYDEBUG 1 static std::vector * _pvariables = 0; static ParseTree *_pdata = 0; static ParseTree *_prelations = 0; static void setName(ParseTree *p, std::string *name); static void setParameters(ParseTree *p, std::vector *parameters); static void setParameters(ParseTree *p, ParseTree *param1); static void setParameters(ParseTree *p, ParseTree *param1, ParseTree *param2); static void setParameters(ParseTree *p, ParseTree *param1, ParseTree *param2, ParseTree *param3); static ParseTree *Truncated (ParseTree *left, ParseTree *right); static ParseTree *Interval(ParseTree *left, ParseTree *right); %} %defines %union { /* We can't put any C++ class that requires a constructor in union. In particular, we can't have strings. To get round this limitation, we put a pointer to a string in the union, and then get the lexical analyzer to return a pointer to a dynamically allocated string. The parser frees the memory when it is done. This is tedious, but the alternative is to copy character arrays using, e.g. strncpy instead. */ double val; std::string *stringptr; jags::ParseTree *ptree; std::vector *pvec; } %token VAR %token DATA %token MODEL %token NAME %token FUNC %token SPECIAL %token BADCHAR %token IN %token ARROW %token FOR %token GT GE LT LE EQ NE %token AND OR %token LENGTH %token DIM %token DOUBLE %token INT %left OR %left AND %left NOT %nonassoc GT GE LT LE EQ NE %left '+' '-' %left '*' '/' %left SPECIAL %nonassoc ':' %left NEG %right '^' %token ENDL %type node_dec %type expression var %type relation for_loop counter %type determ_relation stoch_relation %type range_element %type distribution truncated interval relations %type dec_list relation_list expression_list dim_list %type range_list %type product sum %token UREPCHAR %expect 2 %% input: /* empty */ | model_stmt | var_stmt model_stmt | data_stmt model_stmt | var_stmt data_stmt model_stmt ; var_stmt: VAR dec_list { _pvariables = $2; } | VAR dec_list ';' { _pvariables = $2; } ; dec_list: node_dec { $$ = new std::vector(1, $1); } | dec_list ',' node_dec { $$ = $1; $$->push_back($3); } ; node_dec: NAME { $$ = new ParseTree(jags::P_VAR, yylineno); setName($$, $1); } | NAME '[' dim_list ']' { $$ = new ParseTree(jags::P_VAR, yylineno); setName($$, $1); setParameters($$, $3); } ; dim_list: expression { $$ = new std::vector(1, $1); } | dim_list ',' expression { $$=$1; $$->push_back($3); } ; data_stmt: DATA '{' relation_list '}' { ParseTree *p = new ParseTree(jags::P_RELATIONS, yylineno); setParameters(p, $3); _pdata = p; } ; model_stmt: MODEL '{' relation_list '}' { ParseTree *p = new ParseTree(jags::P_RELATIONS, yylineno); setParameters(p, $3); _prelations = p; } ; relations: '{' relation_list '}' { $$ = new ParseTree(jags::P_RELATIONS, yylineno); setParameters($$, $2); } ; relation_list: relation { $$ = new std::vector(1, $1); } | relation_list relation { $$=$1; $$->push_back($2); } ; relation: stoch_relation | determ_relation | for_loop | stoch_relation ';' | determ_relation ';' ; for_loop: counter relations { $$ = new ParseTree(jags::P_FOR, yylineno); setParameters($$, $1, $2); } ; counter: FOR '(' NAME IN range_element ')' { $$ = new ParseTree(jags::P_COUNTER, yylineno); setName($$, $3); setParameters($$, $5); } ; assignment: ARROW | '=' ; determ_relation: var assignment expression { $$ = new ParseTree(jags::P_DETRMREL, yylineno); setParameters($$, $1, $3); } | FUNC '(' var ')' assignment expression { /* The link function is given using an S-style replacement function notation. We need to turn this round so the inverse link function is applied to the RHS of the deterministic relation */ ParseTree *p = new ParseTree(jags::P_LINK, yylineno); setName(p, $1); setParameters(p, $6); $$ = new ParseTree(jags::P_DETRMREL, yylineno); setParameters($$, $3, p); } ; stoch_relation: var '~' distribution { $$ = new ParseTree(jags::P_STOCHREL, yylineno); setParameters($$, $1, $3); } | var '~' distribution truncated { $$ = new ParseTree(jags::P_STOCHREL, yylineno); setParameters($$, $1, $3, $4); } | var '~' distribution interval { $$ = new ParseTree(jags::P_STOCHREL, yylineno); setParameters($$, $1, $3, $4); } ; product: expression '*' expression { $$ = new std::vector; $$->push_back($1); $$->push_back($3); } | product '*' expression { // This creates a shift-reduce conflict because in the expression // A*B*C, (A*B) is a valid expression. By default, bison shifts, // which is what we want. The warning is suppressed with the %expect // declaration (See also sum: below). $$ = $1; $$->push_back($3); } ; sum: expression '+' expression { $$ = new std::vector; $$->push_back($1); $$->push_back($3); } | sum '+' expression { // This creates a shift-reduce conflict. By default, bison shifts, // which is what we want. The warning is suppressed with the %expect // declaration (See also product: above). $$ = $1; $$->push_back($3); } ; expression: var | DOUBLE {$$ = new ParseTree(jags::P_VALUE, yylineno); $$->setValue($1);} | LENGTH '(' var ')' { $$ = new ParseTree(jags::P_LENGTH, yylineno); setParameters($$,$3); } | DIM '(' var ')' { $$ = new ParseTree(jags::P_DIM, yylineno); setParameters($$,$3); } | FUNC '(' expression_list ')' { $$ = new ParseTree(jags::P_FUNCTION, yylineno); setName($$, $1); setParameters($$, $3); } | product { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("*"); setParameters($$, $1); } | expression '/' expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("/"); setParameters($$, $1, $3); } | sum { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("+"); setParameters($$, $1); } | expression '-' expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("-"); setParameters($$, $1, $3); } | '-' expression %prec NEG { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("NEG"); setParameters($$, $2); } | expression ':' expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName(":"); setParameters($$, $1, $3); } | expression GT expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName(">"); setParameters($$, $1, $3); } | expression GE expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName(">="); setParameters($$, $1, $3); } | expression LT expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("<"); setParameters($$, $1, $3); } | expression LE expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("<="); setParameters($$, $1, $3); } | expression EQ expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("=="); setParameters($$, $1, $3); } | expression NE expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("!="); setParameters($$, $1, $3); } | expression AND expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("&&"); setParameters($$, $1, $3); } | expression OR expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("||"); setParameters($$, $1, $3); } | expression '^' expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); $$->setName("^"); setParameters($$, $1, $3); } | expression SPECIAL expression { $$ = new ParseTree(jags::P_FUNCTION, yylineno); setName($$, $2); setParameters($$, $1, $3); } | '(' expression ')' { $$ = $2; } ; expression_list: expression { $$ = new std::vector(1, $1); } | expression_list ',' expression { $$=$1; $$->push_back($3); } ; range_list: range_element { $$ = new std::vector(1, $1); } | range_list ',' range_element { $$=$1; $$->push_back($3); } ; range_element: {$$ = new ParseTree(jags::P_RANGE, yylineno);} | expression { $$ = new ParseTree(jags::P_RANGE, yylineno); setParameters($$,$1); } ; distribution: FUNC '(' expression_list ')' { $$ = new ParseTree(jags::P_DENSITY, yylineno); setName($$, $1); setParameters($$, $3); } | FUNC '(' ')' { //BUGS has a dflat() distribution with no parameters $$ = new ParseTree(jags::P_DENSITY, yylineno); setName($$, $1); } ; //FIXME: It does not seem like a good idea to have NULL pointers here //We should replace these with a new ParseTree object of tclass P_NULL truncated: 'T' '(' expression ',' expression ')' {$$ = Truncated($3,$5);} | 'T' '(' ',' expression ')' {$$ = Truncated(0,$4);} | 'T' '(' expression ',' ')' {$$ = Truncated($3,0);} | 'T' '(' ',' ')' {$$ = Truncated(0,0);} ; interval: 'I' '(' expression ',' expression ')' {$$ = Interval($3,$5);} | 'I' '(' ',' expression ')' {$$ = Interval(0,$4);} | 'I' '(' expression ',' ')' {$$ = Interval($3,0);} | 'I' '(' ',' ')' {$$ = Interval(0,0);} ; var: NAME { $$ = new ParseTree(jags::P_VAR, yylineno); setName($$, $1); } | NAME '[' range_list ']' { $$ = new ParseTree(jags::P_VAR, yylineno); setName($$, $1); setParameters($$, $3); } ; %% static std::string error_buf; void yyerror (const char *s) { extern char * yytext; extern int yylineno; std::ostringstream msg; msg << std::string(s) << " on line " << yylineno << " near \"" << std::string(yytext) << "\""; error_buf = msg.str(); } static ParseTree *Truncated (ParseTree *left, ParseTree *right) { //JAGS-Style truncation notation ParseTree *p = new ParseTree(jags::P_BOUNDS, yylineno); setParameters(p, left, right); return p; } static ParseTree *Interval (ParseTree *left, ParseTree *right) { //BUGS-Style interval censoring notation ParseTree *p = new ParseTree(jags::P_INTERVAL, yylineno); setParameters(p, left, right); return p; } void setName(ParseTree *p, std::string *name) { /* The scanner cannot return a string, because a string cannot be part of a union. So instead the scanner returns a pointer to a newly allocated string. This memory must be freed as soon as it is used. */ p->setName(*name); delete name; } void setParameters(ParseTree *p, std::vector *parameters) { /* Same as setName (above). The parser dynamically allocates vectors of (pointers to) parameters. These vectors must be deleted when we are done with them. */ p->setParameters(*parameters); delete parameters; } void setParameters(ParseTree *p, ParseTree *param1) { /* Wrapper function that creates a vector containing param1 to be passed to ParseTree::setParameters. */ std::vector parameters(1, param1); p->setParameters(parameters); } void setParameters(ParseTree *p, ParseTree *param1, ParseTree *param2) { /* Wrapper function that creates a vector containing param1 and param2, to be passed to ParseTree::setParameters */ std::vector parameters; parameters.push_back(param1); parameters.push_back(param2); p->setParameters(parameters); } void setParameters(ParseTree *p, ParseTree *param1, ParseTree *param2, ParseTree *param3) { /* Wrapper function that creates a vector containing param1, param2 and param3, to be passed to ParseTree::setParameters */ std::vector parameters; parameters.push_back(param1); parameters.push_back(param2); parameters.push_back(param3); p->setParameters(parameters); } int parse_bugs (std::FILE *file, std::vector * &dec_list, ParseTree * &data, ParseTree * &relations, std::string &message) { extern std::FILE *yyin; yyin = file; int val = 0; error_buf.clear(); if (yyparse() == 0) { dec_list = _pvariables; data = _pdata; relations = _prelations; } else { message = error_buf; delete _pvariables; delete _prelations; delete _pdata; val = 1; } _pvariables = 0; _prelations = 0; _pdata = 0; yylex_destroy(); return val; } JAGS-4.3.2/src/lib/compiler/scanner.ll0000664000175000017500000000541714224052514014326 00000000000000/* -*-C++-*- */ %{ /* Note the use of trailing context in the rules for the functions, allowing function names to be used as variable names. This occurs in the "otree" example where "mean" is used as a variable name. */ #include #include "remap.h" #include "parser.hh" #include void jags_scanner_error(const char *msg); #define YY_FATAL_ERROR(msg) jags_scanner_error (msg) %} EXPONENT [eE][+-]?[0-9]+ BRACKET [ \t]*\( %x COMMENT %option nounput %option yylineno %option nodefault %% "var" return VAR; "data" return DATA; "model" return MODEL; "length"/{BRACKET} return LENGTH; "dim"/{BRACKET} return DIM; "for"/{BRACKET} return FOR; "in"/{BRACKET} return IN; "in" return IN; ";" return ';'; "," return ','; ":" return ':'; "[" return '['; "]" return ']'; "(" return '('; ")" return ')'; "{" return '{'; "}" return '}'; "<=" return LE; "<" return LT; ">=" return GE; ">" return GT; "&&" return AND; "||" return OR; "!=" return NE; "!" return NOT; "==" return EQ; "=" return '='; "~" return '~'; "<-" return ARROW; "+" return '+'; "-" return '-'; "^" return '^'; "**" return '^'; "*" return '*'; "/" return '/'; "T"/{BRACKET} return 'T'; "I"/{BRACKET} return 'I'; "%"+[^% \t\r\n]*"%" { /* Special operators, e.g. %*% for matrix multiplication */ yylval.stringptr = new std::string(yytext); return SPECIAL; } "/*" BEGIN(COMMENT); [^*]* ; /* Eat up anything that's not a '*' */ "*"+[^*/]* ; /* Eat up '*'s not followed by a '/' */ "*"+"/" BEGIN(INITIAL); [ \t\r\n\f]+ /* Eat whitespace */ "#".*\n /* Eat comments */ ([0-9]+){EXPONENT}? { yylval.val = atof(yytext); return DOUBLE; } ([0-9]+"."[0-9]*){EXPONENT}? { yylval.val = atof(yytext); return DOUBLE; } ("."[0-9]+){EXPONENT}? { yylval.val = atof(yytext); return DOUBLE; } ([a-zA-Z]+[a-zA-Z0-9\._]*)/{BRACKET} { yylval.stringptr = new std::string(yytext); return FUNC; } [a-zA-Z]+[a-zA-Z0-9\._]* { yylval.stringptr = new std::string(yytext); return NAME; } <> yyterminate(); \357\277\275 { throw std::logic_error("Coding error in file (UTF-8 replacement char U+FFFD found by parser)"); } . { /* Default rule for unmatched input. We return a BADCHAR which is not matched by any grammar rule, and so causes a syntax error. */ return BADCHAR; } %% int yywrap() { return 1; } void jags_scanner_error (char const *msg) { throw std::runtime_error(msg); } JAGS-4.3.2/src/lib/compiler/Compiler.cc0000664000175000017500000012740614224052514014430 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "MixCompiler.h" #include #include #include #include #include #include #include #include #include #include using std::string; using std::vector; using std::list; using std::map; using std::pair; using std::invalid_argument; using std::runtime_error; using std::logic_error; using std::ostringstream; using std::min; using std::max; using std::set; using std::fabs; using std::max_element; namespace jags { typedef pair, vector > CNodeKey; bool lt(CNodeKey const &k1, CNodeKey const &k2) { //Sort first on dimension if (k1.first < k2.first) { return true; } else if (k1.first > k2.first) { return false; } else { //Fuzzy sort on values return lt(&k1.second[0], &k2.second[0], k1.second.size()); } } typedef map > CNodeMap; #include template string ToString(const T& val) { ostringstream strm; strm << val; return strm.str(); } static void CompileError(ParseTree const *p, string const &msg1, string const &msg2 = "") { string msg = string("Compilation error on line ") + ToString(p->line()) + "."; if (!msg1.empty()) { msg.append("\n"); msg.append(msg1); } if (!msg2.empty()) { msg.append(" "); msg.append(msg2); } throw runtime_error(msg); } /* * By analysing the ParseTree containing the relations, we can * find variables that appear on the right hand side of a relation * but which are never defined. This is such a fundamental error * that it is worth doing this before trying to build the Model. */ /* static void getRHSNames(ParseTree const *t, map &rhs, vector const &cntrs) { //Get variable names that appear on the right hand side of a //relation excluding active counters, and add them to the map //rhs, which also records the line number. //Safety check: truncation expressions can have NULL pointers if (t == 0) return; if (t->treeClass() == P_VAR) { if (find(cntrs.begin(), cntrs.end(), t->name()) == cntrs.end()) { //Not an active counter if (rhs.count(t->name()) == 0) { //Not already used rhs[t->name()] = t->line(); } } } for (vector::const_iterator p = t->parameters().begin(); p != t->parameters().end(); ++p) { //Continue recursive search getRHSNames(*p, rhs, cntrs); } } */ /* Experimental features to add additional checks prior to compilation static void classifyVarNames(ParseTree const *rels, set &lhs, map &rhs, vector &counters) { //Get variable names that appear on the left hand side and //the right hand side of any relation. We also track the names //of the active counters. for (vector::const_iterator p = rels->parameters().begin(); p != rels->parameters().end(); ++p) { vector const &par = (*p)->parameters(); switch ((*p)->treeClass()) { case P_FOR: getRHSNames(par[0]->parameters()[0], rhs, counters); counters.push_back(par[0]->name()); classifyVarNames(par[1], lhs, rhs, counters); counters.pop_back(); break; case P_STOCHREL: case P_DETRMREL: lhs.insert(par[0]->name()); for (unsigned int i = 1; i < par.size(); ++i) { getRHSNames(par[i], rhs, counters); } break; default: throw logic_error("Malformed parse tree"); break; } } } static void classifyVarNames(ParseTree const *relations, set &lhs, map &rhs) { //Non-recursive form of classifyVarNames. We also check that //the counter stack is valid. vector counters; classifyVarNames(relations, lhs, rhs, counters); if (!counters.empty()) { string msg = string("Invalid counter stack\n") + "Ensure that all for loops are closed"; throw runtime_error(msg); } } static void checkVarNames(ParseTree const *relations, map const &data_table) { //Check that all parameters appearing on RHS of a relation are //defined, either in a declaration or in the data set lhs; map rhs; classifyVarNames(relations, lhs, rhs); //Erase variable names that appear on the LHS of a relation for(set::const_iterator p = lhs.begin(); p != lhs.end(); ++p) { rhs.erase(*p); } //Erase variable names that appear in the data table for(map::const_iterator p = data_table.begin(); p != data_table.end(); ++p) { rhs.erase(p->first); } if (!rhs.empty()) { ostringstream oss; oss << "Unknown variable(s):\n"; for (map::iterator p = rhs.begin(); p != rhs.end(); ++p) { oss << p->first << " (line " << p->second << ")\n"; } oss << "Either supply values for these variables with the data\n" << "or define them on the left hand side of a relation."; throw runtime_error(oss.str()); } } static void checkDecNames(vector const &declarations, map const &data_table) { //Check that dimension expressions in node declarations //do not depend on undefined nodes map rhs; for (unsigned int i = 0; i < declarations.size(); ++i) { vector const &pari = declarations[i]->parameters(); for (unsigned int j = 0; j < pari.size(); ++j) { getRHSNames(pari[j], rhs, vector()); } //Erase variable names that appear in the data table for(map::const_iterator p = data_table.begin(); p != data_table.end(); ++p) { rhs.erase(p->first); } if (!rhs.empty()) { ostringstream oss; oss << "Cannot calculate dimensions of " << declarations[i]->name() << " because the following variables are undefined:\n"; for (map::iterator p = rhs.begin(); p != rhs.end(); ++p) { oss << p->first << " (line " << p->second << ")\n"; } oss << "Supply values for these variables with the data."; throw runtime_error(oss.str()); } } } */ void Compiler::getLHSVars(ParseTree const *rel) { //Utility function to get the names of variables used on the //left hand side of a relation. These are added to the set //_lhs_vars. The main use of this information is to give better //diagnostic messages when we cannot resolve a variable name. if (rel->treeClass() != P_STOCHREL && rel->treeClass() != P_DETRMREL) { throw logic_error("Malformed parse tree in Compiler::getLHSVars"); } ParseTree *var = rel->parameters()[0]; _lhs_vars.insert(var->name()); } Node * Compiler::constFromTable(ParseTree const *p) { // Get a constant value directly from the data table if (!_index_expression) { throw logic_error("Can only call constFromTable inside index expression"); } if (_countertab.getCounter(p->name())) { // DO NOT get value from the data table if there is a counter // that shares the same name. return 0; } map::const_iterator i = _data_table.find(p->name()); if (i == _data_table.end()) { return 0; } SArray const &sarray = i->second; Range subset_range = getRange(p, sarray.range()); if (isNULL(subset_range)) { //Range expression not evaluated return 0; } else if (subset_range.length() > 1) { //Multivariate constant RangeIterator i(subset_range); unsigned int n = subset_range.length(); //double const *v = sarray.value(); vector const &v = sarray.value(); vector value(n); for (unsigned int j = 0; j < n; ++j, i.nextLeft()) { unsigned int offset = sarray.range().leftOffset(i); value[j] = v[offset]; if (value[j] == JAGS_NA) { return 0; } } return getConstant(subset_range.dim(false), value, _model.nchain(), true); } else { //Scalar constant unsigned int offset = sarray.range().leftOffset(subset_range.first()); double value = sarray.value()[offset]; if (value == JAGS_NA) { return 0; } else { return getConstant(value, _model.nchain(), true); } } } bool Compiler::indexExpression(ParseTree const *p, vector &value) { /* Evaluates an index expression. Index expressions occur in three contexts: 1) In the limits of a "for" loop 2) On the left hand side of a relation 3) On the right hand side of a relation They are integer-valued, constant expressions. We return true on success and the result is written to the parameter value. */ /* The counter _index_expression is non-zero if we are inside an Index expression. This invokes special rules in the functions getParameter and getArraySubset. The counter tracks the levels of nesting of index expressions. The vector _index_nodes holds the Nodes created during the evaluation of the index expression. */ bool isfixed = true; _index_expression++; Node *node = getParameter(p); _index_expression--; if (!node || !node->isFixed()) { isfixed = false; } else { for (unsigned int i = 0; i < node->length(); ++i) { double v = node->value(0)[i]; if (!checkInteger(v)) { throw NodeError(node, "Index expression evaluates to non-integer value"); } value.push_back(asInteger(v)); } } /* Make sure we always clean up at the top-level call to IndexExpression */ if (_index_expression == 0) { while(!_index_nodes.empty()) { Node *inode = _index_nodes.back(); _index_nodes.pop_back(); inode->unlinkParents(); delete inode; } } return isfixed; } Range Compiler::getRange(ParseTree const *p, SimpleRange const &default_range) { /* Evaluate a range expression. If successful, it returns the range corresponding to the expression. If unsuccessful (due to missing values) returns a null range. The default_range argument provides default values if the range expression is blank: e.g. foo[] or bar[,1]. The default range may a NULL range, in which case, missing indices will result in failure. */ vector const &range_list = p->parameters(); string const &name = p->name(); if (range_list.empty()) { //An empty range expression implies the default range return default_range; } // Check size and integrity of range expression unsigned int size = range_list.size(); if (!isNULL(default_range) && size != default_range.ndim(false)) { CompileError(p, "Dimension mismatch taking subset of", name); } for (unsigned int i = 0; i < size; ++i) { if (range_list[i]->treeClass() != P_RANGE) { throw logic_error("Malformed parse tree. Expected range expression"); } } // Now step through and evaluate lower and upper index expressions vector > scope(size); for (unsigned int i = 0; i < size; i++) { switch (range_list[i]->parameters().size()) { case 0: // Empty index implies default range if (isNULL(default_range)) { return Range(); } scope[i] = default_range.scope()[i]; break; case 1: if (!indexExpression(range_list[i]->parameters()[0], scope[i])) { return Range(); } if (scope[i].empty()) { CompileError(p, "Invalid range"); } break; default: throw logic_error("Malformed parse tree in index expression"); } } if (!isNULL(default_range)) { // If a default range is given, the subset cannot be outside of it if (!default_range.contains(Range(scope))) { CompileError(p, "Index out of range taking subset of ", name); } } return Range(scope); } SimpleRange Compiler::VariableSubsetRange(ParseTree const *var) { /* Get the range of a subset expression of a variable on the LHS of a relation. This means that the subset expression must be constant and it must be a simple range. */ if (var->treeClass() != P_VAR) { throw logic_error("Expecting variable expression"); } string const &name = var->name(); if (_countertab.getCounter(name)) { CompileError(var, "Attempt to redefine counter defined in for loop:", name); } NodeArray *array = _model.symtab().getVariable(name); SimpleRange default_range; if (array) { // Declared node vector const &range_list = var->parameters(); if (range_list.empty()) { //Missing range implies the whole node return array->range(); } if (range_list.size() != array->range().ndim(false)) { CompileError(var, "Dimension mismatch in subset expression of", name); } default_range = array->range(); } Range range = getRange(var, default_range); if (isNULL(range)) { CompileError(var, "Cannot evaluate subset expression for", name); } //New in 4.1.0: Enforce use of simple ranges on the LHS of a relation for (unsigned int i = 0; i < range.ndim(false); ++i) { vector const &indices = range.scope()[i]; for (unsigned int j = 1; j < indices.size(); ++j) { if (indices[j] != indices[j-1] + 1) { string msg = string("Invalid subset expression for ") + name + "\nIndex expressions on the left hand side of a relation" + "\nmust define a contiguous, increasing set of indices"; CompileError(var, msg); } } } return SimpleRange(range.first(), range.last()); } Range Compiler::CounterRange(ParseTree const *var) { /* The range expression for a counter differs from that of a variable in that it is 1) one-dimensional 2) may not be empty Further, no variables are created for counters in the Symbol Table */ if (var->treeClass() != P_COUNTER) { throw logic_error("Expecting counter expression"); } if (var->parameters().size() != 1) { throw logic_error("Invalid counter expression"); } Range range; ParseTree const *prange = var->parameters()[0]; if (prange->treeClass() != P_RANGE) { throw logic_error("Expecting range expression"); } unsigned int size = prange->parameters().size(); if (size != 1) { throw logic_error(string("Invalid range expression for counter ") + var->name()); } vector indices; if(!indexExpression(prange->parameters()[0], indices)) { CompileError(var, "Cannot evaluate range of counter", var->name()); } if (indices.empty()) { return Range(); } else { return Range(vector >(1, indices)); } } Node * Compiler::getConstant(double value, unsigned int nchain, bool observed) { return getConstant(vector(1, 1), vector(1, value), nchain, observed); } Node * Compiler::getConstant(vector const &dim, vector const &value, unsigned int nchain, bool observed) { ConstantNode * cnode = 0; if (_index_expression) { cnode = new ConstantNode(dim, value, nchain, observed); _index_nodes.push_back(cnode); } else { CNodeMap::key_type k(dim, value); CNodeMap::const_iterator p = _cnode_map.find(k); if (p != _cnode_map.end()) { cnode = p->second; } else { cnode = new ConstantNode(dim, value, nchain, observed); _cnode_map[k] = cnode; _model.addNode(cnode); } } return cnode; } Node *Compiler::getArraySubset(ParseTree const *p) { Node *node = 0; if (p->treeClass() != P_VAR) { throw logic_error("Expecting expression"); } if (_index_expression) { //It is possible to evaluate an index expression before //any Nodes are available from the symbol table. node = constFromTable(p); if (node) return node; } Counter *counter = _countertab.getCounter(p->name()); //A counter if (counter) { node = getConstant((*counter)[0], _model.nchain(), false); } else { NodeArray *array = _model.symtab().getVariable(p->name()); if (array) { Range subset_range = getRange(p, array->range()); if (!isNULL(subset_range)) { //A fixed subset if (!array->range().contains(subset_range)) { CompileError(p, "Subset out of range:", array->name() + print(subset_range)); } node = array->getSubset(subset_range, _model); if (node == 0 && _resolution_level == 1) { /* At resolution level 1 we make a note of all subsets that could not be resolved. Example: we have just failed to resolve x[1:5] but we need to know which of x[1], x[2], x[3], x[4], x[5] are empty. */ bool empty = true; for (RangeIterator r(subset_range); !r.atEnd(); r.nextLeft()) { if (array->getSubset(SimpleRange(r,r), _model)) { empty = false; break; } } if (empty) { //No elements found, so report the whole range //as missing, e.g. x[1:5] pair upair(p->name(), subset_range); if (_umap.find(upair) == _umap.end()) { set lines; lines.insert(p->line()); _umap[upair] = lines; } else { _umap.find(upair)->second.insert(p->line()); } } else { //Some elements found, so report only the missing //elements, e.g. x[5] for (RangeIterator r(subset_range); !r.atEnd(); r.nextLeft()) { SimpleRange sr(r,r); if (!array->getSubset(sr, _model)) { pair upair(p->name(), sr); if (_umap.find(upair) == _umap.end()) { set lines; lines.insert(p->line()); _umap[upair] = lines; } else { _umap.find(upair)->second.insert(p->line()); } } } } } } else if (!_index_expression) { //A stochastic subset node = getMixtureNode(p, this); if (node == 0 && _resolution_level == 1) { getMissingMixParams(p, _umap, this); } } } else if (_lhs_vars.find(p->name()) == _lhs_vars.end()) { string msg = string("Unknown variable ") + p->name() + "\n" + "Either supply values for this variable with the data\n" + "or define it on the left hand side of a relation."; CompileError(p, msg); } else if (_resolution_level == 1) { string msg = string("Possible directed cycle involving ") + p->name(); CompileError(p, msg); } } return node; } static FunctionPtr const & getFunction(ParseTree const *t, FuncTab const &functab) { if (t->treeClass() != P_FUNCTION) throw logic_error("Malformed parse tree: Expected function"); FunctionPtr const &func = functab.find(t->name()); if (isNULL(func)) { CompileError(t, "Unknown function:", t->name()); } return func; } Node *Compiler::getLength(ParseTree const *p, SymTab const &symtab) { if (p->treeClass() != P_LENGTH) { throw logic_error("Malformed parse tree. Expecting dim expression"); } ParseTree const *var = p->parameters()[0]; if (var->treeClass() != P_VAR) { throw logic_error("Malformed parse tree. Expecting variable name"); } NodeArray const *array = symtab.getVariable(var->name()); if (array) { Range subset_range = getRange(var, array->range()); if (isNULL(subset_range)) { return 0; } else { double length = product(subset_range.dim(true)); return getConstant(length, _model.nchain(), false); } } else { return 0; } } Node *Compiler::getDim(ParseTree const *p, SymTab const &symtab) { if (p->treeClass() != P_DIM) { throw logic_error("Malformed parse tree. Expecting dim expression"); } ParseTree const *var = p->parameters()[0]; if (var->treeClass() != P_VAR) { throw logic_error("Malformed parse tree. Expecting variable name"); } NodeArray const *array = symtab.getVariable(var->name()); if (array) { Range subset_range = getRange(var, array->range()); if (isNULL(subset_range)) { return 0; } else { vector idim = subset_range.dim(false); vector ddim(idim.size()); for (unsigned int j = 0; j < idim.size(); ++j) { ddim[j] = idim[j]; } vector d(1, idim.size()); return getConstant(d, ddim, _model.nchain(), false); } } else { return 0; } } /* * Evaluates the expression t, and returns a pointer to a Node. If the * expression cannot be evaluated, a NULL pointer is returned. */ Node * Compiler::getParameter(ParseTree const *t) { vector parents; Node *node = 0; switch (t->treeClass()) { case P_VALUE: node = getConstant(t->value(), _model.nchain(), false); break; case P_VAR: node = getArraySubset(t); break; case P_LENGTH: node = getLength(t,_model.symtab()); break; case P_DIM: node = getDim(t, _model.symtab()); break; case P_LINK: if (getParameterVector(t, parents)) { LinkFunction const *link = funcTab().findLink(t->name()); if (!link) { CompileError(t, "Unknown link function:", t->name()); } node = _logicalfactory.getNode(FunctionPtr(link), parents, _model); } break; case P_FUNCTION: if (getParameterVector(t, parents)) { FunctionPtr const &func = getFunction(t, funcTab()); if (_index_expression) { node = LogicalFactory::newNode(func, parents, _model.nchain()); _index_nodes.push_back(node); } else { node = _logicalfactory.getNode(func, parents, _model); } } break; default: throw logic_error("Malformed parse tree."); break; } if (!node) return 0; if (_index_expression) { //Random variables in index expressions must be observed if (node->randomVariableStatus() == RV_TRUE_UNOBSERVED) return 0; } return node; } /* * Before creating the node y <- foo(a,b), or z ~ dfoo(a,b), the parent * nodes must a,b be created. This expression evaluates the vector(a,b) * Arguments are the same as for getParameter. */ bool Compiler::getParameterVector(ParseTree const *t, vector &parents) { if (!parents.empty()) { throw logic_error("parent vector must be empty in getParameterVector"); } bool ok = true; switch (t->treeClass()) { case P_FUNCTION: case P_LINK: case P_DENSITY: if (t->parameters().size() == 0) CompileError(t, "Parameter(s) missing for", t->name()); for (unsigned int i = 0; i < t->parameters().size(); ++i) { Node *node = getParameter(t->parameters()[i]); if (node) { parents.push_back(node); } else { ok = false; } } if (!ok) { parents.clear(); return false; } break; default: throw logic_error("Invalid Parse Tree."); } return true; } Node * Compiler::allocateStochastic(ParseTree const *stoch_relation) { ParseTree const *distribution = stoch_relation->parameters()[1]; // Create the parameter vector vector parameters; if (!getParameterVector(distribution, parameters)) { return 0; } // Set upper and lower bounds Node *lBound = 0, *uBound = 0; if (stoch_relation->parameters().size() == 3) { //Truncated distribution ParseTree const *truncated = stoch_relation->parameters()[2]; switch(truncated->treeClass()) { case P_BOUNDS: case P_INTERVAL: break; default: throw logic_error("Invalid parse tree"); } ParseTree const *ll = truncated->parameters()[0]; ParseTree const *ul = truncated->parameters()[1]; if (ll) { lBound = getParameter(ll); if (!lBound) { return 0; } } if (ul) { uBound = getParameter(ul); if (!uBound) { return 0; } } } /* Check data table to see if this is an observed node. If it is, we put the data in an array of doubles pointed to by this_data, and set data_length equal to the length of the array */ double *this_data = 0; unsigned int data_length = 0; ParseTree *var = stoch_relation->parameters()[0]; map::const_iterator q = _data_table.find(var->name()); if (q != _data_table.end()) { vector const &data_value = q->second.value(); SimpleRange const &data_range = q->second.range(); SimpleRange target_range = VariableSubsetRange(var); data_length = target_range.length(); this_data = new double[data_length]; unsigned int i = 0; unsigned int nmissing = 0; for (RangeIterator p(target_range); !p.atEnd(); p.nextLeft()) { unsigned int j = data_range.leftOffset(p); if (data_value[j] == JAGS_NA) { ++nmissing; } this_data[i++] = data_value[j]; } if (nmissing == data_length) { delete [] this_data; this_data = 0; data_length = 0; } else if (nmissing != 0) { delete [] this_data; CompileError(var, var->name() + print(target_range), "is partly observed and partly missing"); } } // Check that distribution exists string const &distname = distribution->name(); DistPtr const &dist = distTab().find(distname); if (isNULL(dist)) { CompileError(distribution, "Unknown distribution:", distname); } if (!this_data) { /* Special rule for observable functions, which exist both as a Function and a Distribution. If the node is unobserved, and we find a function matched to the distribution in obsFuncTab, then we create a Logical Node instead. */ FunctionPtr const &func = obsFuncTab().find(dist); if (!isNULL(func)) { LogicalNode *lnode = LogicalFactory::newNode(func, parameters, _model.nchain()); _model.addNode(lnode); return lnode; } } /* We allow BUGS-style interval censoring notation for compatibility but only allow it if there are no free parameters in the distribution */ if (stoch_relation->parameters().size() == 3) { ParseTree const *t = stoch_relation->parameters()[2]; if (t->treeClass() == P_INTERVAL) { for (unsigned int i = 0; i < parameters.size(); ++i) { if (!parameters[i]->isFixed()) { CompileError(stoch_relation, "BUGS I(,) notation is only allowed if", "all parameters are fixed"); } } } } StochasticNode *snode = 0; if (SCALAR(dist)) { snode = new ScalarStochasticNode(SCALAR(dist), _model.nchain(), parameters, lBound, uBound); } else if (VECTOR(dist)) { snode = new VectorStochasticNode(VECTOR(dist), _model.nchain(), parameters, lBound, uBound); } else if (ARRAY(dist)) { snode = new ArrayStochasticNode(ARRAY(dist), _model.nchain(), parameters, lBound, uBound); } else { throw logic_error("Unable to classify distribution"); } _model.addNode(snode); if (this_data) { snode->setData(this_data, data_length); delete [] this_data; } return snode; } Node * Compiler::allocateLogical(ParseTree const *rel) { ParseTree *expression = rel->parameters()[1]; Node *node = 0; vector parents; switch (expression->treeClass()) { case P_VALUE: node = getConstant(expression->value(), _model.nchain(), false); break; case P_VAR: case P_FUNCTION: case P_LINK: case P_LENGTH: case P_DIM: node = getParameter(expression); break; default: throw logic_error("Malformed parse tree in Compiler::allocateLogical"); } /* Check that there are no values in the data table corresponding to this node. */ ParseTree *var = rel->parameters()[0]; map::const_iterator q = _data_table.find(var->name()); if (q != _data_table.end()) { vector const &data_value = q->second.value(); SimpleRange const &data_range = q->second.range(); SimpleRange target_range = VariableSubsetRange(var); for (RangeIterator p(target_range); !p.atEnd(); p.nextLeft()) { unsigned int j = data_range.leftOffset(p); if (data_value[j] != JAGS_NA) { CompileError(var, var->name() + print(target_range), "is a logical node and cannot be observed"); } } } return node; } void Compiler::allocate(ParseTree const *rel) { if (_is_resolved[_n_relations]) return; Node *node = 0; switch(rel->treeClass()) { case P_STOCHREL: node = allocateStochastic(rel); break; case P_DETRMREL: node = allocateLogical(rel); break; default: throw logic_error("Malformed parse tree in Compiler::allocate"); break; } SymTab &symtab = _model.symtab(); if (node) { ParseTree *var = rel->parameters()[0]; NodeArray *array = symtab.getVariable(var->name()); if (!array) { //Undeclared array. Its size is inferred from the dimensions of //the newly created node vector const &dim = node->dim(); for (unsigned int i = 0; i < dim.size(); ++i) { if (dim[i] == 0) { CompileError(var, "Zero dimension for variable " + var->name()); } } symtab.addVariable(var->name(), dim); array = symtab.getVariable(var->name()); array->insert(node, array->range()); } else { // Check if a node is already inserted into this range SimpleRange range = VariableSubsetRange(var); if (array->getSubset(range, _model)) { CompileError(var, "Attempt to redefine node", var->name() + print(range)); } array->insert(node, range); } _n_resolved++; _is_resolved[_n_relations] = true; } else if (_resolution_level == 2) { /* Remove from the set of unresolved parameters, any array subsets that are defined on the left hand side of a relation */ ParseTree *var = rel->parameters()[0]; SimpleRange range = VariableSubsetRange(var); _umap.erase(pair(var->name(), range)); /* In addition, the parameter might be a *subset* of a node defined on the LHS of a relation. */ map, set >::iterator p = _umap.begin(); while (p != _umap.end()) { pair const &up = p->first; if (up.first == var->name() && range.contains(up.second)) { _umap.erase(p++); } else { p++; } } } } void Compiler::setConstantMask(ParseTree const *rel) { ParseTree const *var = rel->parameters()[0]; string const &name = var->name(); map >::iterator p = _constant_mask.find(name); if (p == _constant_mask.end()) { return; } map::const_iterator q = _data_table.find(name); if (q == _data_table.end()) { throw logic_error ("Error in Compiler::setConstantMask"); } SimpleRange range = VariableSubsetRange(var); SimpleRange const &var_range = q->second.range(); if (!var_range.contains(range)) { throw logic_error("Invalid range in Compiler::setConstantMask."); } vector &mask = p->second; for (RangeIterator i(range); !i.atEnd(); i.nextLeft()) { mask[var_range.leftOffset(i)] = false; } } void Compiler::getArrayDim(ParseTree const *p) { /* Called by traverseTree. For each node array, calculates the upper bounds of the subset expressions on the left-and side of all relations. The results are stored in the map _node_array_bounds which is then used to calculate the dimensions of the node arrays. */ ParseTree const *var = p->parameters()[0]; if (var->parameters().empty()) { //No index expession => No info on array size return; } SimpleRange new_range = VariableSubsetRange(var); vector const &new_upper = new_range.last(); string const &name = var->name(); map >::iterator i = _node_array_bounds.find(name); if (i == _node_array_bounds.end()) { //Create a new entry _node_array_bounds[name] = new_upper; } else { //Check against the existing entry, and modify if necessary vector & ubound = i->second; if (new_upper.size() != ubound.size()) { CompileError(var, "Inconsistent dimensions for array", name); } else { for (unsigned int j = 0; j < ubound.size(); ++j) { ubound[j] = max(ubound[j], new_upper[j]); } } } } void Compiler::writeConstantData(ParseTree const *relations) { /* Values supplied in the data table, but which DO NOT appear on the left-hand side of a relation, are constants. We have to find these values in order to create the constant nodes that form the top level of any graphical model. */ //First we set up the constant mask, setting all values to true by //default map::const_iterator p; for (p = _data_table.begin(); p != _data_table.end(); ++p) { pair > apair; apair.first = p->first; apair.second = vector(p->second.length(), true); _constant_mask.insert(apair); } //Now traverse the parse tree, setting node array subsets that //correspond to the left-hand side of any relation to be false traverseTree(relations, &Compiler::setConstantMask); //Create a temporary copy of the data table containing only //data for constant nodes map temp_data_table = _data_table; map::iterator p2; for(p2 = temp_data_table.begin(); p2 != temp_data_table.end(); ++p2) { string const &name = p2->first; SArray &temp_data = p2->second; vector const &mask = _constant_mask.find(name)->second; for (unsigned long i = 0; i < temp_data.length(); ++i) { if (!mask[i]) { temp_data.setValue(JAGS_NA, i); } } } _model.symtab().writeData(temp_data_table); } void Compiler::writeRelations(ParseTree const *relations) { writeConstantData(relations); traverseTree(relations, &Compiler::getLHSVars); _is_resolved = vector(_n_relations, false); for (unsigned long N = _n_relations; N > 0; N -= _n_resolved) { _n_resolved = 0; /* Here we use the abilitiy to sweep forwards and backwards through the relations, allowing rapid compilation of models written in both topological order and reverse topological order. Without this facility, compilation of some large models can be very slow. */ traverseTree(relations, &Compiler::allocate, true, true); if (_n_resolved == 0) break; } _is_resolved.clear(); if (_n_resolved == 0) { /* Somes nodes remain unresolved. We need to identify them and print an informative error message for the user. The basic strategy is to identify nodes that appear on the right-hand side of a relation but cannot be resolved. Then we eliminate the nodes that are defined on the left hand side of a relation. Whatever nodes are left are used in an expression but never defined (either in a relation or in the data). It may happen that all the unresolved nodes are defined on the left hand side of a relation. This can happen if there is a directed cycle (i.e. the nodes are defined in terms of each other). */ /* Step 1: Collect identifiers for unresolved parameters. These will be held in the map _umap along with the line numbers on which they are used. */ _resolution_level = 1; //See getArraySubset traverseTree(relations, &Compiler::allocate); if (_umap.empty()) { //Not clear what went wrong here, so throw a generic error message throw runtime_error("Unable to resolve relations"); } //Take a back-up copy of unresolved parameters map, set > umap_copy = _umap; /* Step 2: Eliminate parameters that appear on the left of a relation */ _resolution_level = 2; traverseTree(relations, &Compiler::allocate); /* Step 3: Informative error message for the user */ ostringstream oss; if (!_umap.empty()) { //Undefined parameter message oss << "Unable to resolve the following parameters:\n"; for (map, set >::iterator p = _umap.begin(); p != _umap.end(); ++p) { oss << p->first.first << print(p->first.second); oss << " (line "; set const &lines = p->second; for (set::const_iterator i = lines.begin(); i != lines.end(); ++i) { if (i != lines.begin()) { oss << ", "; } oss << *i; } oss << ")\n"; } oss << "Either supply values for these nodes with the data\n" << "or define them on the left hand side of a relation."; } else { //Directed cycle message oss << "Possible directed cycle involving some or all\n" << "of the following nodes:\n"; for (map, set >::const_iterator p = umap_copy.begin(); p != umap_copy.end(); ++p) { oss << p->first.first << print(p->first.second) << "\n"; } } throw runtime_error(oss.str()); } } void Compiler::traverseTree(ParseTree const *relations, CompilerMemFn fun, bool resetcounter, bool reverse) { /* Traverse parse tree, expanding FOR loops and applying function fun to relations. In JAGS 4.3.0 we do a breadth first search, i.e. we process the relations within each block before expanding the for loops. This allows us to optionally reverse through the relations. See writeRelations for more details. */ if (resetcounter) { _n_relations = 0; } vector const &relation_list = relations->parameters(); for (vector::const_reverse_iterator p = relation_list.rbegin(); p != relation_list.rend(); ++p) { switch ((*p)->treeClass()) { case P_FOR: break; case P_STOCHREL: case P_DETRMREL: (this->*fun)(*p); _n_relations++; break; default: throw logic_error("Malformed parse tree in Compiler::traverseTree"); break; } } if (reverse) { unsigned int nrel = _n_relations; //Save current relation number for (vector::const_iterator p = relation_list.begin(); p != relation_list.end(); ++p) { //Reverse sweep through relations switch ((*p)->treeClass()) { case P_FOR: break; case P_STOCHREL: case P_DETRMREL: _n_relations--; (this->*fun)(*p); break; default: break; } } _n_relations = nrel; //Restore current relation number } for (vector::const_reverse_iterator p = relation_list.rbegin(); p != relation_list.rend(); ++p) { //Expand for loops Counter *counter; ParseTree *var; switch ((*p)->treeClass()) { case P_FOR: var = (*p)->parameters()[0]; if (!isNULL(CounterRange(var))) { counter = _countertab.pushCounter(var->name(), CounterRange(var)); for (; !counter->atEnd(); counter->next()) { traverseTree((*p)->parameters()[1], fun, false, reverse); } _countertab.popCounter(); } break; case P_STOCHREL: case P_DETRMREL: break; default: break; } } } Compiler::Compiler(BUGSModel &model, map const &data_table) : _model(model), _countertab(), _data_table(data_table), _n_resolved(0), _n_relations(0), _is_resolved(0), _resolution_level(0), _index_expression(0), _index_nodes() { if (_model.nodes().size() != 0) throw invalid_argument("Non empty graph in Compiler constructor"); if (_model.symtab().size() != 0) throw invalid_argument("Non empty symtab in Compiler constructor"); } void Compiler::declareVariables(vector const &dec_list) { vector::const_iterator p; for (p = dec_list.begin() ; p != dec_list.end(); ++p) { if ((*p)->treeClass() != P_VAR) { throw invalid_argument("Expected variable expression"); } } //checkDecNames(dec_list, _data_table); for (p = dec_list.begin() ; p != dec_list.end(); ++p) { ParseTree const *node_dec = *p; string const &name = node_dec->name(); unsigned int ndim = node_dec->parameters().size(); if (ndim == 0) { // Variable is scalar _model.symtab().addVariable(name, vector(1,1)); } else { // Variable is an array vector dim(ndim); for (unsigned int i = 0; i < ndim; ++i) { vector dim_i; if (!indexExpression(node_dec->parameters()[i], dim_i)) { CompileError(node_dec, "Unable to calculate dimensions of", name); } if (dim_i.empty()) { CompileError(node_dec, "NULL dimension in declaration of", name); } if (dim_i.size() != 1) { CompileError(node_dec, "Vector-valued dimension in declaration of", name); } if (dim_i[0] <= 0) { CompileError(node_dec, "Non-positive dimension for node", name); } dim[i] = static_cast(dim_i[0]); } _model.symtab().addVariable(name, dim); } //Check consistency with data, if supplied map::const_iterator p = _data_table.find(name); if (p != _data_table.end()) { NodeArray const *array = _model.symtab().getVariable(name); if (p->second.range() != array->range()) { string msg = string("Dimensions of ") + name + " in declaration (" + print(array->range()) + ") conflict with dimensions in data (" + print(p->second.range()) + ")"; CompileError(node_dec, msg); } } } } void Compiler::undeclaredVariables(ParseTree const *prelations) { //Find parameters on RHS of relations that are never defined //checkVarNames(prelations, _data_table); // Get undeclared variables from data table for (map::const_iterator p = _data_table.begin(); p != _data_table.end(); ++p) { string const &name = p->first; NodeArray const *array = _model.symtab().getVariable(name); if (array) { if (p->second.range() != array->range()) { //Should have been checked already in declareVariables throw logic_error("Dimension mismatch"); } } else { _model.symtab().addVariable(name, p->second.dim(false)); } } // Infer the dimension of remaining nodes from the relations traverseTree(prelations, &Compiler::getArrayDim); map >::const_iterator i = _node_array_bounds.begin(); for (; i != _node_array_bounds.end(); ++i) { if (_model.symtab().getVariable(i->first)) { //Node already declared or defined by data. Check consistency NodeArray const * array = _model.symtab().getVariable(i->first); vector const &upper = array->range().upper(); if (upper.size() != i->second.size()) { string msg = "Dimension mismatch for variable "; msg.append(i->first); throw runtime_error(msg); } for (unsigned int j = 0; j < upper.size(); ++j) { if (i->second[j] <= 0 || i->second[j] > upper[j]) { string msg = string("Index out of range for variable ") + i->first; throw runtime_error(msg); } } } else { //Variable not declared. Use inferred size vector const &upper = i->second; unsigned int ndim = upper.size(); vector dim(ndim); for (unsigned int j = 0; j < ndim; ++j) { if (upper[j] <= 0) { string msg = string("Invalid dimension for ") + i->first; throw runtime_error(msg); } else { dim[j] = static_cast(upper[j]); } } _model.symtab().addVariable(i->first, dim); } } } /* We use construct-on-first-use for the lookup tables used by the compiler. By dynamically allocating a table, we ensure that its destructor is never called - the memory is simply returned to the OS on exit. This fixes a nasty exit bug. We cannot guarantee the order that static destructors are called in. Therefore, a segfault can occur if a module tries to unload itself from a table that has already been destroyed. See also Model.cc, where the same technique is used for factory lists. */ DistTab &Compiler::distTab() { static DistTab *_disttab = new DistTab(); return *_disttab; } FuncTab &Compiler::funcTab() { static FuncTab *_functab = new FuncTab(); return *_functab; } ObsFuncTab &Compiler::obsFuncTab() { static ObsFuncTab *_oftab = new ObsFuncTab(); return *_oftab; } MixtureFactory& Compiler::mixtureFactory1() { return _mixfactory1; } MixtureFactory& Compiler::mixtureFactory2() { return _mixfactory2; } BUGSModel &Compiler::model() const { return _model; } } //namespace jags JAGS-4.3.2/src/lib/compiler/LogicalFactory.cc0000664000175000017500000000535214224052514015553 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::pair; using std::map; using std::vector; using std::invalid_argument; using std::runtime_error; using std::string; namespace jags { bool lt(LogicalPair const &arg1, LogicalPair const &arg2) { if (FUNC(arg1.first) == FUNC(arg2.first)) { //Same function: check parameters return lt(arg1.second, arg2.second); } else { //Diferent functions: sort by address (arbitrary) return FUNC(arg1.first) < FUNC(arg2.first); } } LogicalNode* LogicalFactory::newNode(FunctionPtr const &func, vector const &parents, unsigned int nchain) { LogicalNode *node = 0; if (SCALAR(func)) { unsigned int arglength = 1; for (unsigned int i = 0; i < parents.size(); ++i) { if (parents[i]->length() > 1) { if (arglength == 1) { arglength = parents[i]->length(); } else if (parents[i]->length() != arglength) { arglength = 0; break; } } } if (arglength == 0) { throw runtime_error(string("Incompatible argument lengths for ") + func.name()); } else if (arglength == 1) { node = new ScalarLogicalNode(SCALAR(func), nchain, parents); } else { node = new VSLogicalNode(SCALAR(func), nchain, parents); } } else if (LINK(func)) { bool ok = true; for (unsigned int i = 0; i < parents.size(); ++i) { if (parents[i]->length() != 1) { ok = false; break; } } if (ok) { node = new LinkNode(LINK(func), nchain, parents); } else { throw runtime_error("Invalid vector argument to " + func.name()); } } else if (VECTOR(func)) node = new VectorLogicalNode(VECTOR(func), nchain, parents); else if (ARRAY(func)) node = new ArrayLogicalNode(ARRAY(func), nchain, parents); else throw invalid_argument("Invalid function in getNode"); return node; } Node* LogicalFactory::getNode(FunctionPtr const &func, vector const &parents, Model &model) { if (isNULL(func)) { throw invalid_argument("NULL function passed to getLogicalNode"); } LogicalPair lpair(func, parents); map >::iterator i = _logicalmap.find(lpair); if (i != _logicalmap.end()) { return i->second; } else { LogicalNode *lnode = newNode(func, parents, model.nchain()); _logicalmap[lpair] = lnode; model.addNode(lnode); return lnode; } } } //namespace jags JAGS-4.3.2/src/lib/compiler/ParseTree.cc0000664000175000017500000000432214224052514014537 00000000000000#include #include #include using std::string; using std::vector; using std::logic_error; namespace jags { ParseTree::ParseTree(TreeClass tclass, int line) : _tclass(tclass), _parameters(), _parent(0), _name(), _value(0), _line(line) { } ParseTree::~ParseTree() { for (vector::iterator p = _parameters.begin(); p != _parameters.end(); p++) { if (*p != 0) { delete *p; } } } void ParseTree::setName(string const &name) { switch(_tclass) { case P_VAR: case P_COUNTER: case P_FUNCTION: case P_DENSITY: case P_LINK: case P_ARRAY: _name = name; break; default: throw logic_error("Can't set name of ParseTree object"); } } void ParseTree::setValue(double value) { if (_tclass == P_VALUE) { _value = value; } else { throw logic_error("Can't set value of ParseTree"); } } vector const &ParseTree::parameters() const { return _parameters; } TreeClass ParseTree::treeClass() const { return _tclass; } string const &ParseTree::name() const { switch(_tclass) { case P_VAR: case P_COUNTER: case P_FUNCTION: case P_DENSITY: case P_LINK: case P_ARRAY: break; default: throw logic_error("Can't get name of ParseTree: invalid treeClass"); } return _name; } double ParseTree::value() const { if (_tclass != P_VALUE) { throw logic_error ("Can't get value of ParseTree: invalid treeClass"); } return _value; } int ParseTree::line() const { return _line; } void ParseTree::setParameters(vector const ¶meters) { if (!_parameters.empty()) { throw logic_error("Parameters already set in ParseTree"); } if (_parent != 0) { throw logic_error("Can't set parameters of ParseTree: node already has parent"); } for (unsigned int i = 0; i < parameters.size(); ++i) { if (parameters[i] == this) { throw logic_error("ParseTree cannot be a parameter of itself"); } if (parameters[i] != 0) { if (parameters[i]->_parent == 0) { parameters[i]->_parent = this; } else { throw logic_error("Can't set parameters of ParseTree: parameter already has parent"); } } } _parameters = parameters; } } //namespace jags JAGS-4.3.2/src/lib/compiler/Counter.cc0000664000175000017500000000060414224052514014263 00000000000000#include #include #include #include using std::logic_error; namespace jags { Counter::Counter(Range const &range) : RangeIterator(range) { if (range.ndim(false) != 1) throw logic_error("Attempt to construct Counter from non-scalar Range"); } Counter &Counter::next() { nextLeft(); return *this; } } //namespace jags JAGS-4.3.2/src/lib/compiler/CounterTab.cc0000664000175000017500000000156714224052514014723 00000000000000#include #include #include using std::vector; using std::pair; using std::string; namespace jags { CounterTab::CounterTab() { } CounterTab::~CounterTab() { int n = _table.size(); for (int i = 0; i < n; i++) { popCounter(); } } Counter * CounterTab::pushCounter(string const &name, Range const &range) { Counter *counter = new Counter(range); pair cpair(name, counter); _table.push_back(cpair); return counter; } void CounterTab::popCounter() { pair topcpair = _table.back(); _table.pop_back(); delete topcpair.second; } Counter *CounterTab::getCounter(string const &name) const { vector >::const_iterator p(_table.begin()); for (; p != _table.end(); ++p) { if (name == p->first) return p->second; } return 0; } } //namespace jags JAGS-4.3.2/src/lib/compiler/MixtureFactory.cc0000664000175000017500000000251014224052514015627 00000000000000#include #include #include #include #include #include #include #include using std::vector; using std::map; using std::logic_error; namespace jags { MixtureNode * MixtureFactory::getMixtureNode(vector const &index_nodes, MixMap const &mixmap, Model &model) { /* Separate the index values from the parameters. Only the latter are used to index the mixture nodes */ vector parameters; vector > index_values; for (map, Node const *>::const_iterator p = mixmap.begin(); p != mixmap.end(); ++p) { index_values.push_back(p->first); parameters.push_back(p->second); } MixPair mpair(index_nodes, parameters); map::const_iterator p = _mix_node_map.find(mpair); if (p != _mix_node_map.end()) { return p->second; } else { if (parameters.size() != index_values.size()) { throw logic_error("Length mismatch in MixtureFactory::getMixtureNode"); } MixtureNode *mix = new MixtureNode(index_nodes, model.nchain(), mixmap); _mix_node_map[mpair] = mix; model.addNode(mix); return mix; } } } //namespace jags JAGS-4.3.2/src/lib/compiler/MixCompiler.cc0000664000175000017500000004327314224052514015105 00000000000000/* Compiler rules for Mixture nodes. Node * getMixtureNode(ParseTree const * var, Compiler *compiler); This is painfully complicated, but the aim is to be as efficient as possible in the allocation of Mixture Nodes. Suppose we have an expression X[Y], where X is a vector node of length N, and Y is a discrete-valued scalar node. We know that Y can only legally take values 1, ..., N. So the simplest approach is to create a Mixture Node that takes value X[i] when Y = i, for i = 1, ... N. This mixture node has N+1 parents: the index node Y and the N subset nodes X[1], ... X[N]. It may not be efficient to do this in cases where the range of Y is restricted. For example, suppose Y only takes values in the range M1, ..., M2, where M1 > 1 and M2 < N. Then the parents X[1], ... X[M1 - 1] and X[M2 + 1] ... X[N] are redundant. This may be harmless, but there are circumstances under which it will lead to a compiler error. There are limited circumstances under which we can calculate the possible values of the index node. Currently, this is restricted to the case where all the Stochastic parents of Y are discrete and univariate. In this case, the function getMixtureNode1 is used to create an efficient Mixture Node. If this fails, we fall back on the default getMixtureNode2 function. */ #include #include #include #include #include #include #include #include #include #include #include "MixCompiler.h" #include #include #include #include #include #include #include using std::vector; using std::pair; using std::logic_error; using std::runtime_error; using std::string; using std::set; using std::map; using std::copy; using std::reverse; using std::list; namespace jags { //Saves the values of the nodes in chain 0 to the values vector //(presumed empty when the function is called) template void save(vector const &nodes, vector > &values) { for (typename vector::const_iterator p = nodes.begin(); p != nodes.end(); ++p) { double const *pv = (*p)->value(0); unsigned int n = (*p)->length(); vector v(n); copy(pv, pv + n, v.begin()); values.push_back(v); } } //Restores saved values to the nodes in chain 0 template void restore(vector const &nodes, vector > const &values) { for (unsigned int j = 0; j < nodes.size(); ++j) { vector const &pv = values[j]; nodes[j]->setValue(&pv[0], pv.size(), 0); } } //Structure to hold subset indices struct SSI { Node const *node; vector indices; SSI() : node(0) {}; }; /* Given a vector of subset indices, this function modifies the argument "subsets", so that it contains a vector of pairs: - Index: Possible value of the variable indices - Range: Corresponding range of the array to take as a subset All possible values of Index are included in the vector, based on the the range of the array we are taking subsets from (default_range). */ static void getSubsetRanges(vector, Range> > &subsets, vector const &limits, SimpleRange const &default_range) { unsigned int ndim = limits.size(); // Create upper and lower bounds vector var_offset, var_lower, var_upper; vector > scope(ndim); for (unsigned int j = 0; j < ndim; ++j) { if (limits[j].node) { var_offset.push_back(j); var_lower.push_back(default_range.lower()[j]); var_upper.push_back(default_range.upper()[j]); } else { scope[j] = limits[j].indices; } } SimpleRange var_range(var_lower, var_upper); //range of variable indices for (RangeIterator p(var_range); !p.atEnd(); p.nextLeft()) { for (unsigned int k = 0; k < var_offset.size(); ++k) { scope[var_offset[k]] = vector(1, p[k]); } subsets.push_back(pair, Range>(p, Range(scope))); } } /* Recursive function that returns true if node, or one of its deterministic descendants, is in target_set */ static bool hasDescendant(DeterministicNode *node, set const &target_set, vector &dnodes, map &known_dnodes) { //Skip previously visited nodes map::iterator i = known_dnodes.find(node); if (i != known_dnodes.end()) { return i->second; } //The current node might be in the target set. bool ans = target_set.count(node); //Search all deterministic descendants. Even if node is in //target_set we still need to visit the descendants to ensure that //nodes are pushed onto the vector dnodes *after* their deterministic //descendants (i.e. in reverse topological order). list const *dc = node->deterministicChildren(); for(list::const_iterator p = dc->begin(); p != dc->end(); ++p) { if (hasDescendant(*p, target_set, dnodes, known_dnodes)) { ans = true; } } //At this point we have visited all deterministic descendants and can //classify the current node. known_dnodes[node] = ans; if (ans) { dnodes.push_back(node); } return ans; } /* hasDescendant for stochastic nodes */ static bool hasDescendant(StochasticNode *node, set const &target_set, vector &dnodes, map &known_dnodes) { //This is a stripped-down version of hasDescendant for deterministic //nodes. We do not keep track of known stochastic nodes bool ans = target_set.count(node); list const *dc = node->deterministicChildren(); for(list::const_iterator p = dc->begin(); p != dc->end(); ++p) { if (hasDescendant(*p, target_set, dnodes, known_dnodes)) { ans = true; } } return ans; } /* Find stochastic parents of given set of nodes within the model, and their intermediate deterministic descendants in topological order */ static void findStochasticParents(vector const &tgt_nodes, Model const &model, vector &stoch_parents, vector &dtrm_parents) { //Copy input vector tgt_nodes to a set set tgt_set; for (unsigned int i = 0; i < tgt_nodes.size(); ++i) { tgt_set.insert(tgt_nodes[i]); } //Set up auxliary variables required for hasDescendant and call map known_dnodes; vector const &snodes = model.stochasticNodes(); for (unsigned int i = 0; i < snodes.size(); ++i) { if (hasDescendant(snodes[i], tgt_set, dtrm_parents, known_dnodes)) { stoch_parents.push_back(snodes[i]); } } // Nodes are pushed onto dtrm_parents in reverse topological order. // Reverse the vector to get them in topological (forward sampling) order reverse(dtrm_parents.begin(), dtrm_parents.end()); } /* static void cloneNodes(vector const &nodes, vector &newnodes, map &remap) { // Clone nodes without remapping parents for (unsigned int i = 0; i < nodes.size(); ++i) { StochasticNode *newnode = nodes[i]->clone(nodes[i]->parents()); newnodes.push_back(newnode); remap[nodes[i]] = newnode; } } static void cloneNodes(vector const &nodes, vector &newnodes, map &remap) { // Clone nodes with remapped parents for (unsigned int i = 0; i < nodes.size(); ++i) { vector args = nodes[i]->parents(); for (unsigned int j = 0; j < args.size(); ++j) { map::const_iterator p = remap.find(args[j]); if (p != remap.end()) args[j] = p->second; } DeterministicNode *newnode = nodes[i]->clone(args); newnodes.push_back(newnode); remap[nodes[i]] = newnode; } } */ static Node* getMixtureNode1(NodeArray *array, vector const &limits, Compiler *compiler) // Try to simplify the mixture node by enumerating all possible values // that the indices can take. This can only be done under certain // conditions. { unsigned int ndim = limits.size(); vector indices; for (unsigned int i = 0; i < ndim; ++i) { if (limits[i].node) { indices.push_back(limits[i].node); } } unsigned int nvi = indices.size(); vector sparents; vector dparents; findStochasticParents(indices, compiler->model(), sparents, dparents); unsigned int nparents = sparents.size(); if (nparents > 10) { //This algorithm grinds to a halt with too many stochastic //parents. So bail out after 10 return 0; } vector lower(nparents), upper(nparents); for (unsigned int i = 0; i < nparents; ++i) { StochasticNode const *snode = sparents[i]; if (snode->length() != 1 || !snode->isDiscreteValued() || !isSupportFixed(snode)) { //Must have discrete, scalar parents with fixed support return 0; } // Get lower and upper limits of support double l = JAGS_NEGINF, u = JAGS_POSINF; snode->support(&l, &u, 1U, 0); if (!jags_finite(l) || !jags_finite(u)) { return 0; //Unbounded parent => serious trouble } if (l < -INT_MAX || u > INT_MAX) { return 0; //Can't cast to int } lower[i] = static_cast(l); upper[i] = static_cast(u); } //Store current value of all stochastic parents and deterministic nodes vector > stored_parent_values, stored_dtrm_values; save(sparents, stored_parent_values); save(dparents, stored_dtrm_values); // Create a set containing all possible values that the stochastic // indices can take set > index_values; vector this_index(indices.size(),1); SimpleRange stoch_node_range(lower, upper); for (RangeIterator i(stoch_node_range); !i.atEnd(); i.nextLeft()) { for (unsigned int j = 0; j < sparents.size(); ++j) { double v = i[j]; sparents[j]->setValue(&v, 1, 0); } for (unsigned int k = 0; k < dparents.size(); ++k) { dparents[k]->deterministicSample(0); } for (unsigned int l = 0; l < indices.size(); ++l) { this_index[l] = static_cast(*indices[l]->value(0)); } index_values.insert(this_index); } //Restore value of all stochastic parents and deterministic nodes restore(sparents, stored_parent_values); restore(dparents, stored_dtrm_values); // Now set up the possible subsets defined by the stochastic indices vector variable_offset; vector > scope(ndim); for (unsigned int j = 0; j < ndim; ++j) { if (limits[j].node) { variable_offset.push_back(j); } else { scope[j] = limits[j].indices; } } vector, Range> > ranges; set >::const_iterator p; for (p = index_values.begin(); p != index_values.end(); ++p) { vector const &i = *p; for (unsigned int k = 0; k < nvi; ++k) { scope[variable_offset[k]] = vector(1, i[k]); } ranges.push_back(pair, Range>(i, Range(scope))); } //Look out for trivial mixture nodes in which all subsets are the same. bool trivial = true; Node *subset_node0 = array->getSubset(ranges[0].second, compiler->model()); map, Node const *> subsets; for (unsigned int i = 0; i < ranges.size(); ++i) { Node *subset_node = array->getSubset(ranges[i].second, compiler->model()); if (!subset_node) { return 0; } subsets[ranges[i].first] = subset_node; if (subset_node != subset_node0) { trivial = false; } } if (trivial) { // Nothing to do here! All subset nodes are the same, so we // just return the subset node. return subset_node0; } return compiler->mixtureFactory1().getMixtureNode(indices, subsets, compiler->model()); } static Node * getMixtureNode2(NodeArray *array, vector const &limits, Compiler *compiler) { vector, Range> > ranges; getSubsetRanges(ranges, limits, array->range()); map, Node const *> mixmap; for (unsigned int i = 0; i < ranges.size(); ++i) { Node *subset_node = array->getSubset(ranges[i].second, compiler->model()); if (subset_node) { mixmap[ranges[i].first] = subset_node; } else { return 0; } } vector indices; for (unsigned int i = 0; i < limits.size(); ++i) { if (limits[i].node) { indices.push_back(limits[i].node); } } return compiler->mixtureFactory2().getMixtureNode(indices, mixmap, compiler->model()); } Node * getMixtureNode(ParseTree const * var, Compiler *compiler) { if (var->treeClass() != P_VAR) { throw logic_error("Expecting variable expression"); } NodeArray *array = compiler->model().symtab().getVariable(var->name()); if (array == 0) { throw runtime_error(string("Unknown parameter: ") + var->name()); } vector const &range_list = var->parameters(); vector limits; unsigned int ndim = array->range().ndim(false); if (range_list.size() != ndim) { throw runtime_error("Dimension mismatch taking variable subset of " + var->name()); } unsigned int nvi = 0; //Count number of variable indices for (unsigned int i = 0; i < ndim; ++i) { ParseTree const *range_element = range_list[i]; if (range_element->treeClass() != P_RANGE) { throw runtime_error("Malformed range expression"); } SSI ssi; ParseTree const *p0; switch(range_element->parameters().size()) { case 0: // Index is empty, implying the whole range ssi.indices = array->range().scope()[i]; break; case 1: p0 = range_element->parameters()[0]; if(!compiler->indexExpression(p0, ssi.indices)) { ssi.node = compiler->getParameter(p0); if (ssi.node == 0) return 0; else ++nvi; } break; default: throw logic_error("Invalid range expression"); } //Check validity of subset index if (ssi.node) { if (!ssi.node->isDiscreteValued()) { throw NodeError(ssi.node, "Continuous node used as index"); } if (ssi.node->length() != 1) { throw NodeError(ssi.node, "Vector node used as index"); } } else { if (ssi.indices.empty()) { throw runtime_error("Requested invalid variable subset of " + var->name()); } for (unsigned int j = 0; j < ssi.indices.size(); ++j) { if (ssi.indices[j] < array->range().lower()[i] || ssi.indices[j] > array->range().upper()[i]) { throw runtime_error("Requested invalid variable subset of " + var->name()); } } } limits.push_back(ssi); } //Check number of variable indices (nvi) if (nvi == 0) { throw logic_error("Trivial mixture node"); } Node *mnode = getMixtureNode1(array, limits, compiler); if (mnode) return mnode; else return getMixtureNode2(array, limits, compiler); } /** * This is a diagnostic function that is called by the compiler * in _resolution_level 2 when a mixture node cannot be resolved. * * FIXME: There is some serious cut-and-paste in this function. * However, this is currently the simplest way to implement these * checks without perturbing the API */ void getMissingMixParams(ParseTree const * var, UMap &umap, Compiler *compiler) { NodeArray *array = compiler->model().symtab().getVariable(var->name()); vector const &range_list = var->parameters(); vector limits; unsigned int ndim = array->range().ndim(false); bool resolved = true; for (unsigned int i = 0; i < ndim; ++i) { ParseTree const *range_element = range_list[i]; SSI ssi; ParseTree const *p0; switch(range_element->parameters().size()) { case 0: // Index is empty, implying the whole range ssi.indices = array->range().scope()[i]; break; case 1: p0 = range_element->parameters()[0]; if(!compiler->indexExpression(p0, ssi.indices)) { ssi.node = compiler->getParameter(p0); if (ssi.node == 0) { resolved = false; } } break; default: throw logic_error("Invalid range expression"); } limits.push_back(ssi); } if (!resolved) return; vector, Range> > ranges; getSubsetRanges(ranges, limits, array->range()); for (unsigned int i = 0; i < ranges.size(); ++i) { Range const &subset_range = ranges[i].second; Node *node = array->getSubset(subset_range, compiler->model()); if (node) continue; /* Make a note of all subsets that could not be resolved. */ bool empty = true; for (RangeIterator r(subset_range); !r.atEnd(); r.nextLeft()) { if (array->getSubset(SimpleRange(r,r), compiler->model())) { empty = false; break; } } if (empty) { //No elements found, so report the whole range //as missing, e.g. x[1:5] pair upair(var->name(), subset_range); if (umap.find(upair) == umap.end()) { set lines; lines.insert(var->line()); umap[upair] = lines; } else { umap.find(upair)->second.insert(var->line()); } } else { //Some elements found, so report only the missing //elements, e.g. x[5] for (RangeIterator r(subset_range); !r.atEnd(); r.nextLeft()) { SimpleRange sr(r,r); if (!array->getSubset(sr, compiler->model())) { pair upair(var->name(), sr); if (umap.find(upair) == umap.end()) { set lines; lines.insert(var->line()); umap[upair] = lines; } else { umap.find(upair)->second.insert(var->line()); } } } } } } } //namespace jags JAGS-4.3.2/src/lib/compiler/NodeFactory.cc0000664000175000017500000000403214224052514015060 00000000000000#include #include #include #include #include using std::vector; namespace jags { /* Comparison function for arrays of doubles of equal length */ bool lt(double const *value1, double const *value2, unsigned int length) { for (unsigned long i = 0; i < length; ++i) { if (lt(value1[i], value2[i])) { return true; } else if (lt(value2[i], value1[i])) { return false; } } return false; } /* Comparison function for STL vectors */ /* bool lt(vector const &value1, vector const &value2) { for (unsigned long i = 0; i < value1.size(); ++i) { if (lt(value1[i], value2[i])) { return true; } else if (lt(value2[i], value1[i])) { return false; } } return false; } */ /* Comparison function for Nodes */ bool lt(Node const *node1, Node const *node2) { if (node1 == node2) { // A node is always identical to itself return false; } bool fix1 = node1->isFixed(); bool fix2 = node2->isFixed(); if (fix1 && fix2) { //Fixed nodes are sorted by dimension, then value if (node1->dim() == node2->dim()) { return lt(node1->value(0), node2->value(0), node1->length()); } else { return node1->dim() < node2->dim(); } } else if (!fix1 && !fix2) { //Non-fixed nodes are sorted by address. The ordering is //arbitrary, but unique. return (node1 < node2); } else { //Fixed nodes come before non-fixed nodes return fix1 > fix2; } } /* Comparison operator for vectors of parameters */ bool lt(vector const &par1, vector const &par2) { if (par1.size() == par2.size()) { //Equal sized vectors: Sort by ordering of elements for (unsigned int i = 0; i < par1.size(); ++i) { if (lt(par1[i], par2[i])) { return true; } else if (lt(par2[i], par1[i])) { return false; } } return false; } else { return par1.size() < par2.size(); } } } JAGS-4.3.2/src/lib/compiler/ObsFuncTab.cc0000664000175000017500000000233014400666557014646 00000000000000#include #include #include #include #include #include using std::find_if; using std::bind; namespace jags { typedef std::pair ObsFunc; typedef std::list OFList; struct isDist { // Adaptable binary predicate for find_if algorithm bool operator()(ObsFunc const &f, DistPtr const &dist) const { return f.first == dist; } }; ObsFuncTab::ObsFuncTab() : _flist(), _nullfun() { //Required by Solaris Studio, which won't create a default constructor //with -std=c++11 } void ObsFuncTab::insert (DistPtr const &dist, FunctionPtr const &func) { ObsFunc f(dist, func); if (std::find(_flist.begin(), _flist.end(), f) == _flist.end()) { _flist.push_front(f); } } FunctionPtr const &ObsFuncTab::find(DistPtr const &dist) const { OFList::const_iterator p = find_if(_flist.begin(), _flist.end(), bind(isDist(), std::placeholders::_1, dist)); return (p == _flist.end()) ? _nullfun : p->second; } void ObsFuncTab::erase(DistPtr const &dist, FunctionPtr const &func) { _flist.remove(ObsFunc(dist, func)); } } //namespace jags JAGS-4.3.2/src/lib/rng/0000755000175000017500000000000014400711324011364 500000000000000JAGS-4.3.2/src/lib/rng/Makefile.am0000664000175000017500000000021414224052514013342 00000000000000noinst_LTLIBRARIES = librng.la librng_la_CPPFLAGS = -I$(top_srcdir)/src/include librng_la_SOURCES = RNG.cc RmathRNG.cc TruncatedNormal.cc JAGS-4.3.2/src/lib/rng/Makefile.in0000644000175000017500000005502614400675235013373 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/rng ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) librng_la_LIBADD = am_librng_la_OBJECTS = librng_la-RNG.lo librng_la-RmathRNG.lo \ librng_la-TruncatedNormal.lo librng_la_OBJECTS = $(am_librng_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/librng_la-RNG.Plo \ ./$(DEPDIR)/librng_la-RmathRNG.Plo \ ./$(DEPDIR)/librng_la-TruncatedNormal.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(librng_la_SOURCES) DIST_SOURCES = $(librng_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = librng.la librng_la_CPPFLAGS = -I$(top_srcdir)/src/include librng_la_SOURCES = RNG.cc RmathRNG.cc TruncatedNormal.cc all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/rng/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/rng/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } librng.la: $(librng_la_OBJECTS) $(librng_la_DEPENDENCIES) $(EXTRA_librng_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(librng_la_OBJECTS) $(librng_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librng_la-RNG.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librng_la-RmathRNG.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librng_la-TruncatedNormal.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< librng_la-RNG.lo: RNG.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librng_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT librng_la-RNG.lo -MD -MP -MF $(DEPDIR)/librng_la-RNG.Tpo -c -o librng_la-RNG.lo `test -f 'RNG.cc' || echo '$(srcdir)/'`RNG.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librng_la-RNG.Tpo $(DEPDIR)/librng_la-RNG.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RNG.cc' object='librng_la-RNG.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librng_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o librng_la-RNG.lo `test -f 'RNG.cc' || echo '$(srcdir)/'`RNG.cc librng_la-RmathRNG.lo: RmathRNG.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librng_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT librng_la-RmathRNG.lo -MD -MP -MF $(DEPDIR)/librng_la-RmathRNG.Tpo -c -o librng_la-RmathRNG.lo `test -f 'RmathRNG.cc' || echo '$(srcdir)/'`RmathRNG.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librng_la-RmathRNG.Tpo $(DEPDIR)/librng_la-RmathRNG.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RmathRNG.cc' object='librng_la-RmathRNG.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librng_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o librng_la-RmathRNG.lo `test -f 'RmathRNG.cc' || echo '$(srcdir)/'`RmathRNG.cc librng_la-TruncatedNormal.lo: TruncatedNormal.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librng_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT librng_la-TruncatedNormal.lo -MD -MP -MF $(DEPDIR)/librng_la-TruncatedNormal.Tpo -c -o librng_la-TruncatedNormal.lo `test -f 'TruncatedNormal.cc' || echo '$(srcdir)/'`TruncatedNormal.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/librng_la-TruncatedNormal.Tpo $(DEPDIR)/librng_la-TruncatedNormal.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='TruncatedNormal.cc' object='librng_la-TruncatedNormal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(librng_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o librng_la-TruncatedNormal.lo `test -f 'TruncatedNormal.cc' || echo '$(srcdir)/'`TruncatedNormal.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/librng_la-RNG.Plo -rm -f ./$(DEPDIR)/librng_la-RmathRNG.Plo -rm -f ./$(DEPDIR)/librng_la-TruncatedNormal.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/librng_la-RNG.Plo -rm -f ./$(DEPDIR)/librng_la-RmathRNG.Plo -rm -f ./$(DEPDIR)/librng_la-TruncatedNormal.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/rng/RNG.cc0000664000175000017500000000071014224052371012245 00000000000000#include #include using std::string; namespace jags { RNG::RNG(string const &name) : _name(name) {} RNG::~RNG() {} #define i2_32m1 2.328306437080797e-10/* = 1/(2^32 - 1) */ double RNG::fixup(double x) { /* ensure 0 and 1 are never returned */ if(x <= 0.0) return 0.5*i2_32m1; if((1.0 - x) <= 0.0) return 1.0 - 0.5*i2_32m1; return x; } string const &RNG::name() const { return _name; } } //namespace jags JAGS-4.3.2/src/lib/rng/RmathRNG.cc0000664000175000017500000001557514224052514013257 00000000000000#include #include #include #include #include #define repeat for(;;) using std::string; using std::log; using std::exp; using std::sin; using std::cos; using std::sqrt; using std::fabs; using std::logic_error; #define PI 3.141592653589793238462643383280 namespace jags { static inline double fmin2(double x, double y) { return (x < y) ? x : y; } static inline double fmax2(double x, double y) { return (x < y) ? y : x; } RmathRNG::RmathRNG(string const &name, NormKind N01_kind) : RNG(name), _N01_kind(N01_kind), _BM_norm_keep(0) {} double RmathRNG::exponential() { /* q[k-1] = sum(log(2)^k / k!) k=1,..,n, */ /* The highest n (here 8) is determined by q[n-1] = 1.0 */ /* within standard precision */ const static double q[] = { 0.6931471805599453, 0.9333736875190459, 0.9888777961838675, 0.9984959252914960, 0.9998292811061389, 0.9999833164100727, 0.9999985691438767, 0.9999998906925558, 0.9999999924734159, 0.9999999995283275, 0.9999999999728814, 0.9999999999985598, 0.9999999999999289, 0.9999999999999968, 0.9999999999999999, 1.0000000000000000 }; double a, u, ustar, umin; int i; a = 0.; /* precaution if u = 0 is ever returned */ u = uniform(); while(u <= 0.0 || u >= 1.0) u = uniform(); for (;;) { u += u; if (u > 1.0) break; a += q[0]; } u -= 1.; if (u <= q[0]) return a + u; i = 0; ustar = uniform(); umin = ustar; do { ustar = uniform(); if (ustar < umin) umin = ustar; i++; } while (u > q[i]); return a + umin * q[0]; } /* * REFERENCE * * Ahrens, J.H. and Dieter, U. * Extensions of Forsythe's method for random sampling from * the normal distribution. * Math. Comput. 27, 927-937. * * The definitions of the constants a[k], d[k], t[k] and * h[k] are according to the abovementioned article */ double RmathRNG::normal() { const static double a[32] = { 0.0000000, 0.03917609, 0.07841241, 0.1177699, 0.1573107, 0.19709910, 0.23720210, 0.2776904, 0.3186394, 0.36012990, 0.40225010, 0.4450965, 0.4887764, 0.53340970, 0.57913220, 0.6260990, 0.6744898, 0.72451440, 0.77642180, 0.8305109, 0.8871466, 0.94678180, 1.00999000, 1.0775160, 1.1503490, 1.22985900, 1.31801100, 1.4177970, 1.5341210, 1.67594000, 1.86273200, 2.1538750 }; const static double d[31] = { 0.0000000, 0.0000000, 0.0000000, 0.0000000, 0.0000000, 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.1417700, 0.1379632, 0.1344418, 0.1311722, 0.1281260, 0.1252791, 0.1226109, 0.1201036, 0.1177417, 0.1155119, 0.1134023, 0.1114027, 0.1095039 }; const static double t[31] = { 7.673828e-4, 0.002306870, 0.003860618, 0.005438454, 0.007050699, 0.008708396, 0.010423570, 0.012209530, 0.014081250, 0.016055790, 0.018152900, 0.020395730, 0.022811770, 0.025434070, 0.028302960, 0.031468220, 0.034992330, 0.038954830, 0.043458780, 0.048640350, 0.054683340, 0.061842220, 0.070479830, 0.081131950, 0.094624440, 0.112300100, 0.136498000, 0.171688600, 0.227624100, 0.330498000, 0.584703100 }; const static double h[31] = { 0.03920617, 0.03932705, 0.03950999, 0.03975703, 0.04007093, 0.04045533, 0.04091481, 0.04145507, 0.04208311, 0.04280748, 0.04363863, 0.04458932, 0.04567523, 0.04691571, 0.04833487, 0.04996298, 0.05183859, 0.05401138, 0.05654656, 0.05953130, 0.06308489, 0.06737503, 0.07264544, 0.07926471, 0.08781922, 0.09930398, 0.11555990, 0.14043440, 0.18361420, 0.27900160, 0.70104740 }; /*----------- Constants and definitions for Kinderman - Ramage --- */ /* * REFERENCE * * Kinderman A. J. and Ramage J. G. (1976). * Computer generation of normal random variables. * JASA 71, 893-896. */ #define C1 0.398942280401433 #define C2 0.180025191068563 #define g(x) (C1*exp(-x*x/2.0)-C2*(A-x)) const static double A = 2.216035867166471; double s, u1, w, y, u2, u3, aa, tt, theta, R; int i; switch(_N01_kind) { case AHRENS_DIETER: /* see Reference above */ u1 = uniform(); s = 0.0; if (u1 > 0.5) s = 1.0; u1 = u1 + u1 - s; u1 *= 32.0; i = (int) u1; if (i == 32) i = 31; if (i != 0) { u2 = u1 - i; aa = a[i - 1]; while (u2 <= t[i - 1]) { u1 = uniform(); w = u1 * (a[i] - aa); tt = (w * 0.5 + aa) * w; repeat { if (u2 > tt) goto deliver; u1 = uniform(); if (u2 < u1) break; tt = u1; u2 = uniform(); } u2 = uniform(); } w = (u2 - t[i - 1]) * h[i - 1]; } else { i = 6; aa = a[31]; repeat { u1 = u1 + u1; if (u1 >= 1.0) break; aa = aa + d[i - 1]; i = i + 1; } u1 = u1 - 1.0; repeat { w = u1 * d[i - 1]; tt = (w * 0.5 + aa) * w; repeat { u2 = uniform(); if (u2 > tt) goto jump; u1 = uniform(); if (u2 < u1) break; tt = u1; } u1 = uniform(); } jump:; } deliver: y = aa + w; return (s == 1.0) ? -y : y; case BOX_MULLER: if(_BM_norm_keep != 0.0) { /* An exact test is intentional */ s = _BM_norm_keep; _BM_norm_keep = 0.0; return s; } else { theta = 2 * PI * uniform(); R = sqrt(-2 * log(uniform())) + 10*DBL_MIN; /* ensure non-zero */ _BM_norm_keep = R * sin(theta); return R * cos(theta); } case KINDERMAN_RAMAGE: /* see Reference above */ /* corrected version from Josef Leydold * */ u1 = uniform(); if(u1 < 0.884070402298758) { u2 = uniform(); return A*(1.131131635444180*u1+u2-1); } if(u1 >= 0.973310954173898) { /* tail: */ repeat { u2 = uniform(); u3 = uniform(); tt = (A*A-2*log(u3)); if( u2*u2<(A*A)/tt ) return (u1 < 0.986655477086949) ? sqrt(tt) : -sqrt(tt); } } if(u1 >= 0.958720824790463) { /* region3: */ repeat { u2 = uniform(); u3 = uniform(); tt = A - 0.630834801921960* fmin2(u2,u3); if(fmax2(u2,u3) <= 0.755591531667601) return (u2= 0.911312780288703) { /* region2: */ repeat { u2 = uniform(); u3 = uniform(); tt = 0.479727404222441+1.105473661022070*fmin2(u2,u3); if( fmax2(u2,u3)<=0.872834976671790 ) return (u2 #include #include #include #include #include using std::sqrt; using std::exp; using std::logic_error; //sqrt(2*pi) #define STP 2.506628274631 namespace jags { //Calculates optimal scale parameter for exponential envelope static double Alpha(double mu) { return (mu + sqrt(mu*mu + 4))/2; } static double lnorm(double left, RNG *rng) { if (!jags_finite(left)) { throw logic_error("Non-finite boundary in truncated normal"); } if (left < 0) { //Repeated sampling until truncation satisfied while(true) { double y = rng->normal(); if (y >= left) return y; } } else { //Rejection sampling with exponential envelope double alpha = Alpha(left); while (true) { double y = rng->exponential(); double C = (1 - y)/alpha; if (rng->uniform() <= exp(-C*C/2)) return left + y/alpha; /* //Original version, less stable for large mu double z = left + rng->exponential() / alpha; if (rng->uniform() <= exp(-(alpha - z)*(alpha - z)/2)) return z; */ } } } static double rnorm(double right, RNG *rng) { return -lnorm(-right, rng); } /* Rejection sampling of interval-truncated standard normal distribution using a uniform envelope. This works best when we are sampling a short interval.x */ static double inorm_unif(double left, double right, RNG *rng) { double zmax; //Value of z at which density is maximum if (left > 0) zmax = left; else if (right < 0) zmax = right; else zmax = 0; while (true) { double z = left + (right - left) * rng->uniform(); if (rng->uniform() <= exp((zmax*zmax - z*z)/2)) { return z; } } } /* Sampling from a interval-truncated standard normal by repeated draws from a non-truncated standard normal distribution. We keep sampling until the sampled value lies in the required interval. This works best when we are sampling a wide interval, and are not sampling from one of the tails (so that left < 0, right > 0). */ static double inorm_repeat(double left, double right, RNG *rng) { double y = rng->normal(); while (y < left || y > right) { y = rng->normal(); } return y; } /* Sample an interval-truncated normal distribution when the interval [left,right] is in the right tail of the underlying normal distribution (so left > 0). If the interval is short, we do this by rejection sampling. Otherwise we do it by repeated sampling from a left truncated normal until the right limit is also satisfied. */ static double inorm_right_tail(double left, double right, RNG *rng) { double alpha = Alpha(left); double maxdiff = exp((left*left - alpha*left + 1)/2)/alpha; if (right - left <= maxdiff) { //Rejection sampling with uniform envelope return inorm_unif(left, right, rng); } else { //Interval too wide for rejection sampling. Do repeat sampling //from left-truncated normal double y = lnorm(left, rng); while (y >= right) { y = lnorm(left, rng); } return y; } } static double inorm(double left, double right, RNG *rng) { if (!jags_finite(left) || !jags_finite(right)) { throw logic_error("Non-finite boundary in truncated normal"); } if (right < left) { throw logic_error("Invalid limits in inorm"); } if (left > 0) { return inorm_right_tail(left, right, rng); } else if (right < 0) { return -inorm_right_tail(-right, -left, rng); } else if (right - left < STP) { return inorm_unif(left, right, rng); } else { return inorm_repeat(left, right, rng); } } /* Public interface */ double lnormal(double left, RNG *rng, double mu, double sigma) { return mu + sigma * lnorm((left - mu)/sigma, rng); } double rnormal(double right, RNG *rng, double mu, double sigma) { return mu + sigma * rnorm((right - mu)/sigma, rng); } double inormal(double left, double right, RNG *rng, double mu, double sigma) { return mu + sigma * inorm((left - mu)/sigma, (right - mu)/sigma, rng); } } //namespace jags JAGS-4.3.2/src/lib/module/0000755000175000017500000000000014400711324012063 500000000000000JAGS-4.3.2/src/lib/module/Makefile.am0000664000175000017500000000021014224052371014036 00000000000000noinst_LTLIBRARIES = libmodule.la libmodule_la_CPPFLAGS = -I$(top_srcdir)/src/include libmodule_la_SOURCES = Module.cc ModuleError.cc JAGS-4.3.2/src/lib/module/Makefile.in0000644000175000017500000005254614400675235014076 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/lib/module ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmodule_la_LIBADD = am_libmodule_la_OBJECTS = libmodule_la-Module.lo \ libmodule_la-ModuleError.lo libmodule_la_OBJECTS = $(am_libmodule_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libmodule_la-Module.Plo \ ./$(DEPDIR)/libmodule_la-ModuleError.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libmodule_la_SOURCES) DIST_SOURCES = $(libmodule_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libmodule.la libmodule_la_CPPFLAGS = -I$(top_srcdir)/src/include libmodule_la_SOURCES = Module.cc ModuleError.cc all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/module/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/lib/module/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libmodule.la: $(libmodule_la_OBJECTS) $(libmodule_la_DEPENDENCIES) $(EXTRA_libmodule_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libmodule_la_OBJECTS) $(libmodule_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodule_la-Module.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmodule_la-ModuleError.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libmodule_la-Module.lo: Module.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodule_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodule_la-Module.lo -MD -MP -MF $(DEPDIR)/libmodule_la-Module.Tpo -c -o libmodule_la-Module.lo `test -f 'Module.cc' || echo '$(srcdir)/'`Module.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodule_la-Module.Tpo $(DEPDIR)/libmodule_la-Module.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Module.cc' object='libmodule_la-Module.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodule_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodule_la-Module.lo `test -f 'Module.cc' || echo '$(srcdir)/'`Module.cc libmodule_la-ModuleError.lo: ModuleError.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodule_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmodule_la-ModuleError.lo -MD -MP -MF $(DEPDIR)/libmodule_la-ModuleError.Tpo -c -o libmodule_la-ModuleError.lo `test -f 'ModuleError.cc' || echo '$(srcdir)/'`ModuleError.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmodule_la-ModuleError.Tpo $(DEPDIR)/libmodule_la-ModuleError.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ModuleError.cc' object='libmodule_la-ModuleError.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmodule_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmodule_la-ModuleError.lo `test -f 'ModuleError.cc' || echo '$(srcdir)/'`ModuleError.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libmodule_la-Module.Plo -rm -f ./$(DEPDIR)/libmodule_la-ModuleError.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libmodule_la-Module.Plo -rm -f ./$(DEPDIR)/libmodule_la-ModuleError.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/lib/module/Module.cc0000664000175000017500000001640314224052514013550 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::list; using std::string; using std::find; using std::pair; namespace jags { Module::Module(string const &name) : _name(name), _loaded(false) { modules().push_back(this); } Module::~Module() { //FIXME: Could be causing windows segfault?? unload(); list::iterator p = find(modules().begin(), modules().end(), this); if (p != modules().end()) { modules().erase(p); } } void Module::insert(ScalarFunction *func) { _functions.push_back(func); _fp_list.push_back(FunctionPtr(func)); } void Module::insert(LinkFunction *func) { _functions.push_back(func); _fp_list.push_back(FunctionPtr(func)); } void Module::insert(VectorFunction *func) { _functions.push_back(func); _fp_list.push_back(FunctionPtr(func)); } void Module::insert(ArrayFunction *func) { _functions.push_back(func); _fp_list.push_back(FunctionPtr(func)); } void Module::insert(RScalarDist *dist) { _distributions.push_back(dist); _dp_list.push_back(DistPtr(dist)); insert(new ScalarLogDensity(dist)); insert(new DFunction(dist)); insert(new PFunction(dist)); insert(new QFunction(dist)); } void Module::insert(ScalarDist *dist) { _distributions.push_back(dist); _dp_list.push_back(DistPtr(dist)); insert(new ScalarLogDensity(dist)); } void Module::insert(VectorDist *dist) { _distributions.push_back(dist); _dp_list.push_back(DistPtr(dist)); insert(new VectorLogDensity(dist)); } void Module::insert(ArrayDist *dist) { _distributions.push_back(dist); _dp_list.push_back(DistPtr(dist)); insert(new ArrayLogDensity(dist)); } void Module::insert(ScalarDist *dist, ScalarFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } void Module::insert(ScalarDist *dist, LinkFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } void Module::insert(ScalarDist *dist, VectorFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } void Module::insert(ScalarDist *dist, ArrayFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } // void Module::insert(VectorDist *dist, ScalarFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } void Module::insert(VectorDist *dist, LinkFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } void Module::insert(VectorDist *dist, VectorFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } void Module::insert(VectorDist *dist, ArrayFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } // void Module::insert(ArrayDist *dist, ScalarFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } void Module::insert(ArrayDist *dist, LinkFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } void Module::insert(ArrayDist *dist, VectorFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } void Module::insert(ArrayDist *dist, ArrayFunction *func) { _obs_functions.push_back(pair(dist,func)); insert(dist); insert(func); } void Module::insert(SamplerFactory *fac) { _sampler_factories.push_back(fac); } void Module::insert(RNGFactory *fac) { _rng_factories.push_back(fac); } void Module::insert(MonitorFactory *fac) { _monitor_factories.push_back(fac); } void Module::load() { if (_loaded) return; for (unsigned int i = 0; i < _monitor_factories.size(); ++i) { pair p(_monitor_factories[i], true); Model::monitorFactories().push_front(p); } for (unsigned int i = 0; i < _rng_factories.size(); ++i) { pair p(_rng_factories[i], true); Model::rngFactories().push_front(p); } for (unsigned int i = 0; i < _sampler_factories.size(); ++i) { pair p(_sampler_factories[i], true); Model::samplerFactories().push_front(p); } for (unsigned int i = 0; i < _dp_list.size(); ++i) { Compiler::distTab().insert(_dp_list[i]); } for (unsigned int i = 0; i < _fp_list.size(); ++i) { Compiler::funcTab().insert(_fp_list[i]); } for (unsigned int i = 0; i < _obs_functions.size(); ++i) { Compiler::obsFuncTab().insert(_obs_functions[i].first, _obs_functions[i].second); } _loaded = true; loadedModules().push_back(this); } void Module::unload() { if (!_loaded) return; loadedModules().remove(this); _loaded = false; for (unsigned int i = 0; i < _fp_list.size(); ++i) { Compiler::funcTab().erase(_fp_list[i]); } for (unsigned int i = 0; i < _obs_functions.size(); ++i) { Compiler::obsFuncTab().erase(_obs_functions[i].first, _obs_functions[i].second); } for (unsigned int i = 0; i < _distributions.size(); ++i) { Compiler::distTab().erase(_dp_list[i]); } list > &rngf = Model::rngFactories(); for (unsigned int i = 0; i < _rng_factories.size(); ++i) { RNGFactory *f = _rng_factories[i]; rngf.remove(pair(f, true)); rngf.remove(pair(f, false)); } list > &sf = Model::samplerFactories(); for (unsigned int i = 0; i < _sampler_factories.size(); ++i) { SamplerFactory *f = _sampler_factories[i]; sf.remove(pair(f, true)); sf.remove(pair(f, false)); } list > &mf = Model::monitorFactories(); for (unsigned int i = 0; i < _monitor_factories.size(); ++i) { MonitorFactory *f = _monitor_factories[i]; mf.remove(pair(f, true)); mf.remove(pair(f, false)); } } vector const &Module::functions() const { return _functions; } vector const &Module::distributions() const { return _distributions; } vector const &Module::samplerFactories() const { return _sampler_factories; } vector const &Module::rngFactories() const { return _rng_factories; } vector const &Module::monitorFactories() const { return _monitor_factories; } string const &Module::name() const { return _name; } list &Module::modules() { static list *_modules = new list; return *_modules; } list &Module::loadedModules() { static list *_modules = new list; return *_modules; } } //namespace jags JAGS-4.3.2/src/lib/module/ModuleError.cc0000664000175000017500000000134614224052371014563 00000000000000#include #include #include #include #include using std::string; using std::runtime_error; using std::logic_error; namespace jags { void throwLogicError(string const &message) { throw logic_error(message); } void throwRuntimeError(string const &message) { throw runtime_error(message); } void throwNodeError(Node const *node, string const &message) { throw NodeError(node, message); } void throwDistError(Distribution const *dist, string const &message) { throw DistError(dist, message); } void throwFuncError(Function const *func, string const &message) { throw FuncError(func, message); } } //namespace jags JAGS-4.3.2/src/jrmath/0000755000175000017500000000000014400711324011315 500000000000000JAGS-4.3.2/src/jrmath/Makefile.am0000664000175000017500000000254514224052371013305 00000000000000lib_LTLIBRARIES = libjrmath.la libjrmath_la_CPPFLAGS = -I$(top_srcdir)/src/include -DMATHLIB_STANDALONE libjrmath_la_CFLAGS = -std=c99 libjrmath_la_LDFLAGS = -no-undefined -version-info 0:0:0 libjrmath_la_LIBADD = -lm libjrmath_la_SOURCES = callbacks.cc \ beta.c gamma.c gammalims.c lgamma.c polygamma.c toms708.c \ mlutils.c stirlerr.c bd0.c choose.c \ d1mach.c i1mach.c fsign.c imax2.c imin2.c \ fmin2.c fmax2.c fprec.c fround.c ftrunc.c \ chebyshev.c lgammacor.c lbeta.c \ rbeta.c dbeta.c pbeta.c qbeta.c \ rbinom.c dbinom.c pbinom.c qbinom.c \ rchisq.c dchisq.c pchisq.c qchisq.c \ rexp.c dexp.c pexp.c qexp.c \ rgamma.c dgamma.c pgamma.c qgamma.c \ rhyper.c dhyper.c phyper.c qhyper.c \ rlnorm.c dlnorm.c plnorm.c qlnorm.c \ rlogis.c dlogis.c plogis.c qlogis.c \ rnbinom.c dnbinom.c pnbinom.c qnbinom.c \ rnorm.c dnorm.c pnorm.c qnorm.c \ rpois.c dpois.c ppois.c qpois.c \ rt.c dt.c pt.c qt.c \ runif.c dunif.c punif.c qunif.c \ rweibull.c dweibull.c pweibull.c qweibull.c \ rnchisq.c dnchisq.c pnchisq.c qnchisq.c \ rcauchy.c dcauchy.c pcauchy.c qcauchy.c \ rf.c df.c pf.c qf.c \ cospi.c gamma_cody.c bessel_i.c bessel_j.c bessel_k.c bessel_y.c \ dgeom.c pgeom.c qgeom.c rgeom.c \ dnbeta.c pnbeta.c qnbeta.c \ dnf.c pnf.c qnf.c \ dnt.c pnt.c qnt.c \ sign.c \ rweibull2.c dweibull2.c pweibull2.c qweibull2.c noinst_HEADERS = nmath.h dpq.h bessel.h EXTRA_DIST = README JAGS-4.3.2/src/jrmath/nmath.h0000664000175000017500000001320514224052371012524 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998-2013 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ /* S Like Fortran Interface */ /* These may not be adequate everywhere. Convex had _ prepending common blocks, and some compilers may need to specify Fortran linkage */ /* Remap for JAGS */ #define norm_rand jags_norm_rand #define unif_rand jags_unif_rand #define exp_rand jags_exp_rand /* Private header file for use during compilation of Mathlib */ #ifndef MATHLIB_PRIVATE_H #define MATHLIB_PRIVATE_H #ifdef HAVE_CONFIG_H # include #endif /* Required by C99 but might be slow */ #ifdef HAVE_LONG_DOUBLE # define LDOUBLE long double #else # define LDOUBLE double #endif #include #include /* DBL_MIN etc */ #include /* Used internally only */ double jags_d1mach(int); double jags_gamma_cody(double); /* Copied from R_ext/RS.h */ #ifdef HAVE_F77_UNDERSCORE # define F77_CALL(x) x ## _ #else # define F77_CALL(x) x #endif #define F77_NAME(x) F77_CALL(x) #define F77_SUB(x) F77_CALL(x) #define F77_COM(x) F77_CALL(x) #define F77_COMDECL(x) F77_CALL(x) /* moved from dpq.h */ #ifdef HAVE_NEARYINT # define R_forceint(x) nearbyint() #else # define R_forceint(x) round(x) #endif //R >= 3.1.0: # define R_nonint(x) (fabs((x) - R_forceint(x)) > 1e-7) # define R_nonint(x) (fabs((x) - R_forceint(x)) > 1e-7*fmax2(1., fabs(x))) /* Mathlib standalone */ #include #include /* for exit */ #define MATHLIB_ERROR(fmt,x) { printf(fmt,x); exit(1); } #define MATHLIB_WARNING(fmt,x) printf(fmt,x) #define MATHLIB_WARNING2(fmt,x,x2) printf(fmt,x,x2) #define MATHLIB_WARNING3(fmt,x,x2,x3) printf(fmt,x,x2,x3) #define MATHLIB_WARNING4(fmt,x,x2,x3,x4) printf(fmt,x,x2,x3,x4) #define MATHLIB_WARNING5(fmt,x,x2,x3,x4,x5) printf(fmt,x,x2,x3,x4,x5) #define ISNAN(x) (isnan(x)!=0) #define R_FINITE(x) JR_finite(x) int JR_finite(double); #define ML_POSINF (1.0 / 0.0) #define ML_NEGINF ((-1.0) / 0.0) #define ML_NAN (0.0 / 0.0) #define _(String) String #define ML_VALID(x) (!ISNAN(x)) #define ME_NONE 0 /* no error */ #define ME_DOMAIN 1 /* argument out of domain */ #define ME_RANGE 2 /* value out of range */ #define ME_NOCONV 4 /* process did not converge */ #define ME_PRECISION 8 /* does not have "full" precision */ #define ME_UNDERFLOW 16 /* and underflow occured (important for IEEE)*/ #define ML_ERR_return_NAN { ML_ERROR(ME_DOMAIN, ""); return ML_NAN; } /* For a long time prior to R 2.3.0 ML_ERROR did nothing. We don't report ME_DOMAIN errors as the callers collect ML_NANs into a single warning. */ #define ML_ERROR(x, s) { \ if(x > ME_DOMAIN) { \ char *msg = ""; \ switch(x) { \ case ME_DOMAIN: \ msg = _("argument out of domain in '%s'\n"); \ break; \ case ME_RANGE: \ msg = _("value out of range in '%s'\n"); \ break; \ case ME_NOCONV: \ msg = _("convergence failed in '%s'\n"); \ break; \ case ME_PRECISION: \ msg = _("full precision may not have been achieved in '%s'\n"); \ break; \ case ME_UNDERFLOW: \ msg = _("underflow occurred in '%s'\n"); \ break; \ } \ MATHLIB_WARNING(msg, s); \ } \ } /* Wilcoxon Rank Sum Distribution */ #define WILCOX_MAX 50 #ifdef HAVE_VISIBILITY_ATTRIBUTE # define attribute_hidden __attribute__ ((visibility ("hidden"))) #else # define attribute_hidden #endif /* Formerly private part of Mathlib.h */ /* always remap internal functions */ #define bd0 jags_bd0 #define chebyshev_eval jags_chebyshev_eval #define chebyshev_init jags_chebyshev_init #define gammalims jags_gammalims #define lfastchoose jags_lfastchoose #define lgammacor jags_lgammacor #define stirlerr jags_stirlerr /* Chebyshev Series */ int attribute_hidden chebyshev_init(double*, int, double); double attribute_hidden chebyshev_eval(double, const double *, const int); /* Gamma and Related Functions */ void attribute_hidden gammalims(double*, double*); double attribute_hidden lgammacor(double); /* log(gamma) correction */ double attribute_hidden stirlerr(double); /* Stirling expansion "error" */ double attribute_hidden lfastchoose(double, double); double attribute_hidden bd0(double, double); double attribute_hidden dbinom_raw(double, double, double, double, int); double attribute_hidden dpois_raw (double, double, int); double attribute_hidden pnchisq_raw(double, double, double, double, double, int, Rboolean, Rboolean); double attribute_hidden pgamma_raw(double, double, int, int); double attribute_hidden pbeta_raw(double, double, double, int, int); double attribute_hidden qchisq_appr(double, double, double, int, int, double tol); LDOUBLE attribute_hidden pnbeta_raw(double, double, double, double, double); double attribute_hidden pnbeta2(double, double, double, double, double, int, int); int jags_i1mach(int); /* From toms708.c */ void attribute_hidden bratio(double a, double b, double x, double y, double *w, double *w1, int *ierr, int log_p); #endif /* MATHLIB_PRIVATE_H */ JAGS-4.3.2/src/jrmath/dpq.h0000664000175000017500000001067114224052371012205 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 2000--2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ /* Utilities for `dpq' handling (density/probability/quantile) */ /* give_log in "d"; log_p in "p" & "q" : */ #define give_log log_p /* "DEFAULT" */ /* --------- */ #define R_D__0 (log_p ? ML_NEGINF : 0.) /* 0 */ #define R_D__1 (log_p ? 0. : 1.) /* 1 */ #define R_DT_0 (lower_tail ? R_D__0 : R_D__1) /* 0 */ #define R_DT_1 (lower_tail ? R_D__1 : R_D__0) /* 1 */ #define R_D_half (log_p ? -M_LN2 : 0.5) // 1/2 (lower- or upper tail) /* Use 0.5 - p + 0.5 to perhaps gain 1 bit of accuracy */ #define R_D_Lval(p) (lower_tail ? (p) : (0.5 - (p) + 0.5)) /* p */ #define R_D_Cval(p) (lower_tail ? (0.5 - (p) + 0.5) : (p)) /* 1 - p */ #define R_D_val(x) (log_p ? log(x) : (x)) /* x in pF(x,..) */ #define R_D_qIv(p) (log_p ? exp(p) : (p)) /* p in qF(p,..) */ #define R_D_exp(x) (log_p ? (x) : exp(x)) /* exp(x) */ #define R_D_log(p) (log_p ? (p) : log(p)) /* log(p) */ #define R_D_Clog(p) (log_p ? log1p(-(p)) : (0.5 - (p) + 0.5)) /* [log](1-p) */ // log(1 - exp(x)) in more stable form than log1p(- R_D_qIv(x)) : #define R_Log1_Exp(x) ((x) > -M_LN2 ? log(-expm1(x)) : log1p(-exp(x))) /* log(1-exp(x)): R_D_LExp(x) == (log1p(- R_D_qIv(x))) but even more stable:*/ #define R_D_LExp(x) (log_p ? R_Log1_Exp(x) : log1p(-x)) #define R_DT_val(x) (lower_tail ? R_D_val(x) : R_D_Clog(x)) #define R_DT_Cval(x) (lower_tail ? R_D_Clog(x) : R_D_val(x)) /*#define R_DT_qIv(p) R_D_Lval(R_D_qIv(p)) * p in qF ! */ #define R_DT_qIv(p) (log_p ? (lower_tail ? exp(p) : - expm1(p)) \ : R_D_Lval(p)) /*#define R_DT_CIv(p) R_D_Cval(R_D_qIv(p)) * 1 - p in qF */ #define R_DT_CIv(p) (log_p ? (lower_tail ? -expm1(p) : exp(p)) \ : R_D_Cval(p)) #define R_DT_exp(x) R_D_exp(R_D_Lval(x)) /* exp(x) */ #define R_DT_Cexp(x) R_D_exp(R_D_Cval(x)) /* exp(1 - x) */ #define R_DT_log(p) (lower_tail? R_D_log(p) : R_D_LExp(p))/* log(p) in qF */ #define R_DT_Clog(p) (lower_tail? R_D_LExp(p): R_D_log(p))/* log(1-p) in qF*/ #define R_DT_Log(p) (lower_tail? (p) : R_Log1_Exp(p)) // == R_DT_log when we already "know" log_p == TRUE #define R_Q_P01_check(p) \ if ((log_p && p > 0) || \ (!log_p && (p < 0 || p > 1)) ) \ ML_ERR_return_NAN /* Do the boundaries exactly for q*() functions : * Often _LEFT_ = ML_NEGINF , and very often _RIGHT_ = ML_POSINF; * * R_Q_P01_boundaries(p, _LEFT_, _RIGHT_) :<==> * * R_Q_P01_check(p); * if (p == R_DT_0) return _LEFT_ ; * if (p == R_DT_1) return _RIGHT_; * * the following implementation should be more efficient (less tests): */ #define R_Q_P01_boundaries(p, _LEFT_, _RIGHT_) \ if (log_p) { \ if(p > 0) \ ML_ERR_return_NAN; \ if(p == 0) /* upper bound*/ \ return lower_tail ? _RIGHT_ : _LEFT_; \ if(p == ML_NEGINF) \ return lower_tail ? _LEFT_ : _RIGHT_; \ } \ else { /* !log_p */ \ if(p < 0 || p > 1) \ ML_ERR_return_NAN; \ if(p == 0) \ return lower_tail ? _LEFT_ : _RIGHT_; \ if(p == 1) \ return lower_tail ? _RIGHT_ : _LEFT_; \ } #define R_P_bounds_01(x, x_min, x_max) \ if(x <= x_min) return R_DT_0; \ if(x >= x_max) return R_DT_1 /* is typically not quite optimal for (-Inf,Inf) where * you'd rather have */ #define R_P_bounds_Inf_01(x) \ if(!R_FINITE(x)) { \ if (x > 0) return R_DT_1; \ /* x < 0 */return R_DT_0; \ } /* additions for density functions (C.Loader) */ #define R_D_fexp(f,x) (give_log ? -0.5*log(f)+(x) : exp(x)/sqrt(f)) /* [neg]ative or [non int]eger : */ #define R_D_negInonint(x) (x < 0. || R_nonint(x)) // for discrete d(x, ...) : #define R_D_nonint_check(x) \ if(R_nonint(x)) { \ MATHLIB_WARNING("non-integer x = %f", x); \ return R_D__0; \ } JAGS-4.3.2/src/jrmath/bessel.h0000664000175000017500000001256014224052371012675 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 2001-2014 R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ /* Constants und Documentation that apply to several of the * ./bessel_[ijky].c files */ /* ******************************************************************* Explanation of machine-dependent constants beta = Radix for the floating-point system minexp = Smallest representable power of beta maxexp = Smallest power of beta that overflows it = p = Number of bits (base-beta digits) in the mantissa (significand) of a working precision (floating-point) variable NSIG = Decimal significance desired. Should be set to INT(LOG10(2)*it+1). Setting NSIG lower will result in decreased accuracy while setting NSIG higher will increase CPU time without increasing accuracy. The truncation error is limited to a relative error of T=.5*10^(-NSIG). ENTEN = 10 ^ K, where K is the largest int such that ENTEN is machine-representable in working precision ENSIG = 10 ^ NSIG RTNSIG = 10 ^ (-K) for the smallest int K such that K >= NSIG/4 ENMTEN = Smallest ABS(X) such that X/4 does not underflow XINF = Largest positive machine number; approximately beta ^ maxexp == DBL_MAX (defined in #include ) SQXMIN = Square root of beta ^ minexp = sqrt(DBL_MIN) EPS = The smallest positive floating-point number such that 1.0+EPS > 1.0 = beta ^ (-p) == DBL_EPSILON For I : EXPARG = Largest working precision argument that the library EXP routine can handle and upper limit on the magnitude of X when IZE=1; approximately LOG(beta ^ maxexp) For I and J : xlrg_IJ = xlrg_BESS_IJ (was = XLARGE). Upper limit on the magnitude of X (when IZE=2 for I()). Bear in mind that if floor(abs(x)) =: N, then at least N iterations of the backward recursion will be executed. The value of 10 ^ 4 was used till Feb.2009, when it was increased to 10 ^ 5 (= 1e5). For j : XMIN_J = Smallest acceptable argument for RBESY; approximately max(2*beta ^ minexp, 2/XINF), rounded up For Y : xlrg_Y = (was = XLARGE). Upper bound on X; approximately 1/DEL, because the sine and cosine functions have lost about half of their precision at that point. EPS_SINC = Machine number below which sin(x)/x = 1; approximately SQRT(EPS). THRESH = Lower bound for use of the asymptotic form; approximately AINT(-LOG10(EPS/2.0))+1.0 For K : xmax_k = (was = XMAX). Upper limit on the magnitude of X when ize = 1; i.e. maximal x for UNscaled answer. Solution to equation: W(X) * (1 -1/8 X + 9/128 X^2) = beta ^ minexp where W(X) = EXP(-X)*SQRT(PI/2X) -------------------------------------------------------------------- Approximate values for some important machines are: beta minexp maxexp it NSIG ENTEN ENSIG RTNSIG ENMTEN EXPARG IEEE (IBM/XT, SUN, etc.) (S.P.) 2 -126 128 24 8 1e38 1e8 1e-2 4.70e-38 88 IEEE (...) (D.P.) 2 -1022 1024 53 16 1e308 1e16 1e-4 8.90e-308 709 CRAY-1 (S.P.) 2 -8193 8191 48 15 1e2465 1e15 1e-4 1.84e-2466 5677 Cyber 180/855 under NOS (S.P.) 2 -975 1070 48 15 1e322 1e15 1e-4 1.25e-293 741 IBM 3033 (D.P.) 16 -65 63 14 5 1e75 1e5 1e-2 2.16e-78 174 VAX (S.P.) 2 -128 127 24 8 1e38 1e8 1e-2 1.17e-38 88 VAX D-Format (D.P.) 2 -128 127 56 17 1e38 1e17 1e-5 1.17e-38 88 VAX G-Format (D.P.) 2 -1024 1023 53 16 1e307 1e16 1e-4 2.22e-308 709 And routine specific : xlrg_IJ xlrg_Y xmax_k EPS_SINC XMIN_J XINF THRESH IEEE (IBM/XT, SUN, etc.) (S.P.) 1e4 1e4 85.337 1e-4 2.36e-38 3.40e38 8. IEEE (...) (D.P.) 1e4 1e8 705.342 1e-8 4.46e-308 1.79e308 16. CRAY-1 (S.P.) 1e4 2e7 5674.858 5e-8 3.67e-2466 5.45e2465 15. Cyber 180/855 under NOS (S.P.) 1e4 2e7 672.788 5e-8 6.28e-294 1.26e322 15. IBM 3033 (D.P.) 1e4 1e8 177.852 1e-8 2.77e-76 7.23e75 17. VAX (S.P.) 1e4 1e4 86.715 1e-4 1.18e-38 1.70e38 8. VAX e-Format (D.P.) 1e4 1e9 86.715 1e-9 1.18e-38 1.70e38 17. VAX G-Format (D.P.) 1e4 1e8 706.728 1e-8 2.23e-308 8.98e307 16. */ #define nsig_BESS 16 #define ensig_BESS 1e16 #define rtnsig_BESS 1e-4 #define enmten_BESS 8.9e-308 #define enten_BESS 1e308 #define exparg_BESS 709. #define xlrg_BESS_IJ 1e5 #define xlrg_BESS_Y 1e8 #define thresh_BESS_Y 16. #define xmax_BESS_K 705.342/* maximal x for UNscaled answer */ /* sqrt(DBL_MIN) = 1.491668e-154 */ #define sqxmin_BESS_K 1.49e-154 /* x < eps_sinc <==> sin(x)/x == 1 (particularly "==>"); Linux (around 2001-02) gives 2.14946906753213e-08 Solaris 2.5.1 gives 2.14911933289084e-08 */ #define M_eps_sinc 2.149e-8 JAGS-4.3.2/src/jrmath/Makefile.in0000644000175000017500000053164314400675235013330 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/jrmath ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libjrmath_la_DEPENDENCIES = am_libjrmath_la_OBJECTS = libjrmath_la-callbacks.lo \ libjrmath_la-beta.lo libjrmath_la-gamma.lo \ libjrmath_la-gammalims.lo libjrmath_la-lgamma.lo \ libjrmath_la-polygamma.lo libjrmath_la-toms708.lo \ libjrmath_la-mlutils.lo libjrmath_la-stirlerr.lo \ libjrmath_la-bd0.lo libjrmath_la-choose.lo \ libjrmath_la-d1mach.lo libjrmath_la-i1mach.lo \ libjrmath_la-fsign.lo libjrmath_la-imax2.lo \ libjrmath_la-imin2.lo libjrmath_la-fmin2.lo \ libjrmath_la-fmax2.lo libjrmath_la-fprec.lo \ libjrmath_la-fround.lo libjrmath_la-ftrunc.lo \ libjrmath_la-chebyshev.lo libjrmath_la-lgammacor.lo \ libjrmath_la-lbeta.lo libjrmath_la-rbeta.lo \ libjrmath_la-dbeta.lo libjrmath_la-pbeta.lo \ libjrmath_la-qbeta.lo libjrmath_la-rbinom.lo \ libjrmath_la-dbinom.lo libjrmath_la-pbinom.lo \ libjrmath_la-qbinom.lo libjrmath_la-rchisq.lo \ libjrmath_la-dchisq.lo libjrmath_la-pchisq.lo \ libjrmath_la-qchisq.lo libjrmath_la-rexp.lo \ libjrmath_la-dexp.lo libjrmath_la-pexp.lo libjrmath_la-qexp.lo \ libjrmath_la-rgamma.lo libjrmath_la-dgamma.lo \ libjrmath_la-pgamma.lo libjrmath_la-qgamma.lo \ libjrmath_la-rhyper.lo libjrmath_la-dhyper.lo \ libjrmath_la-phyper.lo libjrmath_la-qhyper.lo \ libjrmath_la-rlnorm.lo libjrmath_la-dlnorm.lo \ libjrmath_la-plnorm.lo libjrmath_la-qlnorm.lo \ libjrmath_la-rlogis.lo libjrmath_la-dlogis.lo \ libjrmath_la-plogis.lo libjrmath_la-qlogis.lo \ libjrmath_la-rnbinom.lo libjrmath_la-dnbinom.lo \ libjrmath_la-pnbinom.lo libjrmath_la-qnbinom.lo \ libjrmath_la-rnorm.lo libjrmath_la-dnorm.lo \ libjrmath_la-pnorm.lo libjrmath_la-qnorm.lo \ libjrmath_la-rpois.lo libjrmath_la-dpois.lo \ libjrmath_la-ppois.lo libjrmath_la-qpois.lo libjrmath_la-rt.lo \ libjrmath_la-dt.lo libjrmath_la-pt.lo libjrmath_la-qt.lo \ libjrmath_la-runif.lo libjrmath_la-dunif.lo \ libjrmath_la-punif.lo libjrmath_la-qunif.lo \ libjrmath_la-rweibull.lo libjrmath_la-dweibull.lo \ libjrmath_la-pweibull.lo libjrmath_la-qweibull.lo \ libjrmath_la-rnchisq.lo libjrmath_la-dnchisq.lo \ libjrmath_la-pnchisq.lo libjrmath_la-qnchisq.lo \ libjrmath_la-rcauchy.lo libjrmath_la-dcauchy.lo \ libjrmath_la-pcauchy.lo libjrmath_la-qcauchy.lo \ libjrmath_la-rf.lo libjrmath_la-df.lo libjrmath_la-pf.lo \ libjrmath_la-qf.lo libjrmath_la-cospi.lo \ libjrmath_la-gamma_cody.lo libjrmath_la-bessel_i.lo \ libjrmath_la-bessel_j.lo libjrmath_la-bessel_k.lo \ libjrmath_la-bessel_y.lo libjrmath_la-dgeom.lo \ libjrmath_la-pgeom.lo libjrmath_la-qgeom.lo \ libjrmath_la-rgeom.lo libjrmath_la-dnbeta.lo \ libjrmath_la-pnbeta.lo libjrmath_la-qnbeta.lo \ libjrmath_la-dnf.lo libjrmath_la-pnf.lo libjrmath_la-qnf.lo \ libjrmath_la-dnt.lo libjrmath_la-pnt.lo libjrmath_la-qnt.lo \ libjrmath_la-sign.lo libjrmath_la-rweibull2.lo \ libjrmath_la-dweibull2.lo libjrmath_la-pweibull2.lo \ libjrmath_la-qweibull2.lo libjrmath_la_OBJECTS = $(am_libjrmath_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libjrmath_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libjrmath_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libjrmath_la-bd0.Plo \ ./$(DEPDIR)/libjrmath_la-bessel_i.Plo \ ./$(DEPDIR)/libjrmath_la-bessel_j.Plo \ ./$(DEPDIR)/libjrmath_la-bessel_k.Plo \ ./$(DEPDIR)/libjrmath_la-bessel_y.Plo \ ./$(DEPDIR)/libjrmath_la-beta.Plo \ ./$(DEPDIR)/libjrmath_la-callbacks.Plo \ ./$(DEPDIR)/libjrmath_la-chebyshev.Plo \ ./$(DEPDIR)/libjrmath_la-choose.Plo \ ./$(DEPDIR)/libjrmath_la-cospi.Plo \ ./$(DEPDIR)/libjrmath_la-d1mach.Plo \ ./$(DEPDIR)/libjrmath_la-dbeta.Plo \ ./$(DEPDIR)/libjrmath_la-dbinom.Plo \ ./$(DEPDIR)/libjrmath_la-dcauchy.Plo \ ./$(DEPDIR)/libjrmath_la-dchisq.Plo \ ./$(DEPDIR)/libjrmath_la-dexp.Plo \ ./$(DEPDIR)/libjrmath_la-df.Plo \ ./$(DEPDIR)/libjrmath_la-dgamma.Plo \ ./$(DEPDIR)/libjrmath_la-dgeom.Plo \ ./$(DEPDIR)/libjrmath_la-dhyper.Plo \ ./$(DEPDIR)/libjrmath_la-dlnorm.Plo \ ./$(DEPDIR)/libjrmath_la-dlogis.Plo \ ./$(DEPDIR)/libjrmath_la-dnbeta.Plo \ ./$(DEPDIR)/libjrmath_la-dnbinom.Plo \ ./$(DEPDIR)/libjrmath_la-dnchisq.Plo \ ./$(DEPDIR)/libjrmath_la-dnf.Plo \ ./$(DEPDIR)/libjrmath_la-dnorm.Plo \ ./$(DEPDIR)/libjrmath_la-dnt.Plo \ ./$(DEPDIR)/libjrmath_la-dpois.Plo \ ./$(DEPDIR)/libjrmath_la-dt.Plo \ ./$(DEPDIR)/libjrmath_la-dunif.Plo \ ./$(DEPDIR)/libjrmath_la-dweibull.Plo \ ./$(DEPDIR)/libjrmath_la-dweibull2.Plo \ ./$(DEPDIR)/libjrmath_la-fmax2.Plo \ ./$(DEPDIR)/libjrmath_la-fmin2.Plo \ ./$(DEPDIR)/libjrmath_la-fprec.Plo \ ./$(DEPDIR)/libjrmath_la-fround.Plo \ ./$(DEPDIR)/libjrmath_la-fsign.Plo \ ./$(DEPDIR)/libjrmath_la-ftrunc.Plo \ ./$(DEPDIR)/libjrmath_la-gamma.Plo \ ./$(DEPDIR)/libjrmath_la-gamma_cody.Plo \ ./$(DEPDIR)/libjrmath_la-gammalims.Plo \ ./$(DEPDIR)/libjrmath_la-i1mach.Plo \ ./$(DEPDIR)/libjrmath_la-imax2.Plo \ ./$(DEPDIR)/libjrmath_la-imin2.Plo \ ./$(DEPDIR)/libjrmath_la-lbeta.Plo \ ./$(DEPDIR)/libjrmath_la-lgamma.Plo \ ./$(DEPDIR)/libjrmath_la-lgammacor.Plo \ ./$(DEPDIR)/libjrmath_la-mlutils.Plo \ ./$(DEPDIR)/libjrmath_la-pbeta.Plo \ ./$(DEPDIR)/libjrmath_la-pbinom.Plo \ ./$(DEPDIR)/libjrmath_la-pcauchy.Plo \ ./$(DEPDIR)/libjrmath_la-pchisq.Plo \ ./$(DEPDIR)/libjrmath_la-pexp.Plo \ ./$(DEPDIR)/libjrmath_la-pf.Plo \ ./$(DEPDIR)/libjrmath_la-pgamma.Plo \ ./$(DEPDIR)/libjrmath_la-pgeom.Plo \ ./$(DEPDIR)/libjrmath_la-phyper.Plo \ ./$(DEPDIR)/libjrmath_la-plnorm.Plo \ ./$(DEPDIR)/libjrmath_la-plogis.Plo \ ./$(DEPDIR)/libjrmath_la-pnbeta.Plo \ ./$(DEPDIR)/libjrmath_la-pnbinom.Plo \ ./$(DEPDIR)/libjrmath_la-pnchisq.Plo \ ./$(DEPDIR)/libjrmath_la-pnf.Plo \ ./$(DEPDIR)/libjrmath_la-pnorm.Plo \ ./$(DEPDIR)/libjrmath_la-pnt.Plo \ ./$(DEPDIR)/libjrmath_la-polygamma.Plo \ ./$(DEPDIR)/libjrmath_la-ppois.Plo \ ./$(DEPDIR)/libjrmath_la-pt.Plo \ ./$(DEPDIR)/libjrmath_la-punif.Plo \ ./$(DEPDIR)/libjrmath_la-pweibull.Plo \ ./$(DEPDIR)/libjrmath_la-pweibull2.Plo \ ./$(DEPDIR)/libjrmath_la-qbeta.Plo \ ./$(DEPDIR)/libjrmath_la-qbinom.Plo \ ./$(DEPDIR)/libjrmath_la-qcauchy.Plo \ ./$(DEPDIR)/libjrmath_la-qchisq.Plo \ ./$(DEPDIR)/libjrmath_la-qexp.Plo \ ./$(DEPDIR)/libjrmath_la-qf.Plo \ ./$(DEPDIR)/libjrmath_la-qgamma.Plo \ ./$(DEPDIR)/libjrmath_la-qgeom.Plo \ ./$(DEPDIR)/libjrmath_la-qhyper.Plo \ ./$(DEPDIR)/libjrmath_la-qlnorm.Plo \ ./$(DEPDIR)/libjrmath_la-qlogis.Plo \ ./$(DEPDIR)/libjrmath_la-qnbeta.Plo \ ./$(DEPDIR)/libjrmath_la-qnbinom.Plo \ ./$(DEPDIR)/libjrmath_la-qnchisq.Plo \ ./$(DEPDIR)/libjrmath_la-qnf.Plo \ ./$(DEPDIR)/libjrmath_la-qnorm.Plo \ ./$(DEPDIR)/libjrmath_la-qnt.Plo \ ./$(DEPDIR)/libjrmath_la-qpois.Plo \ ./$(DEPDIR)/libjrmath_la-qt.Plo \ ./$(DEPDIR)/libjrmath_la-qunif.Plo \ ./$(DEPDIR)/libjrmath_la-qweibull.Plo \ ./$(DEPDIR)/libjrmath_la-qweibull2.Plo \ ./$(DEPDIR)/libjrmath_la-rbeta.Plo \ ./$(DEPDIR)/libjrmath_la-rbinom.Plo \ ./$(DEPDIR)/libjrmath_la-rcauchy.Plo \ ./$(DEPDIR)/libjrmath_la-rchisq.Plo \ ./$(DEPDIR)/libjrmath_la-rexp.Plo \ ./$(DEPDIR)/libjrmath_la-rf.Plo \ ./$(DEPDIR)/libjrmath_la-rgamma.Plo \ ./$(DEPDIR)/libjrmath_la-rgeom.Plo \ ./$(DEPDIR)/libjrmath_la-rhyper.Plo \ ./$(DEPDIR)/libjrmath_la-rlnorm.Plo \ ./$(DEPDIR)/libjrmath_la-rlogis.Plo \ ./$(DEPDIR)/libjrmath_la-rnbinom.Plo \ ./$(DEPDIR)/libjrmath_la-rnchisq.Plo \ ./$(DEPDIR)/libjrmath_la-rnorm.Plo \ ./$(DEPDIR)/libjrmath_la-rpois.Plo \ ./$(DEPDIR)/libjrmath_la-rt.Plo \ ./$(DEPDIR)/libjrmath_la-runif.Plo \ ./$(DEPDIR)/libjrmath_la-rweibull.Plo \ ./$(DEPDIR)/libjrmath_la-rweibull2.Plo \ ./$(DEPDIR)/libjrmath_la-sign.Plo \ ./$(DEPDIR)/libjrmath_la-stirlerr.Plo \ ./$(DEPDIR)/libjrmath_la-toms708.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libjrmath_la_SOURCES) DIST_SOURCES = $(libjrmath_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libjrmath.la libjrmath_la_CPPFLAGS = -I$(top_srcdir)/src/include -DMATHLIB_STANDALONE libjrmath_la_CFLAGS = -std=c99 libjrmath_la_LDFLAGS = -no-undefined -version-info 0:0:0 libjrmath_la_LIBADD = -lm libjrmath_la_SOURCES = callbacks.cc \ beta.c gamma.c gammalims.c lgamma.c polygamma.c toms708.c \ mlutils.c stirlerr.c bd0.c choose.c \ d1mach.c i1mach.c fsign.c imax2.c imin2.c \ fmin2.c fmax2.c fprec.c fround.c ftrunc.c \ chebyshev.c lgammacor.c lbeta.c \ rbeta.c dbeta.c pbeta.c qbeta.c \ rbinom.c dbinom.c pbinom.c qbinom.c \ rchisq.c dchisq.c pchisq.c qchisq.c \ rexp.c dexp.c pexp.c qexp.c \ rgamma.c dgamma.c pgamma.c qgamma.c \ rhyper.c dhyper.c phyper.c qhyper.c \ rlnorm.c dlnorm.c plnorm.c qlnorm.c \ rlogis.c dlogis.c plogis.c qlogis.c \ rnbinom.c dnbinom.c pnbinom.c qnbinom.c \ rnorm.c dnorm.c pnorm.c qnorm.c \ rpois.c dpois.c ppois.c qpois.c \ rt.c dt.c pt.c qt.c \ runif.c dunif.c punif.c qunif.c \ rweibull.c dweibull.c pweibull.c qweibull.c \ rnchisq.c dnchisq.c pnchisq.c qnchisq.c \ rcauchy.c dcauchy.c pcauchy.c qcauchy.c \ rf.c df.c pf.c qf.c \ cospi.c gamma_cody.c bessel_i.c bessel_j.c bessel_k.c bessel_y.c \ dgeom.c pgeom.c qgeom.c rgeom.c \ dnbeta.c pnbeta.c qnbeta.c \ dnf.c pnf.c qnf.c \ dnt.c pnt.c qnt.c \ sign.c \ rweibull2.c dweibull2.c pweibull2.c qweibull2.c noinst_HEADERS = nmath.h dpq.h bessel.h EXTRA_DIST = README all: all-am .SUFFIXES: .SUFFIXES: .c .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/jrmath/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/jrmath/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libjrmath.la: $(libjrmath_la_OBJECTS) $(libjrmath_la_DEPENDENCIES) $(EXTRA_libjrmath_la_DEPENDENCIES) $(AM_V_CXXLD)$(libjrmath_la_LINK) -rpath $(libdir) $(libjrmath_la_OBJECTS) $(libjrmath_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-bd0.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-bessel_i.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-bessel_j.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-bessel_k.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-bessel_y.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-beta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-callbacks.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-chebyshev.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-choose.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-cospi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-d1mach.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dbeta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dbinom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dcauchy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dchisq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dexp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-df.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dgamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dgeom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dhyper.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dlnorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dlogis.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dnbeta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dnbinom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dnchisq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dnf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dnorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dnt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dpois.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dunif.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dweibull.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-dweibull2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-fmax2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-fmin2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-fprec.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-fround.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-fsign.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-ftrunc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-gamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-gamma_cody.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-gammalims.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-i1mach.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-imax2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-imin2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-lbeta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-lgamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-lgammacor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-mlutils.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pbeta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pbinom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pcauchy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pchisq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pexp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pgamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pgeom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-phyper.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-plnorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-plogis.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pnbeta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pnbinom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pnchisq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pnf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pnorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pnt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-polygamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-ppois.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-punif.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pweibull.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-pweibull2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qbeta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qbinom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qcauchy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qchisq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qexp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qgamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qgeom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qhyper.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qlnorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qlogis.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qnbeta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qnbinom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qnchisq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qnf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qnorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qnt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qpois.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qunif.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qweibull.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-qweibull2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rbeta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rbinom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rcauchy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rchisq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rexp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rf.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rgamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rgeom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rhyper.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rlnorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rlogis.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rnbinom.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rnchisq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rnorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rpois.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-runif.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rweibull.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-rweibull2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-sign.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-stirlerr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjrmath_la-toms708.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< libjrmath_la-beta.lo: beta.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-beta.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-beta.Tpo -c -o libjrmath_la-beta.lo `test -f 'beta.c' || echo '$(srcdir)/'`beta.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-beta.Tpo $(DEPDIR)/libjrmath_la-beta.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='beta.c' object='libjrmath_la-beta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-beta.lo `test -f 'beta.c' || echo '$(srcdir)/'`beta.c libjrmath_la-gamma.lo: gamma.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-gamma.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-gamma.Tpo -c -o libjrmath_la-gamma.lo `test -f 'gamma.c' || echo '$(srcdir)/'`gamma.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-gamma.Tpo $(DEPDIR)/libjrmath_la-gamma.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gamma.c' object='libjrmath_la-gamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-gamma.lo `test -f 'gamma.c' || echo '$(srcdir)/'`gamma.c libjrmath_la-gammalims.lo: gammalims.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-gammalims.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-gammalims.Tpo -c -o libjrmath_la-gammalims.lo `test -f 'gammalims.c' || echo '$(srcdir)/'`gammalims.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-gammalims.Tpo $(DEPDIR)/libjrmath_la-gammalims.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gammalims.c' object='libjrmath_la-gammalims.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-gammalims.lo `test -f 'gammalims.c' || echo '$(srcdir)/'`gammalims.c libjrmath_la-lgamma.lo: lgamma.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-lgamma.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-lgamma.Tpo -c -o libjrmath_la-lgamma.lo `test -f 'lgamma.c' || echo '$(srcdir)/'`lgamma.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-lgamma.Tpo $(DEPDIR)/libjrmath_la-lgamma.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lgamma.c' object='libjrmath_la-lgamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-lgamma.lo `test -f 'lgamma.c' || echo '$(srcdir)/'`lgamma.c libjrmath_la-polygamma.lo: polygamma.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-polygamma.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-polygamma.Tpo -c -o libjrmath_la-polygamma.lo `test -f 'polygamma.c' || echo '$(srcdir)/'`polygamma.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-polygamma.Tpo $(DEPDIR)/libjrmath_la-polygamma.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='polygamma.c' object='libjrmath_la-polygamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-polygamma.lo `test -f 'polygamma.c' || echo '$(srcdir)/'`polygamma.c libjrmath_la-toms708.lo: toms708.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-toms708.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-toms708.Tpo -c -o libjrmath_la-toms708.lo `test -f 'toms708.c' || echo '$(srcdir)/'`toms708.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-toms708.Tpo $(DEPDIR)/libjrmath_la-toms708.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='toms708.c' object='libjrmath_la-toms708.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-toms708.lo `test -f 'toms708.c' || echo '$(srcdir)/'`toms708.c libjrmath_la-mlutils.lo: mlutils.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-mlutils.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-mlutils.Tpo -c -o libjrmath_la-mlutils.lo `test -f 'mlutils.c' || echo '$(srcdir)/'`mlutils.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-mlutils.Tpo $(DEPDIR)/libjrmath_la-mlutils.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mlutils.c' object='libjrmath_la-mlutils.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-mlutils.lo `test -f 'mlutils.c' || echo '$(srcdir)/'`mlutils.c libjrmath_la-stirlerr.lo: stirlerr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-stirlerr.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-stirlerr.Tpo -c -o libjrmath_la-stirlerr.lo `test -f 'stirlerr.c' || echo '$(srcdir)/'`stirlerr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-stirlerr.Tpo $(DEPDIR)/libjrmath_la-stirlerr.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stirlerr.c' object='libjrmath_la-stirlerr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-stirlerr.lo `test -f 'stirlerr.c' || echo '$(srcdir)/'`stirlerr.c libjrmath_la-bd0.lo: bd0.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-bd0.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-bd0.Tpo -c -o libjrmath_la-bd0.lo `test -f 'bd0.c' || echo '$(srcdir)/'`bd0.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-bd0.Tpo $(DEPDIR)/libjrmath_la-bd0.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bd0.c' object='libjrmath_la-bd0.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-bd0.lo `test -f 'bd0.c' || echo '$(srcdir)/'`bd0.c libjrmath_la-choose.lo: choose.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-choose.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-choose.Tpo -c -o libjrmath_la-choose.lo `test -f 'choose.c' || echo '$(srcdir)/'`choose.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-choose.Tpo $(DEPDIR)/libjrmath_la-choose.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='choose.c' object='libjrmath_la-choose.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-choose.lo `test -f 'choose.c' || echo '$(srcdir)/'`choose.c libjrmath_la-d1mach.lo: d1mach.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-d1mach.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-d1mach.Tpo -c -o libjrmath_la-d1mach.lo `test -f 'd1mach.c' || echo '$(srcdir)/'`d1mach.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-d1mach.Tpo $(DEPDIR)/libjrmath_la-d1mach.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='d1mach.c' object='libjrmath_la-d1mach.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-d1mach.lo `test -f 'd1mach.c' || echo '$(srcdir)/'`d1mach.c libjrmath_la-i1mach.lo: i1mach.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-i1mach.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-i1mach.Tpo -c -o libjrmath_la-i1mach.lo `test -f 'i1mach.c' || echo '$(srcdir)/'`i1mach.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-i1mach.Tpo $(DEPDIR)/libjrmath_la-i1mach.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='i1mach.c' object='libjrmath_la-i1mach.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-i1mach.lo `test -f 'i1mach.c' || echo '$(srcdir)/'`i1mach.c libjrmath_la-fsign.lo: fsign.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-fsign.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-fsign.Tpo -c -o libjrmath_la-fsign.lo `test -f 'fsign.c' || echo '$(srcdir)/'`fsign.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-fsign.Tpo $(DEPDIR)/libjrmath_la-fsign.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fsign.c' object='libjrmath_la-fsign.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-fsign.lo `test -f 'fsign.c' || echo '$(srcdir)/'`fsign.c libjrmath_la-imax2.lo: imax2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-imax2.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-imax2.Tpo -c -o libjrmath_la-imax2.lo `test -f 'imax2.c' || echo '$(srcdir)/'`imax2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-imax2.Tpo $(DEPDIR)/libjrmath_la-imax2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imax2.c' object='libjrmath_la-imax2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-imax2.lo `test -f 'imax2.c' || echo '$(srcdir)/'`imax2.c libjrmath_la-imin2.lo: imin2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-imin2.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-imin2.Tpo -c -o libjrmath_la-imin2.lo `test -f 'imin2.c' || echo '$(srcdir)/'`imin2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-imin2.Tpo $(DEPDIR)/libjrmath_la-imin2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='imin2.c' object='libjrmath_la-imin2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-imin2.lo `test -f 'imin2.c' || echo '$(srcdir)/'`imin2.c libjrmath_la-fmin2.lo: fmin2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-fmin2.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-fmin2.Tpo -c -o libjrmath_la-fmin2.lo `test -f 'fmin2.c' || echo '$(srcdir)/'`fmin2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-fmin2.Tpo $(DEPDIR)/libjrmath_la-fmin2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fmin2.c' object='libjrmath_la-fmin2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-fmin2.lo `test -f 'fmin2.c' || echo '$(srcdir)/'`fmin2.c libjrmath_la-fmax2.lo: fmax2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-fmax2.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-fmax2.Tpo -c -o libjrmath_la-fmax2.lo `test -f 'fmax2.c' || echo '$(srcdir)/'`fmax2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-fmax2.Tpo $(DEPDIR)/libjrmath_la-fmax2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fmax2.c' object='libjrmath_la-fmax2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-fmax2.lo `test -f 'fmax2.c' || echo '$(srcdir)/'`fmax2.c libjrmath_la-fprec.lo: fprec.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-fprec.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-fprec.Tpo -c -o libjrmath_la-fprec.lo `test -f 'fprec.c' || echo '$(srcdir)/'`fprec.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-fprec.Tpo $(DEPDIR)/libjrmath_la-fprec.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fprec.c' object='libjrmath_la-fprec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-fprec.lo `test -f 'fprec.c' || echo '$(srcdir)/'`fprec.c libjrmath_la-fround.lo: fround.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-fround.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-fround.Tpo -c -o libjrmath_la-fround.lo `test -f 'fround.c' || echo '$(srcdir)/'`fround.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-fround.Tpo $(DEPDIR)/libjrmath_la-fround.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fround.c' object='libjrmath_la-fround.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-fround.lo `test -f 'fround.c' || echo '$(srcdir)/'`fround.c libjrmath_la-ftrunc.lo: ftrunc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-ftrunc.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-ftrunc.Tpo -c -o libjrmath_la-ftrunc.lo `test -f 'ftrunc.c' || echo '$(srcdir)/'`ftrunc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-ftrunc.Tpo $(DEPDIR)/libjrmath_la-ftrunc.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ftrunc.c' object='libjrmath_la-ftrunc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-ftrunc.lo `test -f 'ftrunc.c' || echo '$(srcdir)/'`ftrunc.c libjrmath_la-chebyshev.lo: chebyshev.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-chebyshev.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-chebyshev.Tpo -c -o libjrmath_la-chebyshev.lo `test -f 'chebyshev.c' || echo '$(srcdir)/'`chebyshev.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-chebyshev.Tpo $(DEPDIR)/libjrmath_la-chebyshev.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='chebyshev.c' object='libjrmath_la-chebyshev.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-chebyshev.lo `test -f 'chebyshev.c' || echo '$(srcdir)/'`chebyshev.c libjrmath_la-lgammacor.lo: lgammacor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-lgammacor.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-lgammacor.Tpo -c -o libjrmath_la-lgammacor.lo `test -f 'lgammacor.c' || echo '$(srcdir)/'`lgammacor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-lgammacor.Tpo $(DEPDIR)/libjrmath_la-lgammacor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lgammacor.c' object='libjrmath_la-lgammacor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-lgammacor.lo `test -f 'lgammacor.c' || echo '$(srcdir)/'`lgammacor.c libjrmath_la-lbeta.lo: lbeta.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-lbeta.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-lbeta.Tpo -c -o libjrmath_la-lbeta.lo `test -f 'lbeta.c' || echo '$(srcdir)/'`lbeta.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-lbeta.Tpo $(DEPDIR)/libjrmath_la-lbeta.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lbeta.c' object='libjrmath_la-lbeta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-lbeta.lo `test -f 'lbeta.c' || echo '$(srcdir)/'`lbeta.c libjrmath_la-rbeta.lo: rbeta.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rbeta.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rbeta.Tpo -c -o libjrmath_la-rbeta.lo `test -f 'rbeta.c' || echo '$(srcdir)/'`rbeta.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rbeta.Tpo $(DEPDIR)/libjrmath_la-rbeta.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rbeta.c' object='libjrmath_la-rbeta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rbeta.lo `test -f 'rbeta.c' || echo '$(srcdir)/'`rbeta.c libjrmath_la-dbeta.lo: dbeta.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dbeta.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dbeta.Tpo -c -o libjrmath_la-dbeta.lo `test -f 'dbeta.c' || echo '$(srcdir)/'`dbeta.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dbeta.Tpo $(DEPDIR)/libjrmath_la-dbeta.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbeta.c' object='libjrmath_la-dbeta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dbeta.lo `test -f 'dbeta.c' || echo '$(srcdir)/'`dbeta.c libjrmath_la-pbeta.lo: pbeta.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pbeta.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pbeta.Tpo -c -o libjrmath_la-pbeta.lo `test -f 'pbeta.c' || echo '$(srcdir)/'`pbeta.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pbeta.Tpo $(DEPDIR)/libjrmath_la-pbeta.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pbeta.c' object='libjrmath_la-pbeta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pbeta.lo `test -f 'pbeta.c' || echo '$(srcdir)/'`pbeta.c libjrmath_la-qbeta.lo: qbeta.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qbeta.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qbeta.Tpo -c -o libjrmath_la-qbeta.lo `test -f 'qbeta.c' || echo '$(srcdir)/'`qbeta.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qbeta.Tpo $(DEPDIR)/libjrmath_la-qbeta.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qbeta.c' object='libjrmath_la-qbeta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qbeta.lo `test -f 'qbeta.c' || echo '$(srcdir)/'`qbeta.c libjrmath_la-rbinom.lo: rbinom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rbinom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rbinom.Tpo -c -o libjrmath_la-rbinom.lo `test -f 'rbinom.c' || echo '$(srcdir)/'`rbinom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rbinom.Tpo $(DEPDIR)/libjrmath_la-rbinom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rbinom.c' object='libjrmath_la-rbinom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rbinom.lo `test -f 'rbinom.c' || echo '$(srcdir)/'`rbinom.c libjrmath_la-dbinom.lo: dbinom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dbinom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dbinom.Tpo -c -o libjrmath_la-dbinom.lo `test -f 'dbinom.c' || echo '$(srcdir)/'`dbinom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dbinom.Tpo $(DEPDIR)/libjrmath_la-dbinom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dbinom.c' object='libjrmath_la-dbinom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dbinom.lo `test -f 'dbinom.c' || echo '$(srcdir)/'`dbinom.c libjrmath_la-pbinom.lo: pbinom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pbinom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pbinom.Tpo -c -o libjrmath_la-pbinom.lo `test -f 'pbinom.c' || echo '$(srcdir)/'`pbinom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pbinom.Tpo $(DEPDIR)/libjrmath_la-pbinom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pbinom.c' object='libjrmath_la-pbinom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pbinom.lo `test -f 'pbinom.c' || echo '$(srcdir)/'`pbinom.c libjrmath_la-qbinom.lo: qbinom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qbinom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qbinom.Tpo -c -o libjrmath_la-qbinom.lo `test -f 'qbinom.c' || echo '$(srcdir)/'`qbinom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qbinom.Tpo $(DEPDIR)/libjrmath_la-qbinom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qbinom.c' object='libjrmath_la-qbinom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qbinom.lo `test -f 'qbinom.c' || echo '$(srcdir)/'`qbinom.c libjrmath_la-rchisq.lo: rchisq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rchisq.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rchisq.Tpo -c -o libjrmath_la-rchisq.lo `test -f 'rchisq.c' || echo '$(srcdir)/'`rchisq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rchisq.Tpo $(DEPDIR)/libjrmath_la-rchisq.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rchisq.c' object='libjrmath_la-rchisq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rchisq.lo `test -f 'rchisq.c' || echo '$(srcdir)/'`rchisq.c libjrmath_la-dchisq.lo: dchisq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dchisq.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dchisq.Tpo -c -o libjrmath_la-dchisq.lo `test -f 'dchisq.c' || echo '$(srcdir)/'`dchisq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dchisq.Tpo $(DEPDIR)/libjrmath_la-dchisq.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dchisq.c' object='libjrmath_la-dchisq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dchisq.lo `test -f 'dchisq.c' || echo '$(srcdir)/'`dchisq.c libjrmath_la-pchisq.lo: pchisq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pchisq.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pchisq.Tpo -c -o libjrmath_la-pchisq.lo `test -f 'pchisq.c' || echo '$(srcdir)/'`pchisq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pchisq.Tpo $(DEPDIR)/libjrmath_la-pchisq.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pchisq.c' object='libjrmath_la-pchisq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pchisq.lo `test -f 'pchisq.c' || echo '$(srcdir)/'`pchisq.c libjrmath_la-qchisq.lo: qchisq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qchisq.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qchisq.Tpo -c -o libjrmath_la-qchisq.lo `test -f 'qchisq.c' || echo '$(srcdir)/'`qchisq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qchisq.Tpo $(DEPDIR)/libjrmath_la-qchisq.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qchisq.c' object='libjrmath_la-qchisq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qchisq.lo `test -f 'qchisq.c' || echo '$(srcdir)/'`qchisq.c libjrmath_la-rexp.lo: rexp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rexp.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rexp.Tpo -c -o libjrmath_la-rexp.lo `test -f 'rexp.c' || echo '$(srcdir)/'`rexp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rexp.Tpo $(DEPDIR)/libjrmath_la-rexp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rexp.c' object='libjrmath_la-rexp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rexp.lo `test -f 'rexp.c' || echo '$(srcdir)/'`rexp.c libjrmath_la-dexp.lo: dexp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dexp.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dexp.Tpo -c -o libjrmath_la-dexp.lo `test -f 'dexp.c' || echo '$(srcdir)/'`dexp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dexp.Tpo $(DEPDIR)/libjrmath_la-dexp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dexp.c' object='libjrmath_la-dexp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dexp.lo `test -f 'dexp.c' || echo '$(srcdir)/'`dexp.c libjrmath_la-pexp.lo: pexp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pexp.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pexp.Tpo -c -o libjrmath_la-pexp.lo `test -f 'pexp.c' || echo '$(srcdir)/'`pexp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pexp.Tpo $(DEPDIR)/libjrmath_la-pexp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pexp.c' object='libjrmath_la-pexp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pexp.lo `test -f 'pexp.c' || echo '$(srcdir)/'`pexp.c libjrmath_la-qexp.lo: qexp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qexp.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qexp.Tpo -c -o libjrmath_la-qexp.lo `test -f 'qexp.c' || echo '$(srcdir)/'`qexp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qexp.Tpo $(DEPDIR)/libjrmath_la-qexp.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qexp.c' object='libjrmath_la-qexp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qexp.lo `test -f 'qexp.c' || echo '$(srcdir)/'`qexp.c libjrmath_la-rgamma.lo: rgamma.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rgamma.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rgamma.Tpo -c -o libjrmath_la-rgamma.lo `test -f 'rgamma.c' || echo '$(srcdir)/'`rgamma.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rgamma.Tpo $(DEPDIR)/libjrmath_la-rgamma.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rgamma.c' object='libjrmath_la-rgamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rgamma.lo `test -f 'rgamma.c' || echo '$(srcdir)/'`rgamma.c libjrmath_la-dgamma.lo: dgamma.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dgamma.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dgamma.Tpo -c -o libjrmath_la-dgamma.lo `test -f 'dgamma.c' || echo '$(srcdir)/'`dgamma.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dgamma.Tpo $(DEPDIR)/libjrmath_la-dgamma.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dgamma.c' object='libjrmath_la-dgamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dgamma.lo `test -f 'dgamma.c' || echo '$(srcdir)/'`dgamma.c libjrmath_la-pgamma.lo: pgamma.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pgamma.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pgamma.Tpo -c -o libjrmath_la-pgamma.lo `test -f 'pgamma.c' || echo '$(srcdir)/'`pgamma.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pgamma.Tpo $(DEPDIR)/libjrmath_la-pgamma.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pgamma.c' object='libjrmath_la-pgamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pgamma.lo `test -f 'pgamma.c' || echo '$(srcdir)/'`pgamma.c libjrmath_la-qgamma.lo: qgamma.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qgamma.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qgamma.Tpo -c -o libjrmath_la-qgamma.lo `test -f 'qgamma.c' || echo '$(srcdir)/'`qgamma.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qgamma.Tpo $(DEPDIR)/libjrmath_la-qgamma.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qgamma.c' object='libjrmath_la-qgamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qgamma.lo `test -f 'qgamma.c' || echo '$(srcdir)/'`qgamma.c libjrmath_la-rhyper.lo: rhyper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rhyper.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rhyper.Tpo -c -o libjrmath_la-rhyper.lo `test -f 'rhyper.c' || echo '$(srcdir)/'`rhyper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rhyper.Tpo $(DEPDIR)/libjrmath_la-rhyper.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rhyper.c' object='libjrmath_la-rhyper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rhyper.lo `test -f 'rhyper.c' || echo '$(srcdir)/'`rhyper.c libjrmath_la-dhyper.lo: dhyper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dhyper.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dhyper.Tpo -c -o libjrmath_la-dhyper.lo `test -f 'dhyper.c' || echo '$(srcdir)/'`dhyper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dhyper.Tpo $(DEPDIR)/libjrmath_la-dhyper.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dhyper.c' object='libjrmath_la-dhyper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dhyper.lo `test -f 'dhyper.c' || echo '$(srcdir)/'`dhyper.c libjrmath_la-phyper.lo: phyper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-phyper.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-phyper.Tpo -c -o libjrmath_la-phyper.lo `test -f 'phyper.c' || echo '$(srcdir)/'`phyper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-phyper.Tpo $(DEPDIR)/libjrmath_la-phyper.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='phyper.c' object='libjrmath_la-phyper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-phyper.lo `test -f 'phyper.c' || echo '$(srcdir)/'`phyper.c libjrmath_la-qhyper.lo: qhyper.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qhyper.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qhyper.Tpo -c -o libjrmath_la-qhyper.lo `test -f 'qhyper.c' || echo '$(srcdir)/'`qhyper.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qhyper.Tpo $(DEPDIR)/libjrmath_la-qhyper.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qhyper.c' object='libjrmath_la-qhyper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qhyper.lo `test -f 'qhyper.c' || echo '$(srcdir)/'`qhyper.c libjrmath_la-rlnorm.lo: rlnorm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rlnorm.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rlnorm.Tpo -c -o libjrmath_la-rlnorm.lo `test -f 'rlnorm.c' || echo '$(srcdir)/'`rlnorm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rlnorm.Tpo $(DEPDIR)/libjrmath_la-rlnorm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rlnorm.c' object='libjrmath_la-rlnorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rlnorm.lo `test -f 'rlnorm.c' || echo '$(srcdir)/'`rlnorm.c libjrmath_la-dlnorm.lo: dlnorm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dlnorm.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dlnorm.Tpo -c -o libjrmath_la-dlnorm.lo `test -f 'dlnorm.c' || echo '$(srcdir)/'`dlnorm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dlnorm.Tpo $(DEPDIR)/libjrmath_la-dlnorm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dlnorm.c' object='libjrmath_la-dlnorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dlnorm.lo `test -f 'dlnorm.c' || echo '$(srcdir)/'`dlnorm.c libjrmath_la-plnorm.lo: plnorm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-plnorm.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-plnorm.Tpo -c -o libjrmath_la-plnorm.lo `test -f 'plnorm.c' || echo '$(srcdir)/'`plnorm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-plnorm.Tpo $(DEPDIR)/libjrmath_la-plnorm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plnorm.c' object='libjrmath_la-plnorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-plnorm.lo `test -f 'plnorm.c' || echo '$(srcdir)/'`plnorm.c libjrmath_la-qlnorm.lo: qlnorm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qlnorm.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qlnorm.Tpo -c -o libjrmath_la-qlnorm.lo `test -f 'qlnorm.c' || echo '$(srcdir)/'`qlnorm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qlnorm.Tpo $(DEPDIR)/libjrmath_la-qlnorm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qlnorm.c' object='libjrmath_la-qlnorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qlnorm.lo `test -f 'qlnorm.c' || echo '$(srcdir)/'`qlnorm.c libjrmath_la-rlogis.lo: rlogis.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rlogis.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rlogis.Tpo -c -o libjrmath_la-rlogis.lo `test -f 'rlogis.c' || echo '$(srcdir)/'`rlogis.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rlogis.Tpo $(DEPDIR)/libjrmath_la-rlogis.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rlogis.c' object='libjrmath_la-rlogis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rlogis.lo `test -f 'rlogis.c' || echo '$(srcdir)/'`rlogis.c libjrmath_la-dlogis.lo: dlogis.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dlogis.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dlogis.Tpo -c -o libjrmath_la-dlogis.lo `test -f 'dlogis.c' || echo '$(srcdir)/'`dlogis.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dlogis.Tpo $(DEPDIR)/libjrmath_la-dlogis.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dlogis.c' object='libjrmath_la-dlogis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dlogis.lo `test -f 'dlogis.c' || echo '$(srcdir)/'`dlogis.c libjrmath_la-plogis.lo: plogis.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-plogis.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-plogis.Tpo -c -o libjrmath_la-plogis.lo `test -f 'plogis.c' || echo '$(srcdir)/'`plogis.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-plogis.Tpo $(DEPDIR)/libjrmath_la-plogis.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plogis.c' object='libjrmath_la-plogis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-plogis.lo `test -f 'plogis.c' || echo '$(srcdir)/'`plogis.c libjrmath_la-qlogis.lo: qlogis.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qlogis.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qlogis.Tpo -c -o libjrmath_la-qlogis.lo `test -f 'qlogis.c' || echo '$(srcdir)/'`qlogis.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qlogis.Tpo $(DEPDIR)/libjrmath_la-qlogis.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qlogis.c' object='libjrmath_la-qlogis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qlogis.lo `test -f 'qlogis.c' || echo '$(srcdir)/'`qlogis.c libjrmath_la-rnbinom.lo: rnbinom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rnbinom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rnbinom.Tpo -c -o libjrmath_la-rnbinom.lo `test -f 'rnbinom.c' || echo '$(srcdir)/'`rnbinom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rnbinom.Tpo $(DEPDIR)/libjrmath_la-rnbinom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rnbinom.c' object='libjrmath_la-rnbinom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rnbinom.lo `test -f 'rnbinom.c' || echo '$(srcdir)/'`rnbinom.c libjrmath_la-dnbinom.lo: dnbinom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dnbinom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dnbinom.Tpo -c -o libjrmath_la-dnbinom.lo `test -f 'dnbinom.c' || echo '$(srcdir)/'`dnbinom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dnbinom.Tpo $(DEPDIR)/libjrmath_la-dnbinom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dnbinom.c' object='libjrmath_la-dnbinom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dnbinom.lo `test -f 'dnbinom.c' || echo '$(srcdir)/'`dnbinom.c libjrmath_la-pnbinom.lo: pnbinom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pnbinom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pnbinom.Tpo -c -o libjrmath_la-pnbinom.lo `test -f 'pnbinom.c' || echo '$(srcdir)/'`pnbinom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pnbinom.Tpo $(DEPDIR)/libjrmath_la-pnbinom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pnbinom.c' object='libjrmath_la-pnbinom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pnbinom.lo `test -f 'pnbinom.c' || echo '$(srcdir)/'`pnbinom.c libjrmath_la-qnbinom.lo: qnbinom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qnbinom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qnbinom.Tpo -c -o libjrmath_la-qnbinom.lo `test -f 'qnbinom.c' || echo '$(srcdir)/'`qnbinom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qnbinom.Tpo $(DEPDIR)/libjrmath_la-qnbinom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qnbinom.c' object='libjrmath_la-qnbinom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qnbinom.lo `test -f 'qnbinom.c' || echo '$(srcdir)/'`qnbinom.c libjrmath_la-rnorm.lo: rnorm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rnorm.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rnorm.Tpo -c -o libjrmath_la-rnorm.lo `test -f 'rnorm.c' || echo '$(srcdir)/'`rnorm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rnorm.Tpo $(DEPDIR)/libjrmath_la-rnorm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rnorm.c' object='libjrmath_la-rnorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rnorm.lo `test -f 'rnorm.c' || echo '$(srcdir)/'`rnorm.c libjrmath_la-dnorm.lo: dnorm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dnorm.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dnorm.Tpo -c -o libjrmath_la-dnorm.lo `test -f 'dnorm.c' || echo '$(srcdir)/'`dnorm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dnorm.Tpo $(DEPDIR)/libjrmath_la-dnorm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dnorm.c' object='libjrmath_la-dnorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dnorm.lo `test -f 'dnorm.c' || echo '$(srcdir)/'`dnorm.c libjrmath_la-pnorm.lo: pnorm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pnorm.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pnorm.Tpo -c -o libjrmath_la-pnorm.lo `test -f 'pnorm.c' || echo '$(srcdir)/'`pnorm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pnorm.Tpo $(DEPDIR)/libjrmath_la-pnorm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pnorm.c' object='libjrmath_la-pnorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pnorm.lo `test -f 'pnorm.c' || echo '$(srcdir)/'`pnorm.c libjrmath_la-qnorm.lo: qnorm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qnorm.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qnorm.Tpo -c -o libjrmath_la-qnorm.lo `test -f 'qnorm.c' || echo '$(srcdir)/'`qnorm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qnorm.Tpo $(DEPDIR)/libjrmath_la-qnorm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qnorm.c' object='libjrmath_la-qnorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qnorm.lo `test -f 'qnorm.c' || echo '$(srcdir)/'`qnorm.c libjrmath_la-rpois.lo: rpois.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rpois.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rpois.Tpo -c -o libjrmath_la-rpois.lo `test -f 'rpois.c' || echo '$(srcdir)/'`rpois.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rpois.Tpo $(DEPDIR)/libjrmath_la-rpois.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rpois.c' object='libjrmath_la-rpois.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rpois.lo `test -f 'rpois.c' || echo '$(srcdir)/'`rpois.c libjrmath_la-dpois.lo: dpois.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dpois.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dpois.Tpo -c -o libjrmath_la-dpois.lo `test -f 'dpois.c' || echo '$(srcdir)/'`dpois.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dpois.Tpo $(DEPDIR)/libjrmath_la-dpois.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dpois.c' object='libjrmath_la-dpois.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dpois.lo `test -f 'dpois.c' || echo '$(srcdir)/'`dpois.c libjrmath_la-ppois.lo: ppois.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-ppois.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-ppois.Tpo -c -o libjrmath_la-ppois.lo `test -f 'ppois.c' || echo '$(srcdir)/'`ppois.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-ppois.Tpo $(DEPDIR)/libjrmath_la-ppois.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ppois.c' object='libjrmath_la-ppois.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-ppois.lo `test -f 'ppois.c' || echo '$(srcdir)/'`ppois.c libjrmath_la-qpois.lo: qpois.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qpois.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qpois.Tpo -c -o libjrmath_la-qpois.lo `test -f 'qpois.c' || echo '$(srcdir)/'`qpois.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qpois.Tpo $(DEPDIR)/libjrmath_la-qpois.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qpois.c' object='libjrmath_la-qpois.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qpois.lo `test -f 'qpois.c' || echo '$(srcdir)/'`qpois.c libjrmath_la-rt.lo: rt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rt.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rt.Tpo -c -o libjrmath_la-rt.lo `test -f 'rt.c' || echo '$(srcdir)/'`rt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rt.Tpo $(DEPDIR)/libjrmath_la-rt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rt.c' object='libjrmath_la-rt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rt.lo `test -f 'rt.c' || echo '$(srcdir)/'`rt.c libjrmath_la-dt.lo: dt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dt.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dt.Tpo -c -o libjrmath_la-dt.lo `test -f 'dt.c' || echo '$(srcdir)/'`dt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dt.Tpo $(DEPDIR)/libjrmath_la-dt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dt.c' object='libjrmath_la-dt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dt.lo `test -f 'dt.c' || echo '$(srcdir)/'`dt.c libjrmath_la-pt.lo: pt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pt.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pt.Tpo -c -o libjrmath_la-pt.lo `test -f 'pt.c' || echo '$(srcdir)/'`pt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pt.Tpo $(DEPDIR)/libjrmath_la-pt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pt.c' object='libjrmath_la-pt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pt.lo `test -f 'pt.c' || echo '$(srcdir)/'`pt.c libjrmath_la-qt.lo: qt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qt.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qt.Tpo -c -o libjrmath_la-qt.lo `test -f 'qt.c' || echo '$(srcdir)/'`qt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qt.Tpo $(DEPDIR)/libjrmath_la-qt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qt.c' object='libjrmath_la-qt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qt.lo `test -f 'qt.c' || echo '$(srcdir)/'`qt.c libjrmath_la-runif.lo: runif.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-runif.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-runif.Tpo -c -o libjrmath_la-runif.lo `test -f 'runif.c' || echo '$(srcdir)/'`runif.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-runif.Tpo $(DEPDIR)/libjrmath_la-runif.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='runif.c' object='libjrmath_la-runif.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-runif.lo `test -f 'runif.c' || echo '$(srcdir)/'`runif.c libjrmath_la-dunif.lo: dunif.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dunif.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dunif.Tpo -c -o libjrmath_la-dunif.lo `test -f 'dunif.c' || echo '$(srcdir)/'`dunif.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dunif.Tpo $(DEPDIR)/libjrmath_la-dunif.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dunif.c' object='libjrmath_la-dunif.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dunif.lo `test -f 'dunif.c' || echo '$(srcdir)/'`dunif.c libjrmath_la-punif.lo: punif.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-punif.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-punif.Tpo -c -o libjrmath_la-punif.lo `test -f 'punif.c' || echo '$(srcdir)/'`punif.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-punif.Tpo $(DEPDIR)/libjrmath_la-punif.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='punif.c' object='libjrmath_la-punif.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-punif.lo `test -f 'punif.c' || echo '$(srcdir)/'`punif.c libjrmath_la-qunif.lo: qunif.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qunif.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qunif.Tpo -c -o libjrmath_la-qunif.lo `test -f 'qunif.c' || echo '$(srcdir)/'`qunif.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qunif.Tpo $(DEPDIR)/libjrmath_la-qunif.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qunif.c' object='libjrmath_la-qunif.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qunif.lo `test -f 'qunif.c' || echo '$(srcdir)/'`qunif.c libjrmath_la-rweibull.lo: rweibull.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rweibull.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rweibull.Tpo -c -o libjrmath_la-rweibull.lo `test -f 'rweibull.c' || echo '$(srcdir)/'`rweibull.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rweibull.Tpo $(DEPDIR)/libjrmath_la-rweibull.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rweibull.c' object='libjrmath_la-rweibull.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rweibull.lo `test -f 'rweibull.c' || echo '$(srcdir)/'`rweibull.c libjrmath_la-dweibull.lo: dweibull.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dweibull.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dweibull.Tpo -c -o libjrmath_la-dweibull.lo `test -f 'dweibull.c' || echo '$(srcdir)/'`dweibull.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dweibull.Tpo $(DEPDIR)/libjrmath_la-dweibull.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dweibull.c' object='libjrmath_la-dweibull.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dweibull.lo `test -f 'dweibull.c' || echo '$(srcdir)/'`dweibull.c libjrmath_la-pweibull.lo: pweibull.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pweibull.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pweibull.Tpo -c -o libjrmath_la-pweibull.lo `test -f 'pweibull.c' || echo '$(srcdir)/'`pweibull.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pweibull.Tpo $(DEPDIR)/libjrmath_la-pweibull.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pweibull.c' object='libjrmath_la-pweibull.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pweibull.lo `test -f 'pweibull.c' || echo '$(srcdir)/'`pweibull.c libjrmath_la-qweibull.lo: qweibull.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qweibull.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qweibull.Tpo -c -o libjrmath_la-qweibull.lo `test -f 'qweibull.c' || echo '$(srcdir)/'`qweibull.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qweibull.Tpo $(DEPDIR)/libjrmath_la-qweibull.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qweibull.c' object='libjrmath_la-qweibull.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qweibull.lo `test -f 'qweibull.c' || echo '$(srcdir)/'`qweibull.c libjrmath_la-rnchisq.lo: rnchisq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rnchisq.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rnchisq.Tpo -c -o libjrmath_la-rnchisq.lo `test -f 'rnchisq.c' || echo '$(srcdir)/'`rnchisq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rnchisq.Tpo $(DEPDIR)/libjrmath_la-rnchisq.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rnchisq.c' object='libjrmath_la-rnchisq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rnchisq.lo `test -f 'rnchisq.c' || echo '$(srcdir)/'`rnchisq.c libjrmath_la-dnchisq.lo: dnchisq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dnchisq.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dnchisq.Tpo -c -o libjrmath_la-dnchisq.lo `test -f 'dnchisq.c' || echo '$(srcdir)/'`dnchisq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dnchisq.Tpo $(DEPDIR)/libjrmath_la-dnchisq.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dnchisq.c' object='libjrmath_la-dnchisq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dnchisq.lo `test -f 'dnchisq.c' || echo '$(srcdir)/'`dnchisq.c libjrmath_la-pnchisq.lo: pnchisq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pnchisq.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pnchisq.Tpo -c -o libjrmath_la-pnchisq.lo `test -f 'pnchisq.c' || echo '$(srcdir)/'`pnchisq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pnchisq.Tpo $(DEPDIR)/libjrmath_la-pnchisq.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pnchisq.c' object='libjrmath_la-pnchisq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pnchisq.lo `test -f 'pnchisq.c' || echo '$(srcdir)/'`pnchisq.c libjrmath_la-qnchisq.lo: qnchisq.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qnchisq.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qnchisq.Tpo -c -o libjrmath_la-qnchisq.lo `test -f 'qnchisq.c' || echo '$(srcdir)/'`qnchisq.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qnchisq.Tpo $(DEPDIR)/libjrmath_la-qnchisq.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qnchisq.c' object='libjrmath_la-qnchisq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qnchisq.lo `test -f 'qnchisq.c' || echo '$(srcdir)/'`qnchisq.c libjrmath_la-rcauchy.lo: rcauchy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rcauchy.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rcauchy.Tpo -c -o libjrmath_la-rcauchy.lo `test -f 'rcauchy.c' || echo '$(srcdir)/'`rcauchy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rcauchy.Tpo $(DEPDIR)/libjrmath_la-rcauchy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rcauchy.c' object='libjrmath_la-rcauchy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rcauchy.lo `test -f 'rcauchy.c' || echo '$(srcdir)/'`rcauchy.c libjrmath_la-dcauchy.lo: dcauchy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dcauchy.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dcauchy.Tpo -c -o libjrmath_la-dcauchy.lo `test -f 'dcauchy.c' || echo '$(srcdir)/'`dcauchy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dcauchy.Tpo $(DEPDIR)/libjrmath_la-dcauchy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dcauchy.c' object='libjrmath_la-dcauchy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dcauchy.lo `test -f 'dcauchy.c' || echo '$(srcdir)/'`dcauchy.c libjrmath_la-pcauchy.lo: pcauchy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pcauchy.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pcauchy.Tpo -c -o libjrmath_la-pcauchy.lo `test -f 'pcauchy.c' || echo '$(srcdir)/'`pcauchy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pcauchy.Tpo $(DEPDIR)/libjrmath_la-pcauchy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pcauchy.c' object='libjrmath_la-pcauchy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pcauchy.lo `test -f 'pcauchy.c' || echo '$(srcdir)/'`pcauchy.c libjrmath_la-qcauchy.lo: qcauchy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qcauchy.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qcauchy.Tpo -c -o libjrmath_la-qcauchy.lo `test -f 'qcauchy.c' || echo '$(srcdir)/'`qcauchy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qcauchy.Tpo $(DEPDIR)/libjrmath_la-qcauchy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qcauchy.c' object='libjrmath_la-qcauchy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qcauchy.lo `test -f 'qcauchy.c' || echo '$(srcdir)/'`qcauchy.c libjrmath_la-rf.lo: rf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rf.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rf.Tpo -c -o libjrmath_la-rf.lo `test -f 'rf.c' || echo '$(srcdir)/'`rf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rf.Tpo $(DEPDIR)/libjrmath_la-rf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rf.c' object='libjrmath_la-rf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rf.lo `test -f 'rf.c' || echo '$(srcdir)/'`rf.c libjrmath_la-df.lo: df.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-df.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-df.Tpo -c -o libjrmath_la-df.lo `test -f 'df.c' || echo '$(srcdir)/'`df.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-df.Tpo $(DEPDIR)/libjrmath_la-df.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='df.c' object='libjrmath_la-df.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-df.lo `test -f 'df.c' || echo '$(srcdir)/'`df.c libjrmath_la-pf.lo: pf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pf.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pf.Tpo -c -o libjrmath_la-pf.lo `test -f 'pf.c' || echo '$(srcdir)/'`pf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pf.Tpo $(DEPDIR)/libjrmath_la-pf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pf.c' object='libjrmath_la-pf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pf.lo `test -f 'pf.c' || echo '$(srcdir)/'`pf.c libjrmath_la-qf.lo: qf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qf.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qf.Tpo -c -o libjrmath_la-qf.lo `test -f 'qf.c' || echo '$(srcdir)/'`qf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qf.Tpo $(DEPDIR)/libjrmath_la-qf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qf.c' object='libjrmath_la-qf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qf.lo `test -f 'qf.c' || echo '$(srcdir)/'`qf.c libjrmath_la-cospi.lo: cospi.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-cospi.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-cospi.Tpo -c -o libjrmath_la-cospi.lo `test -f 'cospi.c' || echo '$(srcdir)/'`cospi.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-cospi.Tpo $(DEPDIR)/libjrmath_la-cospi.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cospi.c' object='libjrmath_la-cospi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-cospi.lo `test -f 'cospi.c' || echo '$(srcdir)/'`cospi.c libjrmath_la-gamma_cody.lo: gamma_cody.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-gamma_cody.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-gamma_cody.Tpo -c -o libjrmath_la-gamma_cody.lo `test -f 'gamma_cody.c' || echo '$(srcdir)/'`gamma_cody.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-gamma_cody.Tpo $(DEPDIR)/libjrmath_la-gamma_cody.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gamma_cody.c' object='libjrmath_la-gamma_cody.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-gamma_cody.lo `test -f 'gamma_cody.c' || echo '$(srcdir)/'`gamma_cody.c libjrmath_la-bessel_i.lo: bessel_i.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-bessel_i.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-bessel_i.Tpo -c -o libjrmath_la-bessel_i.lo `test -f 'bessel_i.c' || echo '$(srcdir)/'`bessel_i.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-bessel_i.Tpo $(DEPDIR)/libjrmath_la-bessel_i.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bessel_i.c' object='libjrmath_la-bessel_i.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-bessel_i.lo `test -f 'bessel_i.c' || echo '$(srcdir)/'`bessel_i.c libjrmath_la-bessel_j.lo: bessel_j.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-bessel_j.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-bessel_j.Tpo -c -o libjrmath_la-bessel_j.lo `test -f 'bessel_j.c' || echo '$(srcdir)/'`bessel_j.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-bessel_j.Tpo $(DEPDIR)/libjrmath_la-bessel_j.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bessel_j.c' object='libjrmath_la-bessel_j.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-bessel_j.lo `test -f 'bessel_j.c' || echo '$(srcdir)/'`bessel_j.c libjrmath_la-bessel_k.lo: bessel_k.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-bessel_k.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-bessel_k.Tpo -c -o libjrmath_la-bessel_k.lo `test -f 'bessel_k.c' || echo '$(srcdir)/'`bessel_k.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-bessel_k.Tpo $(DEPDIR)/libjrmath_la-bessel_k.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bessel_k.c' object='libjrmath_la-bessel_k.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-bessel_k.lo `test -f 'bessel_k.c' || echo '$(srcdir)/'`bessel_k.c libjrmath_la-bessel_y.lo: bessel_y.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-bessel_y.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-bessel_y.Tpo -c -o libjrmath_la-bessel_y.lo `test -f 'bessel_y.c' || echo '$(srcdir)/'`bessel_y.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-bessel_y.Tpo $(DEPDIR)/libjrmath_la-bessel_y.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bessel_y.c' object='libjrmath_la-bessel_y.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-bessel_y.lo `test -f 'bessel_y.c' || echo '$(srcdir)/'`bessel_y.c libjrmath_la-dgeom.lo: dgeom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dgeom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dgeom.Tpo -c -o libjrmath_la-dgeom.lo `test -f 'dgeom.c' || echo '$(srcdir)/'`dgeom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dgeom.Tpo $(DEPDIR)/libjrmath_la-dgeom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dgeom.c' object='libjrmath_la-dgeom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dgeom.lo `test -f 'dgeom.c' || echo '$(srcdir)/'`dgeom.c libjrmath_la-pgeom.lo: pgeom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pgeom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pgeom.Tpo -c -o libjrmath_la-pgeom.lo `test -f 'pgeom.c' || echo '$(srcdir)/'`pgeom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pgeom.Tpo $(DEPDIR)/libjrmath_la-pgeom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pgeom.c' object='libjrmath_la-pgeom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pgeom.lo `test -f 'pgeom.c' || echo '$(srcdir)/'`pgeom.c libjrmath_la-qgeom.lo: qgeom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qgeom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qgeom.Tpo -c -o libjrmath_la-qgeom.lo `test -f 'qgeom.c' || echo '$(srcdir)/'`qgeom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qgeom.Tpo $(DEPDIR)/libjrmath_la-qgeom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qgeom.c' object='libjrmath_la-qgeom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qgeom.lo `test -f 'qgeom.c' || echo '$(srcdir)/'`qgeom.c libjrmath_la-rgeom.lo: rgeom.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rgeom.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rgeom.Tpo -c -o libjrmath_la-rgeom.lo `test -f 'rgeom.c' || echo '$(srcdir)/'`rgeom.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rgeom.Tpo $(DEPDIR)/libjrmath_la-rgeom.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rgeom.c' object='libjrmath_la-rgeom.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rgeom.lo `test -f 'rgeom.c' || echo '$(srcdir)/'`rgeom.c libjrmath_la-dnbeta.lo: dnbeta.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dnbeta.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dnbeta.Tpo -c -o libjrmath_la-dnbeta.lo `test -f 'dnbeta.c' || echo '$(srcdir)/'`dnbeta.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dnbeta.Tpo $(DEPDIR)/libjrmath_la-dnbeta.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dnbeta.c' object='libjrmath_la-dnbeta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dnbeta.lo `test -f 'dnbeta.c' || echo '$(srcdir)/'`dnbeta.c libjrmath_la-pnbeta.lo: pnbeta.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pnbeta.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pnbeta.Tpo -c -o libjrmath_la-pnbeta.lo `test -f 'pnbeta.c' || echo '$(srcdir)/'`pnbeta.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pnbeta.Tpo $(DEPDIR)/libjrmath_la-pnbeta.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pnbeta.c' object='libjrmath_la-pnbeta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pnbeta.lo `test -f 'pnbeta.c' || echo '$(srcdir)/'`pnbeta.c libjrmath_la-qnbeta.lo: qnbeta.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qnbeta.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qnbeta.Tpo -c -o libjrmath_la-qnbeta.lo `test -f 'qnbeta.c' || echo '$(srcdir)/'`qnbeta.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qnbeta.Tpo $(DEPDIR)/libjrmath_la-qnbeta.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qnbeta.c' object='libjrmath_la-qnbeta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qnbeta.lo `test -f 'qnbeta.c' || echo '$(srcdir)/'`qnbeta.c libjrmath_la-dnf.lo: dnf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dnf.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dnf.Tpo -c -o libjrmath_la-dnf.lo `test -f 'dnf.c' || echo '$(srcdir)/'`dnf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dnf.Tpo $(DEPDIR)/libjrmath_la-dnf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dnf.c' object='libjrmath_la-dnf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dnf.lo `test -f 'dnf.c' || echo '$(srcdir)/'`dnf.c libjrmath_la-pnf.lo: pnf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pnf.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pnf.Tpo -c -o libjrmath_la-pnf.lo `test -f 'pnf.c' || echo '$(srcdir)/'`pnf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pnf.Tpo $(DEPDIR)/libjrmath_la-pnf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pnf.c' object='libjrmath_la-pnf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pnf.lo `test -f 'pnf.c' || echo '$(srcdir)/'`pnf.c libjrmath_la-qnf.lo: qnf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qnf.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qnf.Tpo -c -o libjrmath_la-qnf.lo `test -f 'qnf.c' || echo '$(srcdir)/'`qnf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qnf.Tpo $(DEPDIR)/libjrmath_la-qnf.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qnf.c' object='libjrmath_la-qnf.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qnf.lo `test -f 'qnf.c' || echo '$(srcdir)/'`qnf.c libjrmath_la-dnt.lo: dnt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dnt.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dnt.Tpo -c -o libjrmath_la-dnt.lo `test -f 'dnt.c' || echo '$(srcdir)/'`dnt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dnt.Tpo $(DEPDIR)/libjrmath_la-dnt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dnt.c' object='libjrmath_la-dnt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dnt.lo `test -f 'dnt.c' || echo '$(srcdir)/'`dnt.c libjrmath_la-pnt.lo: pnt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pnt.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pnt.Tpo -c -o libjrmath_la-pnt.lo `test -f 'pnt.c' || echo '$(srcdir)/'`pnt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pnt.Tpo $(DEPDIR)/libjrmath_la-pnt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pnt.c' object='libjrmath_la-pnt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pnt.lo `test -f 'pnt.c' || echo '$(srcdir)/'`pnt.c libjrmath_la-qnt.lo: qnt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qnt.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qnt.Tpo -c -o libjrmath_la-qnt.lo `test -f 'qnt.c' || echo '$(srcdir)/'`qnt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qnt.Tpo $(DEPDIR)/libjrmath_la-qnt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qnt.c' object='libjrmath_la-qnt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qnt.lo `test -f 'qnt.c' || echo '$(srcdir)/'`qnt.c libjrmath_la-sign.lo: sign.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-sign.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-sign.Tpo -c -o libjrmath_la-sign.lo `test -f 'sign.c' || echo '$(srcdir)/'`sign.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-sign.Tpo $(DEPDIR)/libjrmath_la-sign.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sign.c' object='libjrmath_la-sign.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-sign.lo `test -f 'sign.c' || echo '$(srcdir)/'`sign.c libjrmath_la-rweibull2.lo: rweibull2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-rweibull2.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-rweibull2.Tpo -c -o libjrmath_la-rweibull2.lo `test -f 'rweibull2.c' || echo '$(srcdir)/'`rweibull2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-rweibull2.Tpo $(DEPDIR)/libjrmath_la-rweibull2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rweibull2.c' object='libjrmath_la-rweibull2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-rweibull2.lo `test -f 'rweibull2.c' || echo '$(srcdir)/'`rweibull2.c libjrmath_la-dweibull2.lo: dweibull2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-dweibull2.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-dweibull2.Tpo -c -o libjrmath_la-dweibull2.lo `test -f 'dweibull2.c' || echo '$(srcdir)/'`dweibull2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-dweibull2.Tpo $(DEPDIR)/libjrmath_la-dweibull2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dweibull2.c' object='libjrmath_la-dweibull2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-dweibull2.lo `test -f 'dweibull2.c' || echo '$(srcdir)/'`dweibull2.c libjrmath_la-pweibull2.lo: pweibull2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-pweibull2.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-pweibull2.Tpo -c -o libjrmath_la-pweibull2.lo `test -f 'pweibull2.c' || echo '$(srcdir)/'`pweibull2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-pweibull2.Tpo $(DEPDIR)/libjrmath_la-pweibull2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pweibull2.c' object='libjrmath_la-pweibull2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-pweibull2.lo `test -f 'pweibull2.c' || echo '$(srcdir)/'`pweibull2.c libjrmath_la-qweibull2.lo: qweibull2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -MT libjrmath_la-qweibull2.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-qweibull2.Tpo -c -o libjrmath_la-qweibull2.lo `test -f 'qweibull2.c' || echo '$(srcdir)/'`qweibull2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-qweibull2.Tpo $(DEPDIR)/libjrmath_la-qweibull2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qweibull2.c' object='libjrmath_la-qweibull2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(libjrmath_la_CFLAGS) $(CFLAGS) -c -o libjrmath_la-qweibull2.lo `test -f 'qweibull2.c' || echo '$(srcdir)/'`qweibull2.c .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libjrmath_la-callbacks.lo: callbacks.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libjrmath_la-callbacks.lo -MD -MP -MF $(DEPDIR)/libjrmath_la-callbacks.Tpo -c -o libjrmath_la-callbacks.lo `test -f 'callbacks.cc' || echo '$(srcdir)/'`callbacks.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libjrmath_la-callbacks.Tpo $(DEPDIR)/libjrmath_la-callbacks.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='callbacks.cc' object='libjrmath_la-callbacks.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjrmath_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libjrmath_la-callbacks.lo `test -f 'callbacks.cc' || echo '$(srcdir)/'`callbacks.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libjrmath_la-bd0.Plo -rm -f ./$(DEPDIR)/libjrmath_la-bessel_i.Plo -rm -f ./$(DEPDIR)/libjrmath_la-bessel_j.Plo -rm -f ./$(DEPDIR)/libjrmath_la-bessel_k.Plo -rm -f ./$(DEPDIR)/libjrmath_la-bessel_y.Plo -rm -f ./$(DEPDIR)/libjrmath_la-beta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-callbacks.Plo -rm -f ./$(DEPDIR)/libjrmath_la-chebyshev.Plo -rm -f ./$(DEPDIR)/libjrmath_la-choose.Plo -rm -f ./$(DEPDIR)/libjrmath_la-cospi.Plo -rm -f ./$(DEPDIR)/libjrmath_la-d1mach.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dcauchy.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dexp.Plo -rm -f ./$(DEPDIR)/libjrmath_la-df.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dgamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dgeom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dhyper.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dlnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dlogis.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dpois.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dunif.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dweibull.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dweibull2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-fmax2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-fmin2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-fprec.Plo -rm -f ./$(DEPDIR)/libjrmath_la-fround.Plo -rm -f ./$(DEPDIR)/libjrmath_la-fsign.Plo -rm -f ./$(DEPDIR)/libjrmath_la-ftrunc.Plo -rm -f ./$(DEPDIR)/libjrmath_la-gamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-gamma_cody.Plo -rm -f ./$(DEPDIR)/libjrmath_la-gammalims.Plo -rm -f ./$(DEPDIR)/libjrmath_la-i1mach.Plo -rm -f ./$(DEPDIR)/libjrmath_la-imax2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-imin2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-lbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-lgamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-lgammacor.Plo -rm -f ./$(DEPDIR)/libjrmath_la-mlutils.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pcauchy.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pexp.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pgamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pgeom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-phyper.Plo -rm -f ./$(DEPDIR)/libjrmath_la-plnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-plogis.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-polygamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-ppois.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-punif.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pweibull.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pweibull2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qcauchy.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qexp.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qgamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qgeom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qhyper.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qlnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qlogis.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qpois.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qunif.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qweibull.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qweibull2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rcauchy.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rexp.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rgamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rgeom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rhyper.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rlnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rlogis.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rnbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rnchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rpois.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-runif.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rweibull.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rweibull2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-sign.Plo -rm -f ./$(DEPDIR)/libjrmath_la-stirlerr.Plo -rm -f ./$(DEPDIR)/libjrmath_la-toms708.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libjrmath_la-bd0.Plo -rm -f ./$(DEPDIR)/libjrmath_la-bessel_i.Plo -rm -f ./$(DEPDIR)/libjrmath_la-bessel_j.Plo -rm -f ./$(DEPDIR)/libjrmath_la-bessel_k.Plo -rm -f ./$(DEPDIR)/libjrmath_la-bessel_y.Plo -rm -f ./$(DEPDIR)/libjrmath_la-beta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-callbacks.Plo -rm -f ./$(DEPDIR)/libjrmath_la-chebyshev.Plo -rm -f ./$(DEPDIR)/libjrmath_la-choose.Plo -rm -f ./$(DEPDIR)/libjrmath_la-cospi.Plo -rm -f ./$(DEPDIR)/libjrmath_la-d1mach.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dcauchy.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dexp.Plo -rm -f ./$(DEPDIR)/libjrmath_la-df.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dgamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dgeom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dhyper.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dlnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dlogis.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dnt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dpois.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dunif.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dweibull.Plo -rm -f ./$(DEPDIR)/libjrmath_la-dweibull2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-fmax2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-fmin2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-fprec.Plo -rm -f ./$(DEPDIR)/libjrmath_la-fround.Plo -rm -f ./$(DEPDIR)/libjrmath_la-fsign.Plo -rm -f ./$(DEPDIR)/libjrmath_la-ftrunc.Plo -rm -f ./$(DEPDIR)/libjrmath_la-gamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-gamma_cody.Plo -rm -f ./$(DEPDIR)/libjrmath_la-gammalims.Plo -rm -f ./$(DEPDIR)/libjrmath_la-i1mach.Plo -rm -f ./$(DEPDIR)/libjrmath_la-imax2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-imin2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-lbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-lgamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-lgammacor.Plo -rm -f ./$(DEPDIR)/libjrmath_la-mlutils.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pcauchy.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pexp.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pgamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pgeom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-phyper.Plo -rm -f ./$(DEPDIR)/libjrmath_la-plnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-plogis.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pnt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-polygamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-ppois.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-punif.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pweibull.Plo -rm -f ./$(DEPDIR)/libjrmath_la-pweibull2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qcauchy.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qexp.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qgamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qgeom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qhyper.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qlnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qlogis.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qnt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qpois.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qunif.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qweibull.Plo -rm -f ./$(DEPDIR)/libjrmath_la-qweibull2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rbeta.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rcauchy.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rexp.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rf.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rgamma.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rgeom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rhyper.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rlnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rlogis.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rnbinom.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rnchisq.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rnorm.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rpois.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rt.Plo -rm -f ./$(DEPDIR)/libjrmath_la-runif.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rweibull.Plo -rm -f ./$(DEPDIR)/libjrmath_la-rweibull2.Plo -rm -f ./$(DEPDIR)/libjrmath_la-sign.Plo -rm -f ./$(DEPDIR)/libjrmath_la-stirlerr.Plo -rm -f ./$(DEPDIR)/libjrmath_la-toms708.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-libLTLIBRARIES install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/jrmath/README0000664000175000017500000000341014224052371012121 00000000000000This is a partial copy of the Rmath library that is part of R. The API has been modified for the random number generators. These now take, as argument, a pointer to an opaque struct JRNG which encapsulates the state of the random number generator. The file callbacks.cc is a C++ source file that translates the functions unif_rand, norm_rand and exp_rand into member function calls for the struct JRNG. The current version is based on R 3.1.2 patched (revision r67885). The original intention was to make as few changes as possible in order to make it easier to synchronise the library with R. Nevertheless, a number of other changes have been made: The header file Rmath.h has been renamed JRmath.h. Parts of the header that are not included when R_MATH_STANDALONE is undefined have been removed. We assume that the C library provides both expm1 and log1p, and that log1p is working correctly, rather than testing during configuration and providing drop-in replacements as the R math library does. This is mainly done to simplify the configuration (e.g. no need to derive JRmath.h from JRmath.h.in). If a C library in 2015 does not conform to the C99 standard then there is not much hope for that platform. All functions are remapped with prefix "jags_". This is unlike the R math library which remaps to "Rf_" internally and does no remapping when built as a standalone library. Due to the remapping, there is a namespace clash with the function "df". This is therefore renamed to dF. Similarly pf, qf, rf, are renamed pF, qF, rF respectively. In the private header file "nmath.h" we defined F77_CALL, which is defined in the file R_exts/RS.h in the R sources. The source file toms708.c must be compiled with the flat -std=c99. This is added to the Makefile variable libjrmath_la_CFLAGS. JAGS-4.3.2/src/jrmath/callbacks.cc0000664000175000017500000000045214224052371013472 00000000000000#include #include "nmath.h" #include extern "C" { double unif_rand(JRNG *rng) { return rng->uniform(); } double exp_rand(JRNG *rng) { return rng->exponential(); } double norm_rand(JRNG *rng) { return rng->normal(); } } JAGS-4.3.2/src/jrmath/beta.c0000664000175000017500000000523114224052371012323 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double beta(double a, double b); * * DESCRIPTION * * This function returns the value of the beta function * evaluated with arguments a and b. * * NOTES * * This routine is a translation into C of a Fortran subroutine * by W. Fullerton of Los Alamos Scientific Laboratory. * Some modifications have been made so that the routines * conform to the IEEE 754 standard. */ #include "nmath.h" double beta(double a, double b) { #ifdef NOMORE_FOR_THREADS static double xmin, xmax = 0;/*-> typically = 171.61447887 for IEEE */ static double lnsml = 0;/*-> typically = -708.3964185 */ if (xmax == 0) { gammalims(&xmin, &xmax); lnsml = log(d1mach(1)); } #else /* For IEEE double precision DBL_EPSILON = 2^-52 = 2.220446049250313e-16 : * xmin, xmax : see ./gammalims.c * lnsml = log(DBL_MIN) = log(2 ^ -1022) = -1022 * log(2) */ # define xmin -170.5674972726612 # define xmax 171.61447887182298 # define lnsml -708.39641853226412 #endif #ifdef IEEE_754 /* NaNs propagated correctly */ if(ISNAN(a) || ISNAN(b)) return a + b; #endif if (a < 0 || b < 0) ML_ERR_return_NAN else if (a == 0 || b == 0) return ML_POSINF; else if (!R_FINITE(a) || !R_FINITE(b)) return 0; if (a + b < xmax) {/* ~= 171.61 for IEEE */ // return gammafn(a) * gammafn(b) / gammafn(a+b); /* All the terms are positive, and all can be large for large or small arguments. They are never much less than one. gammafn(x) can still overflow for x ~ 1e-308, but the result would too. */ return (1 / gammafn(a+b)) * gammafn(a) * gammafn(b); } else { double val = lbeta(a, b); if (val < lnsml) { /* a and/or b so big that beta underflows */ ML_ERROR(ME_UNDERFLOW, "beta"); /* return ML_UNDERFLOW; pointless giving incorrect value */ } return exp(val); } } JAGS-4.3.2/src/jrmath/gamma.c0000664000175000017500000001434714224052514012501 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2013 The R Core Team * Copyright (C) 2002-2004 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double gammafn(double x); * * DESCRIPTION * * This function computes the value of the gamma function. * * NOTES * * This function is a translation into C of a Fortran subroutine * by W. Fullerton of Los Alamos Scientific Laboratory. * (e.g. http://www.netlib.org/slatec/fnlib/gamma.f) * * The accuracy of this routine compares (very) favourably * with those of the Sun Microsystems portable mathematical * library. * * MM specialized the case of n! for n < 50 - for even better precision */ #include "nmath.h" double gammafn(double x) { const static double gamcs[42] = { +.8571195590989331421920062399942e-2, +.4415381324841006757191315771652e-2, +.5685043681599363378632664588789e-1, -.4219835396418560501012500186624e-2, +.1326808181212460220584006796352e-2, -.1893024529798880432523947023886e-3, +.3606925327441245256578082217225e-4, -.6056761904460864218485548290365e-5, +.1055829546302283344731823509093e-5, -.1811967365542384048291855891166e-6, +.3117724964715322277790254593169e-7, -.5354219639019687140874081024347e-8, +.9193275519859588946887786825940e-9, -.1577941280288339761767423273953e-9, +.2707980622934954543266540433089e-10, -.4646818653825730144081661058933e-11, +.7973350192007419656460767175359e-12, -.1368078209830916025799499172309e-12, +.2347319486563800657233471771688e-13, -.4027432614949066932766570534699e-14, +.6910051747372100912138336975257e-15, -.1185584500221992907052387126192e-15, +.2034148542496373955201026051932e-16, -.3490054341717405849274012949108e-17, +.5987993856485305567135051066026e-18, -.1027378057872228074490069778431e-18, +.1762702816060529824942759660748e-19, -.3024320653735306260958772112042e-20, +.5188914660218397839717833550506e-21, -.8902770842456576692449251601066e-22, +.1527474068493342602274596891306e-22, -.2620731256187362900257328332799e-23, +.4496464047830538670331046570666e-24, -.7714712731336877911703901525333e-25, +.1323635453126044036486572714666e-25, -.2270999412942928816702313813333e-26, +.3896418998003991449320816639999e-27, -.6685198115125953327792127999999e-28, +.1146998663140024384347613866666e-28, -.1967938586345134677295103999999e-29, +.3376448816585338090334890666666e-30, -.5793070335782135784625493333333e-31 }; int i, n; double y; double sinpiy, value; #ifdef NOMORE_FOR_THREADS static int ngam = 0; static double xmin = 0, xmax = 0., xsml = 0., dxrel = 0.; /* Initialize machine dependent constants, the first time gamma() is called. FIXME for threads ! */ if (ngam == 0) { ngam = chebyshev_init(gamcs, 42, DBL_EPSILON/20);/*was .1*d1mach(3)*/ gammalims(&xmin, &xmax);/*-> ./gammalims.c */ xsml = exp(fmax2(log(DBL_MIN), -log(DBL_MAX)) + 0.01); /* = exp(.01)*DBL_MIN = 2.247e-308 for IEEE */ dxrel = sqrt(DBL_EPSILON);/*was sqrt(d1mach(4)) */ } #else /* For IEEE double precision DBL_EPSILON = 2^-52 = 2.220446049250313e-16 : * (xmin, xmax) are non-trivial, see ./gammalims.c * xsml = exp(.01)*DBL_MIN * dxrel = sqrt(DBL_EPSILON) = 2 ^ -26 */ # define ngam 22 # define xmin -170.5674972726612 # define xmax 171.61447887182298 # define xsml 2.2474362225598545e-308 # define dxrel 1.490116119384765696e-8 #endif if(ISNAN(x)) return x; /* If the argument is exactly zero or a negative integer * then return NaN. */ if (x == 0 || (x < 0 && x == round(x))) { ML_ERROR(ME_DOMAIN, "gammafn"); return ML_NAN; } y = fabs(x); if (y <= 10) { /* Compute gamma(x) for -10 <= x <= 10 * Reduce the interval and find gamma(1 + y) for 0 <= y < 1 * first of all. */ n = (int) x; if(x < 0) --n; y = x - n;/* n = floor(x) ==> y in [ 0, 1 ) */ --n; value = chebyshev_eval(y * 2 - 1, gamcs, ngam) + .9375; if (n == 0) return value;/* x = 1.dddd = 1+y */ if (n < 0) { /* compute gamma(x) for -10 <= x < 1 */ /* exact 0 or "-n" checked already above */ /* The answer is less than half precision */ /* because x too near a negative integer. */ if (x < -0.5 && fabs(x - (int)(x - 0.5) / x) < dxrel) { ML_ERROR(ME_PRECISION, "gammafn"); } /* The argument is so close to 0 that the result would overflow. */ if (y < xsml) { ML_ERROR(ME_RANGE, "gammafn"); if(x > 0) return ML_POSINF; else return ML_NEGINF; } n = -n; for (i = 0; i < n; i++) { value /= (x + i); } return value; } else { /* gamma(x) for 2 <= x <= 10 */ for (i = 1; i <= n; i++) { value *= (y + i); } return value; } } else { /* gamma(x) for y = |x| > 10. */ if (x > xmax) { /* Overflow */ ML_ERROR(ME_RANGE, "gammafn"); return ML_POSINF; } if (x < xmin) { /* Underflow */ ML_ERROR(ME_UNDERFLOW, "gammafn"); return 0.; } if(y <= 50 && y == (int)y) { /* compute (n - 1)! */ value = 1.; for (i = 2; i < y; i++) value *= i; } else { /* normal case */ value = exp((y - 0.5) * log(y) - y + M_LN_SQRT_2PI + ((2*y == (int)2*y)? stirlerr(y) : lgammacor(y))); } if (x > 0) return value; if (fabs((x - (int)(x - 0.5))/x) < dxrel){ /* The answer is less than half precision because */ /* the argument is too near a negative integer. */ ML_ERROR(ME_PRECISION, "gammafn"); } sinpiy = sinpi(y); if (sinpiy == 0) { /* Negative integer arg - overflow */ ML_ERROR(ME_RANGE, "gammafn"); return ML_POSINF; } return -M_PI / (y * sinpiy * value); } } JAGS-4.3.2/src/jrmath/gammalims.c0000664000175000017500000000462014224052371013360 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 1999-2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * void gammalims(double *xmin, double *xmax); * * DESCRIPTION * * This function calculates the minimum and maximum legal bounds * for x in gammafn(x). These are not the only bounds, but they * are the only non-trivial ones to calculate. * * NOTES * * This routine is a translation into C of a Fortran subroutine * by W. Fullerton of Los Alamos Scientific Laboratory. */ #include "nmath.h" void attribute_hidden gammalims(double *xmin, double *xmax) { /* FIXME: Even better: If IEEE, #define these in nmath.h and don't call gammalims() at all */ #ifdef IEEE_754 *xmin = -170.5674972726612; *xmax = 171.61447887182298;/*(3 Intel/Sparc architectures)*/ #else double alnbig, alnsml, xln, xold; int i; alnsml = log(d1mach(1)); *xmin = -alnsml; for (i=1; i<=10; ++i) { xold = *xmin; xln = log(*xmin); *xmin -= *xmin * ((*xmin + .5) * xln - *xmin - .2258 + alnsml) / (*xmin * xln + .5); if (fabs(*xmin - xold) < .005) { *xmin = -(*xmin) + .01; goto find_xmax; } } /* unable to find xmin */ ML_ERROR(ME_NOCONV, "gammalims"); *xmin = *xmax = ML_NAN; find_xmax: alnbig = log(d1mach(2)); *xmax = alnbig; for (i=1; i<=10; ++i) { xold = *xmax; xln = log(*xmax); *xmax -= *xmax * ((*xmax - .5) * xln - *xmax + .9189 - alnbig) / (*xmax * xln - .5); if (fabs(*xmax - xold) < .005) { *xmax += -.01; goto done; } } /* unable to find xmax */ ML_ERROR(ME_NOCONV, "gammalims"); *xmin = *xmax = ML_NAN; done: *xmin = fmax2(*xmin, -(*xmax) + 1); #endif } JAGS-4.3.2/src/jrmath/lgamma.c0000664000175000017500000000707714224052371012660 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2012 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double lgammafn_sign(double x, int *sgn); * double lgammafn(double x); * * DESCRIPTION * * The function lgammafn computes log|gamma(x)|. The function * lgammafn_sign in addition assigns the sign of the gamma function * to the address in the second argument if this is not NULL. * * NOTES * * This routine is a translation into C of a Fortran subroutine * by W. Fullerton of Los Alamos Scientific Laboratory. * * The accuracy of this routine compares (very) favourably * with those of the Sun Microsystems portable mathematical * library. */ #include "nmath.h" double lgammafn_sign(double x, int *sgn) { double ans, y, sinpiy; #ifdef NOMORE_FOR_THREADS static double xmax = 0.; static double dxrel = 0.; if (xmax == 0) {/* initialize machine dependent constants _ONCE_ */ xmax = d1mach(2)/log(d1mach(2));/* = 2.533 e305 for IEEE double */ dxrel = sqrt (d1mach(4));/* sqrt(Eps) ~ 1.49 e-8 for IEEE double */ } #else /* For IEEE double precision DBL_EPSILON = 2^-52 = 2.220446049250313e-16 : xmax = DBL_MAX / log(DBL_MAX) = 2^1024 / (1024 * log(2)) = 2^1014 / log(2) dxrel = sqrt(DBL_EPSILON) = 2^-26 = 5^26 * 1e-26 (is *exact* below !) */ #define xmax 2.5327372760800758e+305 #define dxrel 1.490116119384765625e-8 #endif if (sgn != NULL) *sgn = 1; #ifdef IEEE_754 if(ISNAN(x)) return x; #endif if (sgn != NULL && x < 0 && fmod(floor(-x), 2.) == 0) *sgn = -1; if (x <= 0 && x == trunc(x)) { /* Negative integer argument */ ML_ERROR(ME_RANGE, "lgamma"); return ML_POSINF;/* +Inf, since lgamma(x) = log|gamma(x)| */ } y = fabs(x); if (y < 1e-306) return -log(y); // denormalized range, R change if (y <= 10) return log(fabs(gammafn(x))); /* ELSE y = |x| > 10 ---------------------- */ if (y > xmax) { ML_ERROR(ME_RANGE, "lgamma"); return ML_POSINF; } if (x > 0) { /* i.e. y = x > 10 */ #ifdef IEEE_754 if(x > 1e17) return(x*(log(x) - 1.)); else if(x > 4934720.) return(M_LN_SQRT_2PI + (x - 0.5) * log(x) - x); else #endif return M_LN_SQRT_2PI + (x - 0.5) * log(x) - x + lgammacor(x); } /* else: x < -10; y = -x */ sinpiy = fabs(sinpi(y)); if (sinpiy == 0) { /* Negative integer argument === Now UNNECESSARY: caught above */ MATHLIB_WARNING(" ** should NEVER happen! *** [lgamma.c: Neg.int, y=%g]\n",y); ML_ERR_return_NAN; } ans = M_LN_SQRT_PId2 + (x - 0.5) * log(y) - x - log(sinpiy) - lgammacor(y); if(fabs((x - trunc(x - 0.5)) * ans / x) < dxrel) { /* The answer is less than half precision because * the argument is too near a negative integer. */ ML_ERROR(ME_PRECISION, "lgamma"); } return ans; } double lgammafn(double x) { return lgammafn_sign(x, NULL); } JAGS-4.3.2/src/jrmath/polygamma.c0000664000175000017500000003247014224052371013403 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * Copyright (C) 2004-2009 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * void dpsifn(double x, int n, int kode, int m, * double *ans, int *nz, int *ierr) * double digamma(double x); * double trigamma(double x) * double tetragamma(double x) * double pentagamma(double x) * * DESCRIPTION * * Compute the derivatives of the psi function * and polygamma functions. * * The following definitions are used in dpsifn: * * Definition 1 * * psi(x) = d/dx (ln(gamma(x)), the first derivative of * the log gamma function. * * Definition 2 * k k * psi(k,x) = d /dx (psi(x)), the k-th derivative * of psi(x). * * * "dpsifn" computes a sequence of scaled derivatives of * the psi function; i.e. for fixed x and m it computes * the m-member sequence * * (-1)^(k+1) / gamma(k+1) * psi(k,x) * for k = n,...,n+m-1 * * where psi(k,x) is as defined above. For kode=1, dpsifn * returns the scaled derivatives as described. kode=2 is * operative only when k=0 and in that case dpsifn returns * -psi(x) + ln(x). That is, the logarithmic behavior for * large x is removed when kode=2 and k=0. When sums or * differences of psi functions are computed the logarithmic * terms can be combined analytically and computed separately * to help retain significant digits. * * Note that dpsifn(x, 0, 1, 1, ans) results in ans = -psi(x). * * INPUT * * x - argument, x > 0. * * n - first member of the sequence, 0 <= n <= 100 * n == 0 gives ans(1) = -psi(x) for kode=1 * -psi(x)+ln(x) for kode=2 * * kode - selection parameter * kode == 1 returns scaled derivatives of the * psi function. * kode == 2 returns scaled derivatives of the * psi function except when n=0. In this case, * ans(1) = -psi(x) + ln(x) is returned. * * m - number of members of the sequence, m >= 1 * * OUTPUT * * ans - a vector of length at least m whose first m * components contain the sequence of derivatives * scaled according to kode. * * nz - underflow flag * nz == 0, a normal return * nz != 0, underflow, last nz components of ans are * set to zero, ans(m-k+1)=0.0, k=1,...,nz * * ierr - error flag * ierr=0, a normal return, computation completed * ierr=1, input error, no computation * ierr=2, overflow, x too small or n+m-1 too * large or both * ierr=3, error, n too large. dimensioned * array trmr(nmax) is not large enough for n * * The nominal computational accuracy is the maximum of unit * roundoff (d1mach(4)) and 1e-18 since critical constants * are given to only 18 digits. * * The basic method of evaluation is the asymptotic expansion * for large x >= xmin followed by backward recursion on a two * term recursion relation * * w(x+1) + x^(-n-1) = w(x). * * this is supplemented by a series * * sum( (x+k)^(-n-1) , k=0,1,2,... ) * * which converges rapidly for large n. both xmin and the * number of terms of the series are calculated from the unit * roundoff of the machine environment. * * AUTHOR * * Amos, D. E. (Fortran) * Ross Ihaka (C Translation) * Martin Maechler (x < 0, and psigamma()) * * REFERENCES * * Handbook of Mathematical Functions, * National Bureau of Standards Applied Mathematics Series 55, * Edited by M. Abramowitz and I. A. Stegun, equations 6.3.5, * 6.3.18, 6.4.6, 6.4.9 and 6.4.10, pp.258-260, 1964. * * D. E. Amos, (1983). "A Portable Fortran Subroutine for * Derivatives of the Psi Function", Algorithm 610, * TOMS 9(4), pp. 494-502. * * Routines called: jags_d1mach, jags_i1mach. */ #include "nmath.h" #ifdef MATHLIB_STANDALONE #include #endif #define n_max (100) /* From R, currently only used for kode = 1, m = 1, n in {0,1,2,3} : */ void dpsifn(double x, int n, int kode, int m, double *ans, int *nz, int *ierr) { const static double bvalues[] = { /* Bernoulli Numbers */ 1.00000000000000000e+00, -5.00000000000000000e-01, 1.66666666666666667e-01, -3.33333333333333333e-02, 2.38095238095238095e-02, -3.33333333333333333e-02, 7.57575757575757576e-02, -2.53113553113553114e-01, 1.16666666666666667e+00, -7.09215686274509804e+00, 5.49711779448621554e+01, -5.29124242424242424e+02, 6.19212318840579710e+03, -8.65802531135531136e+04, 1.42551716666666667e+06, -2.72982310678160920e+07, 6.01580873900642368e+08, -1.51163157670921569e+10, 4.29614643061166667e+11, -1.37116552050883328e+13, 4.88332318973593167e+14, -1.92965793419400681e+16 }; int i, j, k, mm, mx, nn, np, nx, fn; double arg, den, elim, eps, fln, fx, rln, rxsq, r1m4, r1m5, s, slope, t, ta, tk, tol, tols, tss, tst, tt, t1, t2, wdtol, xdmln, xdmy, xinc, xln = 0.0 /* -Wall */, xm, xmin, xq, yint; double trm[23], trmr[n_max + 1]; *ierr = 0; if (n < 0 || kode < 1 || kode > 2 || m < 1) { *ierr = 1; return; } if (x <= 0.) { /* use Abramowitz & Stegun 6.4.7 "Reflection Formula" * psi(k, x) = (-1)^k psi(k, 1-x) - pi^{n+1} (d/dx)^n cot(x) */ if (x == round(x)) { /* non-positive integer : +Inf or NaN depends on n */ for(j=0; j < m; j++) /* k = j + n : */ ans[j] = ((j+n) % 2) ? ML_POSINF : ML_NAN; return; } /* This could cancel badly */ dpsifn(1. - x, n, /*kode = */ 1, m, ans, nz, ierr); /* ans[j] == (-1)^(k+1) / gamma(k+1) * psi(k, 1 - x) * for j = 0:(m-1) , k = n + j */ /* Cheat for now: only work for m = 1, n in {0,1,2,3} : */ if(m > 1 || n > 3) {/* doesn't happen for digamma() .. pentagamma() */ /* not yet implemented */ *ierr = 4; return; } x *= M_PI; /* pi * x */ if (n == 0) tt = cos(x)/sin(x); else if (n == 1) tt = -1/JR_pow_di(sin(x), 2); else if (n == 2) tt = 2*cos(x)/JR_pow_di(sin(x), 3); else if (n == 3) tt = -2*(2*JR_pow_di(cos(x), 2) + 1.)/JR_pow_di(sin(x), 4); else /* can not happen! */ tt = ML_NAN; /* end cheat */ s = (n % 2) ? -1. : 1.;/* s = (-1)^n */ /* t := pi^(n+1) * d_n(x) / gamma(n+1) , where * d_n(x) := (d/dx)^n cot(x)*/ t1 = t2 = s = 1.; for(k=0, j=k-n; j < m; k++, j++, s = -s) { /* k == n+j , s = (-1)^k */ t1 *= M_PI;/* t1 == pi^(k+1) */ if(k >= 2) t2 *= k;/* t2 == k! == gamma(k+1) */ if(j >= 0) /* by cheat above, tt === d_k(x) */ ans[j] = s*(ans[j] + t1/t2 * tt); } if (n == 0 && kode == 2) /* unused from R, but "wrong": xln === 0 :*/ ans[0] += xln; return; } /* x <= 0 */ /* else : x > 0 */ *nz = 0; xln = log(x); if(kode == 1 && m == 1) {/* the R case --- for very large x: */ double lrg = 1/(2. * DBL_EPSILON); if(n == 0 && x * xln > lrg) { ans[0] = -xln; return; } else if(n >= 1 && x > n * lrg) { ans[0] = exp(-n * xln)/n; /* == x^-n / n == 1/(n * x^n) */ return; } } mm = m; nx = imin2(-jags_i1mach(15), jags_i1mach(16));/* = 1021 */ r1m5 = jags_d1mach(5); r1m4 = jags_d1mach(4) * 0.5; wdtol = fmax2(r1m4, 0.5e-18); /* 1.11e-16 */ /* elim = approximate exponential over and underflow limit */ elim = 2.302 * (nx * r1m5 - 3.0);/* = 700.6174... */ for(;;) { nn = n + mm - 1; fn = nn; t = (fn + 1) * xln; /* overflow and underflow test for small and large x */ if (fabs(t) > elim) { if (t <= 0.0) { *nz = 0; *ierr = 2; return; } } else { if (x < wdtol) { ans[0] = JR_pow_di(x, -n-1); if (mm != 1) { for(k = 1; k < mm ; k++) ans[k] = ans[k-1] / x; } if (n == 0 && kode == 2) ans[0] += xln; return; } /* compute xmin and the number of terms of the series, fln+1 */ rln = r1m5 * jags_i1mach(14); rln = fmin2(rln, 18.06); fln = fmax2(rln, 3.0) - 3.0; yint = 3.50 + 0.40 * fln; slope = 0.21 + fln * (0.0006038 * fln + 0.008677); xm = yint + slope * fn; mx = (int)xm + 1; xmin = mx; if (n != 0) { xm = -2.302 * rln - fmin2(0.0, xln); arg = xm / n; arg = fmin2(0.0, arg); eps = exp(arg); xm = 1.0 - eps; if (fabs(arg) < 1.0e-3) xm = -arg; fln = x * xm / eps; xm = xmin - x; if (xm > 7.0 && fln < 15.0) break; } xdmy = x; xdmln = xln; xinc = 0.0; if (x < xmin) { nx = (int)x; xinc = xmin - nx; xdmy = x + xinc; xdmln = log(xdmy); } /* generate w(n+mm-1, x) by the asymptotic expansion */ t = fn * xdmln; t1 = xdmln + xdmln; t2 = t + xdmln; tk = fmax2(fabs(t), fmax2(fabs(t1), fabs(t2))); if (tk <= elim) /* for all but large x */ goto L10; } nz++; /* underflow */ mm--; ans[mm] = 0.; if (mm == 0) return; } /* end{for()} */ nn = (int)fln + 1; np = n + 1; t1 = (n + 1) * xln; t = exp(-t1); s = t; den = x; for(i=1; i <= nn; i++) { den += 1.; trm[i] = pow(den, (double)-np); s += trm[i]; } ans[0] = s; if (n == 0 && kode == 2) ans[0] = s + xln; if (mm != 1) { /* generate higher derivatives, j > n */ tol = wdtol / 5.0; for(j = 1; j < mm; j++) { t /= x; s = t; tols = t * tol; den = x; for(i=1; i <= nn; i++) { den += 1.; trm[i] /= den; s += trm[i]; if (trm[i] < tols) break; } ans[j] = s; } } return; L10: tss = exp(-t); tt = 0.5 / xdmy; t1 = tt; tst = wdtol * tt; if (nn != 0) t1 = tt + 1.0 / fn; rxsq = 1.0 / (xdmy * xdmy); ta = 0.5 * rxsq; t = (fn + 1) * ta; s = t * bvalues[2]; if (fabs(s) >= tst) { tk = 2.0; for(k = 4; k <= 22; k++) { t = t * ((tk + fn + 1)/(tk + 1.0))*((tk + fn)/(tk + 2.0)) * rxsq; trm[k] = t * bvalues[k-1]; if (fabs(trm[k]) < tst) break; s += trm[k]; tk += 2.; } } s = (s + t1) * tss; if (xinc != 0.0) { /* backward recur from xdmy to x */ nx = (int)xinc; np = nn + 1; if (nx > n_max) { *nz = 0; *ierr = 3; return; } else { if (nn==0) goto L20; xm = xinc - 1.0; fx = x + xm; /* this loop should not be changed. fx is accurate when x is small */ for(i = 1; i <= nx; i++) { trmr[i] = pow(fx, (double)-np); s += trmr[i]; xm -= 1.; fx = x + xm; } } } ans[mm-1] = s; if (fn == 0) goto L30; /* generate lower derivatives, j < n+mm-1 */ for(j = 2; j <= mm; j++) { fn--; tss *= xdmy; t1 = tt; if (fn!=0) t1 = tt + 1.0 / fn; t = (fn + 1) * ta; s = t * bvalues[2]; if (fabs(s) >= tst) { tk = 4 + fn; for(k=4; k <= 22; k++) { trm[k] = trm[k] * (fn + 1) / tk; if (fabs(trm[k]) < tst) break; s += trm[k]; tk += 2.; } } s = (s + t1) * tss; if (xinc != 0.0) { if (fn == 0) goto L20; xm = xinc - 1.0; fx = x + xm; for(i=1 ; i<=nx ; i++) { trmr[i] = trmr[i] * fx; s += trmr[i]; xm -= 1.; fx = x + xm; } } ans[mm - j] = s; if (fn == 0) goto L30; } return; L20: for(i = 1; i <= nx; i++) s += 1. / (x + (nx - i)); /* avoid disastrous cancellation, PR#13714 */ L30: if (kode != 2) /* always */ ans[0] = s - xdmln; else if (xdmy != x) { xq = xdmy / x; ans[0] = s - log(xq); } return; } /* dpsifn() */ #ifdef MATHLIB_STANDALONE # define ML_TREAT_psigam(_IERR_) \ if(_IERR_ != 0) { \ errno = EDOM; \ return ML_NAN; \ } #else # define ML_TREAT_psigam(_IERR_) \ if(_IERR_ != 0) \ return ML_NAN #endif double psigamma(double x, double deriv) { /* n-th derivative of psi(x); e.g., psigamma(x,0) == digamma(x) */ double ans; int nz, ierr, k, n; if(ISNAN(x)) return x; deriv = R_forceint(deriv); n = (int)deriv; if(n > n_max) { MATHLIB_WARNING2(_("deriv = %d > %d (= n_max)\n"), n, n_max); return ML_NAN; } dpsifn(x, n, 1, 1, &ans, &nz, &ierr); ML_TREAT_psigam(ierr); /* Now, ans == A := (-1)^(n+1) / gamma(n+1) * psi(n, x) */ ans = -ans; /* = (-1)^(0+1) * gamma(0+1) * A */ for(k = 1; k <= n; k++) ans *= (-k);/* = (-1)^(k+1) * gamma(k+1) * A */ return ans;/* = psi(n, x) */ } double digamma(double x) { double ans; int nz, ierr; if(ISNAN(x)) return x; dpsifn(x, 0, 1, 1, &ans, &nz, &ierr); ML_TREAT_psigam(ierr); return -ans; } double trigamma(double x) { double ans; int nz, ierr; if(ISNAN(x)) return x; dpsifn(x, 1, 1, 1, &ans, &nz, &ierr); ML_TREAT_psigam(ierr); return ans; } double tetragamma(double x) { double ans; int nz, ierr; if(ISNAN(x)) return x; dpsifn(x, 2, 1, 1, &ans, &nz, &ierr); ML_TREAT_psigam(ierr); return -2.0 * ans; } double pentagamma(double x) { double ans; int nz, ierr; if(ISNAN(x)) return x; dpsifn(x, 3, 1, 1, &ans, &nz, &ierr); ML_TREAT_psigam(ierr); return 6.0 * ans; } JAGS-4.3.2/src/jrmath/toms708.c0000664000175000017500000017526114224052371012644 00000000000000// -*- mode: C ; delete-old-versions: never -*- /* Based on C translation of ACM TOMS 708 Please do not change this, e.g. to use R's versions of the ancillary routines, without investigating the error analysis as we do need very high relative accuracy. This version has about 14 digits accuracy. */ #undef min #define min(a,b) ((a < b)?a:b) #undef max #define max(a,b) ((a > b)?a:b) #include "nmath.h" #include "dpq.h" /* after config.h to avoid warning on Solaris */ #include /* is included by above, with suitable defines in glibc systems to make log1p and expm1 declared */ /**----------- DEBUGGING ------------- * * make CFLAGS='-DDEBUG_bratio ...' *MM (w/ Debug, w/o Optimization): (cd `R-devel-pbeta-dbg RHOME`/src/nmath ; gcc -I. -I../../src/include -I../../../R/src/include -DHAVE_CONFIG_H -fopenmp -g -pedantic -Wall --std=gnu99 -DDEBUG_q -DDEBUG_bratio -Wcast-align -Wclobbered -c ../../../R/src/nmath/toms708.c -o toms708.o; cd ../..; make R) */ #ifdef DEBUG_bratio # include # define R_ifDEBUG_printf(...) JREprintf(__VA_ARGS__) #else # define R_ifDEBUG_printf(...) #endif /* MM added R_D_LExp, so redefine here in terms of rexpm1 */ #undef R_Log1_Exp #define R_Log1_Exp(x) ((x) > -M_LN2 ? log(-rexpm1(x)) : log1p(-exp(x))) static double bfrac(double, double, double, double, double, double, int log_p); static void bgrat(double, double, double, double, double *, double, int *, Rboolean log_w); static double grat_r(double a, double x, double r, double eps); static double apser(double, double, double, double); static double bpser(double, double, double, double, int log_p); static double basym(double, double, double, double, int log_p); static double fpser(double, double, double, double, int log_p); static double bup(double, double, double, double, int, double, int give_log); static double exparg(int); static double psi(double); static double gam1(double); static double gamln1(double); static double betaln(double, double); static double algdiv(double, double); static double brcmp1(int, double, double, double, double, int give_log); static double brcomp(double, double, double, double, int log_p); static double rlog1(double); static double bcorr(double, double); static double gamln(double); static double alnrel(double); static double esum(int, double, int give_log); static double erf__(double); static double rexpm1(double); static double erfc1(int, double); static double gsumln(double, double); /* ALGORITHM 708, COLLECTED ALGORITHMS FROM ACM. * This work published in Transactions On Mathematical Software, * vol. 18, no. 3, September 1992, pp. 360-373z. */ /* Changes by R Core Team : * add log_p and work towards gaining precision in that case */ void attribute_hidden bratio(double a, double b, double x, double y, double *w, double *w1, int *ierr, int log_p) { /* ----------------------------------------------------------------------- * Evaluation of the Incomplete Beta function I_x(a,b) * -------------------- * It is assumed that a and b are nonnegative, and that x <= 1 * and y = 1 - x. Bratio assigns w and w1 the values * w = I_x(a,b) * w1 = 1 - I_x(a,b) * ierr is a variable that reports the status of the results. * If no input errors are detected then ierr is set to 0 and * w and w1 are computed. otherwise, if an error is detected, * then w and w1 are assigned the value 0 and ierr is set to * one of the following values ... * ierr = 1 if a or b is negative * ierr = 2 if a = b = 0 * ierr = 3 if x < 0 or x > 1 * ierr = 4 if y < 0 or y > 1 * ierr = 5 if x + y != 1 * ierr = 6 if x = a = 0 * ierr = 7 if y = b = 0 * ierr = 8 "error" in bgrat() * -------------------- * Written by Alfred H. Morris, Jr. * Naval Surface Warfare Center * Dahlgren, Virginia * Revised ... Nov 1991 * ----------------------------------------------------------------------- */ Rboolean do_swap; int n, ierr1 = 0; double z, a0, b0, x0, y0, eps, lambda; /* eps is a machine dependent constant: the smallest * floating point number for which 1.0 + eps > 1.0 */ eps = 2.0 * jags_d1mach(3); /* == DBL_EPSILON (in R, Rmath) */ /* ----------------------------------------------------------------------- */ *w = R_D__0; *w1 = R_D__0; if (a < 0.0 || b < 0.0) { *ierr = 1; return; } if (a == 0.0 && b == 0.0) { *ierr = 2; return; } if (x < 0.0 || x > 1.0) { *ierr = 3; return; } if (y < 0.0 || y > 1.0) { *ierr = 4; return; } /* check that 'y == 1 - x' : */ z = x + y - 0.5 - 0.5; if (fabs(z) > eps * 3.0) { *ierr = 5; return; } R_ifDEBUG_printf("bratio(a=%g, b=%g, x=%9g, y=%9g, .., log_p=%d): ", a,b,x,y, log_p); *ierr = 0; if (x == 0.0) goto L200; if (y == 0.0) goto L210; if (a == 0.0) goto L211; if (b == 0.0) goto L201; eps = max(eps, 1e-15); Rboolean a_lt_b = (a < b); if (/* max(a,b) */ (a_lt_b ? b : a) < eps * .001) { /* procedure for a and b < 0.001 * eps */ // L230: -- result *independent* of x (!) // *w = a/(a+b) and w1 = b/(a+b) : if(log_p) { if(a_lt_b) { *w = log1p(-a/(a+b)); // notably if a << b *w1 = log ( a/(a+b)); } else { // b <= a *w = log ( b/(a+b)); *w1 = log1p(-b/(a+b)); } } else { *w = b / (a + b); *w1 = a / (a + b); } R_ifDEBUG_printf("a & b very small -> simple ratios (%g,%g)\n", *w,*w1); return; } #define SET_0_noswap \ a0 = a; x0 = x; \ b0 = b; y0 = y; #define SET_0_swap \ a0 = b; x0 = y; \ b0 = a; y0 = x; if (min(a,b) <= 1.) { /*------------------------ a <= 1 or b <= 1 ---- */ do_swap = (x > 0.5); if (do_swap) { SET_0_swap; } else { SET_0_noswap; } /* now have x0 <= 1/2 <= y0 (still x0+y0 == 1) */ R_ifDEBUG_printf(" min(a,b) <= 1, do_swap=%d;", do_swap); if (b0 < min(eps, eps * a0)) { /* L80: */ *w = fpser(a0, b0, x0, eps, log_p); *w1 = log_p ? R_Log1_Exp(*w) : 0.5 - *w + 0.5; R_ifDEBUG_printf(" b0 small -> w := fpser(*) = %.15g\n", *w); goto L_end; } if (a0 < min(eps, eps * b0) && b0 * x0 <= 1.0) { /* L90: */ *w1 = apser(a0, b0, x0, eps); R_ifDEBUG_printf(" a0 small -> w1 := apser(*) = %.15g\n", *w1); goto L_end_from_w1; } Rboolean did_bup = FALSE; if (max(a0,b0) > 1.0) { /* L20: min(a,b) <= 1 < max(a,b) */ R_ifDEBUG_printf("\n L20: min(a,b) <= 1 < max(a,b); "); if (b0 <= 1.0) goto L_w_bpser; if (x0 >= 0.29) /* was 0.3, PR#13786 */ goto L_w1_bpser; if (x0 < 0.1 && pow(x0*b0, a0) <= 0.7) goto L_w_bpser; if (b0 > 15.0) { *w1 = 0.; goto L131; } } else { /* a, b <= 1 */ R_ifDEBUG_printf("\n both a,b <= 1; "); if (a0 >= min(0.2, b0)) goto L_w_bpser; if (pow(x0, a0) <= 0.9) goto L_w_bpser; if (x0 >= 0.3) goto L_w1_bpser; } n = 20; /* goto L130; */ *w1 = bup(b0, a0, y0, x0, n, eps, FALSE); did_bup = TRUE; R_ifDEBUG_printf(" ... n=20 and *w1 := bup(*) = %.15g; ", *w1); b0 += n; L131: R_ifDEBUG_printf(" L131: bgrat(*, w1=%.15g) ", *w1); bgrat(b0, a0, y0, x0, w1, 15*eps, &ierr1, FALSE); #ifdef DEBUG_bratio JREprintf(" ==> new w1=%.15g", *w1); if(ierr1) JREprintf(" ERROR(code=%d)\n", ierr1) ; else JREprintf("\n"); #endif if(*w1 == 0 || (0 < *w1 && *w1 < 1e-310)) { // w1=0 or very close: // "almost surely" from underflow, try more: [2013-03-04] // FIXME: it is even better to do this in bgrat *directly* at least for the case // !did_bup, i.e., where *w1 = (0 or -Inf) on entry R_ifDEBUG_printf(" denormalized or underflow (?) -> retrying: "); if(did_bup) { // re-do that part on log scale: *w1 = bup(b0-n, a0, y0, x0, n, eps, TRUE); } else *w1 = ML_NEGINF; // = 0 on log-scale bgrat(b0, a0, y0, x0, w1, 15*eps, &ierr1, TRUE); if(ierr1) *ierr = 8; #ifdef DEBUG_bratio JREprintf(" ==> new log(w1)=%.15g", *w1); if(ierr1) JREprintf(" Error(code=%d)\n", ierr1) ; else JREprintf("\n"); #endif goto L_end_from_w1_log; } // else if(ierr1) *ierr = 8; if(*w1 < 0) MATHLIB_WARNING4("bratio(a=%g, b=%g, x=%g): bgrat() -> w1 = %g", a,b,x, *w1); goto L_end_from_w1; } else { /* L30: -------------------- both a, b > 1 {a0 > 1 & b0 > 1} ---*/ if (a > b) lambda = (a + b) * y - b; else lambda = a - (a + b) * x; do_swap = (lambda < 0.0); if (do_swap) { lambda = -lambda; SET_0_swap; } else { SET_0_noswap; } R_ifDEBUG_printf(" L30: both a, b > 1; |lambda| = %#g, do_swap = %d\n", lambda, do_swap); if (b0 < 40.0) { R_ifDEBUG_printf(" b0 < 40;"); if (b0 * x0 <= 0.7 || (log_p && lambda > 650.)) /* << added 2010-03-18 */ goto L_w_bpser; else goto L140; } else if (a0 > b0) { /* ---- a0 > b0 >= 40 ---- */ R_ifDEBUG_printf(" a0 > b0 >= 40;"); if (b0 <= 100.0 || lambda > b0 * 0.03) goto L_bfrac; } else if (a0 <= 100.0) { R_ifDEBUG_printf(" a0 <= 100; a0 <= b0 >= 40;"); goto L_bfrac; } else if (lambda > a0 * 0.03) { R_ifDEBUG_printf(" b0 >= a0 > 100; lambda > a0 * 0.03 "); goto L_bfrac; } /* else if none of the above L180: */ *w = basym(a0, b0, lambda, eps * 100.0, log_p); *w1 = log_p ? R_Log1_Exp(*w) : 0.5 - *w + 0.5; R_ifDEBUG_printf(" b0 >= a0 > 100; lambda <= a0 * 0.03: *w:= basym(*) =%.15g\n", *w); goto L_end; } /* else: a, b > 1 */ /* EVALUATION OF THE APPROPRIATE ALGORITHM */ L_w_bpser: // was L100 *w = bpser(a0, b0, x0, eps, log_p); *w1 = log_p ? R_Log1_Exp(*w) : 0.5 - *w + 0.5; R_ifDEBUG_printf(" L_w_bpser: *w := bpser(*) = %.15g\n", *w); goto L_end; L_w1_bpser: // was L110 *w1 = bpser(b0, a0, y0, eps, log_p); *w = log_p ? R_Log1_Exp(*w1) : 0.5 - *w1 + 0.5; R_ifDEBUG_printf(" L_w1_bpser: *w1 := bpser(*) = %.15g\n", *w1); goto L_end; L_bfrac: *w = bfrac(a0, b0, x0, y0, lambda, eps * 15.0, log_p); *w1 = log_p ? R_Log1_Exp(*w) : 0.5 - *w + 0.5; R_ifDEBUG_printf(" L_bfrac: *w := bfrac(*) = %g\n", *w); goto L_end; L140: /* b0 := fractional_part( b0 ) in (0, 1] */ n = (int) b0; b0 -= n; if (b0 == 0.) { --n; b0 = 1.; } *w = bup(b0, a0, y0, x0, n, eps, FALSE); R_ifDEBUG_printf(" L140: *w := bup(b0=%g,..) = %.15g; ", b0, *w); if(*w < DBL_MIN && log_p) { /* do not believe it; try bpser() : */ /*revert: */ b0 += n; /* which is only valid if b0 <= 1 || b0*x0 <= 0.7 */ goto L_w_bpser; } if (x0 <= 0.7) { /* log_p : TODO: w = bup(.) + bpser(.) -- not so easy to use log-scale */ *w += bpser(a0, b0, x0, eps, /* log_p = */ FALSE); R_ifDEBUG_printf(" x0 <= 0.7: *w := *w + bpser(*) = %.15g\n", *w); goto L_end_from_w; } /* L150: */ if (a0 <= 15.0) { n = 20; *w += bup(a0, b0, x0, y0, n, eps, FALSE); R_ifDEBUG_printf("\n a0 <= 15: *w := *w + bup(*) = %.15g;", *w); a0 += n; } R_ifDEBUG_printf(" bgrat(*, w=%.15g) ", *w); bgrat(a0, b0, x0, y0, w, 15*eps, &ierr1, FALSE); if(ierr1) *ierr = 8; #ifdef DEBUG_bratio JREprintf("==> new w=%.15g", *w); if(ierr1) JREprintf(" Error(code=%d)\n", ierr1) ; else JREprintf("\n"); #endif goto L_end_from_w; /* TERMINATION OF THE PROCEDURE */ L200: if (a == 0.0) { *ierr = 6; return; } // else: L201: *w = R_D__0; *w1 = R_D__1; return; L210: if (b == 0.0) { *ierr = 7; return; } // else: L211: *w = R_D__1; *w1 = R_D__0; return; L_end_from_w: if(log_p) { *w1 = log1p(-*w); *w = log(*w); } else { *w1 = 0.5 - *w + 0.5; } goto L_end; L_end_from_w1: if(log_p) { *w = log1p(-*w1); *w1 = log(*w1); } else { *w = 0.5 - *w1 + 0.5; } goto L_end; L_end_from_w1_log: // *w1 = log(w1) already; w = 1 - w1 ==> log(w) = log(1 - w1) = log(1 - exp(*w1)) if(log_p) { *w = R_Log1_Exp(*w1); } else { *w = /* 1 - exp(*w1) */ -expm1(*w1); *w1 = exp(*w1); } goto L_end; L_end: if (do_swap) { /* swap */ double t = *w; *w = *w1; *w1 = t; } return; } /* bratio */ #undef SET_0_noswap #undef SET_0_swap double fpser(double a, double b, double x, double eps, int log_p) { /* ----------------------------------------------------------------------- * * EVALUATION OF I (A,B) * X * FOR B < MIN(EPS, EPS*A) AND X <= 0.5 * ----------------------------------------------------------------------- */ double ans, c, s, t, an, tol; /* SET ans := x^a : */ if (log_p) { ans = a * log(x); } else if (a > eps * 0.001) { t = a * log(x); if (t < exparg(1)) { /* exp(t) would underflow */ return 0.0; } ans = exp(t); } else ans = 1.; /* NOTE THAT 1/B(A,B) = B */ if (log_p) ans += log(b) - log(a); else ans *= b / a; tol = eps / a; an = a + 1.0; t = x; s = t / an; do { an += 1.0; t = x * t; c = t / an; s += c; } while (fabs(c) > tol); if (log_p) ans += log1p(a * s); else ans *= a * s + 1.0; return ans; } /* fpser */ static double apser(double a, double b, double x, double eps) { /* ----------------------------------------------------------------------- * apser() yields the incomplete beta ratio I_{1-x}(b,a) for * a <= min(eps,eps*b), b*x <= 1, and x <= 0.5, i.e., a is very small. * Use only if above inequalities are satisfied. * ----------------------------------------------------------------------- */ static double const g = .577215664901533; double tol, c, j, s, t, aj; double bx = b * x; t = x - bx; if (b * eps <= 0.02) c = log(x) + psi(b) + g + t; else c = log(bx) + g + t; tol = eps * 5.0 * fabs(c); j = 1.; s = 0.; do { j += 1.0; t *= x - bx / j; aj = t / j; s += aj; } while (fabs(aj) > tol); return -a * (c + s); } /* apser */ static double bpser(double a, double b, double x, double eps, int log_p) { /* ----------------------------------------------------------------------- * Power SERies expansion for evaluating I_x(a,b) when * b <= 1 or b*x <= 0.7. eps is the tolerance used. * ----------------------------------------------------------------------- */ int i, m; double ans, c, n, t, u, w, z, a0, b0, apb, tol, sum; if (x == 0.) { return R_D__0; } /* ----------------------------------------------------------------------- */ /* compute the factor x^a/(a*Beta(a,b)) */ /* ----------------------------------------------------------------------- */ a0 = min(a,b); if (a0 >= 1.0) { /* ------ 1 <= a0 <= b0 ------ */ z = a * log(x) - betaln(a, b); ans = log_p ? z - log(a) : exp(z) / a; } else { b0 = max(a,b); if (b0 < 8.0) { if (b0 <= 1.0) { /* ------ a0 < 1 and b0 <= 1 ------ */ if(log_p) { ans = a * log(x); } else { ans = pow(x, a); if (ans == 0.) /* once underflow, always underflow .. */ return ans; } apb = a + b; if (apb > 1.0) { u = a + b - 1.; z = (gam1(u) + 1.0) / apb; } else { z = gam1(apb) + 1.0; } c = (gam1(a) + 1.0) * (gam1(b) + 1.0) / z; if(log_p) /* FIXME ? -- improve quite a bit for c ~= 1 */ ans += log(c * (b / apb)); else ans *= c * (b / apb); } else { /* ------ a0 < 1 < b0 < 8 ------ */ u = gamln1(a0); m = (int)(b0 - 1.0); if (m >= 1) { c = 1.0; for (i = 1; i <= m; ++i) { b0 += -1.0; c *= b0 / (a0 + b0); } u += log(c); } z = a * log(x) - u; b0 += -1.0; // => b0 in (0, 7) apb = a0 + b0; if (apb > 1.0) { u = a0 + b0 - 1.; t = (gam1(u) + 1.0) / apb; } else { t = gam1(apb) + 1.0; } if(log_p) /* FIXME? potential for improving log(t) */ ans = z + log(a0 / a) + log1p(gam1(b0)) - log(t); else ans = exp(z) * (a0 / a) * (gam1(b0) + 1.0) / t; } } else { /* ------ a0 < 1 < 8 <= b0 ------ */ u = gamln1(a0) + algdiv(a0, b0); z = a * log(x) - u; if(log_p) ans = z + log(a0 / a); else ans = a0 / a * exp(z); } } R_ifDEBUG_printf(" bpser(a=%g, b=%g, x=%g, log=%d): prelim.ans = %.14g;\n", a,b,x, log_p, ans); if (ans == R_D__0 || (!log_p && a <= eps * 0.1)) { return ans; } /* ----------------------------------------------------------------------- */ /* COMPUTE THE SERIES */ /* ----------------------------------------------------------------------- */ sum = 0.; n = 0.; c = 1.; tol = eps / a; do { n += 1.; c *= (0.5 - b / n + 0.5) * x; w = c / (a + n); sum += w; } while (n < 1e7 && fabs(w) > tol); if(fabs(w) > tol) { // the series did not converge (in time) // warn only when the result seems to matter: if(( log_p && !(a*sum > -1. && fabs(log1p(a * sum)) < eps*fabs(ans))) || (!log_p && fabs(a*sum + 1) != 1.)) MATHLIB_WARNING5( " bpser(a=%g, b=%g, x=%g,...) did not converge (n=1e7, |w|/tol=%g > 1; A=%g)", a,b,x, fabs(w)/tol, ans); } R_ifDEBUG_printf(" -> n=%.0f iterations, |w|=%g %s %g=tol:=eps/a ==> a*sum=%g\n", n, fabs(w), (fabs(w) > tol) ? ">!!>" : "<=", tol, a*sum); if(log_p) { if (a*sum > -1.0) ans += log1p(a * sum); else ans = ML_NEGINF; } else ans *= a * sum + 1.0; return ans; } /* bpser */ static double bup(double a, double b, double x, double y, int n, double eps, int give_log) { /* ----------------------------------------------------------------------- */ /* EVALUATION OF I_x(A,B) - I_x(A+N,B) WHERE N IS A POSITIVE INT. */ /* EPS IS THE TOLERANCE USED. */ /* ----------------------------------------------------------------------- */ /* System generated locals */ double ret_val; /* Local variables */ int i, k, mu; double d, l, r, t; // Obtain the scaling factor exp(-mu) and exp(mu)*(x^a * y^b / beta(a,b))/a double apb = a + b, ap1 = a + 1.0; if (n > 1 && a >= 1. && apb >= ap1 * 1.1) { mu = (int)fabs(exparg(1)); k = (int) exparg(0); if (mu > k) mu = k; t = (double) mu; d = exp(-t); } else { mu = 0; d = 1.0; } /* L10: */ ret_val = give_log ? brcmp1(mu, a, b, x, y, TRUE) - log(a) : brcmp1(mu, a, b, x, y, FALSE) / a; if (n == 1 || (give_log && ret_val == ML_NEGINF) || (!give_log && ret_val == 0.)) return ret_val; int nm1 = n - 1; double w = d; /* LET K BE THE INDEX OF THE MAXIMUM TERM */ k = 0; if (b <= 1.0) { goto L40; } if (y > 1e-4) { r = (b - 1.0) * x / y - a; if (r < 1.0) { goto L40; } k = nm1; t = (double) nm1; if (r < t) { k = (int) r; } } else { k = nm1; } /* ADD THE INCREASING TERMS OF THE SERIES */ /* L30: */ for (i = 1; i <= k; ++i) { l = (double) (i - 1); d = (apb + l) / (ap1 + l) * x * d; w += d; /* L31: */ } if (k != nm1) { /* ADD THE REMAINING TERMS OF THE SERIES */ L40: for (i = k+1; i <= nm1; ++i) { l = (double) (i - 1); d = (apb + l) / (ap1 + l) * x * d; w += d; if (d <= eps * w) /* relativ convergence (eps) */ break; } } // L50: TERMINATE THE PROCEDURE if(give_log) { ret_val += log(w); } else ret_val *= w; return ret_val; } /* bup */ static double bfrac(double a, double b, double x, double y, double lambda, double eps, int log_p) { /* ----------------------------------------------------------------------- Continued fraction expansion for I_x(a,b) when a, b > 1. It is assumed that lambda = (a + b)*y - b. -----------------------------------------------------------------------*/ double c, e, n, p, r, s, t, w, c0, c1, r0, an, bn, yp1, anp1, bnp1, beta, alpha; double brc = brcomp(a, b, x, y, log_p); if (!log_p && brc == 0.) /* already underflowed to 0 */ return 0.; c = lambda + 1.0; c0 = b / a; c1 = 1.0 / a + 1.0; yp1 = y + 1.0; n = 0.0; p = 1.0; s = a + 1.0; an = 0.0; bn = 1.0; anp1 = 1.0; bnp1 = c / c1; r = c1 / c; /* CONTINUED FRACTION CALCULATION */ do { n += 1.0; t = n / a; w = n * (b - n) * x; e = a / s; alpha = p * (p + c0) * e * e * (w * x); e = (t + 1.0) / (c1 + t + t); beta = n + w / s + e * (c + n * yp1); p = t + 1.0; s += 2.0; /* update an, bn, anp1, and bnp1 */ t = alpha * an + beta * anp1; an = anp1; anp1 = t; t = alpha * bn + beta * bnp1; bn = bnp1; bnp1 = t; r0 = r; r = anp1 / bnp1; if (fabs(r - r0) <= eps * r) { break; } /* rescale an, bn, anp1, and bnp1 */ an /= bnp1; bn /= bnp1; anp1 = r; bnp1 = 1.0; } while (1); return (log_p ? brc + log(r) : brc * r); } /* bfrac */ static double brcomp(double a, double b, double x, double y, int log_p) { /* ----------------------------------------------------------------------- * Evaluation of x^a * y^b / Beta(a,b) * ----------------------------------------------------------------------- */ static double const__ = .398942280401433; /* == 1/sqrt(2*pi); */ /* R has M_1_SQRT_2PI , and M_LN_SQRT_2PI = ln(sqrt(2*pi)) = 0.918938.. */ int i, n; double c, e, u, v, z, a0, b0, apb; if (x == 0.0 || y == 0.0) { return R_D__0; } a0 = min(a, b); if (a0 < 8.0) { double lnx, lny; if (x <= .375) { lnx = log(x); lny = alnrel(-x); } else { if (y > .375) { lnx = log(x); lny = log(y); } else { lnx = alnrel(-y); lny = log(y); } } z = a * lnx + b * lny; if (a0 >= 1.) { z -= betaln(a, b); return R_D_exp(z); } /* ----------------------------------------------------------------------- */ /* PROCEDURE FOR a < 1 OR b < 1 */ /* ----------------------------------------------------------------------- */ b0 = max(a, b); if (b0 >= 8.0) { /* L80: */ u = gamln1(a0) + algdiv(a0, b0); return (log_p ? log(a0) + (z - u) : a0 * exp(z - u)); } /* else : */ if (b0 <= 1.0) { /* algorithm for max(a,b) = b0 <= 1 */ double e_z = R_D_exp(z); if (!log_p && e_z == 0.0) /* exp() underflow */ return 0.; apb = a + b; if (apb > 1.0) { u = a + b - 1.; z = (gam1(u) + 1.0) / apb; } else { z = gam1(apb) + 1.0; } c = (gam1(a) + 1.0) * (gam1(b) + 1.0) / z; /* FIXME? log(a0*c)= log(a0)+ log(c) and that is improvable */ return (log_p ? e_z + log(a0 * c) - log1p(a0/b0) : e_z * (a0 * c) / (a0 / b0 + 1.0)); } /* else : ALGORITHM FOR 1 < b0 < 8 */ u = gamln1(a0); n = (int)(b0 - 1.0); if (n >= 1) { c = 1.0; for (i = 1; i <= n; ++i) { b0 += -1.0; c *= b0 / (a0 + b0); } u = log(c) + u; } z -= u; b0 += -1.0; apb = a0 + b0; double t; if (apb > 1.0) { u = a0 + b0 - 1.; t = (gam1(u) + 1.0) / apb; } else { t = gam1(apb) + 1.0; } return (log_p ? log(a0) + z + log1p(gam1(b0)) - log(t) : a0 * exp(z) * (gam1(b0) + 1.0) / t); } else { /* ----------------------------------------------------------------------- */ /* PROCEDURE FOR A >= 8 AND B >= 8 */ /* ----------------------------------------------------------------------- */ double h, x0, y0, lambda; if (a <= b) { h = a / b; x0 = h / (h + 1.0); y0 = 1.0 / (h + 1.0); lambda = a - (a + b) * x; } else { h = b / a; x0 = 1.0 / (h + 1.0); y0 = h / (h + 1.0); lambda = (a + b) * y - b; } e = -lambda / a; if (fabs(e) > .6) u = e - log(x / x0); else u = rlog1(e); e = lambda / b; if (fabs(e) <= .6) v = rlog1(e); else v = e - log(y / y0); z = log_p ? -(a * u + b * v) : exp(-(a * u + b * v)); return(log_p ? -M_LN_SQRT_2PI + .5*log(b * x0) + z - bcorr(a,b) : const__ * sqrt(b * x0) * z * exp(-bcorr(a, b))); } } /* brcomp */ // called only once from bup(), as r = brcmp1(mu, a, b, x, y, FALSE) / a; // ----- static double brcmp1(int mu, double a, double b, double x, double y, int give_log) { /* ----------------------------------------------------------------------- * Evaluation of exp(mu) * x^a * y^b / beta(a,b) * ----------------------------------------------------------------------- */ static double const__ = .398942280401433; /* == 1/sqrt(2*pi); */ /* R has M_1_SQRT_2PI */ /* Local variables */ double c, t, u, v, z, a0, b0, apb; a0 = min(a,b); if (a0 < 8.0) { double lnx, lny; if (x <= .375) { lnx = log(x); lny = alnrel(-x); } else if (y > .375) { // L11: lnx = log(x); lny = log(y); } else { lnx = alnrel(-y); lny = log(y); } // L20: z = a * lnx + b * lny; if (a0 >= 1.0) { z -= betaln(a, b); return esum(mu, z, give_log); } // else : /* ----------------------------------------------------------------------- */ /* PROCEDURE FOR A < 1 OR B < 1 */ /* ----------------------------------------------------------------------- */ // L30: b0 = max(a,b); if (b0 >= 8.0) { /* L80: ALGORITHM FOR b0 >= 8 */ u = gamln1(a0) + algdiv(a0, b0); R_ifDEBUG_printf(" brcmp1(mu,a,b,*): a0 < 1, b0 >= 8; z=%.15g\n", z); return give_log ? log(a0) + esum(mu, z - u, TRUE) : a0 * esum(mu, z - u, FALSE); } else if (b0 <= 1.0) { // a0 < 1, b0 <= 1 double ans = esum(mu, z, give_log); if (ans == (give_log ? ML_NEGINF : 0.)) return ans; apb = a + b; if (apb > 1.0) { // L40: u = a + b - 1.; z = (gam1(u) + 1.0) / apb; } else { z = gam1(apb) + 1.0; } // L50: c = give_log ? log1p(gam1(a)) + log1p(gam1(b)) - log(z) : (gam1(a) + 1.0) * (gam1(b) + 1.0) / z; R_ifDEBUG_printf(" brcmp1(mu,a,b,*): a0 < 1, b0 <= 1; c=%.15g\n", c); return give_log ? ans + log(a0) + c - log1p(a0 / b0) : ans * (a0 * c) / (a0 / b0 + 1.0); } // else: algorithm for a0 < 1 < b0 < 8 // L60: u = gamln1(a0); int n = (int)(b0 - 1.0); if (n >= 1) { c = 1.0; for (int i = 1; i <= n; ++i) { b0 += -1.0; c *= b0 / (a0 + b0); /* L61: */ } u += log(c); // TODO?: log(c) = log( prod(...) ) = sum( log(...) ) } // L70: z -= u; b0 += -1.0; apb = a0 + b0; if (apb > 1.) { // L71: t = (gam1(apb - 1.) + 1.0) / apb; } else { t = gam1(apb) + 1.0; } R_ifDEBUG_printf(" brcmp1(mu,a,b,*): a0 < 1 < b0 < 8; t=%.15g\n", t); // L72: return give_log ? log(a0)+ esum(mu, z, TRUE) + log1p(gam1(b0)) - log(t) // TODO? log(t) = log1p(..) : a0 * esum(mu, z, FALSE) * (gam1(b0) + 1.0) / t; } else { /* ----------------------------------------------------------------------- */ /* PROCEDURE FOR A >= 8 AND B >= 8 */ /* ----------------------------------------------------------------------- */ // L100: double h, x0, y0, lambda; if (a > b) { // L101: h = b / a; x0 = 1.0 / (h + 1.0);// => lx0 := log(x0) = 0 - log1p(h) y0 = h / (h + 1.0); lambda = (a + b) * y - b; } else { h = a / b; x0 = h / (h + 1.0); // => lx0 := log(x0) = - log1p(1/h) y0 = 1.0 / (h + 1.0); lambda = a - (a + b) * x; } double lx0 = -log1p(b/a); // in both cases R_ifDEBUG_printf(" brcmp1(mu,a,b,*): a,b >= 8; x0=%.15g, lx0=log(x0)=%.15g\n", x0, lx0); // L110: double e = -lambda / a; if (fabs(e) > 0.6) { // L111: u = e - log(x / x0); } else { u = rlog1(e); } // L120: e = lambda / b; if (fabs(e) > 0.6) { // L121: v = e - log(y / y0); } else { v = rlog1(e); } // L130: z = esum(mu, -(a * u + b * v), give_log); return give_log ? log(const__)+ (log(b) + lx0)/2. + z - bcorr(a, b) : const__ * sqrt(b * x0) * z * exp(-bcorr(a, b)); } } /* brcmp1 */ static void bgrat(double a, double b, double x, double y, double *w, double eps, int *ierr, Rboolean log_w) { /* ----------------------------------------------------------------------- * Asymptotic Expansion for I_x(a,b) when a is larger than b. * Compute w := w + I_x(a,b) * It is assumed a >= 15 and b <= 1. * eps is the tolerance used. * ierr is a variable that reports the status of the results. * * if(log_w), *w itself must be in log-space; * compute w := w + I_x(a,b) but return *w = log(w): * *w := log(exp(*w) + I_x(a,b)) = logspace_add(*w, log( I_x(a,b) )) * ----------------------------------------------------------------------- */ #define n_terms_bgrat 30 double c[n_terms_bgrat], d[n_terms_bgrat]; double bm1 = b - 0.5 - 0.5, nu = a + bm1 * 0.5, /* nu = a + (b-1)/2 =: T, in (9.1) of * Didonato & Morris(1992), p.362 */ lnx = (y > 0.375) ? log(x) : alnrel(-y), z = -nu * lnx; // z =: u in (9.1) of D.&M.(1992) if (b * z == 0.0) { // should not happen, but does, e.g., // for pbeta(1e-320, 1e-5, 0.5) i.e., _subnormal_ x, // Warning ... bgrat(a=20.5, b=1e-05, x=1, y=9.99989e-321): .. MATHLIB_WARNING4( "bgrat(a=%g, b=%g, x=%g, y=%g): b*z == 0 underflow, hence inaccurate pbeta()", a,b,x,y); /* L_Error: THE EXPANSION CANNOT BE COMPUTED */ *ierr = 1; return; } /* COMPUTATION OF THE EXPANSION */ double /* r1 = b * (gam1(b) + 1.0) * exp(b * log(z)),// = b/gamma(b+1) z^b = z^b / gamma(b) * set r := exp(-z) * z^b / gamma(b) ; * gam1(b) = 1/gamma(b+1) - 1 , b in [-1/2, 3/2] */ // exp(a*lnx) underflows for large (a * lnx); e.g. large a ==> using log_r := log(r): // r = r1 * exp(a * lnx) * exp(bm1 * 0.5 * lnx); // log(r)=log(b) + log1p(gam1(b)) + b * log(z) + (a * lnx) + (bm1 * 0.5 * lnx), log_r = log(b) + log1p(gam1(b)) + b * log(z) + nu * lnx, // FIXME work with log_u = log(u) also when log_p=FALSE (??) // u is 'factored out' from the expansion {and multiplied back, at the end}: log_u = log_r - (algdiv(b, a) + b * log(nu)),// algdiv(b,a) = log(gamma(a)/gamma(a+b)) /* u = (log_p) ? log_r - u : exp(log_r-u); // =: M in (9.2) of {reference above} */ /* u = algdiv(b, a) + b * log(nu);// algdiv(b,a) = log(gamma(a)/gamma(a+b)) */ // u = (log_p) ? log_u : exp(log_u); // =: M in (9.2) of {reference above} u = exp(log_u); if (log_u == ML_NEGINF) { R_ifDEBUG_printf(" bgrat(*): underflow log_u = -Inf = log_r -u', log_r = %g ", log_r); /* L_Error: THE EXPANSION CANNOT BE COMPUTED */ *ierr = 2; return; } Rboolean u_0 = (u == 0.); // underflow --> do work with log(u) == log_u ! double l = // := *w/u .. but with care: such that it also works when u underflows to 0: log_w ? ((*w == ML_NEGINF) ? 0. : exp( *w - log_u)) : ((*w == 0.) ? 0. : exp(log(*w) - log_u)); R_ifDEBUG_printf(" bgrat(a=%g, b=%g, x=%g, *)\n -> u=%g, l='w/u'=%g, ", a,b,x, u, l); double q_r = grat_r(b, z, log_r, eps), // = q/r of former grat1(b,z, r, &p, &q) v = 0.25 / (nu * nu), t2 = lnx * 0.25 * lnx, j = q_r, sum = j, t = 1.0, cn = 1.0, n2 = 0.; for (int n = 1; n <= n_terms_bgrat; ++n) { double bp2n = b + n2; j = (bp2n * (bp2n + 1.0) * j + (z + bp2n + 1.0) * t) * v; n2 += 2.; t *= t2; cn /= n2 * (n2 + 1.); int nm1 = n - 1; c[nm1] = cn; double s = 0.0; if (n > 1) { double coef = b - n; for (int i = 1; i <= nm1; ++i) { s += coef * c[i - 1] * d[nm1 - i]; coef += b; } } d[nm1] = bm1 * cn + s / n; double dj = d[nm1] * j; sum += dj; if (sum <= 0.0) { R_ifDEBUG_printf(" bgrat(*): sum_n(..) <= 0; should not happen (n=%d)\n", n); /* L_Error: THE EXPANSION CANNOT BE COMPUTED */ *ierr = 3; return; } if (fabs(dj) <= eps * (sum + l)) { break; } else if(n == n_terms_bgrat) // never? ; please notify R-core if seen: MATHLIB_WARNING5( "bgrat(a=%g, b=%g, x=%g,..): did *not* converge; dj=%g, rel.err=%g\n", a,b,x, dj, fabs(dj) /(sum + l)); } /* ADD THE RESULTS TO W */ *ierr = 0; if(log_w) // *w is in log space already: *w = logspace_add(*w, log_u + log(sum)); else *w += (u_0 ? exp(log_u + log(sum)) : u * sum); return; } /* bgrat */ // called only from bgrat() , as q_r = grat_r(b, z, log_r, eps) : static double grat_r(double a, double x, double log_r, double eps) { /* ----------------------------------------------------------------------- * Scaled complement of incomplete gamma ratio function * grat_r(a,x,r) := Q(a,x) / r * where * Q(a,x) = pgamma(x,a, lower.tail=FALSE) * and r = e^(-x)* x^a / Gamma(a) == exp(log_r) * * It is assumed that a <= 1. eps is the tolerance to be used. * ----------------------------------------------------------------------- */ if (a * x == 0.0) { /* L130: */ if (x <= a) { /* L100: */ return exp(-log_r); } else { /* L110:*/ return 0.; } } else if (a == 0.5) { // e.g. when called from pt() /* L120: */ if (x < 0.25) { double p = erf__(sqrt(x)); R_ifDEBUG_printf(" grat_r(a=%g, x=%g ..)): a=1/2 --> p=erf__(.)= %g\n", a, x, p); return (0.5 - p + 0.5)*exp(-log_r); } else { // 2013-02-27: improvement for "large" x: direct computation of q/r: double sx = sqrt(x), q_r = erfc1(1, sx)/sx * M_SQRT_PI; R_ifDEBUG_printf(" grat_r(a=%g, x=%g ..)): a=1/2 --> q_r=erfc1(..)/r= %g\n", a,x, q_r); return q_r; } } else if (x < 1.1) { /* L10: Taylor series for P(a,x)/x^a */ double an = 3., c = x, sum = x / (a + 3.0), tol = eps * 0.1 / (a + 1.0), t; do { an += 1.; c *= -(x / an); t = c / (a + an); sum += t; } while (fabs(t) > tol); R_ifDEBUG_printf(" grat_r(a=%g, x=%g, log_r=%g): sum=%g; Taylor w/ %.0f terms", a,x,log_r, sum, an-3.); double j = a * x * ((sum/6. - 0.5/(a + 2.)) * x + 1./(a + 1.)), z = a * log(x), h = gam1(a), g = h + 1.0; if ((x >= 0.25 && (a < x / 2.59)) || (z > -0.13394)) { // L40: double l = rexpm1(z), q = ((l + 0.5 + 0.5) * j - l) * g - h; if (q <= 0.0) { R_ifDEBUG_printf(" => q_r= 0.\n"); /* L110:*/ return 0.; } else { R_ifDEBUG_printf(" => q_r=%.15g\n", q * exp(-log_r)); return q * exp(-log_r); } } else { double p = exp(z) * g * (0.5 - j + 0.5); R_ifDEBUG_printf(" => q_r=%.15g\n", (0.5 - p + 0.5) * exp(-log_r)); return /* q/r = */ (0.5 - p + 0.5) * exp(-log_r); } } else { /* L50: ---- (x >= 1.1) ---- Continued Fraction Expansion */ double a2n_1 = 1.0, a2n = 1.0, b2n_1 = x, b2n = x + (1.0 - a), c = 1., am0, an0; do { a2n_1 = x * a2n + c * a2n_1; b2n_1 = x * b2n + c * b2n_1; am0 = a2n_1 / b2n_1; c += 1.; double c_a = c - a; a2n = a2n_1 + c_a * a2n; b2n = b2n_1 + c_a * b2n; an0 = a2n / b2n; } while (fabs(an0 - am0) >= eps * an0); R_ifDEBUG_printf(" grat_r(a=%g, x=%g, log_r=%g): Cont.frac. %.0f terms => q_r=%.15g\n", a,x, log_r, c-1., an0); return /* q/r = (r * an0)/r = */ an0; } } /* grat_r */ static double basym(double a, double b, double lambda, double eps, int log_p) { /* ----------------------------------------------------------------------- */ /* ASYMPTOTIC EXPANSION FOR I_x(A,B) FOR LARGE A AND B. */ /* LAMBDA = (A + B)*Y - B AND EPS IS THE TOLERANCE USED. */ /* IT IS ASSUMED THAT LAMBDA IS NONNEGATIVE AND THAT */ /* A AND B ARE GREATER THAN OR EQUAL TO 15. */ /* ----------------------------------------------------------------------- */ /* ------------------------ */ /* ****** NUM IS THE MAXIMUM VALUE THAT N CAN TAKE IN THE DO LOOP */ /* ENDING AT STATEMENT 50. IT IS REQUIRED THAT NUM BE EVEN. */ #define num_IT 20 /* THE ARRAYS A0, B0, C, D HAVE DIMENSION NUM + 1. */ static double const e0 = 1.12837916709551;/* e0 == 2/sqrt(pi) */ static double const e1 = .353553390593274;/* e1 == 2^(-3/2) */ static double const ln_e0 = 0.120782237635245; /* == ln(e0) */ double a0[num_IT + 1], b0[num_IT + 1], c[num_IT + 1], d[num_IT + 1]; double f = a * rlog1(-lambda/a) + b * rlog1(lambda/b), t; if(log_p) t = -f; else { t = exp(-f); if (t == 0.0) { return 0; /* once underflow, always underflow .. */ } } double z0 = sqrt(f), z = z0 / e1 * 0.5, z2 = f + f, h, r0, r1, w0; if (a < b) { h = a / b; r0 = 1.0 / (h + 1.0); r1 = (b - a) / b; w0 = 1.0 / sqrt(a * (h + 1.0)); } else { h = b / a; r0 = 1.0 / (h + 1.0); r1 = (b - a) / a; w0 = 1.0 / sqrt(b * (h + 1.0)); } a0[0] = r1 * .66666666666666663; c[0] = a0[0] * -0.5; d[0] = -c[0]; double j0 = 0.5 / e0 * erfc1(1, z0), j1 = e1, sum = j0 + d[0] * w0 * j1; double s = 1.0, h2 = h * h, hn = 1.0, w = w0, znm1 = z, zn = z2; for (int n = 2; n <= num_IT; n += 2) { hn *= h2; a0[n - 1] = r0 * 2.0 * (h * hn + 1.0) / (n + 2.0); int np1 = n + 1; s += hn; a0[np1 - 1] = r1 * 2.0 * s / (n + 3.0); for (int i = n; i <= np1; ++i) { double r = (i + 1.0) * -0.5; b0[0] = r * a0[0]; for (int m = 2; m <= i; ++m) { double bsum = 0.0; for (int j = 1; j <= m-1; ++j) { int mmj = m - j; bsum += (j * r - mmj) * a0[j - 1] * b0[mmj - 1]; } b0[m - 1] = r * a0[m - 1] + bsum / m; } c[i - 1] = b0[i - 1] / (i + 1.0); double dsum = 0.0; for (int j = 1; j <= i-1; ++j) { dsum += d[i - j - 1] * c[j - 1]; } d[i - 1] = -(dsum + c[i - 1]); } j0 = e1 * znm1 + (n - 1.0) * j0; j1 = e1 * zn + n * j1; znm1 = z2 * znm1; zn = z2 * zn; w *= w0; double t0 = d[n - 1] * w * j0; w *= w0; double t1 = d[np1 - 1] * w * j1; sum += t0 + t1; if (fabs(t0) + fabs(t1) <= eps * sum) { break; } } if(log_p) return ln_e0 + t - bcorr(a, b) + log(sum); else { double u = exp(-bcorr(a, b)); return e0 * t * u * sum; } } /* basym_ */ static double exparg(int l) { /* -------------------------------------------------------------------- */ /* IF L = 0 THEN EXPARG(L) = THE LARGEST POSITIVE W FOR WHICH * EXP(W) CAN BE COMPUTED. ==> exparg(0) = 709.7827 nowadays. */ /* IF L IS NONZERO THEN EXPARG(L) = THE LARGEST NEGATIVE W FOR * WHICH THE COMPUTED VALUE OF EXP(W) IS NONZERO. * ==> exparg(1) = -708.3964 nowadays. */ /* Note... only an approximate value for exparg(L) is needed. */ /* -------------------------------------------------------------------- */ static double const lnb = .69314718055995; int m = (l == 0) ? jags_i1mach(16) : jags_i1mach(15) - 1; return m * lnb * .99999; } /* exparg */ static double esum(int mu, double x, int give_log) { /* ----------------------------------------------------------------------- */ /* EVALUATION OF EXP(MU + X) */ /* ----------------------------------------------------------------------- */ if(give_log) return x + (double) mu; // else : double w; if (x > 0.0) { /* L10: */ if (mu > 0) return exp((double) mu) * exp(x); w = mu + x; if (w < 0.0) return exp((double) mu) * exp(x); } else { /* x <= 0 */ if (mu < 0) return exp((double) mu) * exp(x); w = mu + x; if (w > 0.0) return exp((double) mu) * exp(x); } return exp(w); } /* esum */ double rexpm1(double x) { /* ----------------------------------------------------------------------- */ /* EVALUATION OF THE FUNCTION EXP(X) - 1 */ /* ----------------------------------------------------------------------- */ static double p1 = 9.14041914819518e-10; static double p2 = .0238082361044469; static double q1 = -.499999999085958; static double q2 = .107141568980644; static double q3 = -.0119041179760821; static double q4 = 5.95130811860248e-4; if (fabs(x) <= 0.15) { return x * (((p2 * x + p1) * x + 1.0) / ((((q4 * x + q3) * x + q2) * x + q1) * x + 1.0)); } else { /* |x| > 0.15 : */ double w = exp(x); if (x > 0.0) return w * (0.5 - 1.0 / w + 0.5); else return w - 0.5 - 0.5; } } /* rexpm1 */ static double alnrel(double a) { /* ----------------------------------------------------------------------- * Evaluation of the function ln(1 + a) * ----------------------------------------------------------------------- */ if (fabs(a) > 0.375) return log(1. + a); // else : |a| <= 0.375 static double p1 = -1.29418923021993, p2 = .405303492862024, p3 = -.0178874546012214, q1 = -1.62752256355323, q2 = .747811014037616, q3 = -.0845104217945565; double t = a / (a + 2.0), t2 = t * t, w = (((p3 * t2 + p2) * t2 + p1) * t2 + 1.) / (((q3 * t2 + q2) * t2 + q1) * t2 + 1.); return t * 2.0 * w; } /* alnrel */ static double rlog1(double x) { /* ----------------------------------------------------------------------- * Evaluation of the function x - ln(1 + x) * ----------------------------------------------------------------------- */ static double a = .0566749439387324; static double b = .0456512608815524; static double p0 = .333333333333333; static double p1 = -.224696413112536; static double p2 = .00620886815375787; static double q1 = -1.27408923933623; static double q2 = .354508718369557; double h, r, t, w, w1; if (x < -0.39 || x > 0.57) { /* direct evaluation */ w = x + 0.5 + 0.5; return x - log(w); } /* else */ if (x < -0.18) { /* L10: */ h = x + .3; h /= .7; w1 = a - h * .3; } else if (x > 0.18) { /* L20: */ h = x * .75 - .25; w1 = b + h / 3.0; } else { /* Argument Reduction */ h = x; w1 = 0.0; } /* L30: Series Expansion */ r = h / (h + 2.0); t = r * r; w = ((p2 * t + p1) * t + p0) / ((q2 * t + q1) * t + 1.0); return t * 2.0 * (1.0 / (1.0 - r) - r * w) + w1; } /* rlog1 */ static double erf__(double x) { /* ----------------------------------------------------------------------- * EVALUATION OF THE REAL ERROR FUNCTION * ----------------------------------------------------------------------- */ /* Initialized data */ static double c = .564189583547756; static double a[5] = { 7.7105849500132e-5,-.00133733772997339, .0323076579225834,.0479137145607681,.128379167095513 }; static double b[3] = { .00301048631703895,.0538971687740286, .375795757275549 }; static double p[8] = { -1.36864857382717e-7,.564195517478974, 7.21175825088309,43.1622272220567,152.98928504694, 339.320816734344,451.918953711873,300.459261020162 }; static double q[8] = { 1.,12.7827273196294,77.0001529352295, 277.585444743988,638.980264465631,931.35409485061, 790.950925327898,300.459260956983 }; static double r[5] = { 2.10144126479064,26.2370141675169, 21.3688200555087,4.6580782871847,.282094791773523 }; static double s[4] = { 94.153775055546,187.11481179959, 99.0191814623914,18.0124575948747 }; /* System generated locals */ double ret_val; /* Local variables */ double t, x2, ax, bot, top; ax = fabs(x); if (ax <= 0.5) { t = x * x; top = (((a[0] * t + a[1]) * t + a[2]) * t + a[3]) * t + a[4] + 1.0; bot = ((b[0] * t + b[1]) * t + b[2]) * t + 1.0; return x * (top / bot); } /* else: ax > 0.5 */ if (ax <= 4.) { /* ax in (0.5, 4] */ top = ((((((p[0] * ax + p[1]) * ax + p[2]) * ax + p[3]) * ax + p[4]) * ax + p[5]) * ax + p[6]) * ax + p[7]; bot = ((((((q[0] * ax + q[1]) * ax + q[2]) * ax + q[3]) * ax + q[4]) * ax + q[5]) * ax + q[6]) * ax + q[7]; ret_val = 0.5 - exp(-x * x) * top / bot + 0.5; if (x < 0.0) { ret_val = -ret_val; } return ret_val; } /* else: ax > 4 */ if (ax >= 5.8) { return x > 0 ? 1 : -1; } x2 = x * x; t = 1.0 / x2; top = (((r[0] * t + r[1]) * t + r[2]) * t + r[3]) * t + r[4]; bot = (((s[0] * t + s[1]) * t + s[2]) * t + s[3]) * t + 1.0; t = (c - top / (x2 * bot)) / ax; ret_val = 0.5 - exp(-x2) * t + 0.5; if (x < 0.0) { ret_val = -ret_val; } return ret_val; } /* erf */ static double erfc1(int ind, double x) { /* ----------------------------------------------------------------------- */ /* EVALUATION OF THE COMPLEMENTARY ERROR FUNCTION */ /* ERFC1(IND,X) = ERFC(X) IF IND = 0 */ /* ERFC1(IND,X) = EXP(X*X)*ERFC(X) OTHERWISE */ /* ----------------------------------------------------------------------- */ /* Initialized data */ static double c = .564189583547756; static double a[5] = { 7.7105849500132e-5,-.00133733772997339, .0323076579225834,.0479137145607681,.128379167095513 }; static double b[3] = { .00301048631703895,.0538971687740286, .375795757275549 }; static double p[8] = { -1.36864857382717e-7,.564195517478974, 7.21175825088309,43.1622272220567,152.98928504694, 339.320816734344,451.918953711873,300.459261020162 }; static double q[8] = { 1.,12.7827273196294,77.0001529352295, 277.585444743988,638.980264465631,931.35409485061, 790.950925327898,300.459260956983 }; static double r[5] = { 2.10144126479064,26.2370141675169, 21.3688200555087,4.6580782871847,.282094791773523 }; static double s[4] = { 94.153775055546,187.11481179959, 99.0191814623914,18.0124575948747 }; double ret_val; double e, t, w, bot, top; double ax = fabs(x); // |X| <= 0.5 */ if (ax <= 0.5) { double t = x * x, top = (((a[0] * t + a[1]) * t + a[2]) * t + a[3]) * t + a[4] + 1.0, bot = ((b[0] * t + b[1]) * t + b[2]) * t + 1.0; ret_val = 0.5 - x * (top / bot) + 0.5; if (ind != 0) { ret_val = exp(t) * ret_val; } return ret_val; } // else (L10:): 0.5 < |X| <= 4 if (ax <= 4.0) { top = ((((((p[0] * ax + p[1]) * ax + p[2]) * ax + p[3]) * ax + p[4]) * ax + p[5]) * ax + p[6]) * ax + p[7]; bot = ((((((q[0] * ax + q[1]) * ax + q[2]) * ax + q[3]) * ax + q[4]) * ax + q[5]) * ax + q[6]) * ax + q[7]; ret_val = top / bot; } else { // |X| > 4 // L20: if (x <= -5.6) { // L50: LIMIT VALUE FOR "LARGE" NEGATIVE X ret_val = 2.0; if (ind != 0) { ret_val = exp(x * x) * 2.0; } return ret_val; } if (ind == 0 && (x > 100.0 || x * x > -exparg(1))) { // LIMIT VALUE FOR LARGE POSITIVE X WHEN IND = 0 // L60: return 0.0; } // L30: t = 1. / (x * x); top = (((r[0] * t + r[1]) * t + r[2]) * t + r[3]) * t + r[4]; bot = (((s[0] * t + s[1]) * t + s[2]) * t + s[3]) * t + 1.0; ret_val = (c - t * top / bot) / ax; } // L40: FINAL ASSEMBLY if (ind != 0) { if (x < 0.0) ret_val = exp(x * x) * 2.0 - ret_val; } else { // L41: ind == 0 : w = x * x; t = w; e = w - t; ret_val = (0.5 - e + 0.5) * exp(-t) * ret_val; if (x < 0.0) ret_val = 2.0 - ret_val; } return ret_val; } /* erfc1 */ static double gam1(double a) { /* ------------------------------------------------------------------ */ /* COMPUTATION OF 1/GAMMA(A+1) - 1 FOR -0.5 <= A <= 1.5 */ /* ------------------------------------------------------------------ */ double d, t, w, bot, top; t = a; d = a - 0.5; // t := if(a > 1/2) a-1 else a if (d > 0.0) t = d - 0.5; if (t < 0.0) { /* L30: */ static double r[9] = { -.422784335098468,-.771330383816272, -.244757765222226,.118378989872749,9.30357293360349e-4, -.0118290993445146,.00223047661158249,2.66505979058923e-4, -1.32674909766242e-4 }, s1 = .273076135303957, s2 = .0559398236957378; top = (((((((r[8] * t + r[7]) * t + r[6]) * t + r[5]) * t + r[4] ) * t + r[3]) * t + r[2]) * t + r[1]) * t + r[0]; bot = (s2 * t + s1) * t + 1.0; w = top / bot; R_ifDEBUG_printf(" gam1(a = %.15g): t < 0: w=%.15g\n", a, w); if (d > 0.0) return t * w / a; else return a * (w + 0.5 + 0.5); } else if (t == 0) { // L10: a in {0, 1} return 0.; } else { /* t > 0; L20: */ static double p[7] = { .577215664901533,-.409078193005776, -.230975380857675,.0597275330452234,.0076696818164949, -.00514889771323592,5.89597428611429e-4 }, q[5] = { 1.,.427569613095214,.158451672430138, .0261132021441447,.00423244297896961 }; top = (((((p[6] * t + p[5]) * t + p[4]) * t + p[3]) * t + p[2] ) * t + p[1]) * t + p[0]; bot = (((q[4] * t + q[3]) * t + q[2]) * t + q[1]) * t + 1.0; w = top / bot; R_ifDEBUG_printf(" gam1(a = %.15g): t > 0: (is a < 1.5 ?) w=%.15g\n", a, w); if (d > 0.0) /* L21: */ return t / a * (w - 0.5 - 0.5); else return a * w; } } /* gam1 */ static double gamln1(double a) { /* ----------------------------------------------------------------------- */ /* EVALUATION OF LN(GAMMA(1 + A)) FOR -0.2 <= A <= 1.25 */ /* ----------------------------------------------------------------------- */ double w; if (a < 0.6) { static double p0 = .577215664901533; static double p1 = .844203922187225; static double p2 = -.168860593646662; static double p3 = -.780427615533591; static double p4 = -.402055799310489; static double p5 = -.0673562214325671; static double p6 = -.00271935708322958; static double q1 = 2.88743195473681; static double q2 = 3.12755088914843; static double q3 = 1.56875193295039; static double q4 = .361951990101499; static double q5 = .0325038868253937; static double q6 = 6.67465618796164e-4; w = ((((((p6 * a + p5)* a + p4)* a + p3)* a + p2)* a + p1)* a + p0) / ((((((q6 * a + q5)* a + q4)* a + q3)* a + q2)* a + q1)* a + 1.); return -(a) * w; } else { /* 0.6 <= a <= 1.25 */ static double r0 = .422784335098467; static double r1 = .848044614534529; static double r2 = .565221050691933; static double r3 = .156513060486551; static double r4 = .017050248402265; static double r5 = 4.97958207639485e-4; static double s1 = 1.24313399877507; static double s2 = .548042109832463; static double s3 = .10155218743983; static double s4 = .00713309612391; static double s5 = 1.16165475989616e-4; double x = a - 0.5 - 0.5; w = (((((r5 * x + r4) * x + r3) * x + r2) * x + r1) * x + r0) / (((((s5 * x + s4) * x + s3) * x + s2) * x + s1) * x + 1.0); return x * w; } } /* gamln1 */ static double psi(double x) { /* --------------------------------------------------------------------- * Evaluation of the Digamma function psi(x) * ----------- * Psi(xx) is assigned the value 0 when the digamma function cannot * be computed. * The main computation involves evaluation of rational Chebyshev * approximations published in Math. Comp. 27, 123-127(1973) by * Cody, Strecok and Thacher. */ /* --------------------------------------------------------------------- */ /* Psi was written at Argonne National Laboratory for the FUNPACK */ /* package of special function subroutines. Psi was modified by */ /* A.H. Morris (NSWC). */ /* --------------------------------------------------------------------- */ static double piov4 = .785398163397448; /* == pi / 4 */ /* dx0 = zero of psi() to extended precision : */ static double dx0 = 1.461632144968362341262659542325721325; /* --------------------------------------------------------------------- */ /* COEFFICIENTS FOR RATIONAL APPROXIMATION OF */ /* PSI(X) / (X - X0), 0.5 <= X <= 3.0 */ static double p1[7] = { .0089538502298197,4.77762828042627, 142.441585084029,1186.45200713425,3633.51846806499, 4138.10161269013,1305.60269827897 }; static double q1[6] = { 44.8452573429826,520.752771467162, 2210.0079924783,3641.27349079381,1908.310765963, 6.91091682714533e-6 }; /* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */ /* COEFFICIENTS FOR RATIONAL APPROXIMATION OF */ /* PSI(X) - LN(X) + 1 / (2*X), X > 3.0 */ static double p2[4] = { -2.12940445131011,-7.01677227766759, -4.48616543918019,-.648157123766197 }; static double q2[4] = { 32.2703493791143,89.2920700481861, 54.6117738103215,7.77788548522962 }; /* --------------------------------------------------------------------- */ int i, m, n, nq; double d2; double w, z; double den, aug, sgn, xmx0, xmax1, upper, xsmall; /* --------------------------------------------------------------------- */ /* MACHINE DEPENDENT CONSTANTS ... */ /* --------------------------------------------------------------------- */ /* XMAX1 = THE SMALLEST POSITIVE FLOATING POINT CONSTANT WITH ENTIRELY INT REPRESENTATION. ALSO USED AS NEGATIVE OF LOWER BOUND ON ACCEPTABLE NEGATIVE ARGUMENTS AND AS THE POSITIVE ARGUMENT BEYOND WHICH PSI MAY BE REPRESENTED AS LOG(X). * Originally: xmax1 = amin1(ipmpar(3), 1./spmpar(1)) */ xmax1 = (double) INT_MAX; d2 = 0.5 / jags_d1mach(3); /*= 0.5 / (0.5 * DBL_EPS) = 1/DBL_EPSILON = 2^52 */ if(xmax1 > d2) xmax1 = d2; /* --------------------------------------------------------------------- */ /* XSMALL = ABSOLUTE ARGUMENT BELOW WHICH PI*COTAN(PI*X) */ /* MAY BE REPRESENTED BY 1/X. */ xsmall = 1e-9; /* --------------------------------------------------------------------- */ aug = 0.0; if (x < 0.5) { /* --------------------------------------------------------------------- */ /* X < 0.5, USE REFLECTION FORMULA */ /* PSI(1-X) = PSI(X) + PI * COTAN(PI*X) */ /* --------------------------------------------------------------------- */ if (fabs(x) <= xsmall) { if (x == 0.0) { goto L_err; } /* --------------------------------------------------------------------- */ /* 0 < |X| <= XSMALL. USE 1/X AS A SUBSTITUTE */ /* FOR PI*COTAN(PI*X) */ /* --------------------------------------------------------------------- */ aug = -1.0 / x; } else { /* |x| > xsmall */ /* --------------------------------------------------------------------- */ /* REDUCTION OF ARGUMENT FOR COTAN */ /* --------------------------------------------------------------------- */ /* L100: */ w = -x; sgn = piov4; if (w <= 0.0) { w = -w; sgn = -sgn; } /* --------------------------------------------------------------------- */ /* MAKE AN ERROR EXIT IF |X| >= XMAX1 */ /* --------------------------------------------------------------------- */ if (w >= xmax1) { goto L_err; } nq = (int) w; w -= (double) nq; nq = (int) (w * 4.0); w = (w - (double) nq * 0.25) * 4.0; /* --------------------------------------------------------------------- */ /* W IS NOW RELATED TO THE FRACTIONAL PART OF 4.0 * X. */ /* ADJUST ARGUMENT TO CORRESPOND TO VALUES IN FIRST */ /* QUADRANT AND DETERMINE SIGN */ /* --------------------------------------------------------------------- */ n = nq / 2; if (n + n != nq) { w = 1.0 - w; } z = piov4 * w; m = n / 2; if (m + m != n) { sgn = -sgn; } /* --------------------------------------------------------------------- */ /* DETERMINE FINAL VALUE FOR -PI*COTAN(PI*X) */ /* --------------------------------------------------------------------- */ n = (nq + 1) / 2; m = n / 2; m += m; if (m == n) { /* --------------------------------------------------------------------- */ /* CHECK FOR SINGULARITY */ /* --------------------------------------------------------------------- */ if (z == 0.0) { goto L_err; } /* --------------------------------------------------------------------- */ /* USE COS/SIN AS A SUBSTITUTE FOR COTAN, AND */ /* SIN/COS AS A SUBSTITUTE FOR TAN */ /* --------------------------------------------------------------------- */ aug = sgn * (cos(z) / sin(z) * 4.0); } else { /* L140: */ aug = sgn * (sin(z) / cos(z) * 4.0); } } x = 1.0 - x; } /* L200: */ if (x <= 3.0) { /* --------------------------------------------------------------------- */ /* 0.5 <= X <= 3.0 */ /* --------------------------------------------------------------------- */ den = x; upper = p1[0] * x; for (i = 1; i <= 5; ++i) { den = (den + q1[i - 1]) * x; upper = (upper + p1[i]) * x; } den = (upper + p1[6]) / (den + q1[5]); xmx0 = x - dx0; return den * xmx0 + aug; } /* --------------------------------------------------------------------- */ /* IF X >= XMAX1, PSI = LN(X) */ /* --------------------------------------------------------------------- */ if (x < xmax1) { /* --------------------------------------------------------------------- */ /* 3.0 < X < XMAX1 */ /* --------------------------------------------------------------------- */ w = 1.0 / (x * x); den = w; upper = p2[0] * w; for (i = 1; i <= 3; ++i) { den = (den + q2[i - 1]) * w; upper = (upper + p2[i]) * w; } aug = upper / (den + q2[3]) - 0.5 / x + aug; } return aug + log(x); /* --------------------------------------------------------------------- */ /* ERROR RETURN */ /* --------------------------------------------------------------------- */ L_err: return 0.; } /* psi */ static double betaln(double a0, double b0) { /* ----------------------------------------------------------------------- * Evaluation of the logarithm of the beta function ln(beta(a0,b0)) * ----------------------------------------------------------------------- */ static double e = .918938533204673;/* e == 0.5*LN(2*PI) */ double a = min(a0 ,b0), b = max(a0, b0); if (a < 8.0) { if (a < 1.0) { /* ----------------------------------------------------------------------- */ // A < 1 /* ----------------------------------------------------------------------- */ if (b < 8.0) return gamln(a) + (gamln(b) - gamln(a+b)); else return gamln(a) + algdiv(a, b); } /* else */ /* ----------------------------------------------------------------------- */ // 1 <= A < 8 /* ----------------------------------------------------------------------- */ double w; if (a < 2.0) { if (b <= 2.0) { return gamln(a) + gamln(b) - gsumln(a, b); } /* else */ w = 0.0; if (b < 8.0) { goto L40; } return gamln(a) + algdiv(a, b); } // else L30: REDUCTION OF A WHEN B <= 1000 if (b <= 1e3) { int n = (int)(a - 1.0); w = 1.0; for (int i = 1; i <= n; ++i) { a += -1.0; double h = a / b; w *= h / (h + 1.0); } w = log(w); if (b >= 8.0) return w + gamln(a) + algdiv(a, b); // else L40: // reduction of B when B < 8 n = (int)(b - 1.0); double z = 1.0; for (int i = 1; i <= n; ++i) { b += -1.0; z *= b / (a + b); } return w + log(z) + (gamln(a) + (gamln(b) - gsumln(a, b))); } else { // L50: reduction of A when B > 1000 int n = (int)(a - 1.0); w = 1.0; for (int i = 1; i <= n; ++i) { a += -1.0; w *= a / (a / b + 1.0); } return log(w) - n * log(b) + (gamln(a) + algdiv(a, b)); } } else { /* ----------------------------------------------------------------------- */ // L60: A >= 8 /* ----------------------------------------------------------------------- */ double w = bcorr(a, b), h = a / b, u = -(a - 0.5) * log(h / (h + 1.0)), v = b * alnrel(h); if (u > v) return log(b) * -0.5 + e + w - v - u; else return log(b) * -0.5 + e + w - u - v; } } /* betaln */ static double gsumln(double a, double b) { /* ----------------------------------------------------------------------- */ /* EVALUATION OF THE FUNCTION LN(GAMMA(A + B)) */ /* FOR 1 <= A <= 2 AND 1 <= B <= 2 */ /* ----------------------------------------------------------------------- */ double x = a + b - 2.;/* in [0, 2] */ if (x <= 0.25) return gamln1(x + 1.0); /* else */ if (x <= 1.25) return gamln1(x) + alnrel(x); /* else x > 1.25 : */ return gamln1(x - 1.0) + log(x * (x + 1.0)); } /* gsumln */ static double bcorr(double a0, double b0) { /* ----------------------------------------------------------------------- */ /* EVALUATION OF DEL(A0) + DEL(B0) - DEL(A0 + B0) WHERE */ /* LN(GAMMA(A)) = (A - 0.5)*LN(A) - A + 0.5*LN(2*PI) + DEL(A). */ /* IT IS ASSUMED THAT A0 >= 8 AND B0 >= 8. */ /* ----------------------------------------------------------------------- */ /* Initialized data */ static double c0 = .0833333333333333; static double c1 = -.00277777777760991; static double c2 = 7.9365066682539e-4; static double c3 = -5.9520293135187e-4; static double c4 = 8.37308034031215e-4; static double c5 = -.00165322962780713; /* System generated locals */ double ret_val, r1; /* Local variables */ double a, b, c, h, t, w, x, s3, s5, x2, s7, s9, s11; /* ------------------------ */ a = min(a0, b0); b = max(a0, b0); h = a / b; c = h / (h + 1.0); x = 1.0 / (h + 1.0); x2 = x * x; /* SET SN = (1 - X^N)/(1 - X) */ s3 = x + x2 + 1.0; s5 = x + x2 * s3 + 1.0; s7 = x + x2 * s5 + 1.0; s9 = x + x2 * s7 + 1.0; s11 = x + x2 * s9 + 1.0; /* SET W = DEL(B) - DEL(A + B) */ /* Computing 2nd power */ r1 = 1.0 / b; t = r1 * r1; w = ((((c5 * s11 * t + c4 * s9) * t + c3 * s7) * t + c2 * s5) * t + c1 * s3) * t + c0; w *= c / b; /* COMPUTE DEL(A) + W */ /* Computing 2nd power */ r1 = 1.0 / a; t = r1 * r1; ret_val = (((((c5 * t + c4) * t + c3) * t + c2) * t + c1) * t + c0) / a + w; return ret_val; } /* bcorr */ static double algdiv(double a, double b) { /* ----------------------------------------------------------------------- */ /* COMPUTATION OF LN(GAMMA(B)/GAMMA(A+B)) WHEN B >= 8 */ /* -------- */ /* IN THIS ALGORITHM, DEL(X) IS THE FUNCTION DEFINED BY */ /* LN(GAMMA(X)) = (X - 0.5)*LN(X) - X + 0.5*LN(2*PI) + DEL(X). */ /* ----------------------------------------------------------------------- */ /* Initialized data */ static double c0 = .0833333333333333; static double c1 = -.00277777777760991; static double c2 = 7.9365066682539e-4; static double c3 = -5.9520293135187e-4; static double c4 = 8.37308034031215e-4; static double c5 = -.00165322962780713; double c, d, h, t, u, v, w, x, s3, s5, x2, s7, s9, s11; /* ------------------------ */ if (a > b) { h = b / a; c = 1.0 / (h + 1.0); x = h / (h + 1.0); d = a + (b - 0.5); } else { h = a / b; c = h / (h + 1.0); x = 1.0 / (h + 1.0); d = b + (a - 0.5); } /* Set s = (1 - x^n)/(1 - x) : */ x2 = x * x; s3 = x + x2 + 1.0; s5 = x + x2 * s3 + 1.0; s7 = x + x2 * s5 + 1.0; s9 = x + x2 * s7 + 1.0; s11 = x + x2 * s9 + 1.0; /* w := Del(b) - Del(a + b) */ t = 1./ (b * b); w = ((((c5 * s11 * t + c4 * s9) * t + c3 * s7) * t + c2 * s5) * t + c1 * s3) * t + c0; w *= c / b; /* COMBINE THE RESULTS */ u = d * alnrel(a / b); v = a * (log(b) - 1.0); if (u > v) return w - v - u; else return w - u - v; } /* algdiv */ static double gamln(double a) { /* ----------------------------------------------------------------------- * Evaluation of ln(gamma(a)) for positive a * ----------------------------------------------------------------------- */ /* Written by Alfred H. Morris */ /* Naval Surface Warfare Center */ /* Dahlgren, Virginia */ /* ----------------------------------------------------------------------- */ static double d = .418938533204673;/* d == 0.5*(LN(2*PI) - 1) */ static double c0 = .0833333333333333; static double c1 = -.00277777777760991; static double c2 = 7.9365066682539e-4; static double c3 = -5.9520293135187e-4; static double c4 = 8.37308034031215e-4; static double c5 = -.00165322962780713; if (a <= 0.8) return gamln1(a) - log(a); /* ln(G(a+1)) - ln(a) == ln(G(a+1)/a) = ln(G(a)) */ else if (a <= 2.25) return gamln1(a - 0.5 - 0.5); else if (a < 10.0) { int i, n = (int)(a - 1.25); double t = a; double w = 1.0; for (i = 1; i <= n; ++i) { t += -1.0; w *= t; } return gamln1(t - 1.) + log(w); } else { /* a >= 10 */ double t = 1. / (a * a); double w = (((((c5 * t + c4) * t + c3) * t + c2) * t + c1) * t + c0) / a; return d + w + (a - 0.5) * (log(a) - 1.0); } } /* gamln */ JAGS-4.3.2/src/jrmath/mlutils.c0000664000175000017500000000526714224052371013112 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998-2006 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #ifdef HAVE_CONFIG_H # include # undef fprintf #endif #include "nmath.h" #ifdef MATHLIB_STANDALONE /* * based on code in ../main/arithmetic.c * used only in standalone Rmath lib. */ int JR_finite(double x) { #ifdef HAVE_WORKING_ISFINITE return isfinite(x); # else return (!isnan(x) & (x != ML_POSINF) & (x != ML_NEGINF)); #endif } /* C++ math header undefines any isnan macro. This file doesn't get C++ headers and so is safe. */ int JR_isnancpp(double x) { return (isnan(x) != 0); } static double myfmod(double x1, double x2) { double q = x1 / x2; return x1 - floor(q) * x2; } double JR_pow(double x, double y) /* = x ^ y */ { if(x == 1. || y == 0.) return(1.); if(x == 0.) { if(y > 0.) return(0.); /* y < 0 */return(ML_POSINF); } if (R_FINITE(x) && R_FINITE(y)) return(pow(x,y)); if (ISNAN(x) || ISNAN(y)) { #ifdef IEEE_754 return(x + y); #else return(ML_NAN); #endif } if(!R_FINITE(x)) { if(x > 0) /* Inf ^ y */ return((y < 0.)? 0. : ML_POSINF); else { /* (-Inf) ^ y */ if(R_FINITE(y) && y == floor(y)) /* (-Inf) ^ n */ return((y < 0.) ? 0. : (myfmod(y,2.) ? x : -x)); } } if(!R_FINITE(y)) { if(x >= 0) { if(y > 0) /* y == +Inf */ return((x >= 1)? ML_POSINF : 0.); else /* y == -Inf */ return((x < 1) ? ML_POSINF : 0.); } } return(ML_NAN); /* all other cases: (-Inf)^{+-Inf, non-int}; (neg)^{+-Inf} */ } double JR_pow_di(double x, int n) { double pow = 1.0; if (ISNAN(x)) return x; if (n != 0) { if (!R_FINITE(x)) return JR_pow(x, (double)n); if (n < 0) { n = -n; x = 1/x; } for(;;) { if(n & 01) pow *= x; if(n >>= 1) x *= x; else break; } } return pow; } #include #include void attribute_hidden JREprintf(const char *format, ...) { va_list(ap); va_start(ap, format); fprintf(stderr, format, ap); va_end(ap); } #endif /* MATHLIB_STANDALONE */ JAGS-4.3.2/src/jrmath/stirlerr.c0000664000175000017500000000714714224052371013266 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000. * * Merge in to R: * Copyright (C) 2000, The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * * Computes the log of the error term in Stirling's formula. * For n > 15, uses the series 1/12n - 1/360n^3 + ... * For n <=15, integers or half-integers, uses stored values. * For other n < 15, uses lgamma directly (don't use this to * write lgamma!) * * Merge in to R: * Copyright (C) 2000, The R Core Team * R has lgammafn, and lgamma is not part of ISO C */ #include "nmath.h" /* stirlerr(n) = log(n!) - log( sqrt(2*pi*n)*(n/e)^n ) * = log Gamma(n+1) - 1/2 * [log(2*pi) + log(n)] - n*[log(n) - 1] * = log Gamma(n+1) - (n + 1/2) * log(n) + n - log(2*pi)/2 * * see also lgammacor() in ./lgammacor.c which computes almost the same! */ double attribute_hidden stirlerr(double n) { #define S0 0.083333333333333333333 /* 1/12 */ #define S1 0.00277777777777777777778 /* 1/360 */ #define S2 0.00079365079365079365079365 /* 1/1260 */ #define S3 0.000595238095238095238095238 /* 1/1680 */ #define S4 0.0008417508417508417508417508/* 1/1188 */ /* error for 0, 0.5, 1.0, 1.5, ..., 14.5, 15.0. */ const static double sferr_halves[31] = { 0.0, /* n=0 - wrong, place holder only */ 0.1534264097200273452913848, /* 0.5 */ 0.0810614667953272582196702, /* 1.0 */ 0.0548141210519176538961390, /* 1.5 */ 0.0413406959554092940938221, /* 2.0 */ 0.03316287351993628748511048, /* 2.5 */ 0.02767792568499833914878929, /* 3.0 */ 0.02374616365629749597132920, /* 3.5 */ 0.02079067210376509311152277, /* 4.0 */ 0.01848845053267318523077934, /* 4.5 */ 0.01664469118982119216319487, /* 5.0 */ 0.01513497322191737887351255, /* 5.5 */ 0.01387612882307074799874573, /* 6.0 */ 0.01281046524292022692424986, /* 6.5 */ 0.01189670994589177009505572, /* 7.0 */ 0.01110455975820691732662991, /* 7.5 */ 0.010411265261972096497478567, /* 8.0 */ 0.009799416126158803298389475, /* 8.5 */ 0.009255462182712732917728637, /* 9.0 */ 0.008768700134139385462952823, /* 9.5 */ 0.008330563433362871256469318, /* 10.0 */ 0.007934114564314020547248100, /* 10.5 */ 0.007573675487951840794972024, /* 11.0 */ 0.007244554301320383179543912, /* 11.5 */ 0.006942840107209529865664152, /* 12.0 */ 0.006665247032707682442354394, /* 12.5 */ 0.006408994188004207068439631, /* 13.0 */ 0.006171712263039457647532867, /* 13.5 */ 0.005951370112758847735624416, /* 14.0 */ 0.005746216513010115682023589, /* 14.5 */ 0.005554733551962801371038690 /* 15.0 */ }; double nn; if (n <= 15.0) { nn = n + n; if (nn == (int)nn) return(sferr_halves[(int)nn]); return(lgammafn(n + 1.) - (n + 0.5)*log(n) + n - M_LN_SQRT_2PI); } nn = n*n; if (n>500) return((S0-S1/nn)/n); if (n> 80) return((S0-(S1-S2/nn)/nn)/n); if (n> 35) return((S0-(S1-(S2-S3/nn)/nn)/nn)/n); /* 15 < n <= 35 : */ return((S0-(S1-(S2-(S3-S4/nn)/nn)/nn)/nn)/n); } JAGS-4.3.2/src/jrmath/bd0.c0000664000175000017500000000372514224052371012063 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000. * * Merge in to R: * Copyright (C) 2000-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * Evaluates the "deviance part" * bd0(x,M) := M * D0(x/M) = M*[ x/M * log(x/M) + 1 - (x/M) ] = * = x * log(x/M) + M - x * where M = E[X] = n*p (or = lambda), for x, M > 0 * * in a manner that should be stable (with small relative error) * for all x and M=np. In particular for x/np close to 1, direct * evaluation fails, and evaluation is based on the Taylor series * of log((1+v)/(1-v)) with v = (x-M)/(x+M) = (x-np)/(x+np). */ #include "nmath.h" double attribute_hidden bd0(double x, double np) { double ej, s, s1, v; int j; if(!R_FINITE(x) || !R_FINITE(np) || np == 0.0) ML_ERR_return_NAN; if (fabs(x-np) < 0.1*(x+np)) { v = (x-np)/(x+np); /* might underflow to 0 */ s = (x-np)*v;/* s using v -- change by MM */ if(fabs(s) < DBL_MIN) return s; ej = 2*x*v; v = v*v; for (j = 1; j < 1000; j++) { /* Taylor series; 1000: no infinite loop as |v| < .1, v^2000 is "zero" */ ej *= v; /* = v^(2j+1) */ s1 = s+ej/((j<<1)+1); if (s1 == s) /* last term was effectively 0 */ return s1 ; s = s1; } } /* else: | x - np | is not too small */ return(x*log(x/np)+np-x); } JAGS-4.3.2/src/jrmath/choose.c0000664000175000017500000001014214224052371012665 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2004-2014 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double choose(double n, double k); * double lchoose(double n, double k); * (and private) * double lfastchoose(double n, double k); * * DESCRIPTION * * Binomial coefficients. * choose(n, k) and lchoose(n,k) := log(abs(choose(n,k)) * * These work for the *generalized* binomial theorem, * i.e., are also defined for non-integer n (integer k). * * We use the simple explicit product formula for k <= k_small_max * and also have added statements to make sure that the symmetry * (n \\ k ) == (n \\ n-k) is preserved for non-negative integer n. */ #include "nmath.h" /* These are recursive, so we should do a stack check */ #ifndef MATHLIB_STANDALONE void R_CheckStack(void); #endif double attribute_hidden lfastchoose(double n, double k) { return -log(n + 1.) - lbeta(n - k + 1., k + 1.); } /* mathematically the same: less stable typically, but useful if n-k+1 < 0 : */ static double lfastchoose2(double n, double k, int *s_choose) { double r; r = lgammafn_sign(n - k + 1., s_choose); return lgammafn(n + 1.) - lgammafn(k + 1.) - r; } #define ODD(_K_) ((_K_) != 2 * floor((_K_) / 2.)) #define R_IS_INT(x) (!R_nonint(x)) double lchoose(double n, double k) { double k0 = k; k = R_forceint(k); #ifdef IEEE_754 /* NaNs propagated correctly */ if(ISNAN(n) || ISNAN(k)) return n + k; #endif #ifndef MATHLIB_STANDALONE R_CheckStack(); #endif if (fabs(k - k0) > 1e-7) MATHLIB_WARNING2(_("'k' (%.2f) must be integer, rounded to %.0f"), k0, k); if (k < 2) { if (k < 0) return ML_NEGINF; if (k == 0) return 0.; /* else: k == 1 */ return log(fabs(n)); } /* else: k >= 2 */ if (n < 0) { return lchoose(-n+ k-1, k); } else if (R_IS_INT(n)) { n = R_forceint(n); if(n < k) return ML_NEGINF; /* k <= n :*/ if(n - k < 2) return lchoose(n, n-k); /* <- Symmetry */ /* else: n >= k+2 */ return lfastchoose(n, k); } /* else non-integer n >= 0 : */ if (n < k-1) { int s; return lfastchoose2(n, k, &s); } return lfastchoose(n, k); } #define k_small_max 30 /* 30 is somewhat arbitrary: it is on the *safe* side: * both speed and precision are clearly improved for k < 30. */ double choose(double n, double k) { double r, k0 = k; k = R_forceint(k); #ifdef IEEE_754 /* NaNs propagated correctly */ if(ISNAN(n) || ISNAN(k)) return n + k; #endif #ifndef MATHLIB_STANDALONE R_CheckStack(); #endif if (fabs(k - k0) > 1e-7) MATHLIB_WARNING2(_("'k' (%.2f) must be integer, rounded to %.0f"), k0, k); if (k < k_small_max) { int j; if(n-k < k && n >= 0 && R_IS_INT(n)) k = n-k; /* <- Symmetry */ if (k < 0) return 0.; if (k == 0) return 1.; /* else: k >= 1 */ r = n; for(j = 2; j <= k; j++) r *= (n-j+1)/j; return R_IS_INT(n) ? R_forceint(r) : r; /* might have got rounding errors */ } /* else: k >= k_small_max */ if (n < 0) { r = choose(-n+ k-1, k); if (ODD(k)) r = -r; return r; } else if (R_IS_INT(n)) { n = R_forceint(n); if(n < k) return 0.; if(n - k < k_small_max) return choose(n, n-k); /* <- Symmetry */ return R_forceint(exp(lfastchoose(n, k))); } /* else non-integer n >= 0 : */ if (n < k-1) { int s_choose; r = lfastchoose2(n, k, /* -> */ &s_choose); return s_choose * exp(r); } return exp(lfastchoose(n, k)); } JAGS-4.3.2/src/jrmath/d1mach.c0000664000175000017500000000307414224052371012550 00000000000000/* * Mathlib - A Mathematical Function Library * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ /* NaNs propagated correctly */ /*-- FIXME: Eliminate calls to these * ===== o from C code when * o it is only used to initialize "static" variables (threading) * and use the DBL_... constants instead */ #include "nmath.h" attribute_hidden double jags_d1mach(int i) { switch(i) { case 1: return DBL_MIN; case 2: return DBL_MAX; case 3: /* = FLT_RADIX ^ - DBL_MANT_DIG for IEEE: = 2^-53 = 1.110223e-16 = .5*DBL_EPSILON */ return 0.5*DBL_EPSILON; case 4: /* = FLT_RADIX ^ (1- DBL_MANT_DIG) = for IEEE: = 2^-52 = DBL_EPSILON */ return DBL_EPSILON; case 5: return M_LOG10_2; default: return 0.0; } } #ifdef __cplusplus extern "C" #endif double F77_NAME(d1mach)(int *i) { return jags_d1mach(*i); } JAGS-4.3.2/src/jrmath/i1mach.c0000664000175000017500000000276514224052371012563 00000000000000/* * Mathlib - A Mathematical Function Library * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-7 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" #include attribute_hidden int jags_i1mach(int i) { switch(i) { case 1: return 5; case 2: return 6; case 3: return 0; case 4: return 0; case 5: return CHAR_BIT * sizeof(int); case 6: return sizeof(int)/sizeof(char); case 7: return 2; case 8: return CHAR_BIT * sizeof(int) - 1; case 9: return INT_MAX; case 10: return FLT_RADIX; case 11: return FLT_MANT_DIG; case 12: return FLT_MIN_EXP; case 13: return FLT_MAX_EXP; case 14: return DBL_MANT_DIG; case 15: return DBL_MIN_EXP; case 16: return DBL_MAX_EXP; default: return 0; } } int F77_NAME(i1mach)(int *i) { return jags_i1mach(*i); } JAGS-4.3.2/src/jrmath/fsign.c0000664000175000017500000000220414224052371012513 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double fsign(double x, double y); * * DESCRIPTION * * This function performs transfer of sign. The result is: * * |x| * signum(y) */ #include "nmath.h" double fsign(double x, double y) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(y)) return x + y; #endif return ((y >= 0) ? fabs(x) : -fabs(x)); } JAGS-4.3.2/src/jrmath/imax2.c0000664000175000017500000000173114224052371012431 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * int imax2(int x, int y); * * DESCRIPTION * * Compute maximum of two integers. */ #include "nmath.h" int imax2(int x, int y) { return (x < y) ? y : x; } JAGS-4.3.2/src/jrmath/imin2.c0000664000175000017500000000173114224052371012427 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * int imin2(int x, int y); * * DESCRIPTION * * Compute minimum of two integers. */ #include "nmath.h" int imin2(int x, int y) { return (x < y) ? x : y; } JAGS-4.3.2/src/jrmath/fmin2.c0000664000175000017500000000170014224052371012420 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" double fmin2(double x, double y) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(y)) return x + y; #endif return (x < y) ? x : y; } JAGS-4.3.2/src/jrmath/fmax2.c0000664000175000017500000000170014224052371012422 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" double fmax2(double x, double y) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(y)) return x + y; #endif return (x < y) ? y : x; } JAGS-4.3.2/src/jrmath/fprec.c0000664000175000017500000000670314224052371012514 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double fprec(double x, double digits); * * DESCRIPTION * * Returns the value of x rounded to "digits" significant * decimal digits. * * NOTES * * This routine is a translation into C of a Fortran subroutine * by W. Fullerton of Los Alamos Scientific Laboratory. * Some modifications have been made so that the routines * conform to the IEEE 754 standard. */ #include #include "nmath.h" /* nearbyint is C99, so all platforms should have it (and AFAIK, all do) */ #ifdef HAVE_NEARBYINT # define R_rint nearbyint #elif defined(HAVE_RINT) # define R_rint rint #else # define R_rint private_rint extern double private_rint(double x); #endif /* Improvements by Martin Maechler, May 1997; further ones, Feb.2000: Replace pow(x, (double)i) by JR_pow_di(x, i) {and use int dig} */ #define MAX_DIGITS 22 /* was till R 0.99: DBL_DIG := digits of precision of a double, usually 15 */ /* FIXME: Hmm, have quite a host of these: 1) ./fround.c uses much more (sensibly!) ``instead'' 2) ../main/coerce.c & ../main/deparse.c have DBL_DIG directly 3) ../main/options.c has #define MAX_DIGITS 22 for options(digits) Really should decide on a (config.h dependent?) global MAX_DIGITS. --MM-- */ double fprec(double x, double digits) { double l10, pow10, sgn, p10, P10; int e10, e2, do_round, dig; /* Max.expon. of 10 (=308.2547) */ const static int max10e = (int) (DBL_MAX_EXP * M_LOG10_2); if (ISNAN(x) || ISNAN(digits)) return x + digits; if (!R_FINITE(x)) return x; if (!R_FINITE(digits)) { if(digits > 0.0) return x; else digits = 1.0; } if(x == 0) return x; dig = (int)round(digits); if (dig > MAX_DIGITS) { return x; } else if (dig < 1) dig = 1; sgn = 1.0; if(x < 0.0) { sgn = -sgn; x = -x; } l10 = log10(x); e10 = (int)(dig-1-floor(l10)); if(fabs(l10) < max10e - 2) { p10 = 1.0; if(e10 > max10e) { /* numbers less than 10^(dig-1) * 1e-308 */ p10 = JR_pow_di(10., e10-max10e); e10 = max10e; } if(e10 > 0) { /* Try always to have pow >= 1 and so exactly representable */ pow10 = JR_pow_di(10., e10); return(sgn*(R_rint((x*pow10)*p10)/pow10)/p10); } else { pow10 = JR_pow_di(10., -e10); return(sgn*(R_rint((x/pow10))*pow10)); } } else { /* -- LARGE or small -- */ do_round = max10e - l10 >= JR_pow_di(10., -dig); e2 = dig + ((e10>0)? 1 : -1) * MAX_DIGITS; p10 = JR_pow_di(10., e2); x *= p10; P10 = JR_pow_di(10., e10-e2); x *= P10; /*-- p10 * P10 = 10 ^ e10 */ if(do_round) x += 0.5; x = floor(x) / p10; return(sgn*x/P10); } } JAGS-4.3.2/src/jrmath/fround.c0000664000175000017500000000534714224052371012715 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-11 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double fround(double x, double digits); * * DESCRIPTION * * Rounds "x" to "digits" decimal digits. * */ #include /* needed for HAVE_*, IEEE_754 */ #include #include "nmath.h" /* nearbyint is C99, so all platforms should have it (and AFAIK, all do) */ #ifdef HAVE_NEARBYINT # define R_rint nearbyint #elif defined(HAVE_RINT) # define R_rint rint #else # define R_rint private_rint extern double private_rint(double x); /* also used potentially in fprec.c and main/format.c */ double attribute_hidden private_rint(double x) { double tmp, sgn = 1.0; long ltmp; if (x != x) return x; /* NaN */ if (x < 0.0) { x = -x; sgn = -1.0; } if(x < (double) LONG_MAX) { /* in is architecture dependent */ ltmp = x + 0.5; /* implement round to even */ if(fabs(x + 0.5 - ltmp) < 10*DBL_EPSILON && (ltmp % 2 == 1)) ltmp--; tmp = ltmp; } else { /* ignore round to even: too small a point to bother */ tmp = floor(x + 0.5); } return sgn * tmp; } #endif double fround(double x, double digits) { #define MAX_DIGITS DBL_MAX_10_EXP /* = 308 (IEEE); was till R 0.99: (DBL_DIG - 1) */ /* Note that large digits make sense for very small numbers */ LDOUBLE pow10, sgn, intx; int dig; if (ISNAN(x) || ISNAN(digits)) return x + digits; if(!R_FINITE(x)) return x; if(digits == ML_POSINF) return x; else if(digits == ML_NEGINF) return 0.0; if (digits > MAX_DIGITS) digits = MAX_DIGITS; dig = (int)floor(digits + 0.5); if(x < 0.) { sgn = -1.; x = -x; } else sgn = 1.; if (dig == 0) { return (double)(sgn * R_rint(x)); } else if (dig > 0) { pow10 = JR_pow_di(10., dig); intx = floor(x); return (double)(sgn * (intx + R_rint((double)((x-intx) * pow10)) / pow10)); } else { pow10 = JR_pow_di(10., -dig); return (double)(sgn * R_rint((double)(x/pow10)) * pow10); } } JAGS-4.3.2/src/jrmath/ftrunc.c0000664000175000017500000000215314224052371012711 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2013 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double ftrunc(double x); * * DESCRIPTION * * Truncation toward zero. */ #include "nmath.h" #ifdef OLD double ftrunc(double x) { if(x >= 0) return floor(x); else return ceil(x); } #else // use C99 function double ftrunc(double x) { return trunc(x); } #endif JAGS-4.3.2/src/jrmath/chebyshev.c0000664000175000017500000000436014224052371013372 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * int chebyshev_init(double *dos, int nos, double eta) * double chebyshev_eval(double x, double *a, int n) * * DESCRIPTION * * "chebyshev_init" determines the number of terms for the * double precision orthogonal series "dos" needed to insure * the error is no larger than "eta". Ordinarily eta will be * chosen to be one-tenth machine precision. * * "chebyshev_eval" evaluates the n-term Chebyshev series * "a" at "x". * * NOTES * * These routines are translations into C of Fortran routines * by W. Fullerton of Los Alamos Scientific Laboratory. * * Based on the Fortran routine dcsevl by W. Fullerton. * Adapted from R. Broucke, Algorithm 446, CACM., 16, 254 (1973). */ #include "nmath.h" /* NaNs propagated correctly */ int attribute_hidden chebyshev_init(double *dos, int nos, double eta) { int i, ii; double err; if (nos < 1) return 0; err = 0.0; i = 0; /* just to avoid compiler warnings */ for (ii=1; ii<=nos; ii++) { i = nos - ii; err += fabs(dos[i]); if (err > eta) { return i; } } return i; } double attribute_hidden chebyshev_eval(double x, const double *a, const int n) { double b0, b1, b2, twox; int i; if (n < 1 || n > 1000) ML_ERR_return_NAN; if (x < -1.1 || x > 1.1) ML_ERR_return_NAN; twox = x * 2; b2 = b1 = 0; b0 = 0; for (i = 1; i <= n; i++) { b2 = b1; b1 = b0; b0 = twox * b1 - b2 + a[n - i]; } return (b0 - b2) * 0.5; } JAGS-4.3.2/src/jrmath/lgammacor.c0000664000175000017500000000516214224052371013355 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2001 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double lgammacor(double x); * * DESCRIPTION * * Compute the log gamma correction factor for x >= 10 so that * * log(gamma(x)) = .5*log(2*pi) + (x-.5)*log(x) -x + lgammacor(x) * * [ lgammacor(x) is called Del(x) in other contexts (e.g. dcdflib)] * * NOTES * * This routine is a translation into C of a Fortran subroutine * written by W. Fullerton of Los Alamos Scientific Laboratory. * * SEE ALSO * * Loader(1999)'s stirlerr() {in ./stirlerr.c} is *very* similar in spirit, * is faster and cleaner, but is only defined "fast" for half integers. */ #include "nmath.h" double attribute_hidden lgammacor(double x) { const static double algmcs[15] = { +.1666389480451863247205729650822e+0, -.1384948176067563840732986059135e-4, +.9810825646924729426157171547487e-8, -.1809129475572494194263306266719e-10, +.6221098041892605227126015543416e-13, -.3399615005417721944303330599666e-15, +.2683181998482698748957538846666e-17, -.2868042435334643284144622399999e-19, +.3962837061046434803679306666666e-21, -.6831888753985766870111999999999e-23, +.1429227355942498147573333333333e-24, -.3547598158101070547199999999999e-26, +.1025680058010470912000000000000e-27, -.3401102254316748799999999999999e-29, +.1276642195630062933333333333333e-30 }; double tmp; /* For IEEE double precision DBL_EPSILON = 2^-52 = 2.220446049250313e-16 : * xbig = 2 ^ 26.5 * xmax = DBL_MAX / 48 = 2^1020 / 3 */ #define nalgm 5 #define xbig 94906265.62425156 #define xmax 3.745194030963158e306 if (x < 10) ML_ERR_return_NAN else if (x >= xmax) { ML_ERROR(ME_UNDERFLOW, "lgammacor"); /* allow to underflow below */ } else if (x < xbig) { tmp = 10 / x; return chebyshev_eval(tmp * tmp * 2 - 1, algmcs, nalgm) / x; } return 1 / (x * 12); } JAGS-4.3.2/src/jrmath/lbeta.c0000664000175000017500000000423114224052371012476 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-12 The R Core Team * Copyright (C) 2003 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double lbeta(double a, double b); * * DESCRIPTION * * This function returns the value of the log beta function. * * NOTES * * This routine is a translation into C of a Fortran subroutine * by W. Fullerton of Los Alamos Scientific Laboratory. */ #include "nmath.h" double lbeta(double a, double b) { double corr, p, q; #ifdef IEEE_754 if(ISNAN(a) || ISNAN(b)) return a + b; #endif p = q = a; if(b < p) p = b;/* := min(a,b) */ if(b > q) q = b;/* := max(a,b) */ /* both arguments must be >= 0 */ if (p < 0) ML_ERR_return_NAN else if (p == 0) { return ML_POSINF; } else if (!R_FINITE(q)) { /* q == +Inf */ return ML_NEGINF; } if (p >= 10) { /* p and q are big. */ corr = lgammacor(p) + lgammacor(q) - lgammacor(p + q); return log(q) * -0.5 + M_LN_SQRT_2PI + corr + (p - 0.5) * log(p / (p + q)) + q * log1p(-p / (p + q)); } else if (q >= 10) { /* p is small, but q is big. */ corr = lgammacor(q) - lgammacor(p + q); return lgammafn(p) + corr + p - p * log(p + q) + (q - 0.5) * log1p(-p / (p + q)); } else /* p and q are small: p <= q < 10. */ /* R change for very small args */ if (p < 1e-306) return lgamma(p) + (lgamma(q) - lgamma(p+q)); return log(gammafn(p) * (gammafn(q) / gammafn(p + q))); } JAGS-4.3.2/src/jrmath/rbeta.c0000664000175000017500000000711514224052514012507 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * Copyright (C) 2000--2010 The R Core Team * Copyright (C) 2000, 2010 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ /* Reference: * R. C. H. Cheng (1978). * Generating beta variates with nonintegral shape parameters. * Communications of the ACM 21, 317-322. * (Algorithms BB and BC) */ #include "nmath.h" #define expmax (DBL_MAX_EXP * M_LN2)/* = log(DBL_MAX) */ double rbeta(double aa, double bb, JRNG *rng) { if (aa < 0. || bb < 0.) ML_ERR_return_NAN; if (!R_FINITE(aa) && !R_FINITE(bb)) // a = b = Inf : all mass at 1/2 return 0.5; if (aa == 0. && bb == 0.) // point mass 1/2 at each of {0,1} : return (unif_rand(rng) < 0.5) ? 0. : 1.; // now, at least one of a, b is finite and positive if (!R_FINITE(aa) || bb == 0.) return 1.0; if (!R_FINITE(bb) || aa == 0.) return 0.0; double a, b, alpha; double r, s, t, u1, u2, v, w, y, z; int qsame; /* FIXME: Keep Globals (properly) for threading */ /* Uses these GLOBALS to save time when many rv's are generated : */ static double beta, gamma, delta, k1, k2; static double olda = -1.0; static double oldb = -1.0; /* Test if we need new "initializing" */ qsame = (olda == aa) && (oldb == bb); if (!qsame) { olda = aa; oldb = bb; } a = fmin2(aa, bb); b = fmax2(aa, bb); /* a <= b */ alpha = a + b; #define v_w_from__u1_bet(AA) \ v = beta * log(u1 / (1.0 - u1)); \ if (v <= expmax) { \ w = AA * exp(v); \ if(!R_FINITE(w)) w = DBL_MAX; \ } else \ w = DBL_MAX if (a <= 1.0) { /* --- Algorithm BC --- */ /* changed notation, now also a <= b (was reversed) */ if (!qsame) { /* initialize */ beta = 1.0 / a; delta = 1.0 + b - a; k1 = delta * (0.0138889 + 0.0416667 * a) / (b * beta - 0.777778); k2 = 0.25 + (0.5 + 0.25 / delta) * a; } /* FIXME: "do { } while()", but not trivially because of "continue"s:*/ for(;;) { u1 = unif_rand(rng); u2 = unif_rand(rng); if (u1 < 0.5) { y = u1 * u2; z = u1 * y; if (0.25 * u2 + z - y >= k1) continue; } else { z = u1 * u1 * u2; if (z <= 0.25) { v_w_from__u1_bet(b); break; } if (z >= k2) continue; } v_w_from__u1_bet(b); if (alpha * (log(alpha / (a + w)) + v) - 1.3862944 >= log(z)) break; } return (aa == a) ? a / (a + w) : w / (a + w); } else { /* Algorithm BB */ if (!qsame) { /* initialize */ beta = sqrt((alpha - 2.0) / (2.0 * a * b - alpha)); gamma = a + 1.0 / beta; } do { u1 = unif_rand(rng); u2 = unif_rand(rng); v_w_from__u1_bet(a); z = u1 * u1 * u2; r = gamma * v - 1.3862944; s = a + r - w; if (s + 2.609438 >= 5.0 * z) break; t = log(z); if (s > t) break; } while (r + alpha * log(alpha / (b + w)) < t); return (aa != a) ? b / (b + w) : w / (b + w); } } JAGS-4.3.2/src/jrmath/dbeta.c0000664000175000017500000000526314224052371012474 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000. * * Merge in to R: * Copyright (C) 2000, The R Core Team * Changes to case a, b < 2, use logs to avoid underflow * Copyright (C) 2006-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * Beta density, * (a+b-1)! a-1 b-1 * p(x;a,b) = ------------ x (1-x) * (a-1)!(b-1)! * * = (a+b-1) dbinom(a-1; a+b-2,x) * * The basic formula for the log density is thus * (a-1) log x + (b-1) log (1-x) - lbeta(a, b) * If either a or b <= 2 then 0 < lbeta(a, b) < 710 and so no * term is large. We use Loader's code only if both a and b > 2. */ #include "nmath.h" #include "dpq.h" double dbeta(double x, double a, double b, int give_log) { #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(a) || ISNAN(b)) return x + a + b; #endif if (a < 0 || b < 0) ML_ERR_return_NAN; if (x < 0 || x > 1) return(R_D__0); // limit cases for (a,b), leading to point masses if(a == 0 || b == 0 || !R_FINITE(a) || !R_FINITE(b)) { if(a == 0 && b == 0) { // point mass 1/2 at each of {0,1} : if (x == 0 || x == 1) return(ML_POSINF); /* else */ return(R_D__0); } if (a == 0 || a/b == 0) { // point mass 1 at 0 if (x == 0) return(ML_POSINF); /* else */ return(R_D__0); } if (b == 0 || b/a == 0) { // point mass 1 at 1 if (x == 1) return(ML_POSINF); /* else */ return(R_D__0); } // else, remaining case: a = b = Inf : point mass 1 at 1/2 if (x == 0.5) return(ML_POSINF); /* else */ return(R_D__0); } if (x == 0) { if(a > 1) return(R_D__0); if(a < 1) return(ML_POSINF); /* a == 1 : */ return(R_D_val(b)); } if (x == 1) { if(b > 1) return(R_D__0); if(b < 1) return(ML_POSINF); /* b == 1 : */ return(R_D_val(a)); } double lval; if (a <= 2 || b <= 2) lval = (a-1)*log(x) + (b-1)*log1p(-x) - lbeta(a, b); else lval = log(a+b-1) + dbinom_raw(a-1, a+b-2, x, 1-x, TRUE); return R_D_exp(lval); } JAGS-4.3.2/src/jrmath/pbeta.c0000664000175000017500000000525014224052371012504 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 2006 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * * double pbeta_raw(double x, double a, double b, int lower_tail, int log_p) * double pbeta (double x, double a, double b, int lower_tail, int log_p) * * DESCRIPTION * * Returns distribution function of the beta distribution. * ( = The incomplete beta ratio I_x(p,q) ). * * NOTES * * As from R 2.3.0, a wrapper for TOMS708 * as from R 2.6.0, 'log_p' partially improved over log(p..) */ #include "nmath.h" #include "dpq.h" attribute_hidden double pbeta_raw(double x, double a, double b, int lower_tail, int log_p) { // treat limit cases correctly here: if(a == 0 || b == 0 || !R_FINITE(a) || !R_FINITE(b)) { // NB: 0 < x < 1 : if(a == 0 && b == 0) // point mass 1/2 at each of {0,1} : return (log_p ? -M_LN2 : 0.5); if (a == 0 || a/b == 0) // point mass 1 at 0 ==> P(X <= x) = 1, all x > 0 return R_DT_1; if (b == 0 || b/a == 0) // point mass 1 at 1 ==> P(X <= x) = 0, all x < 1 return R_DT_0; // else, remaining case: a = b = Inf : point mass 1 at 1/2 if (x < 0.5) return R_DT_0; // else, x >= 0.5 : return R_DT_1; } // Now: 0 < a < Inf; 0 < b < Inf double x1 = 0.5 - x + 0.5, w, wc; int ierr; //==== bratio(a, b, x, x1, &w, &wc, &ierr, log_p); /* -> ./toms708.c */ //==== /* ierr = 8 is about inaccuracy in extreme cases */ if(ierr && (ierr != 8 || log_p) ) MATHLIB_WARNING4(_("pbeta_raw(%g, a=%g, b=%g, ..) -> bratio() gave error code %d"), x, a,b, ierr); return lower_tail ? w : wc; } /* pbeta_raw() */ double pbeta(double x, double a, double b, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(a) || ISNAN(b)) return x + a + b; #endif if (a < 0 || b < 0) ML_ERR_return_NAN; // allowing a==0 and b==0 <==> treat as one- or two-point mass if (x <= 0) return R_DT_0; if (x >= 1) return R_DT_1; return pbeta_raw(x, a, b, lower_tail, log_p); } JAGS-4.3.2/src/jrmath/qbeta.c0000664000175000017500000001632414224052371012511 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * Copyright (C) 1998--2015 The R Core Team * based on code (C) 1979 and later Royal Statistical Society * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * Reference: * Cran, G. W., K. J. Martin and G. E. Thomas (1977). * Remark AS R19 and Algorithm AS 109, * Applied Statistics, 26(1), 111-114. * Remark AS R83 (v.39, 309-310) and the correction (v.40(1) p.236) * have been incorporated in this version. */ #include "nmath.h" #include "dpq.h" #ifdef DEBUG_qbeta /* for JREprintf */ # include #endif /* set the exponent of accu to -2r-2 for r digits of accuracy */ /*---- NEW ---- -- still fails for p = 1e11, q=.5*/ #define fpu 3e-308 /* acu_min: Minimal value for accuracy 'acu' which will depend on (a,p); acu_min >= fpu ! */ #define acu_min 1e-300 #define lower fpu #define upper 1-2.22e-16 #define const1 2.30753 #define const2 0.27061 #define const3 0.99229 #define const4 0.04481 double qbeta(double alpha, double p, double q, int lower_tail, int log_p) { int swap_tail, i_pb, i_inn; #ifdef DEBUG_qbeta Rboolean warned = FALSE; #endif double a, la, adj, logbeta, g, h, pp, p_, prev, qq, r, s, t, tx, w, y, wprev; double acu; volatile double xinbta; /* test for admissibility of parameters */ #ifdef IEEE_754 if (ISNAN(p) || ISNAN(q) || ISNAN(alpha)) return p + q + alpha; #endif if(p < 0. || q < 0.) ML_ERR_return_NAN; R_Q_P01_boundaries(alpha, 0, 1); p_ = R_DT_qIv(alpha);/* lower_tail prob (in any case) */ // Conceptually, 0 < p_ < 1 (but can be 0 or 1 because of cancellation!) // p==0, q==0, p = Inf, q = Inf <==> treat as one- or two-point mass if(p == 0 || q == 0 || !R_FINITE(p) || !R_FINITE(q)) { // We know 0 < p_ < 1 : pbeta() is constant and trivial in {0, 1/2, 1} #ifdef DEBUG_qbeta JREprintf( "qbeta(%g, %g, %g, lower_t=%d, log_p=%d): (p,q)-boundary: trivial\n", alpha, p,q, lower_tail, log_p); #endif if(p == 0 && q == 0) { // point mass 1/2 at each of {0,1} : if(alpha < R_D_half) return 0.; if(alpha > R_D_half) return 1.; // else: alpha == "1/2" return 0.5; } else if (p == 0 || p/q == 0) { // point mass 1 at 0 - "flipped around" return 0.; } else if (q == 0 || q/p == 0) { // point mass 1 at 0 - "flipped around" return 1; } // else: p = q = Inf : point mass 1 at 1/2 return 0.5; } if(log_p && (p_ == 0. || p_ == 1.)) return p_; /* better than NaN or infinite loop; FIXME: suboptimal, since -Inf < alpha ! */ /* initialize */ logbeta = lbeta(p, q); /* change tail if necessary; afterwards 0 < a <= 1/2 */ if (p_ <= 0.5) { a = p_; pp = p; qq = q; swap_tail = 0; la = lower_tail ? R_D_log(alpha) : R_D_LExp(alpha); } else { /* change tail, swap p <-> q :*/ a = R_DT_CIv(alpha); // = 1 - p_ < 1/2 /* la := log(a), but without numerical cancellation: */ la = lower_tail ? R_D_LExp(alpha) : R_D_log(alpha); pp = q; qq = p; swap_tail = 1; } #ifdef DEBUG_qbeta JREprintf("qbeta(%g, %g, %g, lower_t=%d, log_p=%d):%s\n" " swap_tail=%d, la=%g: ", alpha, p,q, lower_tail, log_p, (log_p && (p_ == 0. || p_ == 1.)) ? (p_==0.?" p_=0":" p_=1") : "", swap_tail, la); #endif /* calculate the initial approximation */ /* y := {fast approximation of} qnorm(1 - a) :*/ r = sqrt(-2 * la); y = r - (const1 + const2 * r) / (1. + (const3 + const4 * r) * r); if (pp > 1 && qq > 1) { // use Carter(1947), see AS 109, remark '5.' r = (y * y - 3.) / 6.; s = 1. / (pp + pp - 1.); t = 1. / (qq + qq - 1.); h = 2. / (s + t); w = y * sqrt(h + r) / h - (t - s) * (r + 5. / 6. - 2. / (3. * h)); #ifdef DEBUG_qbeta JREprintf("p,q > 1 => w=%g", w); #endif xinbta = pp / (pp + qq * exp(w + w)); } else { r = qq + qq; t = 1. / (9. * qq); t = r * JR_pow_di(1. - t + y * sqrt(t), 3); #ifdef DEBUG_qbeta JREprintf("min(p,q) <= 1: t=%g", t); #endif if (t <= 0.) { #ifdef DEBUG_qbeta JREprintf(" t <= 0: log1p(-a)=%.15g\n", log1p(-a)); #endif xinbta = 1. - exp((log1p(-a)+ log(qq) + logbeta) / qq); } else { t = (4. * pp + r - 2.) / t; #ifdef DEBUG_qbeta JREprintf(" t >= 0: new t = %g ( > 1 ?)\n", t); #endif if (t <= 1.) xinbta = exp((log(a * pp) + logbeta) / pp); else xinbta = 1. - 2. / (t + 1.); } } /* Desired accuracy for Newton iterations (below) should depend on (a,p) * This is from Remark .. on AS 109, adapted. * However, it's not clear if this is "optimal" for IEEE double prec. * acu = fmax2(acu_min, pow(10., -25. - 5./(pp * pp) - 1./(a * a))); * NEW: 'acu' accuracy NOT for squared adjustment, but simple; * ---- i.e., "new acu" = sqrt(old acu) */ acu = fmax2(acu_min, pow(10.0, -13.0 - 2.5/(pp * pp) - 0.5/(a * a))); #ifdef DEBUG_qbeta JREprintf(" -> xinbta = %.16g (Newton acu=%g)\n", xinbta, acu); #endif /* solve for x by a modified newton-raphson method, */ /* using the function pbeta_raw */ r = 1 - pp; t = 1 - qq; wprev = 0.; adj = 1; /* Sometimes the approximation is negative! */ if (xinbta < lower) xinbta = 0.5; else if (xinbta > upper) xinbta = 0.5; tx = prev = 0.; /* keep -Wall happy */ for (i_pb=0; i_pb < 1000; i_pb++) { y = pbeta_raw(xinbta, pp, qq, /*lower_tail = */ TRUE, FALSE); #ifdef IEEE_754 if(!R_FINITE(y)) #else if (errno) #endif ML_ERR_return_NAN; w = (y - a) * exp(logbeta + r * log(xinbta) + t * log1p(-xinbta)); if (w * wprev <= 0.) prev = fmax2(fabs(adj),fpu); g = 1; #ifdef DEBUG_qbeta JREprintf("N(i=%d): x0=%.15g, pb(x0)=%.15g, w=%.15g, prev=%g,", i_pb, xinbta, y, w, prev); #endif for (i_inn=0; i_inn < 1000;i_inn++) { adj = g * w; if (fabs(adj) < prev) { tx = xinbta - adj; // x_{n+1} = x_n - g*w if (0. <= tx && tx <= 1.) { if (prev <= acu || fabs(w) <= acu) { #ifdef DEBUG_qbeta JREprintf(" it{in}=%d, delta(x)=%g, %s <= acu ==> convergence\n", i_inn, -adj, (prev <= acu) ? "prev" : "|w|"); #endif goto L_converged; } if (tx != 0. && tx != 1) break; } } g /= 3; } #ifdef DEBUG_qbeta JREprintf(" it{in}=%d, delta(x)=%g\n", i_inn, -adj); #endif if (fabs(tx - xinbta) <= 1e-15 * xinbta) // "<=" for xinbta == 0 goto L_converged; xinbta = tx; wprev = w; } /*-- NOT converged: Iteration count --*/ #ifdef DEBUG_qbeta warned = TRUE; #endif ML_ERROR(ME_PRECISION, "qbeta"); L_converged: #ifdef DEBUG_qbeta JREprintf(" %s: Final delta(y) = %g\n", warned ? "_NO_ convergence" : "converged", y - a); #endif return swap_tail ? 1 - xinbta : xinbta; } JAGS-4.3.2/src/jrmath/rbinom.c0000664000175000017500000001277414224052514012707 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * Copyright (C) 2007 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rbinom(double nin, double pp) * * DESCRIPTION * * Random variates from the binomial distribution. * * REFERENCE * * Kachitvichyanukul, V. and Schmeiser, B. W. (1988). * Binomial random variate generation. * Communications of the ACM 31, 216-222. * (Algorithm BTPEC). */ #include "nmath.h" #include "dpq.h" #include #include #define repeat for(;;) double rbinom(double nin, double pp, JRNG *rng) { /* FIXME: These should become THREAD_specific globals : */ static double c, fm, npq, p1, p2, p3, p4, qn; static double xl, xll, xlr, xm, xr; static double psave = -1.0; static int nsave = -1; static int m; double f, f1, f2, u, v, w, w2, x, x1, x2, z, z2; double p, q, np, g, r, al, alv, amaxp, ffm, ynorm; int i, ix, k, n; if (!R_FINITE(nin)) ML_ERR_return_NAN; r = R_forceint(nin); if (r != nin) ML_ERR_return_NAN; if (!R_FINITE(pp) || /* n=0, p=0, p=1 are not errors */ r < 0 || pp < 0. || pp > 1.) ML_ERR_return_NAN; if (r == 0 || pp == 0.) return 0; if (pp == 1.) return r; if (r >= INT_MAX)/* evade integer overflow, and r == INT_MAX gave only even values */ return qbinom(unif_rand(rng), r, pp, /*lower_tail*/ 0, /*log_p*/ 0); /* else */ n = (int) r; p = fmin2(pp, 1. - pp); q = 1. - p; np = n * p; r = p / q; g = r * (n + 1); /* Setup, perform only when parameters change [using static (globals): */ /* FIXING: Want this thread safe -- use as little (thread globals) as possible */ if (pp != psave || n != nsave) { psave = pp; nsave = n; if (np < 30.0) { /* inverse cdf logic for mean less than 30 */ qn = JR_pow_di(q, n); goto L_np_small; } else { ffm = np + p; m = (int) ffm; fm = m; npq = np * q; p1 = (int)(2.195 * sqrt(npq) - 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; } } else if (n == nsave) { if (np < 30.0) goto L_np_small; } /*-------------------------- np = n*p >= 30 : ------------------- */ repeat { u = unif_rand(rng) * p4; v = unif_rand(rng); /* triangular region */ if (u <= p1) { ix = (int)(xm - p1 * v + u); goto finis; } /* parallelogram region */ if (u <= p2) { x = xl + (u - p1) / c; v = v * c + 1.0 - fabs(xm - x) / p1; if (v > 1.0 || v <= 0.) continue; ix = (int) x; } else { if (u > p3) { /* right tail */ ix = (int)(xr - log(v) / xlr); if (ix > n) continue; v = v * (u - p3) * xlr; } else {/* left tail */ ix = (int)(xl + log(v) / xll); if (ix < 0) continue; v = v * (u - p2) * xll; } } /* determine appropriate way to perform accept/reject test */ k = abs(ix - m); if (k <= 20 || k >= npq / 2 - 1) { /* explicit evaluation */ f = 1.0; if (m < ix) { for (i = m + 1; i <= ix; i++) f *= (g / i - r); } else if (m != ix) { for (i = ix + 1; i <= m; i++) f /= (g / i - r); } if (v <= f) goto finis; } else { /* squeezing using upper and lower bounds on log(f(x)) */ amaxp = (k / npq) * ((k * (k / 3. + 0.625) + 0.1666666666666) / npq + 0.5); ynorm = -k * k / (2.0 * npq); alv = log(v); if (alv < ynorm - amaxp) goto finis; if (alv <= ynorm + amaxp) { /* stirling's formula to machine accuracy */ /* for the final acceptance/rejection test */ x1 = ix + 1; f1 = fm + 1.0; z = n + 1 - 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.) goto finis; } } } L_np_small: /*---------------------- np = n*p < 30 : ------------------------- */ repeat { ix = 0; f = qn; u = unif_rand(rng); repeat { if (u < f) goto finis; if (ix > 110) break; u -= f; ix++; f *= (g / ix - r); } } finis: if (psave > 0.5) ix = n - ix; return (double)ix; } JAGS-4.3.2/src/jrmath/dbinom.c0000664000175000017500000000601314224052371012657 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000. * * Merge in to R and further tweaks : * Copyright (C) 2000-2014 The R Core Team * Copyright (C) 2008 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * * To compute the binomial probability, call dbinom(x,n,p). * This checks for argument validity, and calls dbinom_raw(). * * dbinom_raw() does the actual computation; note this is called by * other functions in addition to dbinom(). * (1) dbinom_raw() has both p and q arguments, when one may be represented * more accurately than the other (in particular, in df()). * (2) dbinom_raw() does NOT check that inputs x and n are integers. This * should be done in the calling function, where necessary. * -- but is not the case at all when called e.g., from df() or dbeta() ! * (3) Also does not check for 0 <= p <= 1 and 0 <= q <= 1 or NaN's. * Do this in the calling function. */ #include "nmath.h" #include "dpq.h" double attribute_hidden dbinom_raw(double x, double n, double p, double q, int give_log) { double lf, lc; if (p == 0) return((x == 0) ? R_D__1 : R_D__0); if (q == 0) return((x == n) ? R_D__1 : R_D__0); if (x == 0) { if(n == 0) return R_D__1; lc = (p < 0.1) ? -bd0(n,n*q) - n*p : n*log(q); return( R_D_exp(lc) ); } if (x == n) { lc = (q < 0.1) ? -bd0(n,n*p) - n*q : n*log(p); return( R_D_exp(lc) ); } if (x < 0 || x > n) return( R_D__0 ); /* n*p or n*q can underflow to zero if n and p or q are small. This used to occur in dbeta, and gives NaN as from R 2.3.0. */ lc = stirlerr(n) - stirlerr(x) - stirlerr(n-x) - bd0(x,n*p) - bd0(n-x,n*q); /* f = (M_2PI*x*(n-x))/n; could overflow or underflow */ /* Upto R 2.7.1: * lf = log(M_2PI) + log(x) + log(n-x) - log(n); * -- following is much better for x << n : */ lf = M_LN_2PI + log(x) + log1p(- x/n); return R_D_exp(lc - 0.5*lf); } double dbinom(double x, double n, double p, int give_log) { #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(n) || ISNAN(p)) return x + n + p; #endif if (p < 0 || p > 1 || R_D_negInonint(n)) ML_ERR_return_NAN; R_D_nonint_check(x); if (x < 0 || !R_FINITE(x)) return R_D__0; n = R_forceint(n); x = R_forceint(x); return dbinom_raw(x, n, p, 1-p, give_log); } JAGS-4.3.2/src/jrmath/pbinom.c0000664000175000017500000000301414224052371012671 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * Copyright (C) 2004 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the binomial distribution. */ #include "nmath.h" #include "dpq.h" double pbinom(double x, double n, double p, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(n) || ISNAN(p)) return x + n + p; if (!R_FINITE(n) || !R_FINITE(p)) ML_ERR_return_NAN; #endif if(R_nonint(n)) { MATHLIB_WARNING("non-integer n = %f", n); ML_ERR_return_NAN; } n = R_forceint(n); /* PR#8560: n=0 is a valid value */ if(n < 0 || p < 0 || p > 1) ML_ERR_return_NAN; if (x < 0) return R_DT_0; x = floor(x + 1e-7); if (n <= x) return R_DT_1; return pbeta(p, x + 1, n - x, !lower_tail, log_p); } JAGS-4.3.2/src/jrmath/qbinom.c0000664000175000017500000000762414224052371012705 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2009 The R Core Team * Copyright (C) 2003-2009 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The quantile function of the binomial distribution. * * METHOD * * Uses the Cornish-Fisher Expansion to include a skewness * correction to a normal approximation. This gives an * initial value which never seems to be off by more than * 1 or 2. A search is then conducted of values close to * this initial start point. */ #include "nmath.h" #include "dpq.h" static double do_search(double y, double *z, double p, double n, double pr, double incr) { if(*z >= p) { /* search to the left */ #ifdef DEBUG_qbinom REprintf("\tnew z=%7g >= p = %7g --> search to left (y--) ..\n", z,p); #endif for(;;) { double newz; if(y == 0 || (newz = pbinom(y - incr, n, pr, /*l._t.*/TRUE, /*log_p*/FALSE)) < p) return y; y = fmax2(0, y - incr); *z = newz; } } else { /* search to the right */ #ifdef DEBUG_qbinom REprintf("\tnew z=%7g < p = %7g --> search to right (y++) ..\n", z,p); #endif for(;;) { y = fmin2(y + incr, n); if(y == n || (*z = pbinom(y, n, pr, /*l._t.*/TRUE, /*log_p*/FALSE)) >= p) return y; } } } double qbinom(double p, double n, double pr, int lower_tail, int log_p) { double q, mu, sigma, gamma, z, y; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(n) || ISNAN(pr)) return p + n + pr; #endif if(!R_FINITE(n) || !R_FINITE(pr)) ML_ERR_return_NAN; /* if log_p is true, p = -Inf is a legitimate value */ if(!R_FINITE(p) && !log_p) ML_ERR_return_NAN; if(n != floor(n + 0.5)) ML_ERR_return_NAN; if (pr < 0 || pr > 1 || n < 0) ML_ERR_return_NAN; R_Q_P01_boundaries(p, 0, n); if (pr == 0. || n == 0) return 0.; q = 1 - pr; if(q == 0.) return n; /* covers the full range of the distribution */ mu = n * pr; sigma = sqrt(n * pr * q); gamma = (q - pr) / sigma; #ifdef DEBUG_qbinom REprintf("qbinom(p=%7g, n=%g, pr=%7g, l.t.=%d, log=%d): sigm=%g, gam=%g\n", p,n,pr, lower_tail, log_p, sigma, gamma); #endif /* Note : "same" code in qpois.c, qbinom.c, qnbinom.c -- * FIXME: This is far from optimal [cancellation for p ~= 1, etc]: */ if(!lower_tail || log_p) { p = R_DT_qIv(p); /* need check again (cancellation!): */ if (p == 0.) return 0.; if (p == 1.) return n; } /* temporary hack --- FIXME --- */ if (p + 1.01*DBL_EPSILON >= 1.) return n; /* y := approx.value (Cornish-Fisher expansion) : */ z = qnorm(p, 0., 1., /*lower_tail*/TRUE, /*log_p*/FALSE); y = floor(mu + sigma * (z + gamma * (z*z - 1) / 6) + 0.5); if(y > n) /* way off */ y = n; #ifdef DEBUG_qbinom REprintf(" new (p,1-p)=(%7g,%7g), z=qnorm(..)=%7g, y=%5g\n", p, 1-p, z, y); #endif z = pbinom(y, n, pr, /*lower_tail*/TRUE, /*log_p*/FALSE); /* fuzz to ensure left continuity: */ p *= 1 - 64*DBL_EPSILON; if(n < 1e5) return do_search(y, &z, p, n, pr, 1); /* Otherwise be a bit cleverer in the search */ { double incr = floor(n * 0.001), oldincr; do { oldincr = incr; y = do_search(y, &z, p, n, pr, incr); incr = fmax2(1, floor(incr/100)); } while(oldincr > 1 && incr > n*1e-15); return y; } } JAGS-4.3.2/src/jrmath/rchisq.c0000664000175000017500000000223114224052371012676 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rchisq(double df); * * DESCRIPTION * * Random variates from the chi-squared distribution. * * NOTES * * Calls rgamma to do the real work. */ #include "nmath.h" double rchisq(double df, JRNG *rng) { if (!R_FINITE(df) || df < 0.0) ML_ERR_return_NAN; return rgamma(df / 2.0, 2.0, rng); } JAGS-4.3.2/src/jrmath/dchisq.c0000664000175000017500000000177414224052371012673 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The density of the chi-squared distribution. */ #include "nmath.h" #include "dpq.h" double dchisq(double x, double df, int give_log) { return dgamma(x, df / 2., 2., give_log); } JAGS-4.3.2/src/jrmath/pchisq.c0000664000175000017500000000203714224052371012700 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the chi-squared distribution. */ #include "nmath.h" #include "dpq.h" double pchisq(double x, double df, int lower_tail, int log_p) { return pgamma(x, df/2., 2., lower_tail, log_p); } JAGS-4.3.2/src/jrmath/qchisq.c0000664000175000017500000000203314224052371012675 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The quantile function of the chi-squared distribution. */ #include "nmath.h" #include "dpq.h" double qchisq(double p, double df, int lower_tail, int log_p) { return qgamma(p, 0.5 * df, 2.0, lower_tail, log_p); } JAGS-4.3.2/src/jrmath/rexp.c0000664000175000017500000000226014224052371012365 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000--2008 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rexp(double scale) * * DESCRIPTION * * Random variates from the exponential distribution. * */ #include "nmath.h" double rexp(double scale, JRNG *rng) { if (!R_FINITE(scale) || scale <= 0.0) { if(scale == 0.) return 0.; /* else */ ML_ERR_return_NAN; } return scale * exp_rand(rng); // --> in ./sexp.c } JAGS-4.3.2/src/jrmath/dexp.c0000664000175000017500000000233514224052371012352 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The density of the exponential distribution. */ #include "nmath.h" #include "dpq.h" double dexp(double x, double scale, int give_log) { #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(scale)) return x + scale; #endif if (scale <= 0.0) ML_ERR_return_NAN; if (x < 0.) return R_D__0; return (give_log ? (-x / scale) - log(scale) : exp(-x / scale) / scale); } JAGS-4.3.2/src/jrmath/pexp.c0000664000175000017500000000265114224052371012367 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2002 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the exponential distribution. */ #include "nmath.h" #include "dpq.h" double pexp(double x, double scale, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(scale)) return x + scale; if (scale < 0) ML_ERR_return_NAN; #else if (scale <= 0) ML_ERR_return_NAN; #endif if (x <= 0.) return R_DT_0; /* same as weibull( shape = 1): */ x = -(x / scale); if (lower_tail) return (log_p /* log(1 - exp(x)) for x < 0 : */ ? (x > -M_LN2 ? log(-expm1(x)) : log1p(-exp(x))) : -expm1(x)); /* else: !lower_tail */ return R_D_exp(x); } JAGS-4.3.2/src/jrmath/qexp.c0000664000175000017500000000226714224052371012373 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The quantile function of the exponential distribution. * */ #include "nmath.h" #include "dpq.h" double qexp(double p, double scale, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(p) || ISNAN(scale)) return p + scale; #endif if (scale < 0) ML_ERR_return_NAN; R_Q_P01_check(p); if (p == R_DT_0) return 0; return - scale * R_DT_Clog(p); } JAGS-4.3.2/src/jrmath/rgamma.c0000664000175000017500000001352614224052514012661 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000--2008 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rgamma(double a, double scale); * * DESCRIPTION * * Random variates from the gamma distribution. * * REFERENCES * * [1] Shape parameter a >= 1. Algorithm GD in: * * Ahrens, J.H. and Dieter, U. (1982). * Generating gamma variates by a modified * rejection technique. * Comm. ACM, 25, 47-54. * * * [2] Shape parameter 0 < a < 1. Algorithm GS in: * * Ahrens, J.H. and Dieter, U. (1974). * Computer methods for sampling from gamma, beta, * poisson and binomial distributions. * Computing, 12, 223-246. * * Input: a = parameter (mean) of the standard gamma distribution. * Output: a variate from the gamma(a)-distribution */ #include "nmath.h" #define repeat for(;;) double rgamma(double a, double scale, JRNG *rng) { /* Constants : */ const static double sqrt32 = 5.656854; const static double exp_m1 = 0.36787944117144232159;/* exp(-1) = 1/e */ /* 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) */ const static double q1 = 0.04166669; const static double q2 = 0.02083148; const static double q3 = 0.00801191; const static double q4 = 0.00144121; const static double q5 = -7.388e-5; const static double q6 = 2.4511e-4; const static double q7 = 2.424e-4; const static double a1 = 0.3333333; const static double a2 = -0.250003; const static double a3 = 0.2000062; const static double a4 = -0.1662921; const static double a5 = 0.1423657; const static double a6 = -0.1367177; const static double a7 = 0.1233795; /* State variables [FIXME for threading!] :*/ static double aa = 0.; static double aaa = 0.; static double s, s2, d; /* no. 1 (step 1) */ static double q0, b, si, c;/* no. 2 (step 4) */ double e, p, q, r, t, u, v, w, x, ret_val; if (!R_FINITE(a) || !R_FINITE(scale) || a < 0.0 || scale <= 0.0) { if(scale == 0.) return 0.; ML_ERR_return_NAN; } if (a < 1.) { /* GS algorithm for parameters a < 1 */ if(a == 0) return 0.; e = 1.0 + exp_m1 * a; repeat { p = e * unif_rand(rng); if (p >= 1.0) { x = -log((e - p) / a); if (exp_rand(rng) >= (1.0 - a) * log(x)) break; } else { x = exp(log(p) / a); if (exp_rand(rng) >= x) break; } } return scale * x; } /* --- a >= 1 : GD algorithm --- */ /* Step 1: Recalculations of s2, s, d if a has changed */ if (a != aa) { aa = a; s2 = a - 0.5; s = sqrt(s2); d = sqrt32 - s * 12.0; } /* Step 2: t = standard normal deviate, x = (s,1/2) -normal deviate. */ /* immediate acceptance (i) */ t = norm_rand(rng); x = s + 0.5 * t; ret_val = x * x; if (t >= 0.0) return scale * ret_val; /* Step 3: u = 0,1 - uniform sample. squeeze acceptance (s) */ u = unif_rand(rng); if (d * u <= t * t * t) return scale * ret_val; /* Step 4: recalculations of q0, b, si, c if necessary */ if (a != aaa) { 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) { b = 0.463 + s + 0.178 * s2; si = 1.235; c = 0.195 / s - 0.079 + 0.16 * s; } else if (a <= 13.022) { b = 1.654 + 0.0076 * s2; si = 1.68 / s + 0.275; c = 0.062 / s + 0.024; } else { b = 1.77; si = 0.75; c = 0.1515 / s; } } /* Step 5: no quotient test if x not positive */ if (x > 0.0) { /* Step 6: calculation of v and quotient q */ v = t / (s + s); if (fabs(v) <= 0.25) q = q0 + 0.5 * t * t * ((((((a7 * v + a6) * v + a5) * v + a4) * v + a3) * v + a2) * v + a1) * v; else q = q0 - s * t + 0.25 * t * t + (s2 + s2) * log(1.0 + v); /* Step 7: quotient acceptance (q) */ if (log(1.0 - u) <= q) return scale * ret_val; } repeat { /* Step 8: e = standard exponential deviate * u = 0,1 -uniform deviate * t = (b,si)-double exponential (laplace) sample */ e = exp_rand(rng); u = unif_rand(rng); u = u + u - 1.0; if (u < 0.0) t = b - si * e; else t = b + si * e; /* Step 9: rejection if t < tau(1) = -0.71874483771719 */ if (t >= -0.71874483771719) { /* Step 10: calculation of v and quotient q */ v = t / (s + s); if (fabs(v) <= 0.25) q = q0 + 0.5 * t * t * ((((((a7 * v + a6) * v + a5) * v + a4) * v + a3) * v + a2) * v + a1) * v; else q = q0 - s * t + 0.25 * t * t + (s2 + s2) * log(1.0 + v); /* Step 11: hat acceptance (h) */ /* (if q not positive go to step 8) */ if (q > 0.0) { w = expm1(q); /* ^^^^^ original code had approximation with rel.err < 2e-7 */ /* if t is rejected sample again at step 8 */ if (c * fabs(u) <= w * exp(e - 0.5 * t * t)) break; } } } /* repeat .. until `t' is accepted */ x = s + 0.5 * t; return scale * x * x; } JAGS-4.3.2/src/jrmath/dgamma.c0000664000175000017500000000406214224052371012637 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000. * * Merge in to R: * Copyright (C) 2000 The R Core Team * Copyright (C) 2004 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * * Computes the density of the gamma distribution, * * 1/s (x/s)^{a-1} exp(-x/s) * p(x;a,s) = ----------------------- * (a-1)! * * where `s' is the scale (= 1/lambda in other parametrizations) * and `a' is the shape parameter ( = alpha in other contexts). * * The old (R 1.1.1) version of the code is available via `#define D_non_pois' */ #include "nmath.h" #include "dpq.h" double dgamma(double x, double shape, double scale, int give_log) { double pr; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(shape) || ISNAN(scale)) return x + shape + scale; #endif if (shape < 0 || scale <= 0) ML_ERR_return_NAN; if (x < 0) return R_D__0; if (shape == 0) /* point mass at 0 */ return (x == 0)? ML_POSINF : R_D__0; if (x == 0) { if (shape < 1) return ML_POSINF; if (shape > 1) return R_D__0; /* else */ return give_log ? -log(scale) : 1 / scale; } if (shape < 1) { pr = dpois_raw(shape, x/scale, give_log); return give_log ? pr + log(shape/x) : pr*shape/x; } /* else shape >= 1 */ pr = dpois_raw(shape-1, x/scale, give_log); return give_log ? pr - log(scale) : pr/scale; } JAGS-4.3.2/src/jrmath/pgamma.c0000664000175000017500000004633714224052371012666 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 2005-6 Morten Welinder * Copyright (C) 2005-10 The R Foundation * Copyright (C) 2006-10 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * * double pgamma (double x, double alph, double scale, * int lower_tail, int log_p) * * double log1pmx (double x) * double lgamma1p (double a) * * double logspace_add (double logx, double logy) * double logspace_sub (double logx, double logy) * * * DESCRIPTION * * This function computes the distribution function for the * gamma distribution with shape parameter alph and scale parameter * scale. This is also known as the incomplete gamma function. * See Abramowitz and Stegun (6.5.1) for example. * * NOTES * * Complete redesign by Morten Welinder, originally for Gnumeric. * Improvements (e.g. "while NEEDED_SCALE") by Martin Maechler * * REFERENCES * */ #include "nmath.h" #include "dpq.h" /*----------- DEBUGGING ------------- * make CFLAGS='-DDEBUG_p -g -I/usr/local/include -I../include' * (cd ~/R/D/r-devel/Linux-inst/src/nmath; gcc -std=gnu99 -I. -I../../src/include -I../../../R/src/include -I/usr/local/include -DDEBUG_p -g -O2 -c ../../../R/src/nmath/pgamma.c -o pgamma.o) */ /* Scalefactor:= (2^32)^8 = 2^256 = 1.157921e+77 */ #define SQR(x) ((x)*(x)) static const double scalefactor = SQR(SQR(SQR(4294967296.0))); #undef SQR /* If |x| > |k| * M_cutoff, then log[ exp(-x) * k^x ] =~= -x */ static const double M_cutoff = M_LN2 * DBL_MAX_EXP / DBL_EPSILON;/*=3.196577e18*/ /* Continued fraction for calculation of * 1/i + x/(i+d) + x^2/(i+2*d) + x^3/(i+3*d) + ... = sum_{k=0}^Inf x^k/(i+k*d) * * auxilary in log1pmx() and lgamma1p() */ static double logcf (double x, double i, double d, double eps /* ~ relative tolerance */) { double c1 = 2 * d; double c2 = i + d; double c4 = c2 + d; double a1 = c2; double b1 = i * (c2 - i * x); double b2 = d * d * x; double a2 = c4 * c2 - b2; #if 0 assert (i > 0); assert (d >= 0); #endif b2 = c4 * b1 - i * b2; while (fabs(a2 * b1 - a1 * b2) > fabs(eps * b1 * b2)) { double c3 = c2*c2*x; c2 += d; c4 += d; a1 = c4 * a2 - c3 * a1; b1 = c4 * b2 - c3 * b1; c3 = c1 * c1 * x; c1 += d; c4 += d; a2 = c4 * a1 - c3 * a2; b2 = c4 * b1 - c3 * b2; if (fabs (b2) > scalefactor) { a1 /= scalefactor; b1 /= scalefactor; a2 /= scalefactor; b2 /= scalefactor; } else if (fabs (b2) < 1 / scalefactor) { a1 *= scalefactor; b1 *= scalefactor; a2 *= scalefactor; b2 *= scalefactor; } } return a2 / b2; } /* Accurate calculation of log(1+x)-x, particularly for small x. */ double log1pmx (double x) { static const double minLog1Value = -0.79149064; if (x > 1 || x < minLog1Value) return log1p(x) - x; else { /* -.791 <= x <= 1 -- expand in [x/(2+x)]^2 =: y : * log(1+x) - x = x/(2+x) * [ 2 * y * S(y) - x], with * --------------------------------------------- * S(y) = 1/3 + y/5 + y^2/7 + ... = \sum_{k=0}^\infty y^k / (2k + 3) */ double r = x / (2 + x), y = r * r; if (fabs(x) < 1e-2) { static const double two = 2; return r * ((((two / 9 * y + two / 7) * y + two / 5) * y + two / 3) * y - x); } else { static const double tol_logcf = 1e-14; return r * (2 * y * logcf (y, 3, 2, tol_logcf) - x); } } } /* Compute log(gamma(a+1)) accurately also for small a (0 < a < 0.5). */ double lgamma1p (double a) { const double eulers_const = 0.5772156649015328606065120900824024; /* coeffs[i] holds (zeta(i+2)-1)/(i+2) , i = 0:(N-1), N = 40 : */ const int N = 40; static const double coeffs[40] = { 0.3224670334241132182362075833230126e-0,/* = (zeta(2)-1)/2 */ 0.6735230105319809513324605383715000e-1,/* = (zeta(3)-1)/3 */ 0.2058080842778454787900092413529198e-1, 0.7385551028673985266273097291406834e-2, 0.2890510330741523285752988298486755e-2, 0.1192753911703260977113935692828109e-2, 0.5096695247430424223356548135815582e-3, 0.2231547584535793797614188036013401e-3, 0.9945751278180853371459589003190170e-4, 0.4492623673813314170020750240635786e-4, 0.2050721277567069155316650397830591e-4, 0.9439488275268395903987425104415055e-5, 0.4374866789907487804181793223952411e-5, 0.2039215753801366236781900709670839e-5, 0.9551412130407419832857179772951265e-6, 0.4492469198764566043294290331193655e-6, 0.2120718480555466586923135901077628e-6, 0.1004322482396809960872083050053344e-6, 0.4769810169363980565760193417246730e-7, 0.2271109460894316491031998116062124e-7, 0.1083865921489695409107491757968159e-7, 0.5183475041970046655121248647057669e-8, 0.2483674543802478317185008663991718e-8, 0.1192140140586091207442548202774640e-8, 0.5731367241678862013330194857961011e-9, 0.2759522885124233145178149692816341e-9, 0.1330476437424448948149715720858008e-9, 0.6422964563838100022082448087644648e-10, 0.3104424774732227276239215783404066e-10, 0.1502138408075414217093301048780668e-10, 0.7275974480239079662504549924814047e-11, 0.3527742476575915083615072228655483e-11, 0.1711991790559617908601084114443031e-11, 0.8315385841420284819798357793954418e-12, 0.4042200525289440065536008957032895e-12, 0.1966475631096616490411045679010286e-12, 0.9573630387838555763782200936508615e-13, 0.4664076026428374224576492565974577e-13, 0.2273736960065972320633279596737272e-13, 0.1109139947083452201658320007192334e-13/* = (zeta(40+1)-1)/(40+1) */ }; const double c = 0.2273736845824652515226821577978691e-12;/* zeta(N+2)-1 */ const double tol_logcf = 1e-14; double lgam; int i; if (fabs (a) >= 0.5) return lgammafn (a + 1); /* Abramowitz & Stegun 6.1.33 : for |x| < 2, * <==> log(gamma(1+x)) = -(log(1+x) - x) - gamma*x + x^2 * \sum_{n=0}^\infty c_n (-x)^n * where c_n := (Zeta(n+2) - 1)/(n+2) = coeffs[n] * * Here, another convergence acceleration trick is used to compute * lgam(x) := sum_{n=0..Inf} c_n (-x)^n */ lgam = c * logcf(-a / 2, N + 2, 1, tol_logcf); for (i = N - 1; i >= 0; i--) lgam = coeffs[i] - a * lgam; return (a * lgam - eulers_const) * a - log1pmx (a); } /* lgamma1p */ /* * Compute the log of a sum from logs of terms, i.e., * * log (exp (logx) + exp (logy)) * * without causing overflows and without throwing away large handfuls * of accuracy. */ double logspace_add (double logx, double logy) { return fmax2 (logx, logy) + log1p (exp (-fabs (logx - logy))); } /* * Compute the log of a difference from logs of terms, i.e., * * log (exp (logx) - exp (logy)) * * without causing overflows and without throwing away large handfuls * of accuracy. */ double logspace_sub (double logx, double logy) { return logx + R_Log1_Exp(logy - logx); } /* dpois_wrap (x_P_1, lambda, g_log) == * dpois (x_P_1 - 1, lambda, g_log) := exp(-L) L^k / gamma(k+1) , k := x_P_1 - 1 */ static double dpois_wrap (double x_plus_1, double lambda, int give_log) { #ifdef DEBUG_p REprintf (" dpois_wrap(x+1=%.14g, lambda=%.14g, log=%d)\n", x_plus_1, lambda, give_log); #endif if (!R_FINITE(lambda)) return R_D__0; if (x_plus_1 > 1) return dpois_raw (x_plus_1 - 1, lambda, give_log); if (lambda > fabs(x_plus_1 - 1) * M_cutoff) return R_D_exp(-lambda - lgammafn(x_plus_1)); else { double d = dpois_raw (x_plus_1, lambda, give_log); #ifdef DEBUG_p REprintf (" -> d=dpois_raw(..)=%.14g\n", d); #endif return give_log ? d + log (x_plus_1 / lambda) : d * (x_plus_1 / lambda); } } /* * Abramowitz and Stegun 6.5.29 [right] */ static double pgamma_smallx (double x, double alph, int lower_tail, int log_p) { double sum = 0, c = alph, n = 0, term; #ifdef DEBUG_p REprintf (" pg_smallx(x=%.12g, alph=%.12g): ", x, alph); #endif /* * Relative to 6.5.29 all terms have been multiplied by alph * and the first, thus being 1, is omitted. */ do { n++; c *= -x / n; term = c / (alph + n); sum += term; } while (fabs (term) > DBL_EPSILON * fabs (sum)); #ifdef DEBUG_p REprintf ("%5.0f terms --> conv.sum=%g;", n, sum); #endif if (lower_tail) { double f1 = log_p ? log1p (sum) : 1 + sum; double f2; if (alph > 1) { f2 = dpois_raw (alph, x, log_p); f2 = log_p ? f2 + x : f2 * exp (x); } else if (log_p) f2 = alph * log (x) - lgamma1p (alph); else f2 = pow (x, alph) / exp (lgamma1p (alph)); #ifdef DEBUG_p REprintf (" (f1,f2)= (%g,%g)\n", f1,f2); #endif return log_p ? f1 + f2 : f1 * f2; } else { double lf2 = alph * log (x) - lgamma1p (alph); #ifdef DEBUG_p REprintf (" 1:%.14g 2:%.14g\n", alph * log (x), lgamma1p (alph)); REprintf (" sum=%.14g log(1+sum)=%.14g lf2=%.14g\n", sum, log1p (sum), lf2); #endif if (log_p) return R_Log1_Exp (log1p (sum) + lf2); else { double f1m1 = sum; double f2m1 = expm1 (lf2); return -(f1m1 + f2m1 + f1m1 * f2m1); } } } /* pgamma_smallx() */ static double pd_upper_series (double x, double y, int log_p) { double term = x / y; double sum = term; do { y++; term *= x / y; sum += term; } while (term > sum * DBL_EPSILON); /* sum = \sum_{n=1}^ oo x^n / (y*(y+1)*...*(y+n-1)) * = \sum_{n=0}^ oo x^(n+1) / (y*(y+1)*...*(y+n)) * = x/y * (1 + \sum_{n=1}^oo x^n / ((y+1)*...*(y+n))) * ~ x/y + o(x/y) {which happens when alph -> Inf} */ return log_p ? log (sum) : sum; } /* Continued fraction for calculation of * scaled upper-tail F_{gamma} * ~= (y / d) * [1 + (1-y)/d + O( ((1-y)/d)^2 ) ] */ static double pd_lower_cf (double y, double d) { double f= 0.0 /* -Wall */, of, f0; double i, c2, c3, c4, a1, b1, a2, b2; #define NEEDED_SCALE \ (b2 > scalefactor) { \ a1 /= scalefactor; \ b1 /= scalefactor; \ a2 /= scalefactor; \ b2 /= scalefactor; \ } #define max_it 200000 #ifdef DEBUG_p REprintf("pd_lower_cf(y=%.14g, d=%.14g)", y, d); #endif if (y == 0) return 0; f0 = y/d; /* Needed, e.g. for pgamma(10^c(100,295), shape= 1.1, log=TRUE): */ if(fabs(y - 1) < fabs(d) * DBL_EPSILON) { /* includes y < d = Inf */ #ifdef DEBUG_p REprintf(" very small 'y' -> returning (y/d)\n"); #endif return (f0); } if(f0 > 1.) f0 = 1.; c2 = y; c4 = d; /* original (y,d), *not* potentially scaled ones!*/ a1 = 0; b1 = 1; a2 = y; b2 = d; while NEEDED_SCALE i = 0; of = -1.; /* far away */ while (i < max_it) { i++; c2--; c3 = i * c2; c4 += 2; /* c2 = y - i, c3 = i(y - i), c4 = d + 2i, for i odd */ a1 = c4 * a2 + c3 * a1; b1 = c4 * b2 + c3 * b1; i++; c2--; c3 = i * c2; c4 += 2; /* c2 = y - i, c3 = i(y - i), c4 = d + 2i, for i even */ a2 = c4 * a1 + c3 * a2; b2 = c4 * b1 + c3 * b2; if NEEDED_SCALE if (b2 != 0) { f = a2 / b2; /* convergence check: relative; "absolute" for very small f : */ if (fabs (f - of) <= DBL_EPSILON * fmax2(f0, fabs(f))) { #ifdef DEBUG_p REprintf(" %g iter.\n", i); #endif return f; } of = f; } } MATHLIB_WARNING(" ** NON-convergence in pgamma()'s pd_lower_cf() f= %g.\n", f); return f;/* should not happen ... */ } /* pd_lower_cf() */ #undef NEEDED_SCALE static double pd_lower_series (double lambda, double y) { double term = 1, sum = 0; #ifdef DEBUG_p REprintf("pd_lower_series(lam=%.14g, y=%.14g) ...", lambda, y); #endif while (y >= 1 && term > sum * DBL_EPSILON) { term *= y / lambda; sum += term; y--; } /* sum = \sum_{n=0}^ oo y*(y-1)*...*(y - n) / lambda^(n+1) * = y/lambda * (1 + \sum_{n=1}^Inf (y-1)*...*(y-n) / lambda^n) * ~ y/lambda + o(y/lambda) */ #ifdef DEBUG_p REprintf(" done: term=%g, sum=%g, y= %g\n", term, sum, y); #endif if (y != floor (y)) { /* * The series does not converge as the terms start getting * bigger (besides flipping sign) for y < -lambda. */ double f; #ifdef DEBUG_p REprintf(" y not int: add another term "); #endif /* FIXME: in quite few cases, adding term*f has no effect (f too small) * and is unnecessary e.g. for pgamma(4e12, 121.1) */ f = pd_lower_cf (y, lambda + 1 - y); #ifdef DEBUG_p REprintf(" (= %.14g) * term = %.14g to sum %g\n", f, term * f, sum); #endif sum += term * f; } return sum; } /* pd_lower_series() */ /* * Compute the following ratio with higher accuracy that would be had * from doing it directly. * * dnorm (x, 0, 1, FALSE) * ---------------------------------- * pnorm (x, 0, 1, lower_tail, FALSE) * * Abramowitz & Stegun 26.2.12 */ static double dpnorm (double x, int lower_tail, double lp) { /* * So as not to repeat a pnorm call, we expect * * lp == pnorm (x, 0, 1, lower_tail, TRUE) * * but use it only in the non-critical case where either x is small * or p==exp(lp) is close to 1. */ if (x < 0) { x = -x; lower_tail = !lower_tail; } if (x > 10 && !lower_tail) { double term = 1 / x; double sum = term; double x2 = x * x; double i = 1; do { term *= -i / x2; sum += term; i += 2; } while (fabs (term) > DBL_EPSILON * sum); return 1 / sum; } else { double d = dnorm (x, 0., 1., FALSE); return d / exp (lp); } } /* * Asymptotic expansion to calculate the probability that Poisson variate * has value <= x. * Various assertions about this are made (without proof) at * http://members.aol.com/iandjmsmith/PoissonApprox.htm */ static double ppois_asymp (double x, double lambda, int lower_tail, int log_p) { static const double coefs_a[8] = { -1e99, /* placeholder used for 1-indexing */ 2/3., -4/135., 8/2835., 16/8505., -8992/12629925., -334144/492567075., 698752/1477701225. }; static const double coefs_b[8] = { -1e99, /* placeholder */ 1/12., 1/288., -139/51840., -571/2488320., 163879/209018880., 5246819/75246796800., -534703531/902961561600. }; double elfb, elfb_term; double res12, res1_term, res1_ig, res2_term, res2_ig; double dfm, pt_, s2pt, f, np; int i; dfm = lambda - x; /* If lambda is large, the distribution is highly concentrated about lambda. So representation error in x or lambda can lead to arbitrarily large values of pt_ and hence divergence of the coefficients of this approximation. */ pt_ = - log1pmx (dfm / x); s2pt = sqrt (2 * x * pt_); if (dfm < 0) s2pt = -s2pt; res12 = 0; res1_ig = res1_term = sqrt (x); res2_ig = res2_term = s2pt; for (i = 1; i < 8; i++) { res12 += res1_ig * coefs_a[i]; res12 += res2_ig * coefs_b[i]; res1_term *= pt_ / i ; res2_term *= 2 * pt_ / (2 * i + 1); res1_ig = res1_ig / x + res1_term; res2_ig = res2_ig / x + res2_term; } elfb = x; elfb_term = 1; for (i = 1; i < 8; i++) { elfb += elfb_term * coefs_b[i]; elfb_term /= x; } if (!lower_tail) elfb = -elfb; #ifdef DEBUG_p REprintf ("res12 = %.14g elfb=%.14g\n", elfb, res12); #endif f = res12 / elfb; np = pnorm (s2pt, 0.0, 1.0, !lower_tail, log_p); if (log_p) { double n_d_over_p = dpnorm (s2pt, !lower_tail, np); #ifdef DEBUG_p REprintf ("pp*_asymp(): f=%.14g np=e^%.14g nd/np=%.14g f*nd/np=%.14g\n", f, np, n_d_over_p, f * n_d_over_p); #endif return np + log1p (f * n_d_over_p); } else { double nd = dnorm (s2pt, 0., 1., log_p); #ifdef DEBUG_p REprintf ("pp*_asymp(): f=%.14g np=%.14g nd=%.14g f*nd=%.14g\n", f, np, nd, f * nd); #endif return np + f * nd; } } /* ppois_asymp() */ double pgamma_raw (double x, double alph, int lower_tail, int log_p) { /* Here, assume that (x,alph) are not NA & alph > 0 . */ double res; #ifdef DEBUG_p REprintf("pgamma_raw(x=%.14g, alph=%.14g, low=%d, log=%d)\n", x, alph, lower_tail, log_p); #endif R_P_bounds_01(x, 0., ML_POSINF); if (x < 1) { res = pgamma_smallx (x, alph, lower_tail, log_p); } else if (x <= alph - 1 && x < 0.8 * (alph + 50)) { /* incl. large alph compared to x */ double sum = pd_upper_series (x, alph, log_p);/* = x/alph + o(x/alph) */ double d = dpois_wrap (alph, x, log_p); #ifdef DEBUG_p REprintf(" alph 'large': sum=pd_upper*()= %.12g, d=dpois_w(*)= %.12g\n", sum, d); #endif if (!lower_tail) res = log_p ? R_Log1_Exp (d + sum) : 1 - d * sum; else res = log_p ? sum + d : sum * d; } else if (alph - 1 < x && alph < 0.8 * (x + 50)) { /* incl. large x compared to alph */ double sum; double d = dpois_wrap (alph, x, log_p); #ifdef DEBUG_p REprintf(" x 'large': d=dpois_w(*)= %.14g ", d); #endif if (alph < 1) { if (x * DBL_EPSILON > 1 - alph) sum = R_D__1; else { double f = pd_lower_cf (alph, x - (alph - 1)) * x / alph; /* = [alph/(x - alph+1) + o(alph/(x-alph+1))] * x/alph = 1 + o(1) */ sum = log_p ? log (f) : f; } } else { sum = pd_lower_series (x, alph - 1);/* = (alph-1)/x + o((alph-1)/x) */ sum = log_p ? log1p (sum) : 1 + sum; } #ifdef DEBUG_p REprintf(", sum= %.14g\n", sum); #endif if (!lower_tail) res = log_p ? sum + d : sum * d; else res = log_p ? R_Log1_Exp (d + sum) : 1 - d * sum; } else { /* x >= 1 and x fairly near alph. */ #ifdef DEBUG_p REprintf(" using ppois_asymp()\n"); #endif res = ppois_asymp (alph - 1, x, !lower_tail, log_p); } /* * We lose a fair amount of accuracy to underflow in the cases * where the final result is very close to DBL_MIN. In those * cases, simply redo via log space. */ if (!log_p && res < DBL_MIN / DBL_EPSILON) { /* with(.Machine, double.xmin / double.eps) #|-> 1.002084e-292 */ #ifdef DEBUG_p REprintf(" very small res=%.14g; -> recompute via log\n", res); #endif return exp (pgamma_raw (x, alph, lower_tail, 1)); } else return res; } double pgamma(double x, double alph, double scale, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(alph) || ISNAN(scale)) return x + alph + scale; #endif if(alph < 0. || scale <= 0.) ML_ERR_return_NAN; x /= scale; #ifdef IEEE_754 if (ISNAN(x)) /* eg. original x = scale = +Inf */ return x; #endif if(alph == 0.) /* limit case; useful e.g. in pnchisq() */ return (x <= 0) ? R_DT_0: R_DT_1; /* <= assert pgamma(0,0) ==> 0 */ return pgamma_raw (x, alph, lower_tail, log_p); } /* From: terra@gnome.org (Morten Welinder) * To: R-bugs@biostat.ku.dk * Cc: maechler@stat.math.ethz.ch * Subject: Re: [Rd] pgamma discontinuity (PR#7307) * Date: Tue, 11 Jan 2005 13:57:26 -0500 (EST) * this version of pgamma appears to be quite good and certainly a vast * improvement over current R code. (I last looked at 2.0.1) Apart from * type naming, this is what I have been using for Gnumeric 1.4.1. * This could be included into R as-is, but you might want to benefit from * making logcf, log1pmx, lgamma1p, and possibly logspace_add/logspace_sub * available to other parts of R. * MM: I've not (yet?) taken logcf(), but the other four */ JAGS-4.3.2/src/jrmath/qgamma.c0000664000175000017500000002207714224052371012662 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000--2011 The R Core Team * Copyright (C) 2004--2009 The R Foundation * based on AS 91 (C) 1979 Royal Statistical Society * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * Compute the quantile function of the gamma distribution. * * NOTES * * This function is based on the Applied Statistics * Algorithm AS 91 ("ppchi2") and via pgamma(.) AS 239. * * R core improvements: * o lower_tail, log_p * o non-trivial result for p outside [0.000002, 0.999998] * o p ~ 1 no longer gives +Inf; final Newton step(s) * * REFERENCES * * Best, D. J. and D. E. Roberts (1975). * Percentage Points of the Chi-Squared Distribution. * Applied Statistics 24, page 385. */ #include "nmath.h" #include "dpq.h" #ifdef DEBUG_qgamma # define DEBUG_q #endif attribute_hidden double qchisq_appr(double p, double nu, double g /* = log Gamma(nu/2) */, int lower_tail, int log_p, double tol /* EPS1 */) { #define C7 4.67 #define C8 6.66 #define C9 6.73 #define C10 13.32 double alpha, a, c, ch, p1; double p2, q, t, x; /* test arguments and initialise */ #ifdef IEEE_754 if (ISNAN(p) || ISNAN(nu)) return p + nu; #endif R_Q_P01_check(p); if (nu <= 0) ML_ERR_return_NAN; alpha = 0.5 * nu;/* = [pq]gamma() shape */ c = alpha-1; if(nu < (-1.24)*(p1 = R_DT_log(p))) { /* for small chi-squared */ /* log(alpha) + g = log(alpha) + log(gamma(alpha)) = * = log(alpha*gamma(alpha)) = lgamma(alpha+1) suffers from * catastrophic cancellation when alpha << 1 */ double lgam1pa = (alpha < 0.5) ? lgamma1p(alpha) : (log(alpha) + g); ch = exp((lgam1pa + p1)/alpha + M_LN2); #ifdef DEBUG_qgamma JREprintf(" small chi-sq., ch0 = %g\n", ch); #endif } else if(nu > 0.32) { /* using Wilson and Hilferty estimate */ x = qnorm(p, 0, 1, lower_tail, log_p); p1 = 2./(9*nu); ch = nu*pow(x*sqrt(p1) + 1-p1, 3); #ifdef DEBUG_qgamma JREprintf(" nu > .32: Wilson-Hilferty; x = %7g\n", x); #endif /* approximation for p tending to 1: */ if( ch > 2.2*nu + 6 ) ch = -2*(R_DT_Clog(p) - c*log(0.5*ch) + g); } else { /* "small nu" : 1.24*(-log(p)) <= nu <= 0.32 */ ch = 0.4; a = R_DT_Clog(p) + g + c*M_LN2; #ifdef DEBUG_qgamma JREprintf(" nu <= .32: a = %7g\n", a); #endif do { q = ch; p1 = 1. / (1+ch*(C7+ch)); p2 = ch*(C9+ch*(C8+ch)); t = -0.5 +(C7+2*ch)*p1 - (C9+ch*(C10+3*ch))/p2; ch -= (1- exp(a+0.5*ch)*p2*p1)/t; } while(fabs(q - ch) > tol * fabs(ch)); } return ch; } double qgamma(double p, double alpha, double scale, int lower_tail, int log_p) /* shape = alpha */ { #define EPS1 1e-2 #define EPS2 5e-7/* final precision of AS 91 */ #define EPS_N 1e-15/* precision of Newton step / iterations */ #define LN_EPS -36.043653389117156 /* = log(.Machine$double.eps) iff IEEE_754 */ #define MAXIT 1000/* was 20 */ #define pMIN 1e-100 /* was 0.000002 = 2e-6 */ #define pMAX (1-1e-14)/* was (1-1e-12) and 0.999998 = 1 - 2e-6 */ const static double i420 = 1./ 420., i2520 = 1./ 2520., i5040 = 1./ 5040; double p_, a, b, c, g, ch, ch0, p1; double p2, q, s1, s2, s3, s4, s5, s6, t, x; int i, max_it_Newton = 1; /* test arguments and initialise */ #ifdef IEEE_754 if (ISNAN(p) || ISNAN(alpha) || ISNAN(scale)) return p + alpha + scale; #endif R_Q_P01_boundaries(p, 0., ML_POSINF); if (alpha < 0 || scale <= 0) ML_ERR_return_NAN; if (alpha == 0) /* all mass at 0 : */ return 0.; if (alpha < 1e-10) { /* Warning seems unnecessary now: */ #ifdef _DO_WARN_qgamma_ MATHLIB_WARNING("value of shape (%g) is extremely small: results may be unreliable", alpha); #endif max_it_Newton = 7;/* may still be increased below */ } p_ = R_DT_qIv(p);/* lower_tail prob (in any case) */ #ifdef DEBUG_qgamma JREprintf("qgamma(p=%7g, alpha=%7g, scale=%7g, l.t.=%2d, log_p=%2d): ", p,alpha,scale, lower_tail, log_p); #endif g = lgammafn(alpha);/* log Gamma(v/2) */ /*----- Phase I : Starting Approximation */ ch = qchisq_appr(p, /* nu= 'df' = */ 2*alpha, /* lgamma(nu/2)= */ g, lower_tail, log_p, /* tol= */ EPS1); if(!R_FINITE(ch)) { /* forget about all iterations! */ max_it_Newton = 0; goto END; } if(ch < EPS2) {/* Corrected according to AS 91; MM, May 25, 1999 */ max_it_Newton = 20; goto END;/* and do Newton steps */ } /* FIXME: This (cutoff to {0, +Inf}) is far from optimal * ----- when log_p or !lower_tail, but NOT doing it can be even worse */ if(p_ > pMAX || p_ < pMIN) { /* did return ML_POSINF or 0.; much better: */ max_it_Newton = 20; goto END;/* and do Newton steps */ } #ifdef DEBUG_qgamma JREprintf("\t==> ch = %10g:", ch); #endif /*----- Phase II: Iteration * Call pgamma() [AS 239] and calculate seven term taylor series */ c = alpha-1; s6 = (120+c*(346+127*c)) * i5040; /* used below, is "const" */ ch0 = ch;/* save initial approx. */ for(i=1; i <= MAXIT; i++ ) { q = ch; p1 = 0.5*ch; p2 = p_ - pgamma_raw(p1, alpha, /*lower_tail*/TRUE, /*log_p*/FALSE); #ifdef DEBUG_qgamma if(i == 1) JREprintf(" Ph.II iter; ch=%g, p2=%g\n", ch, p2); if(i >= 2) JREprintf(" it=%d, ch=%g, p2=%g\n", i, ch, p2); #endif #ifdef IEEE_754 if(!R_FINITE(p2) || ch <= 0) #else if(errno != 0 || ch <= 0) #endif { ch = ch0; max_it_Newton = 27; goto END; }/*was return ML_NAN;*/ t = p2*exp(alpha*M_LN2+g+p1-c*log(ch)); b = t/ch; a = 0.5*t - b*c; s1 = (210+ a*(140+a*(105+a*(84+a*(70+60*a))))) * i420; s2 = (420+ a*(735+a*(966+a*(1141+1278*a)))) * i2520; s3 = (210+ a*(462+a*(707+932*a))) * i2520; s4 = (252+ a*(672+1182*a) + c*(294+a*(889+1740*a))) * i5040; s5 = (84+2264*a + c*(1175+606*a)) * i2520; ch += t*(1+0.5*t*s1-b*c*(s1-b*(s2-b*(s3-b*(s4-b*(s5-b*s6)))))); if(fabs(q - ch) < EPS2*ch) goto END; if(fabs(q - ch) > 0.1*ch) {/* diverging? -- also forces ch > 0 */ if(ch < q) ch = 0.9 * q; else ch = 1.1 * q; } } /* no convergence in MAXIT iterations -- but we add Newton now... */ #ifdef DEBUG_q MATHLIB_WARNING3("qgamma(%g) not converged in %d iterations; rel.ch=%g\n", p, MAXIT, ch/fabs(q - ch)); #endif /* was * ML_ERROR(ME_PRECISION, "qgamma"); * does nothing in R !*/ END: /* PR# 2214 : From: Morten Welinder , Fri, 25 Oct 2002 16:50 -------- To: R-bugs@biostat.ku.dk Subject: qgamma precision * With a final Newton step, double accuracy, e.g. for (p= 7e-4; nu= 0.9) * * Improved (MM): - only if rel.Err > EPS_N (= 1e-15); * - also for lower_tail = FALSE or log_p = TRUE * - optionally *iterate* Newton */ x = 0.5*scale*ch; if(max_it_Newton) { /* always use log scale */ if (!log_p) { p = log(p); log_p = TRUE; } if(x == 0) { const double _1_p = 1. + 1e-7; const double _1_m = 1. - 1e-7; x = DBL_MIN; p_ = pgamma(x, alpha, scale, lower_tail, log_p); if(( lower_tail && p_ > p * _1_p) || (!lower_tail && p_ < p * _1_m)) return(0.); /* else: continue, using x = DBL_MIN instead of 0 */ } else p_ = pgamma(x, alpha, scale, lower_tail, log_p); if(p_ == ML_NEGINF) return 0; /* PR#14710 */ for(i = 1; i <= max_it_Newton; i++) { p1 = p_ - p; #ifdef DEBUG_qgamma if(i == 1) JREprintf("\n it=%d: p=%g, x = %g, p.=%g; p1=d{p}=%g\n", i, p, x, p_, p1); if(i >= 2) JREprintf(" x{it= %d} = %g, p.=%g, p1=d{p}=%g\n", i, x, p_, p1); #endif if(fabs(p1) < fabs(EPS_N * p)) break; /* else */ if((g = dgamma(x, alpha, scale, log_p)) == R_D__0) { #ifdef DEBUG_q if(i == 1) JREprintf("no final Newton step because dgamma(*)== 0!\n"); #endif break; } /* else : * delta x = f(x)/f'(x); * if(log_p) f(x) := log P(x) - p; f'(x) = d/dx log P(x) = P' / P * ==> f(x)/f'(x) = f*P / P' = f*exp(p_) / P' (since p_ = log P(x)) */ t = log_p ? p1*exp(p_ - g) : p1/g ;/* = "delta x" */ t = lower_tail ? x - t : x + t; p_ = pgamma (t, alpha, scale, lower_tail, log_p); if (fabs(p_ - p) > fabs(p1) || (i > 1 && fabs(p_ - p) == fabs(p1)) /* <- against flip-flop */) { /* no improvement */ #ifdef DEBUG_qgamma if(i == 1 && max_it_Newton > 1) JREprintf("no Newton step done since delta{p} >= last delta\n"); #endif break; } /* else : */ #ifdef Harmful_notably_if_max_it_Newton_is_1 /* control step length: this could have started at the initial approximation */ if(t > 1.1*x) t = 1.1*x; else if(t < 0.9*x) t = 0.9*x; #endif x = t; } } return x; } JAGS-4.3.2/src/jrmath/rhyper.c0000664000175000017500000002106614224052514012724 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * Copyright (C) 2005 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rhyper(double NR, double NB, double n); * * DESCRIPTION * * Random variates from the hypergeometric distribution. * Returns the number of white balls drawn when kk balls * are drawn at random from an urn containing nn1 white * and nn2 black balls. * * REFERENCE * * V. Kachitvichyanukul and B. Schmeiser (1985). * ``Computer generation of hypergeometric random variates,'' * Journal of Statistical Computation and Simulation 22, 127-145. * * The original algorithm had a bug -- R bug report PR#7314 -- * giving numbers slightly too small in case III h2pe * where (m < 100 || ix <= 50) , see below. */ #include "nmath.h" #include "dpq.h" /* afc(i) := ln( i! ) [logarithm of the factorial i. * If (i > 7), use Stirling's approximation, otherwise use table lookup. */ static double afc(int i) { const static double al[9] = { 0.0, 0.0,/*ln(0!)=ln(1)*/ 0.0,/*ln(1!)=ln(1)*/ 0.69314718055994530941723212145817,/*ln(2) */ 1.79175946922805500081247735838070,/*ln(6) */ 3.17805383034794561964694160129705,/*ln(24)*/ 4.78749174278204599424770093452324, 6.57925121201010099506017829290394, 8.52516136106541430016553103634712 /*, 10.60460290274525022841722740072165*/ }; double di, value; if (i < 0) { MATHLIB_WARNING(("rhyper.c: afc(i), i=%d < 0 -- SHOULD NOT HAPPEN!\n"), i); return -1;/* unreached (Wall) */ } else if (i <= 7) { value = al[i + 1]; } else { di = i; value = (di + 0.5) * log(di) - di + 0.08333333333333 / di - 0.00277777777777 / di / di / di + 0.9189385332; } return value; } double rhyper(double nn1in, double nn2in, double kkin, JRNG *rng) { const static double con = 57.56462733; const static double deltal = 0.0078; const static double deltau = 0.0034; const static double scale = 1e25; /* extern double afc(int); */ int nn1, nn2, kk; int i, ix; Rboolean reject, setup1, setup2; double e, f, g, p, r, t, u, v, y; double de, dg, dr, ds, dt, gl, gu, nk, nm, ub; double xk, xm, xn, y1, ym, yn, yk, alv; /* These should become `thread_local globals' : */ static int ks = -1; static int n1s = -1, n2s = -1; static int k, m; static int minjx, maxjx, n1, n2; static double a, d, s, w; static double tn, xl, xr, kl, kr, lamdl, lamdr, p1, p2, p3; /* check parameter validity */ if(!R_FINITE(nn1in) || !R_FINITE(nn2in) || !R_FINITE(kkin)) ML_ERR_return_NAN; nn1 = (int) R_forceint(nn1in); nn2 = (int) R_forceint(nn2in); kk = (int) R_forceint(kkin); if (nn1 < 0 || nn2 < 0 || kk < 0 || kk > nn1 + nn2) ML_ERR_return_NAN; /* if new parameter values, initialize */ reject = TRUE; if (nn1 != n1s || nn2 != n2s) { setup1 = TRUE; setup2 = TRUE; } else if (kk != ks) { setup1 = FALSE; setup2 = TRUE; } else { setup1 = FALSE; setup2 = FALSE; } if (setup1) { n1s = nn1; n2s = nn2; tn = nn1 + nn2; if (nn1 <= nn2) { n1 = nn1; n2 = nn2; } else { n1 = nn2; n2 = nn1; } } if (setup2) { ks = kk; if (kk + kk >= tn) { k = (int)(tn - kk); } else { k = kk; } } if (setup1 || setup2) { m = (int) ((k + 1.0) * (n1 + 1.0) / (tn + 2.0)); minjx = imax2(0, k - n2); maxjx = imin2(n1, k); } /* generate random variate --- Three basic cases */ if (minjx == maxjx) { /* I: degenerate distribution ---------------- */ ix = maxjx; /* return ix; No, need to unmangle */ /* return appropriate variate */ if (kk + kk >= tn) { if (nn1 > nn2) { ix = kk - nn2 + ix; } else { ix = nn1 - ix; } } else { if (nn1 > nn2) ix = kk - ix; } return ix; } else if (m - minjx < 10) { /* II: inverse transformation ---------- */ if (setup1 || setup2) { if (k < n2) { w = exp(con + afc(n2) + afc(n1 + n2 - k) - afc(n2 - k) - afc(n1 + n2)); } else { w = exp(con + afc(n1) + afc(k) - afc(k - n2) - afc(n1 + n2)); } } L10: p = w; ix = minjx; u = unif_rand(rng) * scale; L20: if (u > p) { u -= p; p *= (n1 - ix) * (k - ix); ix++; p = p / ix / (n2 - k + ix); if (ix > maxjx) goto L10; goto L20; } } else { /* III : h2pe --------------------------------------------- */ if (setup1 || setup2) { s = sqrt((tn - k) * k * n1 * n2 / (tn - 1) / tn / tn); /* remark: d is defined in reference without int. */ /* the truncation centers the cell boundaries at 0.5 */ d = (int) (1.5 * s) + .5; xl = m - d + .5; xr = m + d + .5; a = afc(m) + afc(n1 - m) + afc(k - m) + afc(n2 - k + m); kl = exp(a - afc((int) (xl)) - afc((int) (n1 - xl)) - afc((int) (k - xl)) - afc((int) (n2 - k + xl))); kr = exp(a - afc((int) (xr - 1)) - afc((int) (n1 - xr + 1)) - afc((int) (k - xr + 1)) - afc((int) (n2 - k + xr - 1))); lamdl = -log(xl * (n2 - k + xl) / (n1 - xl + 1) / (k - xl + 1)); lamdr = -log((n1 - xr + 1) * (k - xr + 1) / xr / (n2 - k + xr)); p1 = d + d; p2 = p1 + kl / lamdl; p3 = p2 + kr / lamdr; } L30: u = unif_rand(rng) * p3; v = unif_rand(rng); if (u < p1) { /* rectangular region */ ix = (int) (xl + u); } else if (u <= p2) { /* left tail */ ix = (int) (xl + log(v) / lamdl); if (ix < minjx) goto L30; v = v * (u - p1) * lamdl; } else { /* right tail */ ix = (int) (xr - log(v) / lamdr); if (ix > maxjx) goto L30; v = v * (u - p2) * lamdr; } /* acceptance/rejection test */ if (m < 100 || ix <= 50) { /* explicit evaluation */ /* The original algorithm (and TOMS 668) have f = f * i * (n2 - k + i) / (n1 - i) / (k - i); in the (m > ix) case, but the definition of the recurrence relation on p134 shows that the +1 is needed. */ f = 1.0; if (m < ix) { for (i = m + 1; i <= ix; i++) f = f * (n1 - i + 1) * (k - i + 1) / (n2 - k + i) / i; } else if (m > ix) { for (i = ix + 1; i <= m; i++) f = f * i * (n2 - k + i) / (n1 - i + 1) / (k - i + 1); } if (v <= f) { reject = FALSE; } } else { /* squeeze using upper and lower bounds */ y = ix; y1 = y + 1.0; ym = y - m; yn = n1 - y + 1.0; yk = k - y + 1.0; nk = n2 - k + y1; r = -ym / y1; s = ym / yn; t = ym / yk; e = -ym / nk; g = yn * yk / (y1 * nk) - 1.0; dg = 1.0; if (g < 0.0) dg = 1.0 + g; gu = g * (1.0 + g * (-0.5 + g / 3.0)); gl = gu - .25 * (g * g * g * g) / dg; xm = m + 0.5; xn = n1 - m + 0.5; xk = k - m + 0.5; nm = n2 - k + xm; ub = y * gu - m * gl + deltau + xm * r * (1. + r * (-0.5 + r / 3.0)) + xn * s * (1. + s * (-0.5 + s / 3.0)) + xk * t * (1. + t * (-0.5 + t / 3.0)) + nm * e * (1. + e * (-0.5 + e / 3.0)); /* test against upper bound */ alv = log(v); if (alv > ub) { reject = TRUE; } else { /* test against lower bound */ dr = xm * (r * r * r * r); if (r < 0.0) dr /= (1.0 + r); ds = xn * (s * s * s * s); if (s < 0.0) ds /= (1.0 + s); dt = xk * (t * t * t * t); if (t < 0.0) dt /= (1.0 + t); de = nm * (e * e * e * e); if (e < 0.0) de /= (1.0 + e); if (alv < ub - 0.25 * (dr + ds + dt + de) + (y + m) * (gl - gu) - deltal) { reject = FALSE; } else { /* * Stirling's formula to machine accuracy */ if (alv <= (a - afc(ix) - afc(n1 - ix) - afc(k - ix) - afc(n2 - k + ix))) { reject = FALSE; } else { reject = TRUE; } } } } if (reject) goto L30; } /* return appropriate variate */ if (kk + kk >= tn) { if (nn1 > nn2) { ix = kk - nn2 + ix; } else { ix = nn1 - ix; } } else { if (nn1 > nn2) ix = kk - ix; } return ix; } JAGS-4.3.2/src/jrmath/dhyper.c0000664000175000017500000000436614224052371012713 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000. * * Merge in to R: * Copyright (C) 2000-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * * Given a sequence of r successes and b failures, we sample n (\le b+r) * items without replacement. The hypergeometric probability is the * probability of x successes: * * choose(r, x) * choose(b, n-x) * p(x; r,b,n) = ----------------------------- = * choose(r+b, n) * * dbinom(x,r,p) * dbinom(n-x,b,p) * = -------------------------------- * dbinom(n,r+b,p) * * for any p. For numerical stability, we take p=n/(r+b); with this choice, * the denominator is not exponentially small. */ #include "nmath.h" #include "dpq.h" double dhyper(double x, double r, double b, double n, int give_log) { double p, q, p1, p2, p3; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(r) || ISNAN(b) || ISNAN(n)) return x + r + b + n; #endif if (R_D_negInonint(r) || R_D_negInonint(b) || R_D_negInonint(n) || n > r+b) ML_ERR_return_NAN; if(x < 0) return(R_D__0); R_D_nonint_check(x);// incl warning x = R_forceint(x); r = R_forceint(r); b = R_forceint(b); n = R_forceint(n); if (n < x || r < x || n - x > b) return(R_D__0); if (n == 0) return((x == 0) ? R_D__1 : R_D__0); p = ((double)n)/((double)(r+b)); q = ((double)(r+b-n))/((double)(r+b)); p1 = dbinom_raw(x, r, p,q,give_log); p2 = dbinom_raw(n-x,b, p,q,give_log); p3 = dbinom_raw(n,r+b, p,q,give_log); return( (give_log) ? p1 + p2 - p3 : p1*p2/p3 ); } JAGS-4.3.2/src/jrmath/phyper.c0000664000175000017500000000651514224052371012725 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 1999-2014 The R Core Team * Copyright (C) 2004 Morten Welinder * Copyright (C) 2004 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the hypergeometric distribution. * * Current implementation based on posting * From: Morten Welinder * Cc: R-bugs@biostat.ku.dk * Subject: [Rd] phyper accuracy and efficiency (PR#6772) * Date: Thu, 15 Apr 2004 18:06:37 +0200 (CEST) ...... The current version has very serious cancellation issues. For example, if you ask for a small right-tail you are likely to get total cancellation. For example, phyper(59, 150, 150, 60, FALSE, FALSE) gives 6.372680161e-14. The right answer is dhyper(0, 150, 150, 60, FALSE) which is 5.111204798e-22. phyper is also really slow for large arguments. Therefore, I suggest using the code below. This is a sniplet from Gnumeric ... The code isn't perfect. In fact, if x*(NR+NB) is close to n*NR, then this code can take a while. Not longer than the old code, though. -- Thanks to Ian Smith for ideas. */ #include "nmath.h" #include "dpq.h" static double pdhyper (double x, double NR, double NB, double n, int log_p) { /* * Calculate * * phyper (x, NR, NB, n, TRUE, FALSE) * [log] ---------------------------------- * dhyper (x, NR, NB, n, FALSE) * * without actually calling phyper. This assumes that * * x * (NR + NB) <= n * NR * */ LDOUBLE sum = 0; LDOUBLE term = 1; while (x > 0 && term >= DBL_EPSILON * sum) { term *= x * (NB - n + x) / (n + 1 - x) / (NR + 1 - x); sum += term; x--; } double ss = (double) sum; return log_p ? log1p(ss) : 1 + ss; } /* FIXME: The old phyper() code was basically used in ./qhyper.c as well * ----- We need to sync this again! */ double phyper (double x, double NR, double NB, double n, int lower_tail, int log_p) { /* Sample of n balls from NR red and NB black ones; x are red */ double d, pd; #ifdef IEEE_754 if(ISNAN(x) || ISNAN(NR) || ISNAN(NB) || ISNAN(n)) return x + NR + NB + n; #endif x = floor (x + 1e-7); NR = R_forceint(NR); NB = R_forceint(NB); n = R_forceint(n); if (NR < 0 || NB < 0 || !R_FINITE(NR + NB) || n < 0 || n > NR + NB) ML_ERR_return_NAN; if (x * (NR + NB) > n * NR) { /* Swap tails. */ double oldNB = NB; NB = NR; NR = oldNB; x = n - x - 1; lower_tail = !lower_tail; } if (x < 0) return R_DT_0; if (x >= NR || x >= n) return R_DT_1; d = dhyper (x, NR, NB, n, log_p); pd = pdhyper(x, NR, NB, n, log_p); return log_p ? R_DT_Log(d + pd) : R_D_Lval(d * pd); } JAGS-4.3.2/src/jrmath/qhyper.c0000664000175000017500000000477014224052371012727 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The quantile function of the hypergeometric distribution. */ #include "nmath.h" #include "dpq.h" double qhyper(double p, double NR, double NB, double n, int lower_tail, int log_p) { /* This is basically the same code as ./phyper.c *used* to be --> FIXME! */ double N, xstart, xend, xr, xb, sum, term; int small_N; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(NR) || ISNAN(NB) || ISNAN(n)) return p + NR + NB + n; #endif if(!R_FINITE(p) || !R_FINITE(NR) || !R_FINITE(NB) || !R_FINITE(n)) ML_ERR_return_NAN; NR = R_forceint(NR); NB = R_forceint(NB); N = NR + NB; n = R_forceint(n); if (NR < 0 || NB < 0 || n < 0 || n > N) ML_ERR_return_NAN; /* Goal: Find xr (= #{red balls in sample}) such that * phyper(xr, NR,NB, n) >= p > phyper(xr - 1, NR,NB, n) */ xstart = fmax2(0, n - NB); xend = fmin2(n, NR); R_Q_P01_boundaries(p, xstart, xend); xr = xstart; xb = n - xr;/* always ( = #{black balls in sample} ) */ small_N = (N < 1000); /* won't have underflow in product below */ /* if N is small, term := product.ratio( bin.coef ); otherwise work with its logarithm to protect against underflow */ term = lfastchoose(NR, xr) + lfastchoose(NB, xb) - lfastchoose(N, n); if(small_N) term = exp(term); NR -= xr; NB -= xb; if(!lower_tail || log_p) { p = R_DT_qIv(p); } p *= 1 - 1000*DBL_EPSILON; /* was 64, but failed on FreeBSD sometimes */ sum = small_N ? term : exp(term); while(sum < p && xr < xend) { xr++; NB++; if (small_N) term *= (NR / xr) * (xb / NB); else term += log((NR / xr) * (xb / NB)); sum += small_N ? term : exp(term); xb--; NR--; } return xr; } JAGS-4.3.2/src/jrmath/rlnorm.c0000664000175000017500000000225014224052371012717 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000--2001 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rlnorm(double logmean, double logsd); * * DESCRIPTION * * Random variates from the lognormal distribution. */ #include "nmath.h" double rlnorm(double meanlog, double sdlog, JRNG *rng) { if(ISNAN(meanlog) || !R_FINITE(sdlog) || sdlog < 0.) ML_ERR_return_NAN; return exp(rnorm(meanlog, sdlog, rng)); } JAGS-4.3.2/src/jrmath/dlnorm.c0000664000175000017500000000272214224052371012705 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The density of the lognormal distribution. */ #include "nmath.h" #include "dpq.h" double dlnorm(double x, double meanlog, double sdlog, int give_log) { double y; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(meanlog) || ISNAN(sdlog)) return x + meanlog + sdlog; #endif if(sdlog <= 0) { if(sdlog < 0) ML_ERR_return_NAN; // sdlog == 0 : return (log(x) == meanlog) ? ML_POSINF : R_D__0; } if(x <= 0) return R_D__0; y = (log(x) - meanlog) / sdlog; return (give_log ? -(M_LN_SQRT_2PI + 0.5 * y * y + log(x * sdlog)) : M_1_SQRT_2PI * exp(-0.5 * y * y) / (x * sdlog)); /* M_1_SQRT_2PI = 1 / sqrt(2 * pi) */ } JAGS-4.3.2/src/jrmath/plnorm.c0000664000175000017500000000232414224052371012717 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-8 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The lognormal distribution function. */ #include "nmath.h" #include "dpq.h" double plnorm(double x, double meanlog, double sdlog, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(meanlog) || ISNAN(sdlog)) return x + meanlog + sdlog; #endif if (sdlog < 0) ML_ERR_return_NAN; if (x > 0) return pnorm(log(x), meanlog, sdlog, lower_tail, log_p); return R_DT_0; } JAGS-4.3.2/src/jrmath/qlnorm.c0000664000175000017500000000234114224052371012717 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-8 The R Core Team * Copyright (C) 2005 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * This the lognormal quantile function. */ #include "nmath.h" #include "dpq.h" double qlnorm(double p, double meanlog, double sdlog, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(p) || ISNAN(meanlog) || ISNAN(sdlog)) return p + meanlog + sdlog; #endif R_Q_P01_boundaries(p, 0, ML_POSINF); return exp(qnorm(p, meanlog, sdlog, lower_tail, log_p)); } JAGS-4.3.2/src/jrmath/rlogis.c0000664000175000017500000000220414224052371012704 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * Copyright (C) 2000--2008 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" double rlogis(double location, double scale, JRNG *rng) { if (ISNAN(location) || !R_FINITE(scale)) ML_ERR_return_NAN; if (scale == 0. || !R_FINITE(location)) return location; else { double u = unif_rand(rng); return location + scale * log(u / (1. - u)); } } JAGS-4.3.2/src/jrmath/dlogis.c0000664000175000017500000000236614224052371012677 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" #include "dpq.h" double dlogis(double x, double location, double scale, int give_log) { double e, f; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(location) || ISNAN(scale)) return x + location + scale; #endif if (scale <= 0.0) ML_ERR_return_NAN; x = fabs((x - location) / scale); e = exp(-x); f = 1.0 + e; return give_log ? -(x + log(scale * f * f)) : e / (scale * f * f); } JAGS-4.3.2/src/jrmath/plogis.c0000664000175000017500000000334314224052371012707 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" #include "dpq.h" /* Compute log(1 + exp(x)) without overflow (and fast for x > 18) For the two cutoffs, consider curve(log1p(exp(x)) - x, 33.1, 33.5, n=2^10) curve(x+exp(-x) - log1p(exp(x)), 15, 25, n=2^11) */ double log1pexp(double x) { if(x <= 18.) return log1p(exp(x)); if(x > 33.3) return x; // else: 18.0 < x <= 33.3 : return x + exp(-x); } double plogis(double x, double location, double scale, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(location) || ISNAN(scale)) return x + location + scale; #endif if (scale <= 0.0) ML_ERR_return_NAN; x = (x - location) / scale; if (ISNAN(x)) ML_ERR_return_NAN; R_P_bounds_Inf_01(x); if(log_p) { // log(1 / (1 + exp( +- x ))) = -log(1 + exp( +- x)) return -log1pexp(lower_tail ? -x : x); } else { return 1 / (1 + exp(lower_tail ? -x : x)); } } JAGS-4.3.2/src/jrmath/qlogis.c0000664000175000017500000000274414224052371012714 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * Copyright (C) 2000 The R Core Team * Copyright (C) 2005 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" #include "dpq.h" double qlogis(double p, double location, double scale, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(p) || ISNAN(location) || ISNAN(scale)) return p + location + scale; #endif R_Q_P01_boundaries(p, ML_NEGINF, ML_POSINF); if (scale < 0.) ML_ERR_return_NAN; if (scale == 0.) return location; /* p := logit(p) = log( p / (1-p) ) : */ if(log_p) { if(lower_tail) p = p - R_Log1_Exp(p); else p = R_Log1_Exp(p) - p; } else p = log(lower_tail ? (p / (1. - p)) : ((1. - p) / p)); return location + scale * p; } JAGS-4.3.2/src/jrmath/rnbinom.c0000664000175000017500000000346314224052371013061 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000--2006 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rnbinom(double n, double p) * * DESCRIPTION * * Random variates from the negative binomial distribution. * * NOTES * * x = the number of failures before the n-th success * * REFERENCE * * Devroye, L. (1986). * Non-Uniform Random Variate Generation. * New York:Springer-Verlag. Page 480. * * METHOD * * Generate lambda as gamma with shape parameter n and scale * parameter p/(1-p). Return a Poisson deviate with mean lambda. */ #include "nmath.h" double rnbinom(double size, double prob, JRNG *rng) { if(!R_FINITE(size) || !R_FINITE(prob) || size <= 0 || prob <= 0 || prob > 1) /* prob = 1 is ok, PR#1218 */ ML_ERR_return_NAN; return (prob == 1) ? 0 : rpois(rgamma(size, (1 - prob) / prob, rng), rng); } double rnbinom_mu(double size, double mu, JRNG *rng) { if(!R_FINITE(size) || !R_FINITE(mu) || size <= 0 || mu < 0) ML_ERR_return_NAN; return (mu == 0) ? 0 : rpois(rgamma(size, mu / size, rng), rng); } JAGS-4.3.2/src/jrmath/dnbinom.c0000664000175000017500000000644114224052371013042 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000 and Feb, 2001. * * dnbinom_mu(): Martin Maechler, June 2008 * * Merge in to R: * Copyright (C) 2000--2014, The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * * Computes the negative binomial distribution. For integer n, * this is probability of x failures before the nth success in a * sequence of Bernoulli trials. We do not enforce integer n, since * the distribution is well defined for non-integers, * and this can be useful for e.g. overdispersed discrete survival times. */ #include "nmath.h" #include "dpq.h" double dnbinom(double x, double size, double prob, int give_log) { double ans, p; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(size) || ISNAN(prob)) return x + size + prob; #endif if (prob <= 0 || prob > 1 || size < 0) ML_ERR_return_NAN; R_D_nonint_check(x); if (x < 0 || !R_FINITE(x)) return R_D__0; /* limiting case as size approaches zero is point mass at zero */ if (x == 0 && size==0) return R_D__1; x = R_forceint(x); ans = dbinom_raw(size, x+size, prob, 1-prob, give_log); p = ((double)size)/(size+x); return((give_log) ? log(p) + ans : p * ans); } double dnbinom_mu(double x, double size, double mu, int give_log) { /* originally, just set prob := size / (size + mu) and called dbinom_raw(), * but that suffers from cancellation when mu << size */ double ans, p; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(size) || ISNAN(mu)) return x + size + mu; #endif if (mu < 0 || size < 0) ML_ERR_return_NAN; R_D_nonint_check(x); if (x < 0 || !R_FINITE(x)) return R_D__0; /* limiting case as size approaches zero is point mass at zero, * even if mu is kept constant. limit distribution does not * have mean mu, though. */ if (x == 0 && size==0) return R_D__1; x = R_forceint(x); if(x == 0)/* be accurate, both for n << mu, and n >> mu :*/ return R_D_exp(size * (size < mu ? log(size/(size+mu)) : log1p(- mu/(size+mu)))); if(x < 1e-10 * size) { /* don't use dbinom_raw() but MM's formula: */ /* FIXME --- 1e-8 shows problem; rather use algdiv() from ./toms708.c */ p = (size < mu ? log(size/(1 + size/mu)) : log(mu / (1 + mu/size))); return R_D_exp(x * p - mu - lgamma(x+1) + log1p(x*(x-1)/(2*size))); } /* else: no unnecessary cancellation inside dbinom_raw, when * x_ = size and n_ = x+size are so close that n_ - x_ loses accuracy */ ans = dbinom_raw(size, x+size, size/(size+mu), mu/(size+mu), give_log); p = ((double)size)/(size+x); return((give_log) ? log(p) + ans : p * ans); } JAGS-4.3.2/src/jrmath/pnbinom.c0000664000175000017500000000511514224052371013053 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2013 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the negative binomial distribution. * * NOTES * * x = the number of failures before the n-th success */ #include "nmath.h" #include "dpq.h" double pnbinom(double x, double size, double prob, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(size) || ISNAN(prob)) return x + size + prob; if(!R_FINITE(size) || !R_FINITE(prob)) ML_ERR_return_NAN; #endif if (size < 0 || prob <= 0 || prob > 1) ML_ERR_return_NAN; /* limiting case: point mass at zero */ if (size == 0) return (x >= 0) ? R_DT_1 : R_DT_0; if (x < 0) return R_DT_0; if (!R_FINITE(x)) return R_DT_1; x = floor(x + 1e-7); return pbeta(prob, size, x + 1, lower_tail, log_p); } double pnbinom_mu(double x, double size, double mu, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(size) || ISNAN(mu)) return x + size + mu; if(!R_FINITE(size) || !R_FINITE(mu)) ML_ERR_return_NAN; #endif if (size < 0 || mu < 0) ML_ERR_return_NAN; /* limiting case: point mass at zero */ if (size == 0) return (x >= 0) ? R_DT_1 : R_DT_0; if (x < 0) return R_DT_0; if (!R_FINITE(x)) return R_DT_1; x = floor(x + 1e-7); /* return * pbeta(pr, size, x + 1, lower_tail, log_p); pr = size/(size + mu), 1-pr = mu/(size+mu) * *= pbeta_raw(pr, size, x + 1, lower_tail, log_p) * x. pin qin *= bratio (pin, qin, x., 1-x., &w, &wc, &ierr, log_p), and return w or wc .. *= bratio (size, x+1, pr, 1-pr, &w, &wc, &ierr, log_p) */ { int ierr; double w, wc; bratio(size, x+1, size/(size+mu), mu/(size+mu), &w, &wc, &ierr, log_p); if(ierr) MATHLIB_WARNING(_("pnbinom_mu() -> bratio() gave error code %d"), ierr); return lower_tail ? w : wc; } } JAGS-4.3.2/src/jrmath/qnbinom.c0000664000175000017500000000751114224052371013056 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * Copyright (C) 2005 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double qnbinom(double p, double size, double prob, * int lower_tail, int log_p) * * DESCRIPTION * * The quantile function of the negative binomial distribution. * * NOTES * * x = the number of failures before the n-th success * * METHOD * * Uses the Cornish-Fisher Expansion to include a skewness * correction to a normal approximation. This gives an * initial value which never seems to be off by more than * 1 or 2. A search is then conducted of values close to * this initial start point. */ #include "nmath.h" #include "dpq.h" static double do_search(double y, double *z, double p, double n, double pr, double incr) { if(*z >= p) { /* search to the left */ for(;;) { if(y == 0 || (*z = pnbinom(y - incr, n, pr, /*l._t.*/TRUE, /*log_p*/FALSE)) < p) return y; y = fmax2(0, y - incr); } } else { /* search to the right */ for(;;) { y = y + incr; if((*z = pnbinom(y, n, pr, /*l._t.*/TRUE, /*log_p*/FALSE)) >= p) return y; } } } double qnbinom(double p, double size, double prob, int lower_tail, int log_p) { double P, Q, mu, sigma, gamma, z, y; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(size) || ISNAN(prob)) return p + size + prob; #endif /* this happens if specified via mu, size, since prob == size/(size+mu) */ if (prob == 0 && size == 0) return 0; if (prob <= 0 || prob > 1 || size < 0) ML_ERR_return_NAN; if (prob == 1 || size == 0) return 0; R_Q_P01_boundaries(p, 0, ML_POSINF); Q = 1.0 / prob; P = (1.0 - prob) * Q; mu = size * P; sigma = sqrt(size * P * Q); gamma = (Q + P)/sigma; /* Note : "same" code in qpois.c, qbinom.c, qnbinom.c -- * FIXME: This is far from optimal [cancellation for p ~= 1, etc]: */ if(!lower_tail || log_p) { p = R_DT_qIv(p); /* need check again (cancellation!): */ if (p == R_DT_0) return 0; if (p == R_DT_1) return ML_POSINF; } /* temporary hack --- FIXME --- */ if (p + 1.01*DBL_EPSILON >= 1.) return ML_POSINF; /* y := approx.value (Cornish-Fisher expansion) : */ z = qnorm(p, 0., 1., /*lower_tail*/TRUE, /*log_p*/FALSE); y = R_forceint(mu + sigma * (z + gamma * (z*z - 1) / 6)); z = pnbinom(y, size, prob, /*lower_tail*/TRUE, /*log_p*/FALSE); /* fuzz to ensure left continuity: */ p *= 1 - 64*DBL_EPSILON; /* If the C-F value is not too large a simple search is OK */ if(y < 1e5) return do_search(y, &z, p, size, prob, 1); /* Otherwise be a bit cleverer in the search */ { double incr = floor(y * 0.001), oldincr; do { oldincr = incr; y = do_search(y, &z, p, size, prob, incr); incr = fmax2(1, floor(incr/100)); } while(oldincr > 1 && incr > y*1e-15); return y; } } double qnbinom_mu(double p, double size, double mu, int lower_tail, int log_p) { /* FIXME! Implement properly!! (not losing accuracy for very large size (prob ~= 1)*/ return qnbinom(p, size, /* prob = */ size/(size+mu), lower_tail, log_p); } JAGS-4.3.2/src/jrmath/rnorm.c0000664000175000017500000000236214224052371012547 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include "Rnorm.h" * double rnorm(double mu, double sigma); * * DESCRIPTION * * Random variates from the normal distribution. * */ #include "nmath.h" double rnorm(double mu, double sigma, JRNG *rng) { if (ISNAN(mu) || !R_FINITE(sigma) || sigma < 0.) ML_ERR_return_NAN; if (sigma == 0. || !R_FINITE(mu)) return mu; /* includes mu = +/- Inf with finite sigma */ else return mu + sigma * norm_rand(rng); } JAGS-4.3.2/src/jrmath/dnorm.c0000664000175000017500000000654514224052371012540 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * Copyright (C) 2003 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * double dnorm4(double x, double mu, double sigma, int give_log) * {dnorm (..) is synonymous and preferred inside R} * * DESCRIPTION * * Compute the density of the normal distribution. */ #include "nmath.h" #include "dpq.h" double dnorm4(double x, double mu, double sigma, int give_log) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(mu) || ISNAN(sigma)) return x + mu + sigma; #endif if(!R_FINITE(sigma)) return R_D__0; if(!R_FINITE(x) && mu == x) return ML_NAN;/* x-mu is NaN */ if (sigma <= 0) { if (sigma < 0) ML_ERR_return_NAN; /* sigma == 0 */ return (x == mu) ? ML_POSINF : R_D__0; } x = (x - mu) / sigma; if(!R_FINITE(x)) return R_D__0; x = fabs (x); if (x >= 2 * sqrt(DBL_MAX)) return R_D__0; if (give_log) return -(M_LN_SQRT_2PI + 0.5 * x * x + log(sigma)); // M_1_SQRT_2PI = 1 / sqrt(2 * pi) #ifdef MATHLIB_FAST_dnorm // and for R <= 3.0.x and R-devel upto 2014-01-01: return M_1_SQRT_2PI * exp(-0.5 * x * x) / sigma; #else // more accurate, less fast : if (x < 5) return M_1_SQRT_2PI * exp(-0.5 * x * x) / sigma; /* ELSE: * x*x may lose upto about two digits accuracy for "large" x * Morten Welinder's proposal for PR#15620 * https://bugs.r-project.org/bugzilla/show_bug.cgi?id=15620 * -- 1 -- No hoop jumping when we underflow to zero anyway: * -x^2/2 < log(2)*.Machine$double.min.exp <==> * x > sqrt(-2*log(2)*.Machine$double.min.exp) =IEEE= 37.64031 * but "thanks" to denormalized numbers, underflow happens a bit later, * effective.D.MIN.EXP <- with(.Machine, double.min.exp + double.ulp.digits) * for IEEE, DBL_MIN_EXP is -1022 but "effective" is -1074 * ==> boundary = sqrt(-2*log(2)*(.Machine$double.min.exp + .Machine$double.ulp.digits)) * =IEEE= 38.58601 * [on one x86_64 platform, effective boundary a bit lower: 38.56804] */ if (x > sqrt(-2*M_LN2*(DBL_MIN_EXP + 1-DBL_MANT_DIG))) return 0.; /* Now, to get full accurary, split x into two parts, * x = x1+x2, such that |x2| <= 2^-16. * Assuming that we are using IEEE doubles, that means that * x1*x1 is error free for x<1024 (but we have x < 38.6 anyway). * If we do not have IEEE this is still an improvement over the naive formula. */ double x1 = // R_forceint(x * 65536) / 65536 = ldexp( R_forceint(ldexp(x, 16)), -16); double x2 = x - x1; return M_1_SQRT_2PI / sigma * (exp(-0.5 * x1 * x1) * exp( (-0.5 * x2 - x1) * x2 ) ); #endif } JAGS-4.3.2/src/jrmath/pnorm.c0000664000175000017500000001717014224052371012550 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2013 The R Core Team * Copyright (C) 2003 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * * double pnorm5(double x, double mu, double sigma, int lower_tail,int log_p); * {pnorm (..) is synonymous and preferred inside R} * * void pnorm_both(double x, double *cum, double *ccum, * int i_tail, int log_p); * * DESCRIPTION * * The main computation evaluates near-minimax approximations derived * from those in "Rational Chebyshev approximations for the error * function" by W. J. Cody, Math. Comp., 1969, 631-637. This * transportable program uses rational functions that theoretically * approximate the normal distribution function to at least 18 * significant decimal digits. The accuracy achieved depends on the * arithmetic system, the compiler, the intrinsic functions, and * proper selection of the machine-dependent constants. * * REFERENCE * * Cody, W. D. (1993). * ALGORITHM 715: SPECFUN - A Portable FORTRAN Package of * Special Function Routines and Test Drivers". * ACM Transactions on Mathematical Software. 19, 22-32. * * EXTENSIONS * * The "_both" , lower, upper, and log_p variants were added by * Martin Maechler, Jan.2000; * as well as log1p() and similar improvements later on. * * James M. Rath contributed bug report PR#699 and patches correcting SIXTEN * and if() clauses {with a bug: "|| instead of &&" -> PR #2883) more in line * with the original Cody code. */ #include "nmath.h" #include "dpq.h" double pnorm5(double x, double mu, double sigma, int lower_tail, int log_p) { double p, cp; /* Note: The structure of these checks has been carefully thought through. * For example, if x == mu and sigma == 0, we get the correct answer 1. */ #ifdef IEEE_754 if(ISNAN(x) || ISNAN(mu) || ISNAN(sigma)) return x + mu + sigma; #endif if(!R_FINITE(x) && mu == x) return ML_NAN;/* x-mu is NaN */ if (sigma <= 0) { if(sigma < 0) ML_ERR_return_NAN; /* sigma = 0 : */ return (x < mu) ? R_DT_0 : R_DT_1; } p = (x - mu) / sigma; if(!R_FINITE(p)) return (x < mu) ? R_DT_0 : R_DT_1; x = p; pnorm_both(x, &p, &cp, (lower_tail ? 0 : 1), log_p); return(lower_tail ? p : cp); } #define SIXTEN 16 /* Cutoff allowing exact "*" and "/" */ void pnorm_both(double x, double *cum, double *ccum, int i_tail, int log_p) { /* i_tail in {0,1,2} means: "lower", "upper", or "both" : if(lower) return *cum := P[X <= x] if(upper) return *ccum := P[X > x] = 1 - P[X <= x] */ const static double a[5] = { 2.2352520354606839287, 161.02823106855587881, 1067.6894854603709582, 18154.981253343561249, 0.065682337918207449113 }; const static double b[4] = { 47.20258190468824187, 976.09855173777669322, 10260.932208618978205, 45507.789335026729956 }; const static double c[9] = { 0.39894151208813466764, 8.8831497943883759412, 93.506656132177855979, 597.27027639480026226, 2494.5375852903726711, 6848.1904505362823326, 11602.651437647350124, 9842.7148383839780218, 1.0765576773720192317e-8 }; const static double d[8] = { 22.266688044328115691, 235.38790178262499861, 1519.377599407554805, 6485.558298266760755, 18615.571640885098091, 34900.952721145977266, 38912.003286093271411, 19685.429676859990727 }; const static double p[6] = { 0.21589853405795699, 0.1274011611602473639, 0.022235277870649807, 0.001421619193227893466, 2.9112874951168792e-5, 0.02307344176494017303 }; const static double q[5] = { 1.28426009614491121, 0.468238212480865118, 0.0659881378689285515, 0.00378239633202758244, 7.29751555083966205e-5 }; double xden, xnum, temp, del, eps, xsq, y; #ifdef NO_DENORMS double min = DBL_MIN; #endif int i, lower, upper; #ifdef IEEE_754 if(ISNAN(x)) { *cum = *ccum = x; return; } #endif /* Consider changing these : */ eps = DBL_EPSILON * 0.5; /* i_tail in {0,1,2} =^= {lower, upper, both} */ lower = i_tail != 1; upper = i_tail != 0; y = fabs(x); if (y <= 0.67448975) { /* qnorm(3/4) = .6744.... -- earlier had 0.66291 */ if (y > eps) { xsq = x * x; xnum = a[4] * xsq; xden = xsq; for (i = 0; i < 3; ++i) { xnum = (xnum + a[i]) * xsq; xden = (xden + b[i]) * xsq; } } else xnum = xden = 0.0; temp = x * (xnum + a[3]) / (xden + b[3]); if(lower) *cum = 0.5 + temp; if(upper) *ccum = 0.5 - temp; if(log_p) { if(lower) *cum = log(*cum); if(upper) *ccum = log(*ccum); } } else if (y <= M_SQRT_32) { /* Evaluate pnorm for 0.674.. = qnorm(3/4) < |x| <= sqrt(32) ~= 5.657 */ xnum = c[8] * y; xden = y; for (i = 0; i < 7; ++i) { xnum = (xnum + c[i]) * y; xden = (xden + d[i]) * y; } temp = (xnum + c[7]) / (xden + d[7]); #define do_del(X) \ xsq = trunc(X * SIXTEN) / SIXTEN; \ del = (X - xsq) * (X + xsq); \ if(log_p) { \ *cum = (-xsq * xsq * 0.5) + (-del * 0.5) + log(temp); \ if((lower && x > 0.) || (upper && x <= 0.)) \ *ccum = log1p(-exp(-xsq * xsq * 0.5) * \ exp(-del * 0.5) * temp); \ } \ else { \ *cum = exp(-xsq * xsq * 0.5) * exp(-del * 0.5) * temp; \ *ccum = 1.0 - *cum; \ } #define swap_tail \ if (x > 0.) {/* swap ccum <--> cum */ \ temp = *cum; if(lower) *cum = *ccum; *ccum = temp; \ } do_del(y); swap_tail; } /* else |x| > sqrt(32) = 5.657 : * the next two case differentiations were really for lower=T, log=F * Particularly *not* for log_p ! * Cody had (-37.5193 < x && x < 8.2924) ; R originally had y < 50 * * Note that we do want symmetry(0), lower/upper -> hence use y */ else if((log_p && y < 1e170) /* avoid underflow below */ /* ^^^^^ MM FIXME: can speedup for log_p and much larger |x| ! * Then, make use of Abramowitz & Stegun, 26.2.13, something like xsq = x*x; if(xsq * DBL_EPSILON < 1.) del = (1. - (1. - 5./(xsq+6.)) / (xsq+4.)) / (xsq+2.); else del = 0.; *cum = -.5*xsq - M_LN_SQRT_2PI - log(x) + log1p(-del); *ccum = log1p(-exp(*cum)); /.* ~ log(1) = 0 *./ swap_tail; [Yes, but xsq might be infinite.] */ || (lower && -37.5193 < x && x < 8.2924) || (upper && -8.2924 < x && x < 37.5193) ) { /* Evaluate pnorm for x in (-37.5, -5.657) union (5.657, 37.5) */ xsq = 1.0 / (x * x); /* (1./x)*(1./x) might be better */ xnum = p[5] * xsq; xden = xsq; for (i = 0; i < 4; ++i) { xnum = (xnum + p[i]) * xsq; xden = (xden + q[i]) * xsq; } temp = xsq * (xnum + p[4]) / (xden + q[4]); temp = (M_1_SQRT_2PI - temp) / y; do_del(x); swap_tail; } else { /* large x such that probs are 0 or 1 */ if(x > 0) { *cum = R_D__1; *ccum = R_D__0; } else { *cum = R_D__0; *ccum = R_D__1; } } #ifdef NO_DENORMS /* do not return "denormalized" -- we do in R */ if(log_p) { if(*cum > -min) *cum = -0.; if(*ccum > -min)*ccum = -0.; } else { if(*cum < min) *cum = 0.; if(*ccum < min) *ccum = 0.; } #endif return; } JAGS-4.3.2/src/jrmath/qnorm.c0000664000175000017500000001266414224052371012554 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000--2005 The R Core Team * based on AS 111 (C) 1977 Royal Statistical Society * and on AS 241 (C) 1988 Royal Statistical Society * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * double qnorm5(double p, double mu, double sigma, * int lower_tail, int log_p) * {qnorm (..) is synonymous and preferred inside R} * * DESCRIPTION * * Compute the quantile function for the normal distribution. * * For small to moderate probabilities, algorithm referenced * below is used to obtain an initial approximation which is * polished with a final Newton step. * * For very large arguments, an algorithm of Wichura is used. * * REFERENCE * * Beasley, J. D. and S. G. Springer (1977). * Algorithm AS 111: The percentage points of the normal distribution, * Applied Statistics, 26, 118-121. * * Wichura, M.J. (1988). * Algorithm AS 241: The Percentage Points of the Normal Distribution. * Applied Statistics, 37, 477-484. */ #include "nmath.h" #include "dpq.h" double qnorm5(double p, double mu, double sigma, int lower_tail, int log_p) { double p_, q, r, val; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(mu) || ISNAN(sigma)) return p + mu + sigma; #endif R_Q_P01_boundaries(p, ML_NEGINF, ML_POSINF); if(sigma < 0) ML_ERR_return_NAN; if(sigma == 0) return mu; p_ = R_DT_qIv(p);/* real lower_tail prob. p */ q = p_ - 0.5; #ifdef DEBUG_qnorm REprintf("qnorm(p=%10.7g, m=%g, s=%g, l.t.= %d, log= %d): q = %g\n", p,mu,sigma, lower_tail, log_p, q); #endif /*-- use AS 241 --- */ /* double ppnd16_(double *p, long *ifault)*/ /* ALGORITHM AS241 APPL. STATIST. (1988) VOL. 37, NO. 3 Produces the normal deviate Z corresponding to a given lower tail area of P; Z is accurate to about 1 part in 10**16. (original fortran code used PARAMETER(..) for the coefficients and provided hash codes for checking them...) */ if (fabs(q) <= .425) {/* 0.075 <= p <= 0.925 */ r = .180625 - q * q; val = q * (((((((r * 2509.0809287301226727 + 33430.575583588128105) * r + 67265.770927008700853) * r + 45921.953931549871457) * r + 13731.693765509461125) * r + 1971.5909503065514427) * r + 133.14166789178437745) * r + 3.387132872796366608) / (((((((r * 5226.495278852854561 + 28729.085735721942674) * r + 39307.89580009271061) * r + 21213.794301586595867) * r + 5394.1960214247511077) * r + 687.1870074920579083) * r + 42.313330701600911252) * r + 1.); } else { /* closer than 0.075 from {0,1} boundary */ /* r = min(p, 1-p) < 0.075 */ if (q > 0) r = R_DT_CIv(p);/* 1-p */ else r = p_;/* = R_DT_Iv(p) ^= p */ r = sqrt(- ((log_p && ((lower_tail && q <= 0) || (!lower_tail && q > 0))) ? p : /* else */ log(r))); /* r = sqrt(-log(r)) <==> min(p, 1-p) = exp( - r^2 ) */ #ifdef DEBUG_qnorm REprintf("\t close to 0 or 1: r = %7g\n", r); #endif if (r <= 5.) { /* <==> min(p,1-p) >= exp(-25) ~= 1.3888e-11 */ r += -1.6; val = (((((((r * 7.7454501427834140764e-4 + .0227238449892691845833) * r + .24178072517745061177) * r + 1.27045825245236838258) * r + 3.64784832476320460504) * r + 5.7694972214606914055) * r + 4.6303378461565452959) * r + 1.42343711074968357734) / (((((((r * 1.05075007164441684324e-9 + 5.475938084995344946e-4) * r + .0151986665636164571966) * r + .14810397642748007459) * r + .68976733498510000455) * r + 1.6763848301838038494) * r + 2.05319162663775882187) * r + 1.); } else { /* very close to 0 or 1 */ r += -5.; val = (((((((r * 2.01033439929228813265e-7 + 2.71155556874348757815e-5) * r + .0012426609473880784386) * r + .026532189526576123093) * r + .29656057182850489123) * r + 1.7848265399172913358) * r + 5.4637849111641143699) * r + 6.6579046435011037772) / (((((((r * 2.04426310338993978564e-15 + 1.4215117583164458887e-7)* r + 1.8463183175100546818e-5) * r + 7.868691311456132591e-4) * r + .0148753612908506148525) * r + .13692988092273580531) * r + .59983220655588793769) * r + 1.); } if(q < 0.0) val = -val; /* return (q >= 0.)? r : -r ;*/ } return mu + sigma * val; } JAGS-4.3.2/src/jrmath/rpois.c0000664000175000017500000001473514224052371012555 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2011 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rpois(double lambda) * * DESCRIPTION * * Random variates from the Poisson distribution. * * REFERENCE * * Ahrens, J.H. and Dieter, U. (1982). * Computer generation of Poisson deviates * from modified normal distributions. * ACM Trans. Math. Software 8, 163-179. */ #include "nmath.h" #define a0 -0.5 #define a1 0.3333333 #define a2 -0.2500068 #define a3 0.2000118 #define a4 -0.1661269 #define a5 0.1421878 #define a6 -0.1384794 #define a7 0.1250060 #define one_7 0.1428571428571428571 #define one_12 0.0833333333333333333 #define one_24 0.0416666666666666667 #define repeat for(;;) double rpois(double mu, JRNG *rng) { /* Factorial Table (0:9)! */ const static double fact[10] = { 1., 1., 2., 6., 24., 120., 720., 5040., 40320., 362880. }; /* These are static --- persistent between calls for same mu : */ static int l, m; static double b1, b2, c, c0, c1, c2, c3; static double pp[36], p0, p, q, s, d, omega; static double big_l;/* integer "w/o overflow" */ static double muprev = 0., muprev2 = 0.;/*, muold = 0.*/ /* Local Vars [initialize some for -Wall]: */ double del, difmuk= 0., E= 0., fk= 0., fx, fy, g, px, py, t, u= 0., v, x; double pois = -1.; int k, kflag, big_mu, new_big_mu = FALSE; if (!R_FINITE(mu) || mu < 0) ML_ERR_return_NAN; if (mu <= 0.) return 0.; big_mu = mu >= 10.; if(big_mu) new_big_mu = FALSE; if (!(big_mu && mu == muprev)) {/* maybe compute new persistent par.s */ if (big_mu) { new_big_mu = TRUE; /* Case A. (recalculation of s,d,l because mu has changed): * The poisson probabilities pk exceed the discrete normal * probabilities fk whenever k >= m(mu). */ muprev = mu; s = sqrt(mu); d = 6. * mu * mu; big_l = floor(mu - 1.1484); /* = an upper bound to m(mu) for all mu >= 10.*/ } else { /* Small mu ( < 10) -- not using normal approx. */ /* Case B. (start new table and calculate p0 if necessary) */ /*muprev = 0.;-* such that next time, mu != muprev ..*/ if (mu != muprev) { muprev = mu; m = imax2(1, (int) mu); l = 0; /* pp[] is already ok up to pp[l] */ q = p0 = p = exp(-mu); } repeat { /* Step U. uniform sample for inversion method */ u = unif_rand(rng); if (u <= p0) return 0.; /* Step T. table comparison until the end pp[l] of the pp-table of cumulative poisson probabilities (0.458 > ~= pp[9](= 0.45792971447) for mu=10 ) */ if (l != 0) { for (k = (u <= 0.458) ? 1 : imin2(l, m); k <= l; k++) if (u <= pp[k]) return (double)k; if (l == 35) /* u > pp[35] */ continue; } /* Step C. creation of new poisson probabilities p[l..] and their cumulatives q =: pp[k] */ l++; for (k = l; k <= 35; k++) { p *= mu / k; q += p; pp[k] = q; if (u <= q) { l = k; return (double)k; } } l = 35; } /* end(repeat) */ }/* mu < 10 */ } /* end {initialize persistent vars} */ /* Only if mu >= 10 : ----------------------- */ /* Step N. normal sample */ g = mu + s * norm_rand(rng);/* norm_rand(rng) ~ N(0,1), standard normal */ if (g >= 0.) { pois = floor(g); /* Step I. immediate acceptance if pois is large enough */ if (pois >= big_l) return pois; /* Step S. squeeze acceptance */ fk = pois; difmuk = mu - fk; u = unif_rand(rng); /* ~ U(0,1) - sample */ if (d * u >= difmuk * difmuk * difmuk) return pois; } /* Step P. preparations for steps Q and H. (recalculations of parameters if necessary) */ if (new_big_mu || mu != muprev2) { /* Careful! muprev2 is not always == muprev because one might have exited in step I or S */ muprev2 = mu; omega = M_1_SQRT_2PI / s; /* The quantities b1, b2, c3, c2, c1, c0 are for the Hermite * approximations to the discrete normal probabilities fk. */ b1 = one_24 / mu; b2 = 0.3 * b1 * b1; c3 = one_7 * b1 * b2; c2 = b2 - 15. * c3; c1 = b1 - 6. * b2 + 45. * c3; c0 = 1. - b1 + 3. * b2 - 15. * c3; c = 0.1069 / mu; /* guarantees majorization by the 'hat'-function. */ } if (g >= 0.) { /* 'Subroutine' F is called (kflag=0 for correct return) */ kflag = 0; goto Step_F; } repeat { /* Step E. Exponential Sample */ E = exp_rand(rng); /* ~ Exp(1) (standard exponential) */ /* sample t from the laplace 'hat' (if t <= -0.6744 then pk < fk for all mu >= 10.) */ u = 2 * unif_rand(rng) - 1.; t = 1.8 + fsign(E, u); if (t > -0.6744) { pois = floor(mu + s * t); fk = pois; difmuk = mu - fk; /* 'subroutine' F is called (kflag=1 for correct return) */ kflag = 1; Step_F: /* 'subroutine' F : calculation of px,py,fx,fy. */ if (pois < 10) { /* use factorials from table fact[] */ px = -mu; py = pow(mu, pois) / fact[(int)pois]; } else { /* Case pois >= 10 uses polynomial approximation a0-a7 for accuracy when advisable */ del = one_12 / fk; del = del * (1. - 4.8 * del * del); v = difmuk / fk; if (fabs(v) <= 0.25) px = fk * v * v * (((((((a7 * v + a6) * v + a5) * v + a4) * v + a3) * v + a2) * v + a1) * v + a0) - del; else /* |v| > 1/4 */ px = fk * log(1. + v) - difmuk - del; py = M_1_SQRT_2PI / sqrt(fk); } x = (0.5 - difmuk) / s; x *= x;/* x^2 */ fx = -0.5 * x; fy = omega * (((c3 * x + c2) * x + c1) * x + c0); if (kflag > 0) { /* Step H. Hat acceptance (E is repeated on rejection) */ if (c * fabs(u) <= py * exp(px + E) - fy * exp(fx + E)) break; } else /* Step Q. Quotient acceptance (rare case) */ if (fy - u * fy <= py * exp(px - fx)) break; }/* t > -.67.. */ } return pois; } JAGS-4.3.2/src/jrmath/dpois.c0000664000175000017500000000404214224052371012525 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000. * * Merge in to R: * Copyright (C) 2000-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * * dpois() checks argument validity and calls dpois_raw(). * * dpois_raw() computes the Poisson probability lb^x exp(-lb) / x!. * This does not check that x is an integer, since dgamma() may * call this with a fractional x argument. Any necessary argument * checks should be done in the calling function. * */ #include "nmath.h" #include "dpq.h" double attribute_hidden dpois_raw(double x, double lambda, int give_log) { /* x >= 0 ; integer for dpois(), but not e.g. for pgamma()! lambda >= 0 */ if (lambda == 0) return( (x == 0) ? R_D__1 : R_D__0 ); if (!R_FINITE(lambda)) return R_D__0; if (x < 0) return( R_D__0 ); if (x <= lambda * DBL_MIN) return(R_D_exp(-lambda) ); if (lambda < x * DBL_MIN) return(R_D_exp(-lambda + x*log(lambda) -lgammafn(x+1))); return(R_D_fexp( M_2PI*x, -stirlerr(x)-bd0(x,lambda) )); } double dpois(double x, double lambda, int give_log) { #ifdef IEEE_754 if(ISNAN(x) || ISNAN(lambda)) return x + lambda; #endif if (lambda < 0) ML_ERR_return_NAN; R_D_nonint_check(x); if (x < 0 || !R_FINITE(x)) return R_D__0; x = R_forceint(x); return( dpois_raw(x,lambda,give_log) ); } JAGS-4.3.2/src/jrmath/ppois.c0000664000175000017500000000243314224052371012543 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the Poisson distribution. */ #include "nmath.h" #include "dpq.h" double ppois(double x, double lambda, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(lambda)) return x + lambda; #endif if(lambda < 0.) ML_ERR_return_NAN; if (x < 0) return R_DT_0; if (lambda == 0.) return R_DT_1; if (!R_FINITE(x)) return R_DT_1; x = floor(x + 1e-7); return pgamma(lambda, x + 1, 1., !lower_tail, log_p); } JAGS-4.3.2/src/jrmath/qpois.c0000664000175000017500000000641514224052371012550 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The quantile function of the Poisson distribution. * * METHOD * * Uses the Cornish-Fisher Expansion to include a skewness * correction to a normal approximation. This gives an * initial value which never seems to be off by more than * 1 or 2. A search is then conducted of values close to * this initial start point. */ #include "nmath.h" #include "dpq.h" static double do_search(double y, double *z, double p, double lambda, double incr) { if(*z >= p) { /* search to the left */ for(;;) { if(y == 0 || (*z = ppois(y - incr, lambda, /*l._t.*/TRUE, /*log_p*/FALSE)) < p) return y; y = fmax2(0, y - incr); } } else { /* search to the right */ for(;;) { y = y + incr; if((*z = ppois(y, lambda, /*l._t.*/TRUE, /*log_p*/FALSE)) >= p) return y; } } } double qpois(double p, double lambda, int lower_tail, int log_p) { double mu, sigma, gamma, z, y; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(lambda)) return p + lambda; #endif if(!R_FINITE(lambda)) ML_ERR_return_NAN; if(lambda < 0) ML_ERR_return_NAN; if(lambda == 0) return 0; R_Q_P01_boundaries(p, 0, ML_POSINF); mu = lambda; sigma = sqrt(lambda); /* gamma = sigma; PR#8058 should be kurtosis which is mu^-0.5 */ gamma = 1.0/sigma; /* Note : "same" code in qpois.c, qbinom.c, qnbinom.c -- * FIXME: This is far from optimal [cancellation for p ~= 1, etc]: */ if(!lower_tail || log_p) { p = R_DT_qIv(p); /* need check again (cancellation!): */ if (p == 0.) return 0; if (p == 1.) return ML_POSINF; } /* temporary hack --- FIXME --- */ if (p + 1.01*DBL_EPSILON >= 1.) return ML_POSINF; /* y := approx.value (Cornish-Fisher expansion) : */ z = qnorm(p, 0., 1., /*lower_tail*/TRUE, /*log_p*/FALSE); #ifdef HAVE_NEARBYINT y = nearbyint(mu + sigma * (z + gamma * (z*z - 1) / 6)); #else y = round(mu + sigma * (z + gamma * (z*z - 1) / 6)); #endif z = ppois(y, lambda, /*lower_tail*/TRUE, /*log_p*/FALSE); /* fuzz to ensure left continuity; 1 - 1e-7 may lose too much : */ p *= 1 - 64*DBL_EPSILON; /* If the mean is not too large a simple search is OK */ if(lambda < 1e5) return do_search(y, &z, p, lambda, 1); /* Otherwise be a bit cleverer in the search */ { double incr = floor(y * 0.001), oldincr; do { oldincr = incr; y = do_search(y, &z, p, lambda, incr); incr = fmax2(1, floor(incr/100)); } while(oldincr > 1 && incr > lambda*1e-15); return y; } } JAGS-4.3.2/src/jrmath/rt.c0000664000175000017500000000247214224052371012041 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2008 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * Pseudo-random variates from a t distribution. * * NOTES * * This function calls rchisq and rnorm to do the real work. */ #include "nmath.h" double rt(double df, JRNG *rng) { if (ISNAN(df) || df <= 0.0) ML_ERR_return_NAN; if(!R_FINITE(df)) return norm_rand(rng); else { /* Some compilers (including MW6) evaluated this from right to left return norm_rand(rng) / sqrt(rchisq(df, rng) / df); */ double num = norm_rand(rng); return num / sqrt(rchisq(df, rng) / df); } } JAGS-4.3.2/src/jrmath/dt.c0000664000175000017500000000505514224052371012023 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000. * * Merge in to R: * Copyright (C) 2000-2013 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * * The t density is evaluated as * sqrt(n/2) / ((n+1)/2) * Gamma((n+3)/2) / Gamma((n+2)/2). * * (1+x^2/n)^(-n/2) * / sqrt( 2 pi (1+x^2/n) ) * * This form leads to a stable computation for all * values of n, including n -> 0 and n -> infinity. */ #include "nmath.h" #include "dpq.h" double dt(double x, double n, int give_log) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(n)) return x + n; #endif if (n <= 0) ML_ERR_return_NAN; if(!R_FINITE(x)) return R_D__0; if(!R_FINITE(n)) return dnorm(x, 0., 1., give_log); double u, ax, t = -bd0(n/2.,(n+1)/2.) + stirlerr((n+1)/2.) - stirlerr(n/2.), x2n = x*x/n, // in [0, Inf] l_x2n; // := log(sqrt(1 + x2n)) = log(1 + x2n)/2 Rboolean lrg_x2n = (x2n > 1./DBL_EPSILON); if (lrg_x2n) { // large x^2/n : ax = fabs(x); l_x2n = log(ax) - log(n)/2.; // = log(x2n)/2 = 1/2 * log(x^2 / n) u = // log(1 + x2n) * n/2 = n * log(1 + x2n)/2 = n * l_x2n; } else if (x2n > 0.2) { l_x2n = log(1 + x2n)/2.; u = n * l_x2n; } else { l_x2n = log1p(x2n)/2.; u = -bd0(n/2.,(n+x*x)/2.) + x*x/2.; } //old: return R_D_fexp(M_2PI*(1+x2n), t-u); // R_D_fexp(f,x) := (give_log ? -0.5*log(f)+(x) : exp(x)/sqrt(f)) // f = 2pi*(1+x2n) // ==> 0.5*log(f) = log(2pi)/2 + log(1+x2n)/2 = log(2pi)/2 + l_x2n // 1/sqrt(f) = 1/sqrt(2pi * (1+ x^2 / n)) // = 1/sqrt(2pi)/(|x|/sqrt(n)*sqrt(1+1/x2n)) // = M_1_SQRT_2PI * sqrt(n)/ (|x|*sqrt(1+1/x2n)) if(give_log) return t-u - (M_LN_SQRT_2PI + l_x2n); // else : if(lrg_x2n) : sqrt(1 + 1/x2n) ='= sqrt(1) = 1 double I_sqrt_ = (lrg_x2n ? sqrt(n)/ax : exp(-l_x2n)); return exp(t-u) * M_1_SQRT_2PI * I_sqrt_; } JAGS-4.3.2/src/jrmath/pt.c0000664000175000017500000000511414224052371012033 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * Copyright (C) 2000-2007 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" #include "dpq.h" double pt(double x, double n, int lower_tail, int log_p) { /* return P[ T <= x ] where * T ~ t_{n} (t distrib. with n degrees of freedom). * --> ./pnt.c for NON-central */ double val, nx; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(n)) return x + n; #endif if (n <= 0.0) ML_ERR_return_NAN; if(!R_FINITE(x)) return (x < 0) ? R_DT_0 : R_DT_1; if(!R_FINITE(n)) return pnorm(x, 0.0, 1.0, lower_tail, log_p); #ifdef R_version_le_260 if (n > 4e5) { /*-- Fixme(?): test should depend on `n' AND `x' ! */ /* Approx. from Abramowitz & Stegun 26.7.8 (p.949) */ val = 1./(4.*n); return pnorm(x*(1. - val)/sqrt(1. + x*x*2.*val), 0.0, 1.0, lower_tail, log_p); } #endif nx = 1 + (x/n)*x; /* FIXME: This test is probably losing rather than gaining precision, * now that pbeta(*, log_p = TRUE) is much better. * Note however that a version of this test *is* needed for x*x > D_MAX */ if(nx > 1e100) { /* <==> x*x > 1e100 * n */ /* Danger of underflow. So use Abramowitz & Stegun 26.5.4 pbeta(z, a, b) ~ z^a(1-z)^b / aB(a,b) ~ z^a / aB(a,b), with z = 1/nx, a = n/2, b= 1/2 : */ double lval; lval = -0.5*n*(2*log(fabs(x)) - log(n)) - lbeta(0.5*n, 0.5) - log(0.5*n); val = log_p ? lval : exp(lval); } else { val = (n > x * x) ? pbeta (x * x / (n + x * x), 0.5, n / 2., /*lower_tail*/0, log_p) : pbeta (1. / nx, n / 2., 0.5, /*lower_tail*/1, log_p); } /* Use "1 - v" if lower_tail and x > 0 (but not both):*/ if(x <= 0.) lower_tail = !lower_tail; if(log_p) { if(lower_tail) return log1p(-0.5*exp(val)); else return val - M_LN2; /* = log(.5* pbeta(....)) */ } else { val /= 2.; return R_D_Cval(val); } } JAGS-4.3.2/src/jrmath/qt.c0000664000175000017500000001452314224052371012040 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2013 The R Core Team * Copyright (C) 2003-2013 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The "Student" t distribution quantile function. * * NOTES * * This is a C translation of the Fortran routine given in: * Hill, G.W (1970) "Algorithm 396: Student's t-quantiles" * CACM 13(10), 619-620. * * Supplemented by inversion for 0 < ndf < 1. * * ADDITIONS: * - lower_tail, log_p * - using expm1() : takes care of Lozy (1979) "Remark on Algo.", TOMS * - Apply 2-term Taylor expansion as in * Hill, G.W (1981) "Remark on Algo.396", ACM TOMS 7, 250-1 * - Improve the formula decision for 1 < df < 2 */ #include "nmath.h" #include "dpq.h" double qt(double p, double ndf, int lower_tail, int log_p) { const static double eps = 1.e-12; double P, q; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(ndf)) return p + ndf; #endif R_Q_P01_boundaries(p, ML_NEGINF, ML_POSINF); if (ndf <= 0) ML_ERR_return_NAN; if (ndf < 1) { /* based on qnt */ const static double accu = 1e-13; const static double Eps = 1e-11; /* must be > accu */ double ux, lx, nx, pp; int iter = 0; p = R_DT_qIv(p); /* Invert pt(.) : * 1. finding an upper and lower bound */ if(p > 1 - DBL_EPSILON) return ML_POSINF; pp = fmin2(1 - DBL_EPSILON, p * (1 + Eps)); for(ux = 1.; ux < DBL_MAX && pt(ux, ndf, TRUE, FALSE) < pp; ux *= 2); pp = p * (1 - Eps); for(lx =-1.; lx > -DBL_MAX && pt(lx, ndf, TRUE, FALSE) > pp; lx *= 2); /* 2. interval (lx,ux) halving regula falsi failed on qt(0.1, 0.1) */ do { nx = 0.5 * (lx + ux); if (pt(nx, ndf, TRUE, FALSE) > p) ux = nx; else lx = nx; } while ((ux - lx) / fabs(nx) > accu && ++iter < 1000); if(iter >= 1000) ML_ERROR(ME_PRECISION, "qt"); return 0.5 * (lx + ux); } /* Old comment: * FIXME: "This test should depend on ndf AND p !! * ----- and in fact should be replaced by * something like Abramowitz & Stegun 26.7.5 (p.949)" * * That would say that if the qnorm value is x then * the result is about x + (x^3+x)/4df + (5x^5+16x^3+3x)/96df^2 * The differences are tiny even if x ~ 1e5, and qnorm is not * that accurate in the extreme tails. */ if (ndf > 1e20) return qnorm(p, 0., 1., lower_tail, log_p); P = R_D_qIv(p); /* if exp(p) underflows, we fix below */ Rboolean neg = (!lower_tail || P < 0.5) && (lower_tail || P > 0.5), is_neg_lower = (lower_tail == neg); /* both TRUE or FALSE == !xor */ if(neg) P = 2 * (log_p ? (lower_tail ? P : -expm1(p)) : R_D_Lval(p)); else P = 2 * (log_p ? (lower_tail ? -expm1(p) : P) : R_D_Cval(p)); /* 0 <= P <= 1 ; P = 2*min(P', 1 - P') in all cases */ if (fabs(ndf - 2) < eps) { /* df ~= 2 */ if(P > DBL_MIN) { if(3* P < DBL_EPSILON) /* P ~= 0 */ q = 1 / sqrt(P); else if (P > 0.9) /* P ~= 1 */ q = (1 - P) * sqrt(2 /(P * (2 - P))); else /* eps/3 <= P <= 0.9 */ q = sqrt(2 / (P * (2 - P)) - 2); } else { /* P << 1, q = 1/sqrt(P) = ... */ if(log_p) q = is_neg_lower ? exp(- p/2) / M_SQRT2 : 1/sqrt(-expm1(p)); else q = ML_POSINF; } } else if (ndf < 1 + eps) { /* df ~= 1 (df < 1 excluded above): Cauchy */ if(P == 1.) q = 0; // some versions of tanpi give Inf, some NaN else if(P > 0) q = 1/tanpi(P/2.);/* == - tan((P+1) * M_PI_2) -- suffers for P ~= 0 */ else { /* P = 0, but maybe = 2*exp(p) ! */ if(log_p) /* 1/tan(e) ~ 1/e */ q = is_neg_lower ? M_1_PI * exp(-p) : -1./(M_PI * expm1(p)); else q = ML_POSINF; } } else { /*-- usual case; including, e.g., df = 1.1 */ double x = 0., y, log_P2 = 0./* -Wall */, a = 1 / (ndf - 0.5), b = 48 / (a * a), c = ((20700 * a / b - 98) * a - 16) * a + 96.36, d = ((94.5 / (b + c) - 3) / b + 1) * sqrt(a * M_PI_2) * ndf; Rboolean P_ok1 = P > DBL_MIN || !log_p, P_ok = P_ok1; if(P_ok1) { y = pow(d * P, 2.0 / ndf); P_ok = (y >= DBL_EPSILON); } if(!P_ok) {// log.p && P very.small || (d*P)^(2/df) =: y < eps_c log_P2 = is_neg_lower ? R_D_log(p) : R_D_LExp(p); /* == log(P / 2) */ x = (log(d) + M_LN2 + log_P2) / ndf; y = exp(2 * x); } if ((ndf < 2.1 && P > 0.5) || y > 0.05 + a) { /* P > P0(df) */ /* Asymptotic inverse expansion about normal */ if(P_ok) x = qnorm(0.5 * P, 0., 1., /*lower_tail*/TRUE, /*log_p*/FALSE); else /* log_p && P underflowed */ x = qnorm(log_P2, 0., 1., lower_tail, /*log_p*/ TRUE); y = x * x; if (ndf < 5) c += 0.3 * (ndf - 4.5) * (x + 0.6); c = (((0.05 * d * x - 5) * x - 7) * x - 2) * x + b + c; y = (((((0.4 * y + 6.3) * y + 36) * y + 94.5) / c - y - 3) / b + 1) * x; y = expm1(a * y * y); q = sqrt(ndf * y); } else if(!P_ok && x < - M_LN2 * DBL_MANT_DIG) {/* 0.5* log(DBL_EPSILON) */ /* y above might have underflown */ q = sqrt(ndf) * exp(-x); } else { /* re-use 'y' from above */ y = ((1 / (((ndf + 6) / (ndf * y) - 0.089 * d - 0.822) * (ndf + 2) * 3) + 0.5 / (ndf + 4)) * y - 1) * (ndf + 1) / (ndf + 2) + 1 / y; q = sqrt(ndf * y); } /* Now apply 2-term Taylor expansion improvement (1-term = Newton): * as by Hill (1981) [ref.above] */ /* FIXME: This can be far from optimal when log_p = TRUE * but is still needed, e.g. for qt(-2, df=1.01, log=TRUE). * Probably also improvable when lower_tail = FALSE */ if(P_ok1) { int it=0; while(it++ < 10 && (y = dt(q, ndf, FALSE)) > 0 && R_FINITE(x = (pt(q, ndf, FALSE, FALSE) - P/2) / y) && fabs(x) > 1e-14*fabs(q)) /* Newton (=Taylor 1 term): * q += x; * Taylor 2-term : */ q += x * (1. + x * q * (ndf + 1) / (2 * (q * q + ndf))); } } if(neg) q = -q; return q; } JAGS-4.3.2/src/jrmath/runif.c0000664000175000017500000000233314224052371012533 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * Random variates from the uniform distribution. */ #include "nmath.h" double runif(double a, double b, JRNG *rng) { if (!R_FINITE(a) || !R_FINITE(b) || b < a) ML_ERR_return_NAN; if (a == b) return a; else { double u; /* This is true of all builtin generators, but protect against user-supplied ones */ do {u = unif_rand(rng);} while (u <= 0 || u >= 1); return a + (b - a) * u; } } JAGS-4.3.2/src/jrmath/dunif.c0000664000175000017500000000224714224052371012521 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The density of the uniform distribution. */ #include "nmath.h" #include "dpq.h" double dunif(double x, double a, double b, int give_log) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(a) || ISNAN(b)) return x + a + b; #endif if (b <= a) ML_ERR_return_NAN; if (a <= x && x <= b) return give_log ? -log(b - a) : 1. / (b - a); return R_D__0; } JAGS-4.3.2/src/jrmath/punif.c0000664000175000017500000000250614224052371012533 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2006 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the uniform distribution. */ #include "nmath.h" #include "dpq.h" double punif(double x, double a, double b, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(a) || ISNAN(b)) return x + a + b; #endif if (b < a) ML_ERR_return_NAN; if (!R_FINITE(a) || !R_FINITE(b)) ML_ERR_return_NAN; if (x >= b) return R_DT_1; if (x <= a) return R_DT_0; if (lower_tail) return R_D_val((x - a) / (b - a)); else return R_D_val((b - x) / (b - a)); } JAGS-4.3.2/src/jrmath/qunif.c0000664000175000017500000000237114224052371012534 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2006 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The quantile function of the uniform distribution. */ #include "nmath.h" #include "dpq.h" double qunif(double p, double a, double b, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(p) || ISNAN(a) || ISNAN(b)) return p + a + b; #endif R_Q_P01_check(p); if (!R_FINITE(a) || !R_FINITE(b)) ML_ERR_return_NAN; if (b < a) ML_ERR_return_NAN; if (b == a) return a; return a + R_DT_qIv(p) * (b - a); } JAGS-4.3.2/src/jrmath/rweibull.c0000664000175000017500000000222214224052371013232 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * Random variates from the Weibull distribution. */ #include "nmath.h" double rweibull(double shape, double scale, JRNG *rng) { if (!R_FINITE(shape) || !R_FINITE(scale) || shape <= 0. || scale <= 0.) { if(scale == 0.) return 0.; /* else */ ML_ERR_return_NAN; } return scale * pow(-log(unif_rand(rng)), 1.0 / shape); } JAGS-4.3.2/src/jrmath/dweibull.c0000664000175000017500000000300614224052371013215 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-6 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The density function of the Weibull distribution. */ #include "nmath.h" #include "dpq.h" double dweibull(double x, double shape, double scale, int give_log) { double tmp1, tmp2; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(shape) || ISNAN(scale)) return x + shape + scale; #endif if (shape <= 0 || scale <= 0) ML_ERR_return_NAN; if (x < 0) return R_D__0; if (!R_FINITE(x)) return R_D__0; /* need to handle x == 0 separately */ if(x == 0 && shape < 1) return ML_POSINF; tmp1 = pow(x / scale, shape - 1); tmp2 = tmp1 * (x / scale); /* These are incorrect if tmp1 == 0 */ return give_log ? -tmp2 + log(shape * tmp1 / scale) : shape * tmp1 * exp(-tmp2) / scale; } JAGS-4.3.2/src/jrmath/pweibull.c0000664000175000017500000000256314224052371013240 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2002 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the Weibull distribution. */ #include "nmath.h" #include "dpq.h" double pweibull(double x, double shape, double scale, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(shape) || ISNAN(scale)) return x + shape + scale; #endif if(shape <= 0 || scale <= 0) ML_ERR_return_NAN; if (x <= 0) return R_DT_0; x = -pow(x / scale, shape); if (lower_tail) return (log_p /* log(1 - exp(x)) for x < 0 : */ ? R_Log1_Exp(x) : -expm1(x)); /* else: !lower_tail */ return R_D_exp(x); } JAGS-4.3.2/src/jrmath/qweibull.c0000664000175000017500000000242414224052371013235 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * Copyright (C) 2005 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The quantile function of the Weibull distribution. */ #include "nmath.h" #include "dpq.h" double qweibull(double p, double shape, double scale, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(p) || ISNAN(shape) || ISNAN(scale)) return p + shape + scale; #endif if (shape <= 0 || scale <= 0) ML_ERR_return_NAN; R_Q_P01_boundaries(p, 0, ML_POSINF); return scale * pow(- R_DT_Clog(p), 1./shape) ; } JAGS-4.3.2/src/jrmath/rnchisq.c0000664000175000017500000000431414224052371013060 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 2003 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rnchisq(double df, double lambda); * * DESCRIPTION * * Random variates from the NON CENTRAL chi-squared distribution. * * NOTES * According to Hans R. Kuensch's suggestion (30 sep 2002): It should be easy to do the general case (ncp > 0) by decomposing it as the sum of a central chisquare with df degrees of freedom plus a noncentral chisquare with zero degrees of freedom (which is a Poisson mixture of central chisquares with integer degrees of freedom), see Formula (29.5b-c) in Johnson, Kotz, Balakrishnan (1995). The noncentral chisquare with arbitary degrees of freedom is of interest for simulating the Cox-Ingersoll-Ross model for interest rates in finance. R code that works is rchisq0 <- function(n, ncp) { p <- 0 < (K <- rpois(n, lambda = ncp / 2)) r <- numeric(n) r[p] <- rchisq(sum(p), df = 2*K[p]) r } rchisq <- function(n, df, ncp=0) { if(missing(ncp)) .Internal(rchisq(n, df)) else rchisq0(n, ncp) + .Internal(rchisq(n, df)) } */ #include "nmath.h" double rnchisq(double df, double lambda, JRNG *rng) { if (!R_FINITE(df) || !R_FINITE(lambda) || df < 0. || lambda < 0.) ML_ERR_return_NAN; if(lambda == 0.) { if (df == 0.) ML_ERR_return_NAN; return rgamma(df / 2., 2., rng); } else { double r = rpois( lambda / 2., rng); if (r > 0.) r = rchisq(2. * r, rng); if (df > 0.) r += rgamma(df / 2., 2., rng); return r; } } JAGS-4.3.2/src/jrmath/dnchisq.c0000664000175000017500000000551014224052371013041 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-12 The R Core Team * Copyright (C) 2004-8 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The density of the noncentral chi-squared distribution with "df" * degrees of freedom and noncentrality parameter "ncp". */ #include "nmath.h" #include "dpq.h" double dnchisq(double x, double df, double ncp, int give_log) { const static double eps = 5e-15; double i, ncp2, q, mid, dfmid, imax; LDOUBLE sum, term; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(df) || ISNAN(ncp)) return x + df + ncp; #endif if (ncp < 0 || df <= 0) ML_ERR_return_NAN; if (!R_FINITE(df) || !R_FINITE(ncp)) ML_ERR_return_NAN; if(x < 0) return R_D__0; if(x == 0 && df < 2.) return ML_POSINF; if(ncp == 0) return dchisq(x, df, give_log); if(x == ML_POSINF) return R_D__0; ncp2 = 0.5 * ncp; /* find max element of sum */ imax = ceil((-(2+df) +sqrt((2-df) * (2-df) + 4 * ncp * x))/4); if (imax < 0) imax = 0; if(R_FINITE(imax)) { dfmid = df + 2 * imax; mid = dpois_raw(imax, ncp2, FALSE) * dchisq(x, dfmid, FALSE); } else /* imax = Inf */ mid = 0; if(mid == 0) { /* underflow to 0 -- maybe numerically correct; maybe can be more accurate, * particularly when give_log = TRUE */ /* Use central-chisq approximation formula when appropriate; * ((FIXME: the optimal cutoff also depends on (x,df); use always here? )) */ if(give_log || ncp > 1000.) { double nl = df + ncp, ic = nl/(nl + ncp);/* = "1/(1+b)" Abramowitz & St.*/ return dchisq(x*ic, nl*ic, give_log); } else return R_D__0; } sum = mid; /* errorbound := term * q / (1-q) now subsumed in while() / if() below: */ /* upper tail */ term = mid; df = dfmid; i = imax; double x2 = x * ncp2; do { i++; q = x2 / i / df; df += 2; term *= q; sum += term; } while (q >= 1 || term * q > (1-q)*eps || term > 1e-10*sum); /* lower tail */ term = mid; df = dfmid; i = imax; while (i) { df -= 2; q = i * df / x2; i--; term *= q; sum += term; if (q < 1 && term * q <= (1-q)*eps) break; } return R_D_val((double) sum); } JAGS-4.3.2/src/jrmath/pnchisq.c0000664000175000017500000002217614224052371013064 00000000000000/* * Algorithm AS 275 Appl.Statist. (1992), vol.41, no.2 * original (C) 1992 Royal Statistical Society * * Computes the noncentral chi-squared distribution function with * positive real degrees of freedom df and nonnegative noncentrality * parameter ncp. pnchisq_raw is based on * * Ding, C. G. (1992) * Algorithm AS275: Computing the non-central chi-squared * distribution function. Appl.Statist., 41, 478-482. * Other parts * Copyright (C) 2000-2014 The R Core Team * Copyright (C) 2003-2014 The R Foundation */ #include "nmath.h" #include "dpq.h" /*----------- DEBUGGING ------------- * * make CFLAGS='-DDEBUG_pnch ....' (cd ~/R/D/r-devel/debian-64-inst/src/nmath; gcc -I. -I../../src/include -I../../../R/src/include -I/usr/local/include -DHAVE_CONFIG_H -DDEBUG_pnch -fopenmp -g -pedantic -Wall --std=gnu99 -DDEBUG_q -Wcast-align -Wclobbered -c ../../../R/src/nmath/pnchisq.c -o pnchisq.o ) * -- Feb.6, 2000 (R pre0.99); M.Maechler: still have * bad precision & non-convergence in some cases (x ~= f, both LARGE) */ #ifdef HAVE_LONG_DOUBLE # define EXP expl # define FABS fabsl # define LOG logl #else # define EXP exp # define FABS fabs # define LOG log #endif static const double _dbl_min_exp = M_LN2 * DBL_MIN_EXP; /*= -708.3964 for IEEE double precision */ double pnchisq(double x, double df, double ncp, int lower_tail, int log_p) { double ans; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(df) || ISNAN(ncp)) return x + df + ncp; if (!R_FINITE(df) || !R_FINITE(ncp)) ML_ERR_return_NAN; #endif if (df < 0. || ncp < 0.) ML_ERR_return_NAN; ans = pnchisq_raw(x, df, ncp, 1e-12, 8*DBL_EPSILON, 1000000, lower_tail, log_p); if(ncp >= 80) { if(lower_tail) { ans = fmin2(ans, R_D__1); /* e.g., pchisq(555, 1.01, ncp = 80) */ } else { /* !lower_tail */ /* since we computed the other tail cancellation is likely */ if(ans < (log_p ? (-10. * M_LN10) : 1e-10)) ML_ERROR(ME_PRECISION, "pnchisq"); if(!log_p) ans = fmax2(ans, 0.0); /* Precaution PR#7099 */ } } if (!log_p || ans < -1e-8) return ans; else { // log_p && ans > -1e-8 // prob. = exp(ans) is near one: we can do better using the other tail #ifdef DEBUG_pnch JREprintf(" pnchisq_raw(*, log_p): ans=%g => 2nd call, other tail\n", ans); #endif // FIXME: (sum,sum2) will be the same (=> return them as well and reuse here ?) ans = pnchisq_raw(x, df, ncp, 1e-12, 8*DBL_EPSILON, 1000000, !lower_tail, FALSE); return log1p(-ans); } } double attribute_hidden pnchisq_raw(double x, double f, double theta /* = ncp */, double errmax, double reltol, int itrmax, Rboolean lower_tail, Rboolean log_p) { double lam, x2, f2, term, bound, f_x_2n, f_2n; double l_lam = -1., l_x = -1.; /* initialized for -Wall */ int n; Rboolean lamSml, tSml, is_r, is_b, is_it; LDOUBLE ans, u, v, t, lt, lu =-1; if (x <= 0.) { if(x == 0. && f == 0.) return lower_tail ? exp(-0.5*theta) : -expm1(-0.5*theta); /* x < 0 or {x==0, f > 0} */ return lower_tail ? 0. : 1.; } if(!R_FINITE(x)) return lower_tail ? 1. : 0.; /* This is principally for use from qnchisq */ #ifndef MATHLIB_STANDALONE R_CheckUserInterrupt(); #endif if(theta < 80) { /* use 110 for Inf, as ppois(110, 80/2, lower.tail=FALSE) is 2e-20 */ LDOUBLE sum, sum2, lambda = 0.5 * theta, pr, ans; int i; // Have pgamma(x,s) < x^s / Gamma(s+1) (< and ~= for small x) // ==> pchisq(x, f) = pgamma(x, f/2, 2) = pgamma(x/2, f/2) // < (x/2)^(f/2) / Gamma(f/2+1) < eps // <==> f/2 * log(x/2) - log(Gamma(f/2+1)) < log(eps) ( ~= -708.3964 ) // <==> log(x/2) < 2/f*(log(Gamma(f/2+1)) + log(eps)) // <==> log(x) < log(2) + 2/f*(log(Gamma(f/2+1)) + log(eps)) if(lower_tail && f > 0. && log(x) < M_LN2 + 2/f*(lgamma(f/2. + 1) + _dbl_min_exp)) { // all pchisq(x, f+2*i, lower_tail, FALSE), i=0,...,110 would underflow to 0. // ==> work in log scale sum = sum2 = ML_NEGINF; pr = -lambda; /* we need to renormalize here: the result could be very close to 1 */ for(i = 0; i < 110; pr += LOG(lambda) - LOG(++i)) { sum2 = logspace_add(sum2, pr); sum = logspace_add(sum, pr + pchisq(x, f+2*i, lower_tail, TRUE)); if (sum2 >= -1e-15) /*<=> EXP(sum2) >= 1-1e-15 */ break; } ans = sum - sum2; #ifdef DEBUG_pnch JREprintf("pnchisq(x=%g, f=%g, th.=%g); th. < 80, logspace: i=%d, ans=(sum=%g)-(sum2=%g)\n", x,f,theta, i, (double)sum, (double)sum2); #endif return (double) (log_p ? ans : EXP(ans)); } else { sum = sum2 = 0; pr = EXP(-lambda); // does this need a feature test? /* we need to renormalize here: the result could be very close to 1 */ for(i = 0; i < 110; pr *= lambda/++i) { // pr == exp(-lambda) lambda^i / i! == dpois(i, lambda) sum2 += pr; // pchisq(*, i, *) is strictly decreasing to 0 for lower_tail=TRUE // and strictly increasing to 1 for lower_tail=FALSE sum += pr * pchisq(x, f+2*i, lower_tail, FALSE); if (sum2 >= 1-1e-15) break; } ans = sum/sum2; #ifdef DEBUG_pnch JREprintf("pnchisq(x=%g, f=%g, theta=%g); theta < 80: i=%d, sum=%g, sum2=%g\n", x,f,theta, i, (double)sum, (double)sum2); #endif return (double) (log_p ? LOG(ans) : ans); } } // if(theta < 80) // else: theta == ncp >= 80 -------------------------------------------- #ifdef DEBUG_pnch JREprintf("pnchisq(x=%g, f=%g, theta=%g >= 80): ",x,f,theta); #endif // Series expansion ------- FIXME: log_p=TRUE, lower_tail=FALSE only applied at end lam = .5 * theta; lamSml = (-lam < _dbl_min_exp); if(lamSml) { /* MATHLIB_ERROR( "non centrality parameter (= %g) too large for current algorithm", theta) */ u = 0; lu = -lam;/* == ln(u) */ l_lam = log(lam); } else { u = exp(-lam); } /* evaluate the first term */ v = u; x2 = .5 * x; f2 = .5 * f; f_x_2n = f - x; #ifdef DEBUG_pnch JREprintf("-- v=exp(-th/2)=%g, x/2= %g, f/2= %g\n",v,x2,f2); #endif if(f2 * DBL_EPSILON > 0.125 && /* very large f and x ~= f: probably needs */ FABS(t = x2 - f2) < /* another algorithm anyway */ sqrt(DBL_EPSILON) * f2) { /* evade cancellation error */ /* t = exp((1 - t)*(2 - t/(f2 + 1))) / sqrt(2*M_PI*(f2 + 1));*/ lt = (1 - t)*(2 - t/(f2 + 1)) - M_LN_SQRT_2PI - 0.5 * log(f2 + 1); #ifdef DEBUG_pnch JREprintf(" (case I) ==> "); #endif } else { /* Usual case 2: careful not to overflow .. : */ lt = f2*log(x2) -x2 - lgammafn(f2 + 1); } #ifdef DEBUG_pnch JREprintf(" lt= %g", lt); #endif tSml = (lt < _dbl_min_exp); if(tSml) { #ifdef DEBUG_pnch JREprintf(" is very small\n"); #endif if (x > f + theta + 5* sqrt( 2*(f + 2*theta))) { /* x > E[X] + 5* sigma(X) */ return R_DT_1; /* FIXME: could be more accurate than 0. */ } /* else */ l_x = log(x); ans = term = 0.; t = 0; } else { t = EXP(lt); #ifdef DEBUG_pnch JREprintf(", t=exp(lt)= %g\n", t); #endif ans = term = (double) (v * t); } for (n = 1, f_2n = f + 2., f_x_2n += 2.; ; n++, f_2n += 2, f_x_2n += 2) { #ifdef DEBUG_pnch_n JREprintf("\n _OL_: n=%d",n); #endif #ifndef MATHLIB_STANDALONE if(n % 1000) R_CheckUserInterrupt(); #endif /* f_2n === f + 2*n * f_x_2n === f - x + 2*n > 0 <==> (f+2n) > x */ if (f_x_2n > 0) { /* find the error bound and check for convergence */ bound = (double) (t * x / f_x_2n); #ifdef DEBUG_pnch_n JREprintf("\n L10: n=%d; term= %g; bound= %g",n,term,bound); #endif is_r = is_it = FALSE; /* convergence only if BOTH absolute and relative error < 'bnd' */ if (((is_b = (bound <= errmax)) && (is_r = (term <= reltol * ans))) || (is_it = (n > itrmax))) { #ifdef DEBUG_pnch JREprintf("BREAK n=%d %s; bound= %g %s, rel.err= %g %s\n", n, (is_it ? "> itrmax" : ""), bound, (is_b ? "<= errmax" : ""), term/ans, (is_r ? "<= reltol" : "")); #endif break; /* out completely */ } } /* evaluate the next term of the */ /* expansion and then the partial sum */ if(lamSml) { lu += l_lam - log(n); /* u = u* lam / n */ if(lu >= _dbl_min_exp) { /* no underflow anymore ==> change regime */ #ifdef DEBUG_pnch_n JREprintf(" n=%d; nomore underflow in u = exp(lu) ==> change\n", n); #endif v = u = EXP(lu); /* the first non-0 'u' */ lamSml = FALSE; } } else { u *= lam / n; v += u; } if(tSml) { lt += l_x - log(f_2n);/* t <- t * (x / f2n) */ if(lt >= _dbl_min_exp) { /* no underflow anymore ==> change regime */ #ifdef DEBUG_pnch JREprintf(" n=%d; nomore underflow in t = exp(lt) ==> change\n", n); #endif t = EXP(lt); /* the first non-0 't' */ tSml = FALSE; } } else { t *= x / f_2n; } if(!lamSml && !tSml) { term = (double) (v * t); ans += term; } } /* for(n ...) */ if (is_it) { MATHLIB_WARNING2(_("pnchisq(x=%g, ..): not converged in %d iter."), x, itrmax); } #ifdef DEBUG_pnch JREprintf("\n == L_End: n=%d; term= %g; bound=%g\n",n,term,bound); #endif return (double) R_DT_val(ans); } JAGS-4.3.2/src/jrmath/qnchisq.c0000664000175000017500000000654514224052371013067 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 1995, 1996 Robert Gentleman and Ross Ihaka * Copyright (C) 2000-2008 The R Core Team * Copyright (C) 2004 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" #include "dpq.h" double qnchisq(double p, double df, double ncp, int lower_tail, int log_p) { const static double accu = 1e-13; const static double racc = 4*DBL_EPSILON; /* these two are for the "search" loops, can have less accuracy: */ const static double Eps = 1e-11; /* must be > accu */ const static double rEps= 1e-10; /* relative tolerance ... */ double ux, lx, ux0, nx, pp; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(df) || ISNAN(ncp)) return p + df + ncp; #endif if (!R_FINITE(df)) ML_ERR_return_NAN; /* Was * df = floor(df + 0.5); * if (df < 1 || ncp < 0) ML_ERR_return_NAN; */ if (df < 0 || ncp < 0) ML_ERR_return_NAN; R_Q_P01_boundaries(p, 0, ML_POSINF); /* Invert pnchisq(.) : * 1. finding an upper and lower bound */ { /* This is Pearson's (1959) approximation, which is usually good to 4 figs or so. */ double b, c, ff; b = (ncp*ncp)/(df + 3*ncp); c = (df + 3*ncp)/(df + 2*ncp); ff = (df + 2 * ncp)/(c*c); ux = b + c * qchisq(p, ff, lower_tail, log_p); if(ux < 0) ux = 1; ux0 = ux; } p = R_D_qIv(p); if(!lower_tail && ncp >= 80) { /* pnchisq is only for lower.tail = TRUE */ if(p < 1e-10) ML_ERROR(ME_PRECISION, "qnchisq"); p = 1. - p; lower_tail = TRUE; } if(lower_tail) { if(p > 1 - DBL_EPSILON) return ML_POSINF; pp = fmin2(1 - DBL_EPSILON, p * (1 + Eps)); for(; ux < DBL_MAX && pnchisq_raw(ux, df, ncp, Eps, rEps, 10000, TRUE, FALSE) < pp; ux *= 2); pp = p * (1 - Eps); for(lx = fmin2(ux0, DBL_MAX); lx > DBL_MIN && pnchisq_raw(lx, df, ncp, Eps, rEps, 10000, TRUE, FALSE) > pp; lx *= 0.5); } else { if(p > 1 - DBL_EPSILON) return 0.0; pp = fmin2(1 - DBL_EPSILON, p * (1 + Eps)); for(; ux < DBL_MAX && pnchisq_raw(ux, df, ncp, Eps, rEps, 10000, FALSE, FALSE) > pp; ux *= 2); pp = p * (1 - Eps); for(lx = fmin2(ux0, DBL_MAX); lx > DBL_MIN && pnchisq_raw(lx, df, ncp, Eps, rEps, 10000, FALSE, FALSE) < pp; lx *= 0.5); } /* 2. interval (lx,ux) halving : */ if(lower_tail) { do { nx = 0.5 * (lx + ux); if (pnchisq_raw(nx, df, ncp, accu, racc, 100000, TRUE, FALSE) > p) ux = nx; else lx = nx; } while ((ux - lx) / nx > accu); } else { do { nx = 0.5 * (lx + ux); if (pnchisq_raw(nx, df, ncp, accu, racc, 100000, FALSE, FALSE) < p) ux = nx; else lx = nx; } while ((ux - lx) / nx > accu); } return 0.5 * (ux + lx); } JAGS-4.3.2/src/jrmath/rcauchy.c0000664000175000017500000000237214224052371013051 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000--2008 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rcauchy(double location, double scale); * * DESCRIPTION * * Random variates from the Cauchy distribution. */ #include "nmath.h" double rcauchy(double location, double scale, JRNG *rng) { if (ISNAN(location) || !R_FINITE(scale) || scale < 0) ML_ERR_return_NAN; if (scale == 0. || !R_FINITE(location)) return location; else return location + scale * tan(M_PI * unif_rand(rng)); } JAGS-4.3.2/src/jrmath/dcauchy.c0000664000175000017500000000244414224052371013033 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The density of the Cauchy distribution. */ #include "nmath.h" #include "dpq.h" double dcauchy(double x, double location, double scale, int give_log) { double y; #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(location) || ISNAN(scale)) return x + location + scale; #endif if (scale <= 0) ML_ERR_return_NAN; y = (x - location) / scale; return give_log ? - log(M_PI * scale * (1. + y * y)) : 1. / (M_PI * scale * (1. + y * y)); } JAGS-4.3.2/src/jrmath/pcauchy.c0000664000175000017500000000363014224052371013045 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2014 The R Core Team * Copyright (C) 2004 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the Cauchy distribution. */ #include #ifdef HAVE_ATANPI double atanpi(double); #endif #include "nmath.h" #include "dpq.h" double pcauchy(double x, double location, double scale, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(location) || ISNAN(scale)) return x + location + scale; #endif if (scale <= 0) ML_ERR_return_NAN; x = (x - location) / scale; if (ISNAN(x)) ML_ERR_return_NAN; #ifdef IEEE_754 if(!R_FINITE(x)) { if(x < 0) return R_DT_0; else return R_DT_1; } #endif if (!lower_tail) x = -x; /* for large x, the standard formula suffers from cancellation. * This is from Morten Welinder thanks to Ian Smith's atan(1/x) : */ #ifdef HAVE_ATANPI if (fabs(x) > 1) { double y = atanpi(1/x); return (x > 0) ? R_D_Clog(y) : R_D_val(-y); } else return R_D_val(0.5 + atanpi(x)); #else if (fabs(x) > 1) { double y = atan(1/x) / M_PI; return (x > 0) ? R_D_Clog(y) : R_D_val(-y); } else return R_D_val(0.5 + atan(x) / M_PI); #endif } JAGS-4.3.2/src/jrmath/qcauchy.c0000664000175000017500000000423314224052371013046 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2013 The R Core Team * Copyright (C) 2005-6 The R Foundation * * This version is based on a suggestion by Morten Welinder. * * 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 of the License, 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 * http://www.gnu.org/copyleft/gpl.html. * * DESCRIPTION * * The quantile function of the Cauchy distribution. */ #include "nmath.h" #include "dpq.h" double qcauchy(double p, double location, double scale, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(p) || ISNAN(location) || ISNAN(scale)) return p + location + scale; #endif R_Q_P01_check(p); if (scale <= 0 || !R_FINITE(scale)) { if (scale == 0) return location; /* else */ ML_ERR_return_NAN; } #define my_INF location + (lower_tail ? scale : -scale) * ML_POSINF if (log_p) { if (p > -1) { /* when ep := exp(p), * tan(pi*ep)= -tan(pi*(-ep))= -tan(pi*(-ep)+pi) = -tan(pi*(1-ep)) = * = -tan(pi*(-expm1(p)) * for p ~ 0, exp(p) ~ 1, tan(~0) may be better than tan(~pi). */ if (p == 0.) /* needed, since 1/tan(-0) = -Inf for some arch. */ return my_INF; lower_tail = !lower_tail; p = -expm1(p); } else p = exp(p); } else { if (p > 0.5) { if (p == 1.) return my_INF; p = 1 - p; lower_tail = !lower_tail; } } if (p == 0.5) return location; // avoid 1/Inf below if (p == 0.) return location + (lower_tail ? scale : -scale) * ML_NEGINF; // p = 1. is handled above return location + (lower_tail ? -scale : scale) / tanpi(p); /* -1/tan(pi * p) = -cot(pi * p) = tan(pi * (p - 1/2)) */ } JAGS-4.3.2/src/jrmath/rf.c0000664000175000017500000000246214224052371012022 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include "mathlib.h" * double rf(double dfn, double dfd); * * DESCRIPTION * * Pseudo-random variates from an F distribution. * * NOTES * * This function calls rchisq to do the real work */ #include "nmath.h" double rF(double n1, double n2, JRNG *rng) { double v1, v2; if (ISNAN(n1) || ISNAN(n2) || n1 <= 0. || n2 <= 0.) ML_ERR_return_NAN; v1 = R_FINITE(n1) ? (rchisq(n1, rng) / n1) : 1; v2 = R_FINITE(n2) ? (rchisq(n2, rng) / n2) : 1; return v1 / v2; } JAGS-4.3.2/src/jrmath/df.c0000664000175000017500000000441014224052371011777 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000. * * Merge in to R: * Copyright (C) 2000, 2005 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * * The density function of the F distribution. * To evaluate it, write it as a Binomial probability with p = x*m/(n+x*m). * For m >= 2, we use the simplest conversion. * For m < 2, (m-2)/2 < 0 so the conversion will not work, and we must use * a second conversion. * Note the division by p; this seems unavoidable * for m < 2, since the F density has a singularity as x (or p) -> 0. */ #include "nmath.h" #include "dpq.h" double dF(double x, double m, double n, int give_log) { double p, q, f, dens; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(m) || ISNAN(n)) return x + m + n; #endif if (m <= 0 || n <= 0) ML_ERR_return_NAN; if (x < 0.) return(R_D__0); if (x == 0.) return(m > 2 ? R_D__0 : (m == 2 ? R_D__1 : ML_POSINF)); if (!R_FINITE(m) && !R_FINITE(n)) { /* both +Inf */ if(x == 1.) return ML_POSINF; /* else */ return R_D__0; } if (!R_FINITE(n)) /* must be +Inf by now */ return(dgamma(x, m/2, 2./m, give_log)); if (m > 1e14) {/* includes +Inf: code below is inaccurate there */ dens = dgamma(1./x, n/2, 2./n, give_log); return give_log ? dens - 2*log(x): dens/(x*x); } f = 1./(n+x*m); q = n*f; p = x*m*f; if (m >= 2) { f = m*q/2; dens = dbinom_raw((m-2)/2, (m+n-2)/2, p, q, give_log); } else { f = m*m*q / (2*p*(m+n)); dens = dbinom_raw(m/2, (m+n)/2, p, q, give_log); } return(give_log ? log(f)+dens : f*dens); } JAGS-4.3.2/src/jrmath/pf.c0000664000175000017500000000366114224052371012022 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-8 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the F distribution. */ #include "nmath.h" #include "dpq.h" double pF(double x, double df1, double df2, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(df1) || ISNAN(df2)) return x + df2 + df1; #endif if (df1 <= 0. || df2 <= 0.) ML_ERR_return_NAN; R_P_bounds_01(x, 0., ML_POSINF); /* move to pchisq for very large values - was 'df1 > 4e5' in 2.0.x, now only needed for df1 = Inf or df2 = Inf {since pbeta(0,*)=0} : */ if (df2 == ML_POSINF) { if (df1 == ML_POSINF) { if(x < 1.) return R_DT_0; if(x == 1.) return (log_p ? -M_LN2 : 0.5); if(x > 1.) return R_DT_1; } return pchisq(x * df1, df1, lower_tail, log_p); } if (df1 == ML_POSINF)/* was "fudge" 'df1 > 4e5' in 2.0.x */ return pchisq(df2 / x , df2, !lower_tail, log_p); /* Avoid squeezing pbeta's first parameter against 1 : */ if (df1 * x > df2) x = pbeta(df2 / (df2 + df1 * x), df2 / 2., df1 / 2., !lower_tail, log_p); else x = pbeta(df1 * x / (df2 + df1 * x), df1 / 2., df2 / 2., lower_tail, log_p); return ML_VALID(x) ? x : ML_NAN; } JAGS-4.3.2/src/jrmath/qf.c0000664000175000017500000000330514224052371012016 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-8 The R Core Team * Copyright (C) 2005 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The quantile function of the F distribution. */ #include "nmath.h" #include "dpq.h" double qF(double p, double df1, double df2, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(p) || ISNAN(df1) || ISNAN(df2)) return p + df1 + df2; #endif if (df1 <= 0. || df2 <= 0.) ML_ERR_return_NAN; R_Q_P01_boundaries(p, 0, ML_POSINF); /* fudge the extreme DF cases -- qbeta doesn't do this well. But we still need to fudge the infinite ones. */ if (df1 <= df2 && df2 > 4e5) { if(!R_FINITE(df1)) /* df1 == df2 == Inf : */ return 1.; /* else */ return qchisq(p, df1, lower_tail, log_p) / df1; } if (df1 > 4e5) { /* and so df2 < df1 */ return df2 / qchisq(p, df2, !lower_tail, log_p); } p = (1. / qbeta(p, df2/2, df1/2, !lower_tail, log_p) - 1.) * (df2 / df1); return ML_VALID(p) ? p : ML_NAN; } JAGS-4.3.2/src/jrmath/cospi.c0000664000175000017500000000430514224052371012526 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 2013-2014 The R Core Team * * 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 of the License, 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. */ #include "nmath.h" /* HAVE_COSPI etc will not be defined in standalone-use: the intention is to make the versions here available in that case. */ #ifndef HAVE_COSPI // cos(pi * x) -- exact when x = k/2 for all integer k double cospi(double x) { #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x)) return x; #endif if(!R_FINITE(x)) ML_ERR_return_NAN; x = fmod(fabs(x), 2.);// cos() symmetric; cos(pi(x + 2k)) == cos(pi x) for all integer k if(fmod(x, 1.) == 0.5) return 0.; if( x == 1.) return -1.; if( x == 0.) return 1.; // otherwise return cos(M_PI * x); } #endif #ifndef HAVE_SINPI // sin(pi * x) -- exact when x = k/2 for all integer k double sinpi(double x) { #ifdef IEEE_754 if (ISNAN(x)) return x; #endif if(!R_FINITE(x)) ML_ERR_return_NAN; x = fmod(x, 2.); // sin(pi(x + 2k)) == sin(pi x) for all integer k // map (-2,2) --> (-1,1] : if(x <= -1) x += 2.; else if (x > 1.) x -= 2.; if(x == 0. || x == 1.) return 0.; if(x == 0.5) return 1.; if(x == -0.5) return -1.; // otherwise return sin(M_PI * x); } #endif // tan(pi * x) -- exact when x = k/2 for all integer k #ifndef HAVE_TANPI double tanpi(double x) #else // for use in arithmetic.c, half-values documented to give NaN double Rtanpi(double x) #endif { #ifdef IEEE_754 if (ISNAN(x)) return x; #endif if(!R_FINITE(x)) ML_ERR_return_NAN; x = fmod(x, 1.); // tan(pi(x + k)) == tan(pi x) for all integer k // map (-1,1) --> (-1/2, 1/2] : if(x <= -0.5) x++; else if(x > 0.5) x--; return (x == 0.) ? 0. : ((x == 0.5) ? ML_NAN : tan(M_PI * x)); } JAGS-4.3.2/src/jrmath/gamma_cody.c0000664000175000017500000002023414224052371013510 00000000000000/* From http://www.netlib.org/specfun/gamma Fortran translated by f2c,... * ------------------------------##### Martin Maechler, ETH Zurich * *=========== was part of ribesl (Bessel I(.)) *=========== ~~~~~~ */ // used in bessel_i.c and bessel_j.c, hidden if possible. #include "nmath.h" double attribute_hidden jags_gamma_cody(double x) { /* ---------------------------------------------------------------------- This routine calculates the GAMMA function for a float argument X. Computation is based on an algorithm outlined in reference [1]. The program uses rational functions that approximate the GAMMA function to at least 20 significant decimal digits. Coefficients for the approximation over the interval (1,2) are unpublished. Those for the approximation for X >= 12 are from reference [2]. The accuracy achieved depends on the arithmetic system, the compiler, the intrinsic functions, and proper selection of the machine-dependent constants. ******************************************************************* Error returns The program returns the value XINF for singularities or when overflow would occur. The computation is believed to be free of underflow and overflow. Intrinsic functions required are: INT, DBLE, EXP, LOG, REAL, SIN References: [1] "An Overview of Software Development for Special Functions", W. J. Cody, Lecture Notes in Mathematics, 506, Numerical Analysis Dundee, 1975, G. A. Watson (ed.), Springer Verlag, Berlin, 1976. [2] Computer Approximations, Hart, Et. Al., Wiley and sons, New York, 1968. Latest modification: October 12, 1989 Authors: W. J. Cody and L. Stoltz Applied Mathematics Division Argonne National Laboratory Argonne, IL 60439 ----------------------------------------------------------------------*/ /* ---------------------------------------------------------------------- Mathematical constants ----------------------------------------------------------------------*/ const static double sqrtpi = .9189385332046727417803297; /* == ??? */ /* ******************************************************************* Explanation of machine-dependent constants beta - radix for the floating-point representation maxexp - the smallest positive power of beta that overflows XBIG - the largest argument for which GAMMA(X) is representable in the machine, i.e., the solution to the equation GAMMA(XBIG) = beta**maxexp XINF - the largest machine representable floating-point number; approximately beta**maxexp EPS - the smallest positive floating-point number such that 1.0+EPS > 1.0 XMININ - the smallest positive floating-point number such that 1/XMININ is machine representable Approximate values for some important machines are: beta maxexp XBIG CRAY-1 (S.P.) 2 8191 966.961 Cyber 180/855 under NOS (S.P.) 2 1070 177.803 IEEE (IBM/XT, SUN, etc.) (S.P.) 2 128 35.040 IEEE (IBM/XT, SUN, etc.) (D.P.) 2 1024 171.624 IBM 3033 (D.P.) 16 63 57.574 VAX D-Format (D.P.) 2 127 34.844 VAX G-Format (D.P.) 2 1023 171.489 XINF EPS XMININ CRAY-1 (S.P.) 5.45E+2465 7.11E-15 1.84E-2466 Cyber 180/855 under NOS (S.P.) 1.26E+322 3.55E-15 3.14E-294 IEEE (IBM/XT, SUN, etc.) (S.P.) 3.40E+38 1.19E-7 1.18E-38 IEEE (IBM/XT, SUN, etc.) (D.P.) 1.79D+308 2.22D-16 2.23D-308 IBM 3033 (D.P.) 7.23D+75 2.22D-16 1.39D-76 VAX D-Format (D.P.) 1.70D+38 1.39D-17 5.88D-39 VAX G-Format (D.P.) 8.98D+307 1.11D-16 1.12D-308 ******************************************************************* ---------------------------------------------------------------------- Machine dependent parameters ---------------------------------------------------------------------- */ const static double xbig = 171.624; /* ML_POSINF == const double xinf = 1.79e308;*/ /* DBL_EPSILON = const double eps = 2.22e-16;*/ /* DBL_MIN == const double xminin = 2.23e-308;*/ /*---------------------------------------------------------------------- Numerator and denominator coefficients for rational minimax approximation over (1,2). ----------------------------------------------------------------------*/ const static double p[8] = { -1.71618513886549492533811, 24.7656508055759199108314,-379.804256470945635097577, 629.331155312818442661052,866.966202790413211295064, -31451.2729688483675254357,-36144.4134186911729807069, 66456.1438202405440627855 }; const static double q[8] = { -30.8402300119738975254353, 315.350626979604161529144,-1015.15636749021914166146, -3107.77167157231109440444,22538.1184209801510330112, 4755.84627752788110767815,-134659.959864969306392456, -115132.259675553483497211 }; /*---------------------------------------------------------------------- Coefficients for minimax approximation over (12, INF). ----------------------------------------------------------------------*/ const static double c[7] = { -.001910444077728,8.4171387781295e-4, -5.952379913043012e-4,7.93650793500350248e-4, -.002777777777777681622553,.08333333333333333331554247, .0057083835261 }; /* Local variables */ int i, n; int parity;/*logical*/ double fact, xden, xnum, y, z, yi, res, sum, ysq; parity = (0); fact = 1.; n = 0; y = x; if (y <= 0.) { /* ------------------------------------------------------------- Argument is negative ------------------------------------------------------------- */ y = -x; yi = trunc(y); res = y - yi; if (res != 0.) { if (yi != trunc(yi * .5) * 2.) parity = (1); fact = -M_PI / sinpi(res); y += 1.; } else { return(ML_POSINF); } } /* ----------------------------------------------------------------- Argument is positive -----------------------------------------------------------------*/ if (y < DBL_EPSILON) { /* -------------------------------------------------------------- Argument < EPS -------------------------------------------------------------- */ if (y >= DBL_MIN) { res = 1. / y; } else { return(ML_POSINF); } } else if (y < 12.) { yi = y; if (y < 1.) { /* --------------------------------------------------------- EPS < argument < 1 --------------------------------------------------------- */ z = y; y += 1.; } else { /* ----------------------------------------------------------- 1 <= argument < 12, reduce argument if necessary ----------------------------------------------------------- */ n = (int) y - 1; y -= (double) n; z = y - 1.; } /* --------------------------------------------------------- Evaluate approximation for 1. < argument < 2. ---------------------------------------------------------*/ xnum = 0.; xden = 1.; for (i = 0; i < 8; ++i) { xnum = (xnum + p[i]) * z; xden = xden * z + q[i]; } res = xnum / xden + 1.; if (yi < y) { /* -------------------------------------------------------- Adjust result for case 0. < argument < 1. -------------------------------------------------------- */ res /= yi; } else if (yi > y) { /* ---------------------------------------------------------- Adjust result for case 2. < argument < 12. ---------------------------------------------------------- */ for (i = 0; i < n; ++i) { res *= y; y += 1.; } } } else { /* ------------------------------------------------------------- Evaluate for argument >= 12., ------------------------------------------------------------- */ if (y <= xbig) { ysq = y * y; sum = c[6]; for (i = 0; i < 6; ++i) { sum = sum / ysq + c[i]; } sum = sum / y - y + sqrtpi; sum += (y - .5) * log(y); res = exp(sum); } else { return(ML_POSINF); } } /* ---------------------------------------------------------------------- Final adjustments and return ----------------------------------------------------------------------*/ if (parity) res = -res; if (fact != 1.) res = fact / res; return res; } JAGS-4.3.2/src/jrmath/bessel_i.c0000664000175000017500000003741114224052371013202 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998-2014 Ross Ihaka and the R Core team. * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ /* DESCRIPTION --> see below */ /* From http://www.netlib.org/specfun/ribesl Fortran translated by f2c,... * ------------------------------=#---- Martin Maechler, ETH Zurich */ #include "nmath.h" #include "bessel.h" #ifndef MATHLIB_STANDALONE #include #endif #define min0(x, y) (((x) <= (y)) ? (x) : (y)) static void I_bessel(double *x, double *alpha, int *nb, int *ize, double *bi, int *ncalc); /* .Internal(besselI(*)) : */ double bessel_i(double x, double alpha, double expo) { int nb, ncalc, ize; double na, *bi; #ifndef MATHLIB_STANDALONE const void *vmax; #endif #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(alpha)) return x + alpha; #endif if (x < 0) { ML_ERROR(ME_RANGE, "bessel_i"); return ML_NAN; } ize = (int)expo; na = floor(alpha); if (alpha < 0) { /* Using Abramowitz & Stegun 9.6.2 & 9.6.6 * this may not be quite optimal (CPU and accuracy wise) */ return(bessel_i(x, -alpha, expo) + ((alpha == na) ? /* sin(pi * alpha) = 0 */ 0 : bessel_k(x, -alpha, expo) * ((ize == 1)? 2. : 2.*exp(-2.*x))/M_PI * sinpi(-alpha))); } nb = 1 + (int)na;/* nb-1 <= alpha < nb */ alpha -= (double)(nb-1); #ifdef MATHLIB_STANDALONE bi = (double *) calloc(nb, sizeof(double)); if (!bi) MATHLIB_ERROR("%s", _("bessel_i allocation error")); #else vmax = vmaxget(); bi = (double *) R_alloc((size_t) nb, sizeof(double)); #endif I_bessel(&x, &alpha, &nb, &ize, bi, &ncalc); if(ncalc != nb) {/* error input */ if(ncalc < 0) MATHLIB_WARNING4(_("bessel_i(%g): ncalc (=%d) != nb (=%d); alpha=%g. Arg. out of range?\n"), x, ncalc, nb, alpha); else MATHLIB_WARNING2(_("bessel_i(%g,nu=%g): precision lost in result\n"), x, alpha+(double)nb-1); } x = bi[nb-1]; #ifdef MATHLIB_STANDALONE free(bi); #else vmaxset(vmax); #endif return x; } /* modified version of bessel_i that accepts a work array instead of allocating one. */ double bessel_i_ex(double x, double alpha, double expo, double *bi) { int nb, ncalc, ize; double na; #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(alpha)) return x + alpha; #endif if (x < 0) { ML_ERROR(ME_RANGE, "bessel_i"); return ML_NAN; } ize = (int)expo; na = floor(alpha); if (alpha < 0) { /* Using Abramowitz & Stegun 9.6.2 & 9.6.6 * this may not be quite optimal (CPU and accuracy wise) */ return(bessel_i_ex(x, -alpha, expo, bi) + ((alpha == na) ? 0 : bessel_k_ex(x, -alpha, expo, bi) * ((ize == 1)? 2. : 2.*exp(-2.*x))/M_PI * sinpi(-alpha))); } nb = 1 + (int)na;/* nb-1 <= alpha < nb */ alpha -= (double)(nb-1); I_bessel(&x, &alpha, &nb, &ize, bi, &ncalc); if(ncalc != nb) {/* error input */ if(ncalc < 0) MATHLIB_WARNING4(_("bessel_i(%g): ncalc (=%d) != nb (=%d); alpha=%g. Arg. out of range?\n"), x, ncalc, nb, alpha); else MATHLIB_WARNING2(_("bessel_i(%g,nu=%g): precision lost in result\n"), x, alpha+(double)nb-1); } x = bi[nb-1]; return x; } static void I_bessel(double *x, double *alpha, int *nb, int *ize, double *bi, int *ncalc) { /* ------------------------------------------------------------------- This routine calculates Bessel functions I_(N+ALPHA) (X) for non-negative argument X, and non-negative order N+ALPHA, with or without exponential scaling. Explanation of variables in the calling sequence X - Non-negative argument for which I's or exponentially scaled I's (I*EXP(-X)) are to be calculated. If I's are to be calculated, X must be less than exparg_BESS (IZE=1) or xlrg_BESS_IJ (IZE=2), (see bessel.h). ALPHA - Fractional part of order for which I's or exponentially scaled I's (I*EXP(-X)) are to be calculated. 0 <= ALPHA < 1.0. NB - Number of functions to be calculated, NB > 0. The first function calculated is of order ALPHA, and the last is of order (NB - 1 + ALPHA). IZE - Type. IZE = 1 if unscaled I's are to be calculated, = 2 if exponentially scaled I's are to be calculated. BI - Output vector of length NB. If the routine terminates normally (NCALC=NB), the vector BI contains the functions I(ALPHA,X) through I(NB-1+ALPHA,X), or the corresponding exponentially scaled functions. NCALC - Output variable indicating possible errors. Before using the vector BI, the user should check that NCALC=NB, i.e., all orders have been calculated to the desired accuracy. See error returns below. ******************************************************************* ******************************************************************* Error returns In case of an error, NCALC != NB, and not all I's are calculated to the desired accuracy. NCALC < 0: An argument is out of range. For example, NB <= 0, IZE is not 1 or 2, or IZE=1 and ABS(X) >= EXPARG_BESS. In this case, the BI-vector is not calculated, and NCALC is set to MIN0(NB,0)-1 so that NCALC != NB. NB > NCALC > 0: Not all requested function values could be calculated accurately. This usually occurs because NB is much larger than ABS(X). In this case, BI[N] is calculated to the desired accuracy for N <= NCALC, but precision is lost for NCALC < N <= NB. If BI[N] does not vanish for N > NCALC (because it is too small to be represented), and BI[N]/BI[NCALC] = 10**(-K), then only the first NSIG-K significant figures of BI[N] can be trusted. Intrinsic functions required are: DBLE, EXP, gamma_cody, INT, MAX, MIN, REAL, SQRT Acknowledgement This program is based on a program written by David J. Sookne (2) that computes values of the Bessel functions J or I of float argument and long order. Modifications include the restriction of the computation to the I Bessel function of non-negative float argument, the extension of the computation to arbitrary positive order, the inclusion of optional exponential scaling, and the elimination of most underflow. An earlier version was published in (3). References: "A Note on Backward Recurrence Algorithms," Olver, F. W. J., and Sookne, D. J., Math. Comp. 26, 1972, pp 941-947. "Bessel Functions of Real Argument and Integer Order," Sookne, D. J., NBS Jour. of Res. B. 77B, 1973, pp 125-132. "ALGORITHM 597, Sequence of Modified Bessel Functions of the First Kind," Cody, W. J., Trans. Math. Soft., 1983, pp. 242-245. Latest modification: May 30, 1989 Modified by: W. J. Cody and L. Stoltz Applied Mathematics Division Argonne National Laboratory Argonne, IL 60439 */ /*------------------------------------------------------------------- Mathematical constants -------------------------------------------------------------------*/ const static double const__ = 1.585; /* Local variables */ int nend, intx, nbmx, k, l, n, nstart; double pold, test, p, em, en, empal, emp2al, halfx, aa, bb, cc, psave, plast, tover, psavel, sum, nu, twonu; /*Parameter adjustments */ --bi; nu = *alpha; twonu = nu + nu; /*------------------------------------------------------------------- Check for X, NB, OR IZE out of range. ------------------------------------------------------------------- */ if (*nb > 0 && *x >= 0. && (0. <= nu && nu < 1.) && (1 <= *ize && *ize <= 2) ) { *ncalc = *nb; if(*ize == 1 && *x > exparg_BESS) { for(k=1; k <= *nb; k++) bi[k]=ML_POSINF; /* the limit *is* = Inf */ return; } if(*ize == 2 && *x > xlrg_BESS_IJ) { for(k=1; k <= *nb; k++) bi[k]= 0.; /* The limit exp(-x) * I_nu(x) --> 0 : */ return; } intx = (int) (*x);/* fine, since *x <= xlrg_BESS_IJ <<< LONG_MAX */ if (*x >= rtnsig_BESS) { /* "non-small" x ( >= 1e-4 ) */ /* ------------------------------------------------------------------- Initialize the forward sweep, the P-sequence of Olver ------------------------------------------------------------------- */ nbmx = *nb - intx; n = intx + 1; en = (double) (n + n) + twonu; plast = 1.; p = en / *x; /* ------------------------------------------------ Calculate general significance test ------------------------------------------------ */ test = ensig_BESS + ensig_BESS; if (intx << 1 > nsig_BESS * 5) { test = sqrt(test * p); } else { test /= JR_pow_di(const__, intx); } if (nbmx >= 3) { /* -------------------------------------------------- Calculate P-sequence until N = NB-1 Check for possible overflow. ------------------------------------------------ */ tover = enten_BESS / ensig_BESS; nstart = intx + 2; nend = *nb - 1; for (k = nstart; k <= nend; ++k) { n = k; en += 2.; pold = plast; plast = p; p = en * plast / *x + pold; if (p > tover) { /* ------------------------------------------------ To avoid overflow, divide P-sequence by TOVER. Calculate P-sequence until ABS(P) > 1. ---------------------------------------------- */ tover = enten_BESS; p /= tover; plast /= tover; psave = p; psavel = plast; nstart = n + 1; do { ++n; en += 2.; pold = plast; plast = p; p = en * plast / *x + pold; } while (p <= 1.); bb = en / *x; /* ------------------------------------------------ Calculate backward test, and find NCALC, the highest N such that the test is passed. ------------------------------------------------ */ test = pold * plast / ensig_BESS; test *= .5 - .5 / (bb * bb); p = plast * tover; --n; en -= 2.; nend = min0(*nb,n); for (l = nstart; l <= nend; ++l) { *ncalc = l; pold = psavel; psavel = psave; psave = en * psavel / *x + pold; if (psave * psavel > test) { goto L90; } } *ncalc = nend + 1; L90: --(*ncalc); goto L120; } } n = nend; en = (double)(n + n) + twonu; /*--------------------------------------------------- Calculate special significance test for NBMX > 2. --------------------------------------------------- */ test = fmax2(test,sqrt(plast * ensig_BESS) * sqrt(p + p)); } /* -------------------------------------------------------- Calculate P-sequence until significance test passed. -------------------------------------------------------- */ do { ++n; en += 2.; pold = plast; plast = p; p = en * plast / *x + pold; } while (p < test); L120: /* ------------------------------------------------------------------- Initialize the backward recursion and the normalization sum. ------------------------------------------------------------------- */ ++n; en += 2.; bb = 0.; aa = 1. / p; em = (double) n - 1.; empal = em + nu; emp2al = em - 1. + twonu; sum = aa * empal * emp2al / em; nend = n - *nb; if (nend < 0) { /* ----------------------------------------------------- N < NB, so store BI[N] and set higher orders to 0.. ----------------------------------------------------- */ bi[n] = aa; nend = -nend; for (l = 1; l <= nend; ++l) { bi[n + l] = 0.; } } else { if (nend > 0) { /* ----------------------------------------------------- Recur backward via difference equation, calculating (but not storing) BI[N], until N = NB. --------------------------------------------------- */ for (l = 1; l <= nend; ++l) { --n; en -= 2.; cc = bb; bb = aa; /* for x ~= 1500, sum would overflow to 'inf' here, * and the final bi[] /= sum would give 0 wrongly; * RE-normalize (aa, sum) here -- no need to undo */ if(nend > 100 && aa > 1e200) { /* multiply by 2^-900 = 1.18e-271 */ cc = ldexp(cc, -900); bb = ldexp(bb, -900); sum = ldexp(sum,-900); } aa = en * bb / *x + cc; em -= 1.; emp2al -= 1.; if (n == 1) { break; } if (n == 2) { emp2al = 1.; } empal -= 1.; sum = (sum + aa * empal) * emp2al / em; } } /* --------------------------------------------------- Store BI[NB] --------------------------------------------------- */ bi[n] = aa; if (*nb <= 1) { sum = sum + sum + aa; goto L230; } /* ------------------------------------------------- Calculate and Store BI[NB-1] ------------------------------------------------- */ --n; en -= 2.; bi[n] = en * aa / *x + bb; if (n == 1) { goto L220; } em -= 1.; if (n == 2) emp2al = 1.; else emp2al -= 1.; empal -= 1.; sum = (sum + bi[n] * empal) * emp2al / em; } nend = n - 2; if (nend > 0) { /* -------------------------------------------- Calculate via difference equation and store BI[N], until N = 2. ------------------------------------------ */ for (l = 1; l <= nend; ++l) { --n; en -= 2.; bi[n] = en * bi[n + 1] / *x + bi[n + 2]; em -= 1.; if (n == 2) emp2al = 1.; else emp2al -= 1.; empal -= 1.; sum = (sum + bi[n] * empal) * emp2al / em; } } /* ---------------------------------------------- Calculate BI[1] -------------------------------------------- */ bi[1] = 2. * empal * bi[2] / *x + bi[3]; L220: sum = sum + sum + bi[1]; L230: /* --------------------------------------------------------- Normalize. Divide all BI[N] by sum. --------------------------------------------------------- */ if (nu != 0.) sum *= (jags_gamma_cody(1. + nu) * pow(*x * .5, -nu)); if (*ize == 1) sum *= exp(-(*x)); aa = enmten_BESS; if (sum > 1.) aa *= sum; for (n = 1; n <= *nb; ++n) { if (bi[n] < aa) bi[n] = 0.; else bi[n] /= sum; } return; } else { /* small x < 1e-4 */ /* ----------------------------------------------------------- Two-term ascending series for small X. -----------------------------------------------------------*/ aa = 1.; empal = 1. + nu; #ifdef IEEE_754 /* No need to check for underflow */ halfx = .5 * *x; #else if (*x > enmten_BESS) */ halfx = .5 * *x; else halfx = 0.; #endif if (nu != 0.) aa = pow(halfx, nu) / jags_gamma_cody(empal); if (*ize == 2) aa *= exp(-(*x)); bb = halfx * halfx; bi[1] = aa + aa * bb / empal; if (*x != 0. && bi[1] == 0.) *ncalc = 0; if (*nb > 1) { if (*x == 0.) { for (n = 2; n <= *nb; ++n) bi[n] = 0.; } else { /* ------------------------------------------------- Calculate higher-order functions. ------------------------------------------------- */ cc = halfx; tover = (enmten_BESS + enmten_BESS) / *x; if (bb != 0.) tover = enmten_BESS / bb; for (n = 2; n <= *nb; ++n) { aa /= empal; empal += 1.; aa *= cc; if (aa <= tover * empal) bi[n] = aa = 0.; else bi[n] = aa + aa * bb / empal; if (bi[n] == 0. && *ncalc > n) *ncalc = n - 1; } } } } } else { /* argument out of range */ *ncalc = min0(*nb,0) - 1; } } JAGS-4.3.2/src/jrmath/bessel_j.c0000664000175000017500000004325414224052371013205 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998-2015 Ross Ihaka and the R Core team. * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ /* DESCRIPTION --> see below */ /* From http://www.netlib.org/specfun/rjbesl Fortran translated by f2c,... * ------------------------------=#---- Martin Maechler, ETH Zurich * Additional code for nu == alpha < 0 MM */ #include "nmath.h" #include "bessel.h" #ifndef MATHLIB_STANDALONE #include #endif #define min0(x, y) (((x) <= (y)) ? (x) : (y)) static void J_bessel(double *x, double *alpha, int *nb, double *b, int *ncalc); // unused now from R double bessel_j(double x, double alpha) { int nb, ncalc; double na, *bj; #ifndef MATHLIB_STANDALONE const void *vmax; #endif #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(alpha)) return x + alpha; #endif if (x < 0) { ML_ERROR(ME_RANGE, "bessel_j"); return ML_NAN; } na = floor(alpha); if (alpha < 0) { /* Using Abramowitz & Stegun 9.1.2 * this may not be quite optimal (CPU and accuracy wise) */ return(bessel_j(x, -alpha) * cospi(alpha) + ((alpha == na) ? 0 : bessel_y(x, -alpha) * sinpi(alpha))); } else if (alpha > 1e7) { MATHLIB_WARNING("besselJ(x, nu): nu=%g too large for bessel_j() algorithm", alpha); return ML_NAN; } nb = 1 + (int)na; /* nb-1 <= alpha < nb */ alpha -= (double)(nb-1); // ==> alpha' in [0, 1) #ifdef MATHLIB_STANDALONE bj = (double *) calloc(nb, sizeof(double)); if (!bj) MATHLIB_ERROR("%s", _("bessel_j allocation error")); #else vmax = vmaxget(); bj = (double *) R_alloc((size_t) nb, sizeof(double)); #endif J_bessel(&x, &alpha, &nb, bj, &ncalc); if(ncalc != nb) {/* error input */ if(ncalc < 0) MATHLIB_WARNING4(_("bessel_j(%g): ncalc (=%d) != nb (=%d); alpha=%g. Arg. out of range?\n"), x, ncalc, nb, alpha); else MATHLIB_WARNING2(_("bessel_j(%g,nu=%g): precision lost in result\n"), x, alpha+(double)nb-1); } x = bj[nb-1]; #ifdef MATHLIB_STANDALONE free(bj); #else vmaxset(vmax); #endif return x; } /* Called from R: modified version of bessel_j(), accepting a work array * instead of allocating one. */ double bessel_j_ex(double x, double alpha, double *bj) { int nb, ncalc; double na; #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(alpha)) return x + alpha; #endif if (x < 0) { ML_ERROR(ME_RANGE, "bessel_j"); return ML_NAN; } na = floor(alpha); if (alpha < 0) { /* Using Abramowitz & Stegun 9.1.2 * this may not be quite optimal (CPU and accuracy wise) */ return(bessel_j_ex(x, -alpha, bj) * cospi(alpha) + ((alpha == na) ? 0 : bessel_y_ex(x, -alpha, bj) * sinpi(alpha))); } else if (alpha > 1e7) { MATHLIB_WARNING("besselJ(x, nu): nu=%g too large for bessel_j() algorithm", alpha); return ML_NAN; } nb = 1 + (int)na; /* nb-1 <= alpha < nb */ alpha -= (double)(nb-1); // ==> alpha' in [0, 1) J_bessel(&x, &alpha, &nb, bj, &ncalc); if(ncalc != nb) {/* error input */ if(ncalc < 0) MATHLIB_WARNING4(_("bessel_j(%g): ncalc (=%d) != nb (=%d); alpha=%g. Arg. out of range?\n"), x, ncalc, nb, alpha); else MATHLIB_WARNING2(_("bessel_j(%g,nu=%g): precision lost in result\n"), x, alpha+(double)nb-1); } x = bj[nb-1]; return x; } static void J_bessel(double *x, double *alpha, int *nb, double *b, int *ncalc) { /* Calculates Bessel functions J_{n+alpha} (x) for non-negative argument x, and non-negative order n+alpha, n = 0,1,..,nb-1. Explanation of variables in the calling sequence. X - Non-negative argument for which J's are to be calculated. ALPHA - Fractional part of order for which J's are to be calculated. 0 <= ALPHA < 1. NB - Number of functions to be calculated, NB >= 1. The first function calculated is of order ALPHA, and the last is of order (NB - 1 + ALPHA). B - Output vector of length NB. If RJBESL terminates normally (NCALC=NB), the vector B contains the functions J/ALPHA/(X) through J/NB-1+ALPHA/(X). NCALC - Output variable indicating possible errors. Before using the vector B, the user should check that NCALC=NB, i.e., all orders have been calculated to the desired accuracy. See the following **************************************************************** Error return codes In case of an error, NCALC != NB, and not all J's are calculated to the desired accuracy. NCALC < 0: An argument is out of range. For example, NBES <= 0, ALPHA < 0 or > 1, or X is too large. In this case, b[1] is set to zero, the remainder of the B-vector is not calculated, and NCALC is set to MIN(NB,0)-1 so that NCALC != NB. NB > NCALC > 0: Not all requested function values could be calculated accurately. This usually occurs because NB is much larger than ABS(X). In this case, b[N] is calculated to the desired accuracy for N <= NCALC, but precision is lost for NCALC < N <= NB. If b[N] does not vanish for N > NCALC (because it is too small to be represented), and b[N]/b[NCALC] = 10^(-K), then only the first NSIG - K significant figures of b[N] can be trusted. Acknowledgement This program is based on a program written by David J. Sookne (2) that computes values of the Bessel functions J or I of float argument and long order. Modifications include the restriction of the computation to the J Bessel function of non-negative float argument, the extension of the computation to arbitrary positive order, and the elimination of most underflow. References: Olver, F.W.J., and Sookne, D.J. (1972) "A Note on Backward Recurrence Algorithms"; Math. Comp. 26, 941-947. Sookne, D.J. (1973) "Bessel Functions of Real Argument and Integer Order"; NBS Jour. of Res. B. 77B, 125-132. Latest modification: March 19, 1990 Author: W. J. Cody Applied Mathematics Division Argonne National Laboratory Argonne, IL 60439 ******************************************************************* */ /* --------------------------------------------------------------------- Mathematical constants PI2 = 2 / PI TWOPI1 = first few significant digits of 2 * PI TWOPI2 = (2*PI - TWOPI1) to working precision, i.e., TWOPI1 + TWOPI2 = 2 * PI to extra precision. --------------------------------------------------------------------- */ const static double pi2 = .636619772367581343075535; const static double twopi1 = 6.28125; const static double twopi2 = .001935307179586476925286767; /*--------------------------------------------------------------------- * Factorial(N) *--------------------------------------------------------------------- */ const static double fact[25] = { 1.,1.,2.,6.,24.,120.,720.,5040.,40320., 362880.,3628800.,39916800.,479001600.,6227020800.,87178291200., 1.307674368e12,2.0922789888e13,3.55687428096e14,6.402373705728e15, 1.21645100408832e17,2.43290200817664e18,5.109094217170944e19, 1.12400072777760768e21,2.585201673888497664e22, 6.2044840173323943936e23 }; /* Local variables */ int nend, intx, nbmx, i, j, k, l, m, n, nstart; double nu, twonu, capp, capq, pold, vcos, test, vsin; double p, s, t, z, alpem, halfx, aa, bb, cc, psave, plast; double tover, t1, alp2em, em, en, xc, xk, xm, psavel, gnu, xin, sum; /* Parameter adjustment */ --b; nu = *alpha; twonu = nu + nu; /*------------------------------------------------------------------- Check for out of range arguments. -------------------------------------------------------------------*/ if (*nb > 0 && *x >= 0. && 0. <= nu && nu < 1.) { *ncalc = *nb; if(*x > xlrg_BESS_IJ) { ML_ERROR(ME_RANGE, "J_bessel"); /* indeed, the limit is 0, * but the cutoff happens too early */ for(i=1; i <= *nb; i++) b[i] = 0.; /*was ML_POSINF (really nonsense) */ return; } intx = (int) (*x); /* Initialize result array to zero. */ for (i = 1; i <= *nb; ++i) b[i] = 0.; /*=================================================================== Branch into 3 cases : 1) use 2-term ascending series for small X 2) use asymptotic form for large X when NB is not too large 3) use recursion otherwise ===================================================================*/ if (*x < rtnsig_BESS) { /* --------------------------------------------------------------- Two-term ascending series for small X. --------------------------------------------------------------- */ alpem = 1. + nu; halfx = (*x > enmten_BESS) ? .5 * *x : 0.; aa = (nu != 0.) ? pow(halfx, nu) / (nu * jags_gamma_cody(nu)) : 1.; bb = (*x + 1. > 1.)? -halfx * halfx : 0.; b[1] = aa + aa * bb / alpem; if (*x != 0. && b[1] == 0.) *ncalc = 0; if (*nb != 1) { if (*x <= 0.) { for (n = 2; n <= *nb; ++n) b[n] = 0.; } else { /* ---------------------------------------------- Calculate higher order functions. ---------------------------------------------- */ if (bb == 0.) tover = (enmten_BESS + enmten_BESS) / *x; else tover = enmten_BESS / bb; cc = halfx; for (n = 2; n <= *nb; ++n) { aa /= alpem; alpem += 1.; aa *= cc; if (aa <= tover * alpem) aa = 0.; b[n] = aa + aa * bb / alpem; if (b[n] == 0. && *ncalc > n) *ncalc = n - 1; } } } } else if (*x > 25. && *nb <= intx + 1) { /* ------------------------------------------------------------ Asymptotic series for X > 25 (and not too large nb) ------------------------------------------------------------ */ xc = sqrt(pi2 / *x); xin = 1 / (64 * *x * *x); if (*x >= 130.) m = 4; else if (*x >= 35.) m = 8; else m = 11; xm = 4. * (double) m; /* ------------------------------------------------ Argument reduction for SIN and COS routines. ------------------------------------------------ */ t = trunc(*x / (twopi1 + twopi2) + .5); z = (*x - t * twopi1) - t * twopi2 - (nu + .5) / pi2; vsin = sin(z); vcos = cos(z); gnu = twonu; for (i = 1; i <= 2; ++i) { s = (xm - 1. - gnu) * (xm - 1. + gnu) * xin * .5; t = (gnu - (xm - 3.)) * (gnu + (xm - 3.)); t1= (gnu - (xm + 1.)) * (gnu + (xm + 1.)); k = m + m; capp = s * t / fact[k]; capq = s * t1/ fact[k + 1]; xk = xm; for (; k >= 4; k -= 2) {/* k + 2(j-2) == 2m */ xk -= 4.; s = (xk - 1. - gnu) * (xk - 1. + gnu); t1 = t; t = (gnu - (xk - 3.)) * (gnu + (xk - 3.)); capp = (capp + 1. / fact[k - 2]) * s * t * xin; capq = (capq + 1. / fact[k - 1]) * s * t1 * xin; } capp += 1.; capq = (capq + 1.) * (gnu * gnu - 1.) * (.125 / *x); b[i] = xc * (capp * vcos - capq * vsin); if (*nb == 1) return; /* vsin <--> vcos */ t = vsin; vsin = -vcos; vcos = t; gnu += 2.; } /* ----------------------------------------------- If NB > 2, compute J(X,ORDER+I) for I = 2, NB-1 ----------------------------------------------- */ if (*nb > 2) for (gnu = twonu + 2., j = 3; j <= *nb; j++, gnu += 2.) b[j] = gnu * b[j - 1] / *x - b[j - 2]; } else { /* rtnsig_BESS <= x && ( x <= 25 || intx+1 < *nb ) : -------------------------------------------------------- Use recurrence to generate results. First initialize the calculation of P*S. -------------------------------------------------------- */ nbmx = *nb - intx; n = intx + 1; en = (double)(n + n) + twonu; plast = 1.; p = en / *x; /* --------------------------------------------------- Calculate general significance test. --------------------------------------------------- */ test = ensig_BESS + ensig_BESS; if (nbmx >= 3) { /* ------------------------------------------------------------ Calculate P*S until N = NB-1. Check for possible overflow. ---------------------------------------------------------- */ tover = enten_BESS / ensig_BESS; nstart = intx + 2; nend = *nb - 1; en = (double) (nstart + nstart) - 2. + twonu; for (k = nstart; k <= nend; ++k) { n = k; en += 2.; pold = plast; plast = p; p = en * plast / *x - pold; if (p > tover) { /* ------------------------------------------- To avoid overflow, divide P*S by TOVER. Calculate P*S until ABS(P) > 1. -------------------------------------------*/ tover = enten_BESS; p /= tover; plast /= tover; psave = p; psavel = plast; nstart = n + 1; do { ++n; en += 2.; pold = plast; plast = p; p = en * plast / *x - pold; } while (p <= 1.); bb = en / *x; /* ----------------------------------------------- Calculate backward test and find NCALC, the highest N such that the test is passed. ----------------------------------------------- */ test = pold * plast * (.5 - .5 / (bb * bb)); test /= ensig_BESS; p = plast * tover; --n; en -= 2.; nend = min0(*nb,n); for (l = nstart; l <= nend; ++l) { pold = psavel; psavel = psave; psave = en * psavel / *x - pold; if (psave * psavel > test) { *ncalc = l - 1; goto L190; } } *ncalc = nend; goto L190; } } n = nend; en = (double) (n + n) + twonu; /* ----------------------------------------------------- Calculate special significance test for NBMX > 2. -----------------------------------------------------*/ test = fmax2(test, sqrt(plast * ensig_BESS) * sqrt(p + p)); } /* ------------------------------------------------ Calculate P*S until significance test passes. */ do { ++n; en += 2.; pold = plast; plast = p; p = en * plast / *x - pold; } while (p < test); L190: /*--------------------------------------------------------------- Initialize the backward recursion and the normalization sum. --------------------------------------------------------------- */ ++n; en += 2.; bb = 0.; aa = 1. / p; m = n / 2; em = (double)m; m = (n << 1) - (m << 2);/* = 2 n - 4 (n/2) = 0 for even, 2 for odd n */ if (m == 0) sum = 0.; else { alpem = em - 1. + nu; alp2em = em + em + nu; sum = aa * alpem * alp2em / em; } nend = n - *nb; /* if (nend > 0) */ /* -------------------------------------------------------- Recur backward via difference equation, calculating (but not storing) b[N], until N = NB. -------------------------------------------------------- */ for (l = 1; l <= nend; ++l) { --n; en -= 2.; cc = bb; bb = aa; aa = en * bb / *x - cc; m = m ? 0 : 2; /* m = 2 - m failed on gcc4-20041019 */ if (m != 0) { em -= 1.; alp2em = em + em + nu; if (n == 1) break; alpem = em - 1. + nu; if (alpem == 0.) alpem = 1.; sum = (sum + aa * alp2em) * alpem / em; } } /*-------------------------------------------------- Store b[NB]. --------------------------------------------------*/ b[n] = aa; if (nend >= 0) { if (*nb <= 1) { if (nu + 1. == 1.) alp2em = 1.; else alp2em = nu; sum += b[1] * alp2em; goto L250; } else {/*-- nb >= 2 : --------------------------- Calculate and store b[NB-1]. ----------------------------------------*/ --n; en -= 2.; b[n] = en * aa / *x - bb; if (n == 1) goto L240; m = m ? 0 : 2; /* m = 2 - m failed on gcc4-20041019 */ if (m != 0) { em -= 1.; alp2em = em + em + nu; alpem = em - 1. + nu; if (alpem == 0.) alpem = 1.; sum = (sum + b[n] * alp2em) * alpem / em; } } } /* if (n - 2 != 0) */ /* -------------------------------------------------------- Calculate via difference equation and store b[N], until N = 2. -------------------------------------------------------- */ for (n = n-1; n >= 2; n--) { en -= 2.; b[n] = en * b[n + 1] / *x - b[n + 2]; m = m ? 0 : 2; /* m = 2 - m failed on gcc4-20041019 */ if (m != 0) { em -= 1.; alp2em = em + em + nu; alpem = em - 1. + nu; if (alpem == 0.) alpem = 1.; sum = (sum + b[n] * alp2em) * alpem / em; } } /* --------------------------------------- Calculate b[1]. -----------------------------------------*/ b[1] = 2. * (nu + 1.) * b[2] / *x - b[3]; L240: em -= 1.; alp2em = em + em + nu; if (alp2em == 0.) alp2em = 1.; sum += b[1] * alp2em; L250: /* --------------------------------------------------- Normalize. Divide all b[N] by sum. ---------------------------------------------------*/ /* if (nu + 1. != 1.) poor test */ if(fabs(nu) > 1e-15) sum *= (jags_gamma_cody(nu) * pow(.5* *x, -nu)); aa = enmten_BESS; if (sum > 1.) aa *= sum; for (n = 1; n <= *nb; ++n) { if (fabs(b[n]) < aa) b[n] = 0.; else b[n] /= sum; } } } else { /* Error return -- X, NB, or ALPHA is out of range : */ b[1] = 0.; *ncalc = min0(*nb,0) - 1; } } JAGS-4.3.2/src/jrmath/bessel_k.c0000664000175000017500000004071014224052371013200 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998-2014 Ross Ihaka and the R Core team. * Copyright (C) 2002-3 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ /* DESCRIPTION --> see below */ /* From http://www.netlib.org/specfun/rkbesl Fortran translated by f2c,... * ------------------------------=#---- Martin Maechler, ETH Zurich */ #include "nmath.h" #include "bessel.h" #ifndef MATHLIB_STANDALONE #include #endif #define min0(x, y) (((x) <= (y)) ? (x) : (y)) #define max0(x, y) (((x) <= (y)) ? (y) : (x)) static void K_bessel(double *x, double *alpha, int *nb, int *ize, double *bk, int *ncalc); double bessel_k(double x, double alpha, double expo) { int nb, ncalc, ize; double *bk; #ifndef MATHLIB_STANDALONE const void *vmax; #endif #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(alpha)) return x + alpha; #endif if (x < 0) { ML_ERROR(ME_RANGE, "bessel_k"); return ML_NAN; } ize = (int)expo; if(alpha < 0) alpha = -alpha; nb = 1+ (int)floor(alpha);/* nb-1 <= |alpha| < nb */ alpha -= (double)(nb-1); #ifdef MATHLIB_STANDALONE bk = (double *) calloc(nb, sizeof(double)); if (!bk) MATHLIB_ERROR("%s", _("bessel_k allocation error")); #else vmax = vmaxget(); bk = (double *) R_alloc((size_t) nb, sizeof(double)); #endif K_bessel(&x, &alpha, &nb, &ize, bk, &ncalc); if(ncalc != nb) {/* error input */ if(ncalc < 0) MATHLIB_WARNING4(_("bessel_k(%g): ncalc (=%d) != nb (=%d); alpha=%g. Arg. out of range?\n"), x, ncalc, nb, alpha); else MATHLIB_WARNING2(_("bessel_k(%g,nu=%g): precision lost in result\n"), x, alpha+(double)nb-1); } x = bk[nb-1]; #ifdef MATHLIB_STANDALONE free(bk); #else vmaxset(vmax); #endif return x; } /* modified version of bessel_k that accepts a work array instead of allocating one. */ double bessel_k_ex(double x, double alpha, double expo, double *bk) { int nb, ncalc, ize; #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(alpha)) return x + alpha; #endif if (x < 0) { ML_ERROR(ME_RANGE, "bessel_k"); return ML_NAN; } ize = (int)expo; if(alpha < 0) alpha = -alpha; nb = 1+ (int)floor(alpha);/* nb-1 <= |alpha| < nb */ alpha -= (double)(nb-1); K_bessel(&x, &alpha, &nb, &ize, bk, &ncalc); if(ncalc != nb) {/* error input */ if(ncalc < 0) MATHLIB_WARNING4(_("bessel_k(%g): ncalc (=%d) != nb (=%d); alpha=%g. Arg. out of range?\n"), x, ncalc, nb, alpha); else MATHLIB_WARNING2(_("bessel_k(%g,nu=%g): precision lost in result\n"), x, alpha+(double)nb-1); } x = bk[nb-1]; return x; } static void K_bessel(double *x, double *alpha, int *nb, int *ize, double *bk, int *ncalc) { /*------------------------------------------------------------------- This routine calculates modified Bessel functions of the third kind, K_(N+ALPHA) (X), for non-negative argument X, and non-negative order N+ALPHA, with or without exponential scaling. Explanation of variables in the calling sequence X - Non-negative argument for which K's or exponentially scaled K's (K*EXP(X)) are to be calculated. If K's are to be calculated, X must not be greater than XMAX_BESS_K. ALPHA - Fractional part of order for which K's or exponentially scaled K's (K*EXP(X)) are to be calculated. 0 <= ALPHA < 1.0. NB - Number of functions to be calculated, NB > 0. The first function calculated is of order ALPHA, and the last is of order (NB - 1 + ALPHA). IZE - Type. IZE = 1 if unscaled K's are to be calculated, = 2 if exponentially scaled K's are to be calculated. BK - Output vector of length NB. If the routine terminates normally (NCALC=NB), the vector BK contains the functions K(ALPHA,X), ... , K(NB-1+ALPHA,X), or the corresponding exponentially scaled functions. If (0 < NCALC < NB), BK(I) contains correct function values for I <= NCALC, and contains the ratios K(ALPHA+I-1,X)/K(ALPHA+I-2,X) for the rest of the array. NCALC - Output variable indicating possible errors. Before using the vector BK, the user should check that NCALC=NB, i.e., all orders have been calculated to the desired accuracy. See error returns below. ******************************************************************* Error returns In case of an error, NCALC != NB, and not all K's are calculated to the desired accuracy. NCALC < -1: An argument is out of range. For example, NB <= 0, IZE is not 1 or 2, or IZE=1 and ABS(X) >= XMAX_BESS_K. In this case, the B-vector is not calculated, and NCALC is set to MIN0(NB,0)-2 so that NCALC != NB. NCALC = -1: Either K(ALPHA,X) >= XINF or K(ALPHA+NB-1,X)/K(ALPHA+NB-2,X) >= XINF. In this case, the B-vector is not calculated. Note that again NCALC != NB. 0 < NCALC < NB: Not all requested function values could be calculated accurately. BK(I) contains correct function values for I <= NCALC, and contains the ratios K(ALPHA+I-1,X)/K(ALPHA+I-2,X) for the rest of the array. Intrinsic functions required are: ABS, AINT, EXP, INT, LOG, MAX, MIN, SINH, SQRT Acknowledgement This program is based on a program written by J. B. Campbell (2) that computes values of the Bessel functions K of float argument and float order. Modifications include the addition of non-scaled functions, parameterization of machine dependencies, and the use of more accurate approximations for SINH and SIN. References: "On Temme's Algorithm for the Modified Bessel Functions of the Third Kind," Campbell, J. B., TOMS 6(4), Dec. 1980, pp. 581-586. "A FORTRAN IV Subroutine for the Modified Bessel Functions of the Third Kind of Real Order and Real Argument," Campbell, J. B., Report NRC/ERB-925, National Research Council, Canada. Latest modification: May 30, 1989 Modified by: W. J. Cody and L. Stoltz Applied Mathematics Division Argonne National Laboratory Argonne, IL 60439 ------------------------------------------------------------------- */ /*--------------------------------------------------------------------- * Mathematical constants * A = LOG(2) - Euler's constant * D = SQRT(2/PI) ---------------------------------------------------------------------*/ const static double a = .11593151565841244881; /*--------------------------------------------------------------------- P, Q - Approximation for LOG(GAMMA(1+ALPHA))/ALPHA + Euler's constant Coefficients converted from hex to decimal and modified by W. J. Cody, 2/26/82 */ const static double p[8] = { .805629875690432845,20.4045500205365151, 157.705605106676174,536.671116469207504,900.382759291288778, 730.923886650660393,229.299301509425145,.822467033424113231 }; const static double q[7] = { 29.4601986247850434,277.577868510221208, 1206.70325591027438,2762.91444159791519,3443.74050506564618, 2210.63190113378647,572.267338359892221 }; /* R, S - Approximation for (1-ALPHA*PI/SIN(ALPHA*PI))/(2.D0*ALPHA) */ const static double r[5] = { -.48672575865218401848,13.079485869097804016, -101.96490580880537526,347.65409106507813131, 3.495898124521934782e-4 }; const static double s[4] = { -25.579105509976461286,212.57260432226544008, -610.69018684944109624,422.69668805777760407 }; /* T - Approximation for SINH(Y)/Y */ const static double t[6] = { 1.6125990452916363814e-10, 2.5051878502858255354e-8,2.7557319615147964774e-6, 1.9841269840928373686e-4,.0083333333333334751799, .16666666666666666446 }; /*---------------------------------------------------------------------*/ const static double estm[6] = { 52.0583,5.7607,2.7782,14.4303,185.3004, 9.3715 }; const static double estf[7] = { 41.8341,7.1075,6.4306,42.511,1.35633,84.5096,20.}; /* Local variables */ int iend, i, j, k, m, ii, mplus1; double x2by4, twox, c, blpha, ratio, wminf; double d1, d2, d3, f0, f1, f2, p0, q0, t1, t2, twonu; double dm, ex, bk1, bk2, nu; ii = 0; /* -Wall */ ex = *x; nu = *alpha; *ncalc = min0(*nb,0) - 2; if (*nb > 0 && (0. <= nu && nu < 1.) && (1 <= *ize && *ize <= 2)) { if(ex <= 0 || (*ize == 1 && ex > xmax_BESS_K)) { if(ex <= 0) { if(ex < 0) ML_ERROR(ME_RANGE, "K_bessel"); for(i=0; i < *nb; i++) bk[i] = ML_POSINF; } else /* would only have underflow */ for(i=0; i < *nb; i++) bk[i] = 0.; *ncalc = *nb; return; } k = 0; if (nu < sqxmin_BESS_K) { nu = 0.; } else if (nu > .5) { k = 1; nu -= 1.; } twonu = nu + nu; iend = *nb + k - 1; c = nu * nu; d3 = -c; if (ex <= 1.) { /* ------------------------------------------------------------ Calculation of P0 = GAMMA(1+ALPHA) * (2/X)**ALPHA Q0 = GAMMA(1-ALPHA) * (X/2)**ALPHA ------------------------------------------------------------ */ d1 = 0.; d2 = p[0]; t1 = 1.; t2 = q[0]; for (i = 2; i <= 7; i += 2) { d1 = c * d1 + p[i - 1]; d2 = c * d2 + p[i]; t1 = c * t1 + q[i - 1]; t2 = c * t2 + q[i]; } d1 = nu * d1; t1 = nu * t1; f1 = log(ex); f0 = a + nu * (p[7] - nu * (d1 + d2) / (t1 + t2)) - f1; q0 = exp(-nu * (a - nu * (p[7] + nu * (d1-d2) / (t1-t2)) - f1)); f1 = nu * f0; p0 = exp(f1); /* ----------------------------------------------------------- Calculation of F0 = ----------------------------------------------------------- */ d1 = r[4]; t1 = 1.; for (i = 0; i < 4; ++i) { d1 = c * d1 + r[i]; t1 = c * t1 + s[i]; } /* d2 := sinh(f1)/ nu = sinh(f1)/(f1/f0) * = f0 * sinh(f1)/f1 */ if (fabs(f1) <= .5) { f1 *= f1; d2 = 0.; for (i = 0; i < 6; ++i) { d2 = f1 * d2 + t[i]; } d2 = f0 + f0 * f1 * d2; } else { d2 = sinh(f1) / nu; } f0 = d2 - nu * d1 / (t1 * p0); if (ex <= 1e-10) { /* --------------------------------------------------------- X <= 1.0E-10 Calculation of K(ALPHA,X) and X*K(ALPHA+1,X)/K(ALPHA,X) --------------------------------------------------------- */ bk[0] = f0 + ex * f0; if (*ize == 1) { bk[0] -= ex * bk[0]; } ratio = p0 / f0; c = ex * DBL_MAX; if (k != 0) { /* --------------------------------------------------- Calculation of K(ALPHA,X) and X*K(ALPHA+1,X)/K(ALPHA,X), ALPHA >= 1/2 --------------------------------------------------- */ *ncalc = -1; if (bk[0] >= c / ratio) { return; } bk[0] = ratio * bk[0] / ex; twonu += 2.; ratio = twonu; } *ncalc = 1; if (*nb == 1) return; /* ----------------------------------------------------- Calculate K(ALPHA+L,X)/K(ALPHA+L-1,X), L = 1, 2, ... , NB-1 ----------------------------------------------------- */ *ncalc = -1; for (i = 1; i < *nb; ++i) { if (ratio >= c) return; bk[i] = ratio / ex; twonu += 2.; ratio = twonu; } *ncalc = 1; goto L420; } else { /* ------------------------------------------------------ 10^-10 < X <= 1.0 ------------------------------------------------------ */ c = 1.; x2by4 = ex * ex / 4.; p0 = .5 * p0; q0 = .5 * q0; d1 = -1.; d2 = 0.; bk1 = 0.; bk2 = 0.; f1 = f0; f2 = p0; do { d1 += 2.; d2 += 1.; d3 = d1 + d3; c = x2by4 * c / d2; f0 = (d2 * f0 + p0 + q0) / d3; p0 /= d2 - nu; q0 /= d2 + nu; t1 = c * f0; t2 = c * (p0 - d2 * f0); bk1 += t1; bk2 += t2; } while (fabs(t1 / (f1 + bk1)) > DBL_EPSILON || fabs(t2 / (f2 + bk2)) > DBL_EPSILON); bk1 = f1 + bk1; bk2 = 2. * (f2 + bk2) / ex; if (*ize == 2) { d1 = exp(ex); bk1 *= d1; bk2 *= d1; } wminf = estf[0] * ex + estf[1]; } } else if (DBL_EPSILON * ex > 1.) { /* ------------------------------------------------- X > 1./EPS ------------------------------------------------- */ *ncalc = *nb; bk1 = 1. / (M_SQRT_2dPI * sqrt(ex)); for (i = 0; i < *nb; ++i) bk[i] = bk1; return; } else { /* ------------------------------------------------------- X > 1.0 ------------------------------------------------------- */ twox = ex + ex; blpha = 0.; ratio = 0.; if (ex <= 4.) { /* ---------------------------------------------------------- Calculation of K(ALPHA+1,X)/K(ALPHA,X), 1.0 <= X <= 4.0 ----------------------------------------------------------*/ d2 = trunc(estm[0] / ex + estm[1]); m = (int) d2; d1 = d2 + d2; d2 -= .5; d2 *= d2; for (i = 2; i <= m; ++i) { d1 -= 2.; d2 -= d1; ratio = (d3 + d2) / (twox + d1 - ratio); } /* ----------------------------------------------------------- Calculation of I(|ALPHA|,X) and I(|ALPHA|+1,X) by backward recurrence and K(ALPHA,X) from the wronskian -----------------------------------------------------------*/ d2 = trunc(estm[2] * ex + estm[3]); m = (int) d2; c = fabs(nu); d3 = c + c; d1 = d3 - 1.; f1 = DBL_MIN; f0 = (2. * (c + d2) / ex + .5 * ex / (c + d2 + 1.)) * DBL_MIN; for (i = 3; i <= m; ++i) { d2 -= 1.; f2 = (d3 + d2 + d2) * f0; blpha = (1. + d1 / d2) * (f2 + blpha); f2 = f2 / ex + f1; f1 = f0; f0 = f2; } f1 = (d3 + 2.) * f0 / ex + f1; d1 = 0.; t1 = 1.; for (i = 1; i <= 7; ++i) { d1 = c * d1 + p[i - 1]; t1 = c * t1 + q[i - 1]; } p0 = exp(c * (a + c * (p[7] - c * d1 / t1) - log(ex))) / ex; f2 = (c + .5 - ratio) * f1 / ex; bk1 = p0 + (d3 * f0 - f2 + f0 + blpha) / (f2 + f1 + f0) * p0; if (*ize == 1) { bk1 *= exp(-ex); } wminf = estf[2] * ex + estf[3]; } else { /* --------------------------------------------------------- Calculation of K(ALPHA,X) and K(ALPHA+1,X)/K(ALPHA,X), by backward recurrence, for X > 4.0 ----------------------------------------------------------*/ dm = trunc(estm[4] / ex + estm[5]); m = (int) dm; d2 = dm - .5; d2 *= d2; d1 = dm + dm; for (i = 2; i <= m; ++i) { dm -= 1.; d1 -= 2.; d2 -= d1; ratio = (d3 + d2) / (twox + d1 - ratio); blpha = (ratio + ratio * blpha) / dm; } bk1 = 1. / ((M_SQRT_2dPI + M_SQRT_2dPI * blpha) * sqrt(ex)); if (*ize == 1) bk1 *= exp(-ex); wminf = estf[4] * (ex - fabs(ex - estf[6])) + estf[5]; } /* --------------------------------------------------------- Calculation of K(ALPHA+1,X) from K(ALPHA,X) and K(ALPHA+1,X)/K(ALPHA,X) --------------------------------------------------------- */ bk2 = bk1 + bk1 * (nu + .5 - ratio) / ex; } /*-------------------------------------------------------------------- Calculation of 'NCALC', K(ALPHA+I,X), I = 0, 1, ... , NCALC-1, & K(ALPHA+I,X)/K(ALPHA+I-1,X), I = NCALC, NCALC+1, ... , NB-1 -------------------------------------------------------------------*/ *ncalc = *nb; bk[0] = bk1; if (iend == 0) return; j = 1 - k; if (j >= 0) bk[j] = bk2; if (iend == 1) return; m = min0((int) (wminf - nu),iend); for (i = 2; i <= m; ++i) { t1 = bk1; bk1 = bk2; twonu += 2.; if (ex < 1.) { if (bk1 >= DBL_MAX / twonu * ex) break; } else { if (bk1 / ex >= DBL_MAX / twonu) break; } bk2 = twonu / ex * bk1 + t1; ii = i; ++j; if (j >= 0) { bk[j] = bk2; } } m = ii; if (m == iend) { return; } ratio = bk2 / bk1; mplus1 = m + 1; *ncalc = -1; for (i = mplus1; i <= iend; ++i) { twonu += 2.; ratio = twonu / ex + 1./ratio; ++j; if (j >= 1) { bk[j] = ratio; } else { if (bk2 >= DBL_MAX / ratio) return; bk2 *= ratio; } } *ncalc = max0(1, mplus1 - k); if (*ncalc == 1) bk[0] = bk2; if (*nb == 1) return; L420: for (i = *ncalc; i < *nb; ++i) { /* i == *ncalc */ #ifndef IEEE_754 if (bk[i-1] >= DBL_MAX / bk[i]) return; #endif bk[i] *= bk[i-1]; (*ncalc)++; } } } JAGS-4.3.2/src/jrmath/bessel_y.c0000664000175000017500000003462414224052371013225 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998-2015 Ross Ihaka and the R Core team. * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ /* DESCRIPTION --> see below */ /* From http://www.netlib.org/specfun/rybesl Fortran translated by f2c,... * ------------------------------=#---- Martin Maechler, ETH Zurich */ #include "nmath.h" #include "bessel.h" #ifndef MATHLIB_STANDALONE #include #endif #define min0(x, y) (((x) <= (y)) ? (x) : (y)) static void Y_bessel(double *x, double *alpha, int *nb, double *by, int *ncalc); // unused now from R double bessel_y(double x, double alpha) { int nb, ncalc; double na, *by; #ifndef MATHLIB_STANDALONE const void *vmax; #endif #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(alpha)) return x + alpha; #endif if (x < 0) { ML_ERROR(ME_RANGE, "bessel_y"); return ML_NAN; } na = floor(alpha); if (alpha < 0) { /* Using Abramowitz & Stegun 9.1.2 * this may not be quite optimal (CPU and accuracy wise) */ return(bessel_y(x, -alpha) * cospi(alpha) - ((alpha == na) ? 0 : bessel_j(x, -alpha) * sinpi(alpha))); } else if (alpha > 1e7) { MATHLIB_WARNING("besselY(x, nu): nu=%g too large for bessel_y() algorithm", alpha); return ML_NAN; } nb = 1+ (int)na;/* nb-1 <= alpha < nb */ alpha -= (double)(nb-1); #ifdef MATHLIB_STANDALONE by = (double *) calloc(nb, sizeof(double)); if (!by) MATHLIB_ERROR("%s", _("bessel_y allocation error")); #else vmax = vmaxget(); by = (double *) R_alloc((size_t) nb, sizeof(double)); #endif Y_bessel(&x, &alpha, &nb, by, &ncalc); if(ncalc != nb) {/* error input */ if(ncalc == -1) { #ifdef MATHLIB_STANDALONE free(by); #else vmaxset(vmax); #endif return ML_POSINF; } else if(ncalc < -1) MATHLIB_WARNING4(_("bessel_y(%g): ncalc (=%d) != nb (=%d); alpha=%g. Arg. out of range?\n"), x, ncalc, nb, alpha); else /* ncalc >= 0 */ MATHLIB_WARNING2(_("bessel_y(%g,nu=%g): precision lost in result\n"), x, alpha+(double)nb-1); } x = by[nb-1]; #ifdef MATHLIB_STANDALONE free(by); #else vmaxset(vmax); #endif return x; } /* Called from R: modified version of bessel_y(), accepting a work array * instead of allocating one. */ double bessel_y_ex(double x, double alpha, double *by) { int nb, ncalc; double na; #ifdef IEEE_754 /* NaNs propagated correctly */ if (ISNAN(x) || ISNAN(alpha)) return x + alpha; #endif if (x < 0) { ML_ERROR(ME_RANGE, "bessel_y"); return ML_NAN; } na = floor(alpha); if (alpha < 0) { /* Using Abramowitz & Stegun 9.1.2 * this may not be quite optimal (CPU and accuracy wise) */ return(bessel_y_ex(x, -alpha, by) * cospi(alpha) - ((alpha == na) ? 0 : bessel_j_ex(x, -alpha, by) * sinpi(alpha))); } else if (alpha > 1e7) { MATHLIB_WARNING("besselY(x, nu): nu=%g too large for bessel_y() algorithm", alpha); return ML_NAN; } nb = 1+ (int)na;/* nb-1 <= alpha < nb */ alpha -= (double)(nb-1); Y_bessel(&x, &alpha, &nb, by, &ncalc); if(ncalc != nb) {/* error input */ if(ncalc == -1) return ML_POSINF; else if(ncalc < -1) MATHLIB_WARNING4(_("bessel_y(%g): ncalc (=%d) != nb (=%d); alpha=%g. Arg. out of range?\n"), x, ncalc, nb, alpha); else /* ncalc >= 0 */ MATHLIB_WARNING2(_("bessel_y(%g,nu=%g): precision lost in result\n"), x, alpha+(double)nb-1); } x = by[nb-1]; return x; } static void Y_bessel(double *x, double *alpha, int *nb, double *by, int *ncalc) { /* ---------------------------------------------------------------------- This routine calculates Bessel functions Y_(N+ALPHA) (X) v for non-negative argument X, and non-negative order N+ALPHA. Explanation of variables in the calling sequence X - Non-negative argument for which Y's are to be calculated. ALPHA - Fractional part of order for which Y's are to be calculated. 0 <= ALPHA < 1.0. NB - Number of functions to be calculated, NB > 0. The first function calculated is of order ALPHA, and the last is of order (NB - 1 + ALPHA). BY - Output vector of length NB. If the routine terminates normally (NCALC=NB), the vector BY contains the functions Y(ALPHA,X), ... , Y(NB-1+ALPHA,X), If (0 < NCALC < NB), BY(I) contains correct function values for I <= NCALC, and contains the ratios Y(ALPHA+I-1,X)/Y(ALPHA+I-2,X) for the rest of the array. NCALC - Output variable indicating possible errors. Before using the vector BY, the user should check that NCALC=NB, i.e., all orders have been calculated to the desired accuracy. See error returns below. ******************************************************************* Error returns In case of an error, NCALC != NB, and not all Y's are calculated to the desired accuracy. NCALC < -1: An argument is out of range. For example, NB <= 0, IZE is not 1 or 2, or IZE=1 and ABS(X) >= XMAX. In this case, BY[0] = 0.0, the remainder of the BY-vector is not calculated, and NCALC is set to MIN0(NB,0)-2 so that NCALC != NB. NCALC = -1: Y(ALPHA,X) >= XINF. The requested function values are set to 0.0. 1 < NCALC < NB: Not all requested function values could be calculated accurately. BY(I) contains correct function values for I <= NCALC, and and the remaining NB-NCALC array elements contain 0.0. Intrinsic functions required are: DBLE, EXP, INT, MAX, MIN, REAL, SQRT Acknowledgement This program draws heavily on Temme's Algol program for Y(a,x) and Y(a+1,x) and on Campbell's programs for Y_nu(x). Temme's scheme is used for x < THRESH, and Campbell's scheme is used in the asymptotic region. Segments of code from both sources have been translated into Fortran 77, merged, and heavily modified. Modifications include parameterization of machine dependencies, use of a new approximation for ln(gamma(x)), and built-in protection against over/underflow. References: "Bessel functions J_nu(x) and Y_nu(x) of float order and float argument," Campbell, J. B., Comp. Phy. Comm. 18, 1979, pp. 133-142. "On the numerical evaluation of the ordinary Bessel function of the second kind," Temme, N. M., J. Comput. Phys. 21, 1976, pp. 343-350. Latest modification: March 19, 1990 Modified by: W. J. Cody Applied Mathematics Division Argonne National Laboratory Argonne, IL 60439 ----------------------------------------------------------------------*/ /* ---------------------------------------------------------------------- Mathematical constants FIVPI = 5*PI PIM5 = 5*PI - 15 ----------------------------------------------------------------------*/ const static double fivpi = 15.707963267948966192; const static double pim5 = .70796326794896619231; /*---------------------------------------------------------------------- Coefficients for Chebyshev polynomial expansion of 1/gamma(1-x), abs(x) <= .5 ----------------------------------------------------------------------*/ const static double ch[21] = { -6.7735241822398840964e-24, -6.1455180116049879894e-23,2.9017595056104745456e-21, 1.3639417919073099464e-19,2.3826220476859635824e-18, -9.0642907957550702534e-18,-1.4943667065169001769e-15, -3.3919078305362211264e-14,-1.7023776642512729175e-13, 9.1609750938768647911e-12,2.4230957900482704055e-10, 1.7451364971382984243e-9,-3.3126119768180852711e-8, -8.6592079961391259661e-7,-4.9717367041957398581e-6, 7.6309597585908126618e-5,.0012719271366545622927, .0017063050710955562222,-.07685284084478667369, -.28387654227602353814,.92187029365045265648 }; /* Local variables */ int i, k, na; double alfa, div, ddiv, even, gamma, term, cosmu, sinmu, b, c, d, e, f, g, h, p, q, r, s, d1, d2, q0, pa,pa1, qa,qa1, en, en1, nu, ex, ya,ya1, twobyx, den, odd, aye, dmu, x2, xna; en1 = ya = ya1 = 0; /* -Wall */ ex = *x; nu = *alpha; if (*nb > 0 && 0. <= nu && nu < 1.) { if(ex < DBL_MIN || ex > xlrg_BESS_Y) { /* Warning is not really appropriate, give * proper limit: * ML_ERROR(ME_RANGE, "Y_bessel"); */ *ncalc = *nb; if(ex > xlrg_BESS_Y) by[0]= 0.; /*was ML_POSINF */ else if(ex < DBL_MIN) by[0]=ML_NEGINF; for(i=0; i < *nb; i++) by[i] = by[0]; return; } xna = trunc(nu + .5); na = (int) xna; if (na == 1) {/* <==> .5 <= *alpha < 1 <==> -5. <= nu < 0 */ nu -= xna; } if (nu == -.5) { p = M_SQRT_2dPI / sqrt(ex); ya = p * sin(ex); ya1 = -p * cos(ex); } else if (ex < 3.) { /* ------------------------------------------------------------- Use Temme's scheme for small X ------------------------------------------------------------- */ b = ex * .5; d = -log(b); f = nu * d; e = pow(b, -nu); if (fabs(nu) < M_eps_sinc) c = M_1_PI; else c = nu / sinpi(nu); /* ------------------------------------------------------------ Computation of sinh(f)/f ------------------------------------------------------------ */ if (fabs(f) < 1.) { x2 = f * f; en = 19.; s = 1.; for (i = 1; i <= 9; ++i) { s = s * x2 / en / (en - 1.) + 1.; en -= 2.; } } else { s = (e - 1. / e) * .5 / f; } /* -------------------------------------------------------- Computation of 1/gamma(1-a) using Chebyshev polynomials */ x2 = nu * nu * 8.; aye = ch[0]; even = 0.; alfa = ch[1]; odd = 0.; for (i = 3; i <= 19; i += 2) { even = -(aye + aye + even); aye = -even * x2 - aye + ch[i - 1]; odd = -(alfa + alfa + odd); alfa = -odd * x2 - alfa + ch[i]; } even = (even * .5 + aye) * x2 - aye + ch[20]; odd = (odd + alfa) * 2.; gamma = odd * nu + even; /* End of computation of 1/gamma(1-a) ----------------------------------------------------------- */ g = e * gamma; e = (e + 1. / e) * .5; f = 2. * c * (odd * e + even * s * d); e = nu * nu; p = g * c; q = M_1_PI / g; c = nu * M_PI_2; if (fabs(c) < M_eps_sinc) r = 1.; else r = sinpi(nu/2) / c; r = M_PI * c * r * r; c = 1.; d = -b * b; h = 0.; ya = f + r * q; ya1 = p; en = 1.; while (fabs(g / (1. + fabs(ya))) + fabs(h / (1. + fabs(ya1))) > DBL_EPSILON) { f = (f * en + p + q) / (en * en - e); c *= (d / en); p /= en - nu; q /= en + nu; g = c * (f + r * q); h = c * p - en * g; ya += g; ya1+= h; en += 1.; } ya = -ya; ya1 = -ya1 / b; } else if (ex < thresh_BESS_Y) { /* -------------------------------------------------------------- Use Temme's scheme for moderate X : 3 <= x < 16 -------------------------------------------------------------- */ c = (.5 - nu) * (.5 + nu); b = ex + ex; e = ex * M_1_PI * cospi(nu) / DBL_EPSILON; e *= e; p = 1.; q = -ex; r = 1. + ex * ex; s = r; en = 2.; while (r * en * en < e) { en1 = en + 1.; d = (en - 1. + c / en) / s; p = (en + en - p * d) / en1; q = (-b + q * d) / en1; s = p * p + q * q; r *= s; en = en1; } f = p / s; p = f; g = -q / s; q = g; L220: en -= 1.; if (en > 0.) { r = en1 * (2. - p) - 2.; s = b + en1 * q; d = (en - 1. + c / en) / (r * r + s * s); p = d * r; q = d * s; e = f + 1.; f = p * e - g * q; g = q * e + p * g; en1 = en; goto L220; } f = 1. + f; d = f * f + g * g; pa = f / d; qa = -g / d; d = nu + .5 - p; q += ex; pa1 = (pa * q - qa * d) / ex; qa1 = (qa * q + pa * d) / ex; b = ex - M_PI_2 * (nu + .5); c = cos(b); s = sin(b); d = M_SQRT_2dPI / sqrt(ex); ya = d * (pa * s + qa * c); ya1 = d * (qa1 * s - pa1 * c); } else { /* x > thresh_BESS_Y */ /* ---------------------------------------------------------- Use Campbell's asymptotic scheme. ---------------------------------------------------------- */ na = 0; d1 = trunc(ex / fivpi); i = (int) d1; dmu = ex - 15. * d1 - d1 * pim5 - (*alpha + .5) * M_PI_2; if (i - (i / 2 << 1) == 0) { cosmu = cos(dmu); sinmu = sin(dmu); } else { cosmu = -cos(dmu); sinmu = -sin(dmu); } ddiv = 8. * ex; dmu = *alpha; den = sqrt(ex); for (k = 1; k <= 2; ++k) { p = cosmu; cosmu = sinmu; sinmu = -p; d1 = (2. * dmu - 1.) * (2. * dmu + 1.); d2 = 0.; div = ddiv; p = 0.; q = 0.; q0 = d1 / div; term = q0; for (i = 2; i <= 20; ++i) { d2 += 8.; d1 -= d2; div += ddiv; term = -term * d1 / div; p += term; d2 += 8.; d1 -= d2; div += ddiv; term *= (d1 / div); q += term; if (fabs(term) <= DBL_EPSILON) { break; } } p += 1.; q += q0; if (k == 1) ya = M_SQRT_2dPI * (p * cosmu - q * sinmu) / den; else ya1 = M_SQRT_2dPI * (p * cosmu - q * sinmu) / den; dmu += 1.; } } if (na == 1) { h = 2. * (nu + 1.) / ex; if (h > 1.) { if (fabs(ya1) > DBL_MAX / h) { h = 0.; ya = 0.; } } h = h * ya1 - ya; ya = ya1; ya1 = h; } /* --------------------------------------------------------------- Now have first one or two Y's --------------------------------------------------------------- */ by[0] = ya; *ncalc = 1; if(*nb > 1) { by[1] = ya1; if (ya1 != 0.) { aye = 1. + *alpha; twobyx = 2. / ex; *ncalc = 2; for (i = 2; i < *nb; ++i) { if (twobyx < 1.) { if (fabs(by[i - 1]) * twobyx >= DBL_MAX / aye) goto L450; } else { if (fabs(by[i - 1]) >= DBL_MAX / aye / twobyx) goto L450; } by[i] = twobyx * aye * by[i - 1] - by[i - 2]; aye += 1.; ++(*ncalc); } } } L450: for (i = *ncalc; i < *nb; ++i) by[i] = ML_NEGINF;/* was 0 */ } else { by[0] = 0.; *ncalc = min0(*nb,0) - 1; } } JAGS-4.3.2/src/jrmath/dgeom.c0000664000175000017500000000257514224052371012513 00000000000000/* * AUTHOR * Catherine Loader, catherine@research.bell-labs.com. * October 23, 2000. * * Merge in to R: * Copyright (C) 2000-2014 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * * Computes the geometric probabilities, Pr(X=x) = p(1-p)^x. */ #include "nmath.h" #include "dpq.h" double dgeom(double x, double p, int give_log) { double prob; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(p)) return x + p; #endif if (p <= 0 || p > 1) ML_ERR_return_NAN; R_D_nonint_check(x); if (x < 0 || !R_FINITE(x) || p == 0) return R_D__0; x = R_forceint(x); /* prob = (1-p)^x, stable for small p */ prob = dbinom_raw(0.,x, p,1-p, give_log); return((give_log) ? log(p) + prob : p*prob); } JAGS-4.3.2/src/jrmath/pgeom.c0000664000175000017500000000270014224052371012515 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2006 The R Core Team * Copyright (C) 2004 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the geometric distribution. */ #include "nmath.h" #include "dpq.h" double pgeom(double x, double p, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(p)) return x + p; #endif if(p <= 0 || p > 1) ML_ERR_return_NAN; if (x < 0.) return R_DT_0; if (!R_FINITE(x)) return R_DT_1; x = floor(x +1e-7); if(p == 1.) { /* we cannot assume IEEE */ x = lower_tail ? 1: 0; return log_p ? log(x) : x; } x = log1p(-p) * (x + 1); if (log_p) return R_DT_Clog(x); else return lower_tail ? -expm1(x) : exp(x); } JAGS-4.3.2/src/jrmath/qgeom.c0000664000175000017500000000255514224052371012526 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-12 The R Core Team * Copyright (C) 2004--2005 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The quantile function of the geometric distribution. */ #include "nmath.h" #include "dpq.h" double qgeom(double p, double prob, int lower_tail, int log_p) { if (prob <= 0 || prob > 1) ML_ERR_return_NAN; R_Q_P01_boundaries(p, 0, ML_POSINF); #ifdef IEEE_754 if (ISNAN(p) || ISNAN(prob)) return p + prob; #endif if (prob == 1) return(0); /* add a fuzz to ensure left continuity, but value must be >= 0 */ return fmax2(0, ceil(R_DT_Clog(p) / log1p(- prob) - 1 - 1e-12)); } JAGS-4.3.2/src/jrmath/rgeom.c0000664000175000017500000000263514224052371012526 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka and the R Core Team. * Copyright (C) 2000 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double rgeom(double p); * * DESCRIPTION * * Random variates from the geometric distribution. * * NOTES * * We generate lambda as exponential with scale parameter * p / (1 - p). Return a Poisson deviate with mean lambda. * * REFERENCE * * Devroye, L. (1986). * Non-Uniform Random Variate Generation. * New York: Springer-Verlag. * Page 480. */ #include "nmath.h" double rgeom(double p, JRNG *rng) { if (!R_FINITE(p) || p <= 0 || p > 1) ML_ERR_return_NAN; return rpois(exp_rand(rng) * ((1 - p) / p), rng); } JAGS-4.3.2/src/jrmath/dnbeta.c0000664000175000017500000000700714224052371012650 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-12 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double dnbeta(double x, double a, double b, double ncp, int give_log); * * DESCRIPTION * * Computes the density of the noncentral beta distribution with * noncentrality parameter ncp. The noncentral beta distribution * has density: * * Inf * f(x|a,b,ncp) = SUM p(i) * x^(a+i-1) * (1-x)^(b-1) / B(a+i,b) * i=0 * * where: * * p(k) = exp(-ncp/2) (ncp/2)^k / k! * * B(a,b) = Gamma(a) * Gamma(b) / Gamma(a+b) * * * This can be computed efficiently by using the recursions: * * p(k+1) = ncp/2 / (k+1) * p(k) * * B(a+k+1,b) = (a+k)/(a+b+k) * B(a+k,b) * * The new algorithm first determines for which k the k-th term is maximal, * and then sums outwards to both sides from the 'mid'. */ #include "nmath.h" #include "dpq.h" double dnbeta(double x, double a, double b, double ncp, int give_log) { const static double eps = 1.e-15; int kMax; double k, ncp2, dx2, d, D, term; LDOUBLE sum, p_k, q; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(a) || ISNAN(b) || ISNAN(ncp)) return x + a + b + ncp; #endif if (ncp < 0 || a <= 0 || b <= 0) ML_ERR_return_NAN; if (!R_FINITE(a) || !R_FINITE(b) || !R_FINITE(ncp)) ML_ERR_return_NAN; if (x < 0 || x > 1) return(R_D__0); if(ncp == 0) return dbeta(x, a, b, give_log); /* New algorithm, starting with *largest* term : */ ncp2 = 0.5 * ncp; dx2 = ncp2*x; d = (dx2 - a - 1)/2; D = d*d + dx2 * (a + b) - a; if(D <= 0) { kMax = 0; } else { D = ceil(d + sqrt(D)); kMax = (D > 0) ? (int)D : 0; } /* The starting "middle term" --- first look at it's log scale: */ term = dbeta(x, a + kMax, b, /* log = */ TRUE); p_k = dpois_raw(kMax, ncp2, TRUE); if(x == 0. || !R_FINITE(term) || !R_FINITE((double)p_k)) /* if term = +Inf */ return R_D_exp((double)(p_k + term)); /* Now if s_k := p_k * t_k {here = exp(p_k + term)} would underflow, * we should rather scale everything and re-scale at the end:*/ p_k += term; /* = log(p_k) + log(t_k) == log(s_k) -- used at end to rescale */ /* mid = 1 = the rescaled value, instead of mid = exp(p_k); */ /* Now sum from the inside out */ sum = term = 1. /* = mid term */; /* middle to the left */ k = kMax; while(k > 0 && term > sum * eps) { k--; q = /* 1 / r_k = */ (k+1)*(k+a) / (k+a+b) / dx2; term *= q; sum += term; } /* middle to the right */ term = 1.; k = kMax; do { q = /* r_{old k} = */ dx2 * (k+a+b) / (k+a) / (k+1); k++; term *= q; sum += term; } while (term > sum * eps); #ifdef HAVE_LONG_DOUBLE return R_D_exp((double)(p_k + logl(sum))); #else return R_D_exp((double)(p_k + log(sum))); #endif } JAGS-4.3.2/src/jrmath/pnbeta.c0000664000175000017500000000654714224052371012674 00000000000000/* * Copyright (C) 2000-2013 The R Core Team * * Algorithm AS 226 Appl. Statist. (1987) Vol. 36, No. 2 * by Russell V. Lenth * Incorporates modification AS R84 from AS Vol. 39, pp311-2, 1990 * and AS R95 from AS Vol. 44, pp551-2, 1995 * by H. Frick and Min Long Lam. * original (C) Royal Statistical Society 1987, 1990, 1995 * * Returns the cumulative probability of x for the non-central * beta distribution with parameters a, b and non-centrality ncp. * * Auxiliary routines required: * lgamma - log-gamma function * pbeta - incomplete-beta function {nowadays: pbeta_raw() -> bratio()} */ #include "nmath.h" #include "dpq.h" LDOUBLE attribute_hidden pnbeta_raw(double x, double o_x, double a, double b, double ncp) { /* o_x == 1 - x but maybe more accurate */ /* change errmax and itrmax if desired; * original (AS 226, R84) had (errmax; itrmax) = (1e-6; 100) */ const static double errmax = 1.0e-9; const int itrmax = 10000; /* 100 is not enough for pf(ncp=200) see PR#11277 */ double a0, lbeta, c, errbd, x0, temp, tmp_c; int ierr; LDOUBLE ans, ax, gx, q, sumq; if (ncp < 0. || a <= 0. || b <= 0.) ML_ERR_return_NAN; if(x < 0. || o_x > 1. || (x == 0. && o_x == 1.)) return 0.; if(x > 1. || o_x < 0. || (x == 1. && o_x == 0.)) return 1.; c = ncp / 2.; /* initialize the series */ x0 = floor(fmax2(c - 7. * sqrt(c), 0.)); a0 = a + x0; lbeta = lgammafn(a0) + lgammafn(b) - lgammafn(a0 + b); /* temp = pbeta_raw(x, a0, b, TRUE, FALSE), but using (x, o_x): */ bratio(a0, b, x, o_x, &temp, &tmp_c, &ierr, FALSE); gx = exp(a0 * log(x) + b * (x < .5 ? log1p(-x) : log(o_x)) - lbeta - log(a0)); if (a0 > a) q = exp(-c + x0 * log(c) - lgammafn(x0 + 1.)); else q = exp(-c); sumq = 1. - q; ans = ax = q * temp; /* recurse over subsequent terms until convergence is achieved */ double j = floor(x0); // x0 could be billions, and is in package EnvStats do { j++; temp -= (double) gx; gx *= x * (a + b + j - 1.) / (a + j); q *= c / j; sumq -= q; ax = temp * q; ans += ax; errbd = (double)((temp - gx) * sumq); } while (errbd > errmax && j < itrmax + x0); if (errbd > errmax) ML_ERROR(ME_PRECISION, "pnbeta"); if (j >= itrmax + x0) ML_ERROR(ME_NOCONV, "pnbeta"); return ans; } double attribute_hidden pnbeta2(double x, double o_x, double a, double b, double ncp, /* o_x == 1 - x but maybe more accurate */ int lower_tail, int log_p) { LDOUBLE ans = pnbeta_raw(x, o_x, a,b, ncp); /* return R_DT_val(ans), but we want to warn about cancellation here */ if (lower_tail) #ifdef HAVE_LONG_DOUBLE return (double) (log_p ? logl(ans) : ans); #else return log_p ? log(ans) : ans; #endif else { if (ans > 1. - 1e-10) ML_ERROR(ME_PRECISION, "pnbeta"); if (ans > 1.0) ans = 1.0; /* Precaution */ #if defined(HAVE_LONG_DOUBLE) && defined(HAVE_LOG1PL) return (double) (log_p ? log1pl(-ans) : (1. - ans)); #else /* include standalone case */ return (double) (log_p ? log1p((double)-ans) : (1. - ans)); #endif } } double pnbeta(double x, double a, double b, double ncp, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(a) || ISNAN(b) || ISNAN(ncp)) return x + a + b + ncp; #endif R_P_bounds_01(x, 0., 1.); return pnbeta2(x, 1-x, a, b, ncp, lower_tail, log_p); } JAGS-4.3.2/src/jrmath/qnbeta.c0000664000175000017500000000354714224052371012672 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 2006 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" #include "dpq.h" double qnbeta(double p, double a, double b, double ncp, int lower_tail, int log_p) { const static double accu = 1e-15; const static double Eps = 1e-14; /* must be > accu */ double ux, lx, nx, pp; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(a) || ISNAN(b) || ISNAN(ncp)) return p + a + b + ncp; #endif if (!R_FINITE(a)) ML_ERR_return_NAN; if (ncp < 0. || a <= 0. || b <= 0.) ML_ERR_return_NAN; R_Q_P01_boundaries(p, 0, 1); p = R_DT_qIv(p); /* Invert pnbeta(.) : * 1. finding an upper and lower bound */ if(p > 1 - DBL_EPSILON) return 1.0; pp = fmin2(1 - DBL_EPSILON, p * (1 + Eps)); for(ux = 0.5; ux < 1 - DBL_EPSILON && pnbeta(ux, a, b, ncp, TRUE, FALSE) < pp; ux = 0.5*(1+ux)); pp = p * (1 - Eps); for(lx = 0.5; lx > DBL_MIN && pnbeta(lx, a, b, ncp, TRUE, FALSE) > pp; lx *= 0.5); /* 2. interval (lx,ux) halving : */ do { nx = 0.5 * (lx + ux); if (pnbeta(nx, a, b, ncp, TRUE, FALSE) > p) ux = nx; else lx = nx; } while ((ux - lx) / nx > accu); return 0.5 * (ux + lx); } JAGS-4.3.2/src/jrmath/dnf.c0000664000175000017500000000516714224052371012167 00000000000000/* * AUTHOR * Peter Ruckdeschel, peter.ruckdeschel@uni-bayreuth.de. * April 13, 2006. * * Merge in to R: * Copyright (C) 2006 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * DESCRIPTION * * The density function of the non-central F distribution --- * obtained by differentiating the corresp. cumulative distribution function * using dnbeta. * For df1 < 2, since the F density has a singularity as x -> Inf. */ #include "nmath.h" #include "dpq.h" double dnf(double x, double df1, double df2, double ncp, int give_log) { double y, z, f; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(df1) || ISNAN(df2) || ISNAN(ncp)) return x + df2 + df1 + ncp; #endif /* want to compare dnf(ncp=0) behavior with df() one, hence *NOT* : * if (ncp == 0) * return df(x, df1, df2, give_log); */ if (df1 <= 0. || df2 <= 0. || ncp < 0) ML_ERR_return_NAN; if (x < 0.) return(R_D__0); if (!R_FINITE(ncp)) /* ncp = +Inf -- FIXME?: in some cases, limit exists */ ML_ERR_return_NAN; /* This is not correct for df1 == 2, ncp > 0 - and seems unneeded: * if (x == 0.) return(df1 > 2 ? R_D__0 : (df1 == 2 ? R_D__1 : ML_POSINF)); */ if (!R_FINITE(df1) && !R_FINITE(df2)) { /* both +Inf */ /* PR: not sure about this (taken from ncp==0) -- FIXME ? */ if(x == 1.) return ML_POSINF; /* else */ return R_D__0; } if (!R_FINITE(df2)) /* i.e. = +Inf */ return df1* dnchisq(x*df1, df1, ncp, give_log); /* == dngamma(x, df1/2, 2./df1, ncp, give_log) -- but that does not exist */ if (df1 > 1e14 && ncp < 1e7) { /* includes df1 == +Inf: code below is inaccurate there */ f = 1 + ncp/df1; /* assumes ncp << df1 [ignores 2*ncp^(1/2)/df1*x term] */ z = dgamma(1./x/f, df2/2, 2./df2, give_log); return give_log ? z - 2*log(x) - log(f) : z / (x*x) / f; } y = (df1 / df2) * x; z = dnbeta(y/(1 + y), df1 / 2., df2 / 2., ncp, give_log); return give_log ? z + log(df1) - log(df2) - 2 * log1p(y) : z * (df1 / df2) /(1 + y) / (1 + y); } JAGS-4.3.2/src/jrmath/pnf.c0000664000175000017500000000312714224052371012175 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-8 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the non-central F distribution. */ #include "nmath.h" #include "dpq.h" double pnf(double x, double df1, double df2, double ncp, int lower_tail, int log_p) { double y; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(df1) || ISNAN(df2) || ISNAN(ncp)) return x + df2 + df1 + ncp; #endif if (df1 <= 0. || df2 <= 0. || ncp < 0) ML_ERR_return_NAN; if (!R_FINITE(ncp)) ML_ERR_return_NAN; if (!R_FINITE(df1) && !R_FINITE(df2)) /* both +Inf */ ML_ERR_return_NAN; R_P_bounds_01(x, 0., ML_POSINF); if (df2 > 1e8) /* avoid problems with +Inf and loss of accuracy */ return pnchisq(x * df1, df1, ncp, lower_tail, log_p); y = (df1 / df2) * x; return pnbeta2(y/(1. + y), 1./(1. + y), df1 / 2., df2 / 2., ncp, lower_tail, log_p); } JAGS-4.3.2/src/jrmath/qnf.c0000664000175000017500000000271014224052371012173 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 2006-8 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" #include "dpq.h" double qnf(double p, double df1, double df2, double ncp, int lower_tail, int log_p) { double y; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(df1) || ISNAN(df2) || ISNAN(ncp)) return p + df1 + df2 + ncp; #endif if (df1 <= 0. || df2 <= 0. || ncp < 0) ML_ERR_return_NAN; if (!R_FINITE(ncp)) ML_ERR_return_NAN; if (!R_FINITE(df1) && !R_FINITE(df2)) ML_ERR_return_NAN; R_Q_P01_boundaries(p, 0, ML_POSINF); if (df2 > 1e8) /* avoid problems with +Inf and loss of accuracy */ return qnchisq(p, df1, ncp, lower_tail, log_p)/df1; y = qnbeta(p, df1 / 2., df2 / 2., ncp, lower_tail, log_p); return y/(1-y) * (df2/df1); } JAGS-4.3.2/src/jrmath/dnt.c0000664000175000017500000000540514224052371012200 00000000000000/* * AUTHOR * Claus Ekstrøm, ekstrom@dina.kvl.dk * July 15, 2003. * * Merge in to R: * Copyright (C) 2003 The R Foundation * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * * NOTE * * Requires the following auxiliary routines: * * lgammafn(x) - log gamma function * pnt(x, df, ncp) - the distribution function for * the non-central t distribution * * * DESCRIPTION * * The non-central t density is * * f(x, df, ncp) = * df^(df/2) * exp(-.5*ncp^2) / * (sqrt(pi)*gamma(df/2)*(df+x^2)^((df+1)/2)) * * sum_{k=0}^Inf gamma((df + k + df)/2)*ncp^k / * prod(1:k)*(2*x^2/(df+x^2))^(k/2) * * The functional relationship * * f(x, df, ncp) = df/x * * (F(sqrt((df+2)/df)*x, df+2, ncp) - F(x, df, ncp)) * * is used to evaluate the density at x != 0 and * * f(0, df, ncp) = exp(-.5*ncp^2) / * (sqrt(pi)*sqrt(df)*gamma(df/2))*gamma((df+1)/2) * * is used for x=0. * * All calculations are done on log-scale to increase stability. * */ #include "nmath.h" #include "dpq.h" double dnt(double x, double df, double ncp, int give_log) { double u; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(df)) return x + df; #endif /* If non-positive df then error */ if (df <= 0.0) ML_ERR_return_NAN; if(ncp == 0.0) return dt(x, df, give_log); /* If x is infinite then return 0 */ if(!R_FINITE(x)) return R_D__0; /* If infinite df then the density is identical to a normal distribution with mean = ncp. However, the formula loses a lot of accuracy around df=1e9 */ if(!R_FINITE(df) || df > 1e8) return dnorm(x, ncp, 1., give_log); /* Do calculations on log scale to stabilize */ /* Consider two cases: x ~= 0 or not */ if (fabs(x) > sqrt(df * DBL_EPSILON)) { u = log(df) - log(fabs(x)) + log(fabs(pnt(x*sqrt((df+2)/df), df+2, ncp, 1, 0) - pnt(x, df, ncp, 1, 0))); /* FIXME: the above still suffers from cancellation (but not horribly) */ } else { /* x ~= 0 : -> same value as for x = 0 */ u = lgammafn((df+1)/2) - lgammafn(df/2) - (M_LN_SQRT_PI + .5*(log(df) + ncp*ncp)); } return (give_log ? u : exp(u)); } JAGS-4.3.2/src/jrmath/pnt.c0000664000175000017500000001300214224052371012204 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998-2012 The R Core Team * based on AS243 (C) 1989 Royal Statistical Society * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ /* Algorithm AS 243 Lenth,R.V. (1989). Appl. Statist., Vol.38, 185-189. * ---------------- * Cumulative probability at t of the non-central t-distribution * with df degrees of freedom (may be fractional) and non-centrality * parameter delta. * * NOTE * * Requires the following auxiliary routines: * * lgammafn(x) - log gamma function * pbeta(x, a, b) - incomplete beta function * pnorm(x) - normal distribution function * * CONSTANTS * * M_SQRT_2dPI = 1/ {gamma(1.5) * sqrt(2)} = sqrt(2 / pi) * M_LN_SQRT_PI = ln(sqrt(pi)) = ln(pi)/2 */ #include "nmath.h" #include "dpq.h" /*----------- DEBUGGING ------------- * * make CFLAGS='-DDEBUG_pnt -g' * -- Feb.3, 1999; M.Maechler: - For 't > ncp > 20' (or so) the result is completely WRONG! */ double pnt(double t, double df, double ncp, int lower_tail, int log_p) { double albeta, a, b, del, errbd, lambda, rxb, tt, x; LDOUBLE geven, godd, p, q, s, tnc, xeven, xodd; int it, negdel; /* note - itrmax and errmax may be changed to suit one's needs. */ const int itrmax = 1000; const static double errmax = 1.e-12; if (df <= 0.0) ML_ERR_return_NAN; if(ncp == 0.0) return pt(t, df, lower_tail, log_p); if(!R_FINITE(t)) return (t < 0) ? R_DT_0 : R_DT_1; if (t >= 0.) { negdel = FALSE; tt = t; del = ncp; } else { /* We deal quickly with left tail if extreme, since pt(q, df, ncp) <= pt(0, df, ncp) = \Phi(-ncp) */ if (ncp > 40 && (!log_p || !lower_tail)) return R_DT_0; negdel = TRUE; tt = -t; del = -ncp; } if (df > 4e5 || del*del > 2*M_LN2*(-(DBL_MIN_EXP))) { /*-- 2nd part: if del > 37.62, then p=0 below FIXME: test should depend on `df', `tt' AND `del' ! */ /* Approx. from Abramowitz & Stegun 26.7.10 (p.949) */ s = 1./(4.*df); return pnorm((double)(tt*(1. - s)), del, sqrt((double) (1. + tt*tt*2.*s)), lower_tail != negdel, log_p); } /* initialize twin series */ /* Guenther, J. (1978). Statist. Computn. Simuln. vol.6, 199. */ x = t * t; rxb = df/(x + df);/* := (1 - x) {x below} -- but more accurately */ x = x / (x + df);/* in [0,1) */ #ifdef DEBUG_pnt REprintf("pnt(t=%7g, df=%7g, ncp=%7g) ==> x= %10g:",t,df,ncp, x); #endif if (x > 0.) {/* <==> t != 0 */ lambda = del * del; p = .5 * exp(-.5 * lambda); #ifdef DEBUG_pnt REprintf("\t p=%10Lg\n",p); #endif if(p == 0.) { /* underflow! */ /*========== really use an other algorithm for this case !!! */ ML_ERROR(ME_UNDERFLOW, "pnt"); ML_ERROR(ME_RANGE, "pnt"); /* |ncp| too large */ return R_DT_0; } #ifdef DEBUG_pnt REprintf("it 1e5*(godd, geven)| p q s" /* 1.3 1..4..7.9 1..4..7.9|1..4..7.901 1..4..7.901 1..4..7.901 */ " pnt(*) errbd\n"); /* 1..4..7..0..34 1..4..7.9*/ #endif q = M_SQRT_2dPI * p * del; s = .5 - p; /* s = 0.5 - p = 0.5*(1 - exp(-.5 L)) = -0.5*expm1(-.5 L)) */ if(s < 1e-7) s = -0.5 * expm1(-0.5 * lambda); a = .5; b = .5 * df; /* rxb = (1 - x) ^ b [ ~= 1 - b*x for tiny x --> see 'xeven' below] * where '(1 - x)' =: rxb {accurately!} above */ rxb = pow(rxb, b); albeta = M_LN_SQRT_PI + lgammafn(b) - lgammafn(.5 + b); xodd = pbeta(x, a, b, /*lower*/TRUE, /*log_p*/FALSE); godd = 2. * rxb * exp(a * log(x) - albeta); tnc = b * x; xeven = (tnc < DBL_EPSILON) ? tnc : 1. - rxb; geven = tnc * rxb; tnc = p * xodd + q * xeven; /* repeat until convergence or iteration limit */ for(it = 1; it <= itrmax; it++) { a += 1.; xodd -= godd; xeven -= geven; godd *= x * (a + b - 1.) / a; geven *= x * (a + b - .5) / (a + .5); p *= lambda / (2 * it); q *= lambda / (2 * it + 1); tnc += p * xodd + q * xeven; s -= p; /* R 2.4.0 added test for rounding error here. */ if(s < -1.e-10) { /* happens e.g. for (t,df,ncp)=(40,10,38.5), after 799 it.*/ ML_ERROR(ME_PRECISION, "pnt"); #ifdef DEBUG_pnt REprintf("s = %#14.7Lg < 0 !!! ---> non-convergence!!\n", s); #endif goto finis; } if(s <= 0 && it > 1) goto finis; errbd = (double)(2. * s * (xodd - godd)); #ifdef DEBUG_pnt REprintf("%3d %#9.4g %#9.4g|%#11.4Lg %#11.4Lg %#11.4Lg %#14.10Lg %#9.4g\n", it, 1e5*(double)godd, 1e5*(double)geven, p, q, s, tnc, errbd); #endif if(fabs(errbd) < errmax) goto finis;/*convergence*/ } /* non-convergence:*/ ML_ERROR(ME_NOCONV, "pnt"); } else { /* x = t = 0 */ tnc = 0.; } finis: tnc += pnorm(- del, 0., 1., /*lower*/TRUE, /*log_p*/FALSE); lower_tail = lower_tail != negdel; /* xor */ if(tnc > 1 - 1e-10 && lower_tail) ML_ERROR(ME_PRECISION, "pnt{final}"); return R_DT_val(fmin2((double)tnc, 1.) /* Precaution */); } JAGS-4.3.2/src/jrmath/qnt.c0000664000175000017500000000402114224052371012206 00000000000000/* * R : A Computer Language for Statistical Data Analysis * Copyright (C) 2006-2013 The R Core Team * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ */ #include "nmath.h" #include "dpq.h" double qnt(double p, double df, double ncp, int lower_tail, int log_p) { const static double accu = 1e-13; const static double Eps = 1e-11; /* must be > accu */ double ux, lx, nx, pp; #ifdef IEEE_754 if (ISNAN(p) || ISNAN(df) || ISNAN(ncp)) return p + df + ncp; #endif if (!R_FINITE(df)) ML_ERR_return_NAN; /* Was * df = floor(df + 0.5); * if (df < 1 || ncp < 0) ML_ERR_return_NAN; */ if (df <= 0.0) ML_ERR_return_NAN; if(ncp == 0.0 && df >= 1.0) return qt(p, df, lower_tail, log_p); R_Q_P01_boundaries(p, ML_NEGINF, ML_POSINF); p = R_DT_qIv(p); /* Invert pnt(.) : * 1. finding an upper and lower bound */ if(p > 1 - DBL_EPSILON) return ML_POSINF; pp = fmin2(1 - DBL_EPSILON, p * (1 + Eps)); for(ux = fmax2(1., ncp); ux < DBL_MAX && pnt(ux, df, ncp, TRUE, FALSE) < pp; ux *= 2); pp = p * (1 - Eps); for(lx = fmin2(-1., -ncp); lx > -DBL_MAX && pnt(lx, df, ncp, TRUE, FALSE) > pp; lx *= 2); /* 2. interval (lx,ux) halving : */ do { nx = 0.5 * (lx + ux); // could be zero if (pnt(nx, df, ncp, TRUE, FALSE) > p) ux = nx; else lx = nx; } while ((ux - lx) > accu * fmax2(fabs(lx), fabs(ux))); return 0.5 * (lx + ux); } JAGS-4.3.2/src/jrmath/sign.c0000664000175000017500000000216414224052371012352 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * SYNOPSIS * * #include * double sign(double x); * * DESCRIPTION * * This function computes the 'signum(.)' function: * * sign(x) = 1 if x > 0 * sign(x) = 0 if x == 0 * sign(x) = -1 if x < 0 */ #include "nmath.h" double sign(double x) { if (ISNAN(x)) return x; return ((x > 0) ? 1 : ((x == 0)? 0 : -1)); } JAGS-4.3.2/src/jrmath/rweibull2.c0000664000175000017500000000236514224052371013324 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * Copyright (C) 2015 Martyn Plummer * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * Random variates from the Weibull distribution using the BUGS * parameterization, i.e. x^shape has exponential distribution with * mean 1/rate. */ #include "nmath.h" double rweibull2(double shape, double rate, JRNG *rng) { if (!R_FINITE(shape) || !R_FINITE(rate) || shape <= 0. || rate <= 0.) { ML_ERR_return_NAN; } return pow(-log(unif_rand(rng)) / rate, 1.0 / shape); } JAGS-4.3.2/src/jrmath/dweibull2.c0000664000175000017500000000316614224052371013306 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-6 The R Core Team * Copyright (C) 2015 Martyn Plummer * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The density function of the Weibull distribution using the BUGS * parameterization, i.e. x^shape has exponential distribution with * mean 1/rate. */ #include "nmath.h" #include "dpq.h" double dweibull2(double x, double shape, double rate, int give_log) { double tmp1, tmp2; #ifdef IEEE_754 if (ISNAN(x) || ISNAN(shape) || ISNAN(rate)) return x + shape + rate; #endif if (shape <= 0 || rate <= 0) ML_ERR_return_NAN; if (x < 0) return R_D__0; if (!R_FINITE(x)) return R_D__0; /* need to handle x == 0 separately */ if(x == 0 && shape < 1) return ML_POSINF; tmp1 = rate * pow(x, shape - 1); tmp2 = tmp1 * x; /* These are incorrect if tmp1 == 0 */ return give_log ? -tmp2 + log(shape * tmp1) : shape * tmp1 * exp(-tmp2); } JAGS-4.3.2/src/jrmath/pweibull2.c0000664000175000017500000000277614224052371013330 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000-2002 The R Core Team * Copyright (C) 2015 Martyn Plummer * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The distribution function of the Weibull distribution using the * BUGS parameterization, i.e. x^shape has exponential distribution * with mean 1/rate. */ #include "nmath.h" #include "dpq.h" double pweibull2(double x, double shape, double rate, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(x) || ISNAN(shape) || ISNAN(rate)) return x + shape + rate; #endif if(shape <= 0 || rate <= 0) ML_ERR_return_NAN; if (x <= 0) return R_DT_0; x = - rate * pow(x, shape); if (lower_tail) return (log_p /* log(1 - exp(x)) for x < 0 : */ ? R_Log1_Exp(x) : -expm1(x)); /* else: !lower_tail */ return R_D_exp(x); } JAGS-4.3.2/src/jrmath/qweibull2.c0000664000175000017500000000263414224052371013322 00000000000000/* * Mathlib : A C Library of Special Functions * Copyright (C) 1998 Ross Ihaka * Copyright (C) 2000 The R Core Team * Copyright (C) 2005 The R Foundation * Copyright (C) 2015 Martyn Plummer * * 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 of the License, 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, a copy is available at * http://www.r-project.org/Licenses/ * * DESCRIPTION * * The quantile function of the Weibull distribution using the BUGS * parameterization, i.e. x^shape has exponential distribution with * mean 1/rate. */ #include "nmath.h" #include "dpq.h" double qweibull2(double p, double shape, double rate, int lower_tail, int log_p) { #ifdef IEEE_754 if (ISNAN(p) || ISNAN(shape) || ISNAN(rate)) return p + shape + rate; #endif if (shape <= 0 || rate <= 0) ML_ERR_return_NAN; R_Q_P01_boundaries(p, 0, ML_POSINF); return pow(- R_DT_Clog(p)/rate, 1./shape) ; } JAGS-4.3.2/src/modules/0000755000175000017500000000000014400711327011503 500000000000000JAGS-4.3.2/src/modules/Makefile.am0000664000175000017500000000005414224052371013461 00000000000000SUBDIRS = base bugs msm mix lecuyer glm dic JAGS-4.3.2/src/modules/Makefile.in0000644000175000017500000004627614400675235013516 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = base bugs msm mix lecuyer glm dic all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/base/0000755000175000017500000000000014400711325012413 500000000000000JAGS-4.3.2/src/modules/base/Makefile.am0000664000175000017500000000215514224052371014377 00000000000000SUBDIRS = functions samplers monitors rngs ### Base module: note that the name is "basemod" not "base" to avoid ### conflict with the base package in R. jagsmod_LTLIBRARIES = basemod.la basemod_la_SOURCES = base.cc basemod_la_CPPFLAGS = -I$(top_srcdir)/src/include basemod_la_LIBADD = functions/libbasefunctions.la \ monitors/libbasemonitors.la \ samplers/libbasesamplers.la \ rngs/libbaserngs.la \ $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la basemod_la_LDFLAGS = -module -avoid-version if WINDOWS basemod_la_LDFLAGS += -no-undefined endif ### Test library if CANCHECK check_LTLIBRARIES = libbasetest.la libbasetest_la_SOURCES = testbase.cc testbase.h libbasetest_la_CPPFLAGS = -I$(top_srcdir)/src/include libbasetest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) libbasetest_la_LDFLAGS = $(CPPUNIT_LIBS) libbasetest_la_LIBADD = functions/libbasefuntest.la \ functions/libbasefunctions.la \ $(top_builddir)/src/lib/libtest.la \ $(top_builddir)/src/lib/libjags.la $(top_builddir)/src/jrmath/libjrmath.la endif JAGS-4.3.2/src/modules/base/Makefile.in0000644000175000017500000007676714400675235014440 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WINDOWS_TRUE@am__append_1 = -no-undefined subdir = src/modules/base ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(jagsmoddir)" LTLIBRARIES = $(jagsmod_LTLIBRARIES) basemod_la_DEPENDENCIES = functions/libbasefunctions.la \ monitors/libbasemonitors.la samplers/libbasesamplers.la \ rngs/libbaserngs.la $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la am_basemod_la_OBJECTS = basemod_la-base.lo basemod_la_OBJECTS = $(am_basemod_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = basemod_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(basemod_la_LDFLAGS) $(LDFLAGS) -o $@ @CANCHECK_TRUE@libbasetest_la_DEPENDENCIES = \ @CANCHECK_TRUE@ functions/libbasefuntest.la \ @CANCHECK_TRUE@ functions/libbasefunctions.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libtest.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libjags.la am__libbasetest_la_SOURCES_DIST = testbase.cc testbase.h @CANCHECK_TRUE@am_libbasetest_la_OBJECTS = libbasetest_la-testbase.lo libbasetest_la_OBJECTS = $(am_libbasetest_la_OBJECTS) libbasetest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libbasetest_la_CXXFLAGS) $(CXXFLAGS) \ $(libbasetest_la_LDFLAGS) $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libbasetest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/basemod_la-base.Plo \ ./$(DEPDIR)/libbasetest_la-testbase.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(basemod_la_SOURCES) $(libbasetest_la_SOURCES) DIST_SOURCES = $(basemod_la_SOURCES) \ $(am__libbasetest_la_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = functions samplers monitors rngs ### Base module: note that the name is "basemod" not "base" to avoid ### conflict with the base package in R. jagsmod_LTLIBRARIES = basemod.la basemod_la_SOURCES = base.cc basemod_la_CPPFLAGS = -I$(top_srcdir)/src/include basemod_la_LIBADD = functions/libbasefunctions.la \ monitors/libbasemonitors.la \ samplers/libbasesamplers.la \ rngs/libbaserngs.la \ $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la basemod_la_LDFLAGS = -module -avoid-version $(am__append_1) ### Test library @CANCHECK_TRUE@check_LTLIBRARIES = libbasetest.la @CANCHECK_TRUE@libbasetest_la_SOURCES = testbase.cc testbase.h @CANCHECK_TRUE@libbasetest_la_CPPFLAGS = -I$(top_srcdir)/src/include @CANCHECK_TRUE@libbasetest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) @CANCHECK_TRUE@libbasetest_la_LDFLAGS = $(CPPUNIT_LIBS) @CANCHECK_TRUE@libbasetest_la_LIBADD = functions/libbasefuntest.la \ @CANCHECK_TRUE@ functions/libbasefunctions.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libtest.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libjags.la all: all-recursive .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/base/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/base/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-jagsmodLTLIBRARIES: $(jagsmod_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(jagsmoddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(jagsmoddir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(jagsmoddir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(jagsmoddir)"; \ } uninstall-jagsmodLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(jagsmoddir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(jagsmoddir)/$$f"; \ done clean-jagsmodLTLIBRARIES: -test -z "$(jagsmod_LTLIBRARIES)" || rm -f $(jagsmod_LTLIBRARIES) @list='$(jagsmod_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } basemod.la: $(basemod_la_OBJECTS) $(basemod_la_DEPENDENCIES) $(EXTRA_basemod_la_DEPENDENCIES) $(AM_V_CXXLD)$(basemod_la_LINK) -rpath $(jagsmoddir) $(basemod_la_OBJECTS) $(basemod_la_LIBADD) $(LIBS) libbasetest.la: $(libbasetest_la_OBJECTS) $(libbasetest_la_DEPENDENCIES) $(EXTRA_libbasetest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libbasetest_la_LINK) $(am_libbasetest_la_rpath) $(libbasetest_la_OBJECTS) $(libbasetest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basemod_la-base.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasetest_la-testbase.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< basemod_la-base.lo: base.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(basemod_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT basemod_la-base.lo -MD -MP -MF $(DEPDIR)/basemod_la-base.Tpo -c -o basemod_la-base.lo `test -f 'base.cc' || echo '$(srcdir)/'`base.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/basemod_la-base.Tpo $(DEPDIR)/basemod_la-base.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='base.cc' object='basemod_la-base.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(basemod_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o basemod_la-base.lo `test -f 'base.cc' || echo '$(srcdir)/'`base.cc libbasetest_la-testbase.lo: testbase.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasetest_la_CPPFLAGS) $(CPPFLAGS) $(libbasetest_la_CXXFLAGS) $(CXXFLAGS) -MT libbasetest_la-testbase.lo -MD -MP -MF $(DEPDIR)/libbasetest_la-testbase.Tpo -c -o libbasetest_la-testbase.lo `test -f 'testbase.cc' || echo '$(srcdir)/'`testbase.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasetest_la-testbase.Tpo $(DEPDIR)/libbasetest_la-testbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testbase.cc' object='libbasetest_la-testbase.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasetest_la_CPPFLAGS) $(CPPFLAGS) $(libbasetest_la_CXXFLAGS) $(CXXFLAGS) -c -o libbasetest_la-testbase.lo `test -f 'testbase.cc' || echo '$(srcdir)/'`testbase.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(jagsmoddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-checkLTLIBRARIES clean-generic \ clean-jagsmodLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/basemod_la-base.Plo -rm -f ./$(DEPDIR)/libbasetest_la-testbase.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-jagsmodLTLIBRARIES install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/basemod_la-base.Plo -rm -f ./$(DEPDIR)/libbasetest_la-testbase.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-jagsmodLTLIBRARIES .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-checkLTLIBRARIES \ clean-generic clean-jagsmodLTLIBRARIES clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-jagsmodLTLIBRARIES \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-jagsmodLTLIBRARIES .PRECIOUS: Makefile @CANCHECK_TRUE@ $(top_builddir)/src/jrmath/libjrmath.la # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/base/base.cc0000664000175000017500000000411314224052514013557 00000000000000#include //Functions #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //Samplers #include #include //RNGs #include //Monitors #include #include #include using std::vector; namespace jags { namespace base { class BaseModule : public Module { public: BaseModule(); ~BaseModule(); }; BaseModule::BaseModule() : Module("basemod") { insert(new Add); insert(new And); insert(new Divide); insert(new Equal); insert(new GreaterOrEqual); insert(new GreaterThan); insert(new LessOrEqual); insert(new LessThan); insert(new Multiply); insert(new Neg); insert(new Not); insert(new NotEqual); insert(new Or); insert(new Pow); insert(new Seq); insert(new Subtract); insert(new SliceFactory); insert(new FiniteFactory); insert(new BaseRNGFactory); insert(new TraceMonitorFactory); insert(new MeanMonitorFactory); insert(new VarianceMonitorFactory); } BaseModule::~BaseModule() { vector const &fvec = functions(); for (unsigned int i = 0; i < fvec.size(); ++i) { delete fvec[i]; } vector const &mvec = monitorFactories(); for (unsigned int i = 0; i < mvec.size(); ++i) { delete mvec[i]; } vector const &rvec = rngFactories(); for (unsigned int i = 0; i < rvec.size(); ++i) { delete rvec[i]; } vector const &svec = samplerFactories(); for (unsigned int i = 0; i < svec.size(); ++i) { delete svec[i]; } } }} jags::base::BaseModule _base_module; JAGS-4.3.2/src/modules/base/testbase.cc0000664000175000017500000000026514224052371014464 00000000000000#include "testbase.h" #include "functions/testbasefun.h" #include void init_base_test() { CPPUNIT_TEST_SUITE_REGISTRATION( BaseFunTest ); } JAGS-4.3.2/src/modules/base/testbase.h0000664000175000017500000000013514224052371014322 00000000000000#ifndef BASE_TEST_H_ #define BASE_TEST_H_ void init_base_test(); #endif /* BASE_TEST_H_ */ JAGS-4.3.2/src/modules/base/functions/0000755000175000017500000000000014400711324014422 500000000000000JAGS-4.3.2/src/modules/base/functions/Makefile.am0000664000175000017500000000132414224052514016403 00000000000000noinst_LTLIBRARIES = libbasefunctions.la libbasefunctions_la_CPPFLAGS = -I$(top_srcdir)/src/include libbasefunctions_la_SOURCES = Infix.cc Add.cc Subtract.cc Divide.cc \ Multiply.cc Neg.cc Pow.cc And.cc Or.cc Not.cc Equal.cc NotEqual.cc \ GreaterThan.cc GreaterOrEqual.cc LessThan.cc LessOrEqual.cc Seq.cc noinst_HEADERS = Infix.h Add.h Subtract.h Divide.h Multiply.h Neg.h \ Pow.h And.h Or.h Not.h Equal.h NotEqual.h GreaterThan.h \ GreaterOrEqual.h LessThan.h LessOrEqual.h Seq.h ### Test library if CANCHECK check_LTLIBRARIES = libbasefuntest.la libbasefuntest_la_SOURCES = testbasefun.cc testbasefun.h libbasefuntest_la_CPPFLAGS = -I$(top_srcdir)/src/include libbasefuntest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) endif JAGS-4.3.2/src/modules/base/functions/Infix.h0000664000175000017500000000075614224052514015605 00000000000000#ifndef INFIX_H_ #define INFIX_H_ #include namespace jags { namespace base { /** * Base class for infix operators, providing a deparse method. * * Most infix operators are binary, so we also provide a default value * of 2 for the number of parameters. */ class Infix : public ScalarFunction { public: Infix(std::string const &name, unsigned int npar=2); std::string deparse(std::vector const &par) const; }; }} #endif /* INFIX_H_ */ JAGS-4.3.2/src/modules/base/functions/Add.h0000664000175000017500000000144214224052514015211 00000000000000#ifndef FUNC_ADD_H_ #define FUNC_ADD_H_ #include "Infix.h" namespace jags { namespace base { /** * The Add function implements the infix operator "+" in the BUGS language. * The expression a + b + c is evaluated in a single function call. * @short Sum of scalars *
 * y <- a + b
 * 
*/ class Add : public Infix { public: Add (); double evaluate(std::vectorconst &args) const; bool isDiscreteValued(std::vector const &flags) const; bool isAdditive(std::vector const &mask, std::vector const &fixmask) const; bool isLinear(std::vector const &mask, std::vector const &fixmask) const; bool isScale(std::vector const &mask, std::vector const &fixmask) const; }; }} #endif /* FUNC_ADD_H_ */ JAGS-4.3.2/src/modules/base/functions/Subtract.h0000664000175000017500000000141214224052514016305 00000000000000#ifndef FUNC_SUBTRACT_H_ #define FUNC_SUBTRACT_H_ #include "Infix.h" namespace jags { namespace base { /** * @short Difference of two scalars * * The Subtract function implements the infix operator "-" in the * BUGS language. *
 * y <- x - z
 * 
*/ class Subtract : public Infix { public: Subtract (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; bool isAdditive(std::vector const &mask, std::vector const &fix) const; bool isScale(std::vector const &mask, std::vector const &fix) const; bool isLinear(std::vector const &mask, std::vector const &fix) const; }; }} #endif /* FUNC_SUBTRACT_H_ */ JAGS-4.3.2/src/modules/base/functions/Divide.h0000664000175000017500000000131314224052514015722 00000000000000#ifndef FUNC_DIVIDE_H_ #define FUNC_DIVIDE_H_ #include "Infix.h" namespace jags { namespace base { /** * The Divide function implements the infix operator "/" in the BUGS * language * @short Ratio of two scalars *
 * y <- a/b
 * y = a/b for b != 0
 * 
*/ class Divide:public Infix { public: Divide (); double evaluate(std::vector const &args) const; bool checkParameterValue (std::vector const &args) const; bool isScale(std::vector const &mask, std::vector const &fix) const; bool isPower(std::vector const &mask, std::vector const &fix) const; }; }} #endif /* FUNC_DIVIDE_H_ */ JAGS-4.3.2/src/modules/base/functions/Multiply.h0000664000175000017500000000136214224052514016341 00000000000000#ifndef FUNC_MULTIPLY_H_ #define FUNC_MULTIPLY_H_ #include "Infix.h" namespace jags { namespace base { /** * @short Product of two scalars * * The Multiply function implements the infix operator "*" in the * BUGS language. The expression a * b * c is evaluated in a single * function call. */ class Multiply: public Infix { public: Multiply (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; bool isScale(std::vector const &mask, std::vector const &fixmask) const; bool isPower(std::vector const &mask, std::vector const &fix) const; }; }} #endif /* FUNC_MULTIPLY_H_ */ JAGS-4.3.2/src/modules/base/functions/Neg.h0000664000175000017500000000112014224052514015223 00000000000000#ifndef FUNC_NEG_H_ #define FUNC_NEG_H_ #include namespace jags { namespace base { /** * @short Unary minus operator * UnaryMinus implements the prefix operator "-" * y <- -x */ class Neg : public ScalarFunction { public: Neg (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; bool isScale(std::vector const &mask, std::vector const &fix) const; std::string deparse(std::vector const &par) const; }; }} #endif /* FUNC_NEG_H_ */ JAGS-4.3.2/src/modules/base/functions/Pow.h0000664000175000017500000000105614224052514015267 00000000000000#ifndef FUNC_POW_H_ #define FUNC_POW_H_ #include "Infix.h" namespace jags { namespace base { /** * @short Power function using infix notation * If y <- x^z and x is negative, then z must be an integer */ class Pow : public Infix { public: Pow (); std::string alias() const; double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; bool isPower(std::vector const &mask, std::vector const &fix) const; }; }} #endif /* FUNC_POW_H_ */ JAGS-4.3.2/src/modules/base/functions/And.h0000664000175000017500000000076314224052514015230 00000000000000#ifndef FUNC_AND_H_ #define FUNC_AND_H_ #include "Infix.h" namespace jags { namespace base { /** * The And function implements the infix operator "&" in the BUGS * language * @short Logical and *
 * y <- a&b
 * y = 1 if a != 0 and  b != 0
 * y = 0 otherwise
 * 
*/ class And : public Infix { public: And (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_AND_H_ */ JAGS-4.3.2/src/modules/base/functions/Or.h0000664000175000017500000000075014224052514015102 00000000000000#ifndef FUNC_OR_H_ #define FUNC_OR_H_ #include "Infix.h" namespace jags { namespace base { /** * The Or function implements the infix operator "|" in the BUGS * language * @short Logical or *
 * y <- a|b
 * y = 1 if a != 0 or  b != 0
 * y = 0 otherwise
 * 
*/ class Or:public Infix { public: Or (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_OR_H_ */ JAGS-4.3.2/src/modules/base/functions/Not.h0000664000175000017500000000076614224052514015271 00000000000000#ifndef FUNC_NOT_H_ #define FUNC_NOT_H_ #include namespace jags { namespace base { /** * @short Unary minus operator * UnaryMinus implements the prefix operator "-" * y <- -x */ class Not : public ScalarFunction { public: Not (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; std::string deparse(std::vector const &par) const; }; }} #endif /* FUNC_NOT_H_ */ JAGS-4.3.2/src/modules/base/functions/Equal.h0000664000175000017500000000072114224052514015567 00000000000000#ifndef FUNC_EQUAL_H_ #define FUNC_EQUAL_H_ #include "Infix.h" namespace jags { namespace base { /** * @short Test for equality using infix notation *
 * y <- a == b
 * y = 1 if a==b
 *     0 if a!=b
 * 
*/ class Equal:public Infix { public: Equal (); double evaluate(std::vector const &args) const; /** Returns true */ bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_EQUAL_H_ */ JAGS-4.3.2/src/modules/base/functions/NotEqual.h0000664000175000017500000000074314224052514016254 00000000000000#ifndef FUNC_NOT_EQUAL_H_ #define FUNC_NOT_EQUAL_H_ #include "Infix.h" namespace jags { namespace base { /** * @short Test for equality using infix notation *
 * y <- a != b
 * y = 0 if a==b
 *     1 if a!=b
 * 
*/ class NotEqual:public Infix { public: NotEqual (); double evaluate(std::vector const &args) const; /** Returns true */ bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_NOT_EQUAL_H_ */ JAGS-4.3.2/src/modules/base/functions/GreaterThan.h0000664000175000017500000000074014224052514016725 00000000000000#ifndef FUNC_GREATER_THAN_H_ #define FUNC_GREATER_THAN_H_ #include "Infix.h" namespace jags { namespace base { /** * @short Numeric comparison *
 * y <- a > b
 * y = 1 if a > b
 *     0 if a <= b
 * 
*/ class GreaterThan:public Infix { public: GreaterThan (); double evaluate(std::vector const &args) const; /** Returns true */ bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_GREATER_THAN_H_ */ JAGS-4.3.2/src/modules/base/functions/GreaterOrEqual.h0000664000175000017500000000076314224052514017410 00000000000000#ifndef FUNC_GREATER_OR_EQUAL_H_ #define FUNC_GREATER_OR_EQUAL_H_ #include "Infix.h" namespace jags { namespace base { /** * @short Numeric comparison *
 * y <- a >= b
 * y = 1 if a >= b
 *     0 if a < b
 * 
*/ class GreaterOrEqual:public Infix { public: GreaterOrEqual (); double evaluate(std::vector const &args) const; /** Returns true */ bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_GREATER_OR_EQUAL_H_ */ JAGS-4.3.2/src/modules/base/functions/LessThan.h0000664000175000017500000000072114224052514016241 00000000000000#ifndef FUNC_LESS_THAN_H_ #define FUNC_LESS_THAN_H_ #include "Infix.h" namespace jags { namespace base { /** * @short Numeric comparison *
 * y <- a < b
 * y = 1 if a < b
 *     0 if a >= b
 * 
*/ class LessThan:public Infix { public: LessThan (); double evaluate(std::vector const &args) const; /** Returns true */ bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_LESS_THAN_H_ */ JAGS-4.3.2/src/modules/base/functions/LessOrEqual.h0000664000175000017500000000074414224052514016724 00000000000000#ifndef FUNC_LESS_OR_EQUAL_H_ #define FUNC_LESS_OR_EQUAL_H_ #include "Infix.h" namespace jags { namespace base { /** * @short Numeric comparison *
 * y <- a <= b
 * y = 1 if a <= b
 *     0 if a > b
 * 
*/ class LessOrEqual:public Infix { public: LessOrEqual (); double evaluate(std::vector const &args) const; /** Returns true */ bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_LESS_OR_EQUAL_H_ */ JAGS-4.3.2/src/modules/base/functions/Seq.h0000664000175000017500000000202514224052514015247 00000000000000#ifndef SEQ_H_ #define SEQ_H_ #include namespace jags { namespace base { /** * @short Integer sequence * * The Seq function implements the infix operator ":" in the BUGS language. * The arguments must be integer. *
     * y <- a:b
     * 
* */ class Seq : public VectorFunction { public: Seq(); void evaluate(double *value, std::vector const &values, std::vector const &lengths) const; unsigned int length(std::vector const &lengths, std::vector const &values) const; bool checkParameterLength(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; bool checkParameterDiscrete(std::vector const &mask) const; bool checkParameterFixed(std::vector const &mask) const; std::string deparse(std::vector const &par) const; }; } } /* namespace jags */ #endif /* SEQ_H_ */ JAGS-4.3.2/src/modules/base/functions/Makefile.in0000644000175000017500000013506314400675235016431 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/base/functions ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbasefunctions_la_LIBADD = am_libbasefunctions_la_OBJECTS = libbasefunctions_la-Infix.lo \ libbasefunctions_la-Add.lo libbasefunctions_la-Subtract.lo \ libbasefunctions_la-Divide.lo libbasefunctions_la-Multiply.lo \ libbasefunctions_la-Neg.lo libbasefunctions_la-Pow.lo \ libbasefunctions_la-And.lo libbasefunctions_la-Or.lo \ libbasefunctions_la-Not.lo libbasefunctions_la-Equal.lo \ libbasefunctions_la-NotEqual.lo \ libbasefunctions_la-GreaterThan.lo \ libbasefunctions_la-GreaterOrEqual.lo \ libbasefunctions_la-LessThan.lo \ libbasefunctions_la-LessOrEqual.lo libbasefunctions_la-Seq.lo libbasefunctions_la_OBJECTS = $(am_libbasefunctions_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libbasefuntest_la_LIBADD = am__libbasefuntest_la_SOURCES_DIST = testbasefun.cc testbasefun.h @CANCHECK_TRUE@am_libbasefuntest_la_OBJECTS = \ @CANCHECK_TRUE@ libbasefuntest_la-testbasefun.lo libbasefuntest_la_OBJECTS = $(am_libbasefuntest_la_OBJECTS) libbasefuntest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libbasefuntest_la_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libbasefuntest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libbasefunctions_la-Add.Plo \ ./$(DEPDIR)/libbasefunctions_la-And.Plo \ ./$(DEPDIR)/libbasefunctions_la-Divide.Plo \ ./$(DEPDIR)/libbasefunctions_la-Equal.Plo \ ./$(DEPDIR)/libbasefunctions_la-GreaterOrEqual.Plo \ ./$(DEPDIR)/libbasefunctions_la-GreaterThan.Plo \ ./$(DEPDIR)/libbasefunctions_la-Infix.Plo \ ./$(DEPDIR)/libbasefunctions_la-LessOrEqual.Plo \ ./$(DEPDIR)/libbasefunctions_la-LessThan.Plo \ ./$(DEPDIR)/libbasefunctions_la-Multiply.Plo \ ./$(DEPDIR)/libbasefunctions_la-Neg.Plo \ ./$(DEPDIR)/libbasefunctions_la-Not.Plo \ ./$(DEPDIR)/libbasefunctions_la-NotEqual.Plo \ ./$(DEPDIR)/libbasefunctions_la-Or.Plo \ ./$(DEPDIR)/libbasefunctions_la-Pow.Plo \ ./$(DEPDIR)/libbasefunctions_la-Seq.Plo \ ./$(DEPDIR)/libbasefunctions_la-Subtract.Plo \ ./$(DEPDIR)/libbasefuntest_la-testbasefun.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libbasefunctions_la_SOURCES) $(libbasefuntest_la_SOURCES) DIST_SOURCES = $(libbasefunctions_la_SOURCES) \ $(am__libbasefuntest_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libbasefunctions.la libbasefunctions_la_CPPFLAGS = -I$(top_srcdir)/src/include libbasefunctions_la_SOURCES = Infix.cc Add.cc Subtract.cc Divide.cc \ Multiply.cc Neg.cc Pow.cc And.cc Or.cc Not.cc Equal.cc NotEqual.cc \ GreaterThan.cc GreaterOrEqual.cc LessThan.cc LessOrEqual.cc Seq.cc noinst_HEADERS = Infix.h Add.h Subtract.h Divide.h Multiply.h Neg.h \ Pow.h And.h Or.h Not.h Equal.h NotEqual.h GreaterThan.h \ GreaterOrEqual.h LessThan.h LessOrEqual.h Seq.h ### Test library @CANCHECK_TRUE@check_LTLIBRARIES = libbasefuntest.la @CANCHECK_TRUE@libbasefuntest_la_SOURCES = testbasefun.cc testbasefun.h @CANCHECK_TRUE@libbasefuntest_la_CPPFLAGS = -I$(top_srcdir)/src/include @CANCHECK_TRUE@libbasefuntest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/base/functions/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/base/functions/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libbasefunctions.la: $(libbasefunctions_la_OBJECTS) $(libbasefunctions_la_DEPENDENCIES) $(EXTRA_libbasefunctions_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libbasefunctions_la_OBJECTS) $(libbasefunctions_la_LIBADD) $(LIBS) libbasefuntest.la: $(libbasefuntest_la_OBJECTS) $(libbasefuntest_la_DEPENDENCIES) $(EXTRA_libbasefuntest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libbasefuntest_la_LINK) $(am_libbasefuntest_la_rpath) $(libbasefuntest_la_OBJECTS) $(libbasefuntest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Add.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-And.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Divide.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Equal.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-GreaterOrEqual.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-GreaterThan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Infix.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-LessOrEqual.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-LessThan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Multiply.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Neg.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Not.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-NotEqual.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Or.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Pow.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Seq.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefunctions_la-Subtract.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasefuntest_la-testbasefun.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libbasefunctions_la-Infix.lo: Infix.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Infix.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Infix.Tpo -c -o libbasefunctions_la-Infix.lo `test -f 'Infix.cc' || echo '$(srcdir)/'`Infix.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Infix.Tpo $(DEPDIR)/libbasefunctions_la-Infix.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Infix.cc' object='libbasefunctions_la-Infix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Infix.lo `test -f 'Infix.cc' || echo '$(srcdir)/'`Infix.cc libbasefunctions_la-Add.lo: Add.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Add.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Add.Tpo -c -o libbasefunctions_la-Add.lo `test -f 'Add.cc' || echo '$(srcdir)/'`Add.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Add.Tpo $(DEPDIR)/libbasefunctions_la-Add.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Add.cc' object='libbasefunctions_la-Add.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Add.lo `test -f 'Add.cc' || echo '$(srcdir)/'`Add.cc libbasefunctions_la-Subtract.lo: Subtract.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Subtract.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Subtract.Tpo -c -o libbasefunctions_la-Subtract.lo `test -f 'Subtract.cc' || echo '$(srcdir)/'`Subtract.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Subtract.Tpo $(DEPDIR)/libbasefunctions_la-Subtract.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Subtract.cc' object='libbasefunctions_la-Subtract.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Subtract.lo `test -f 'Subtract.cc' || echo '$(srcdir)/'`Subtract.cc libbasefunctions_la-Divide.lo: Divide.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Divide.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Divide.Tpo -c -o libbasefunctions_la-Divide.lo `test -f 'Divide.cc' || echo '$(srcdir)/'`Divide.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Divide.Tpo $(DEPDIR)/libbasefunctions_la-Divide.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Divide.cc' object='libbasefunctions_la-Divide.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Divide.lo `test -f 'Divide.cc' || echo '$(srcdir)/'`Divide.cc libbasefunctions_la-Multiply.lo: Multiply.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Multiply.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Multiply.Tpo -c -o libbasefunctions_la-Multiply.lo `test -f 'Multiply.cc' || echo '$(srcdir)/'`Multiply.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Multiply.Tpo $(DEPDIR)/libbasefunctions_la-Multiply.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Multiply.cc' object='libbasefunctions_la-Multiply.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Multiply.lo `test -f 'Multiply.cc' || echo '$(srcdir)/'`Multiply.cc libbasefunctions_la-Neg.lo: Neg.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Neg.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Neg.Tpo -c -o libbasefunctions_la-Neg.lo `test -f 'Neg.cc' || echo '$(srcdir)/'`Neg.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Neg.Tpo $(DEPDIR)/libbasefunctions_la-Neg.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Neg.cc' object='libbasefunctions_la-Neg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Neg.lo `test -f 'Neg.cc' || echo '$(srcdir)/'`Neg.cc libbasefunctions_la-Pow.lo: Pow.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Pow.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Pow.Tpo -c -o libbasefunctions_la-Pow.lo `test -f 'Pow.cc' || echo '$(srcdir)/'`Pow.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Pow.Tpo $(DEPDIR)/libbasefunctions_la-Pow.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Pow.cc' object='libbasefunctions_la-Pow.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Pow.lo `test -f 'Pow.cc' || echo '$(srcdir)/'`Pow.cc libbasefunctions_la-And.lo: And.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-And.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-And.Tpo -c -o libbasefunctions_la-And.lo `test -f 'And.cc' || echo '$(srcdir)/'`And.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-And.Tpo $(DEPDIR)/libbasefunctions_la-And.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='And.cc' object='libbasefunctions_la-And.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-And.lo `test -f 'And.cc' || echo '$(srcdir)/'`And.cc libbasefunctions_la-Or.lo: Or.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Or.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Or.Tpo -c -o libbasefunctions_la-Or.lo `test -f 'Or.cc' || echo '$(srcdir)/'`Or.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Or.Tpo $(DEPDIR)/libbasefunctions_la-Or.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Or.cc' object='libbasefunctions_la-Or.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Or.lo `test -f 'Or.cc' || echo '$(srcdir)/'`Or.cc libbasefunctions_la-Not.lo: Not.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Not.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Not.Tpo -c -o libbasefunctions_la-Not.lo `test -f 'Not.cc' || echo '$(srcdir)/'`Not.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Not.Tpo $(DEPDIR)/libbasefunctions_la-Not.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Not.cc' object='libbasefunctions_la-Not.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Not.lo `test -f 'Not.cc' || echo '$(srcdir)/'`Not.cc libbasefunctions_la-Equal.lo: Equal.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Equal.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Equal.Tpo -c -o libbasefunctions_la-Equal.lo `test -f 'Equal.cc' || echo '$(srcdir)/'`Equal.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Equal.Tpo $(DEPDIR)/libbasefunctions_la-Equal.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Equal.cc' object='libbasefunctions_la-Equal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Equal.lo `test -f 'Equal.cc' || echo '$(srcdir)/'`Equal.cc libbasefunctions_la-NotEqual.lo: NotEqual.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-NotEqual.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-NotEqual.Tpo -c -o libbasefunctions_la-NotEqual.lo `test -f 'NotEqual.cc' || echo '$(srcdir)/'`NotEqual.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-NotEqual.Tpo $(DEPDIR)/libbasefunctions_la-NotEqual.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='NotEqual.cc' object='libbasefunctions_la-NotEqual.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-NotEqual.lo `test -f 'NotEqual.cc' || echo '$(srcdir)/'`NotEqual.cc libbasefunctions_la-GreaterThan.lo: GreaterThan.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-GreaterThan.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-GreaterThan.Tpo -c -o libbasefunctions_la-GreaterThan.lo `test -f 'GreaterThan.cc' || echo '$(srcdir)/'`GreaterThan.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-GreaterThan.Tpo $(DEPDIR)/libbasefunctions_la-GreaterThan.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GreaterThan.cc' object='libbasefunctions_la-GreaterThan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-GreaterThan.lo `test -f 'GreaterThan.cc' || echo '$(srcdir)/'`GreaterThan.cc libbasefunctions_la-GreaterOrEqual.lo: GreaterOrEqual.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-GreaterOrEqual.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-GreaterOrEqual.Tpo -c -o libbasefunctions_la-GreaterOrEqual.lo `test -f 'GreaterOrEqual.cc' || echo '$(srcdir)/'`GreaterOrEqual.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-GreaterOrEqual.Tpo $(DEPDIR)/libbasefunctions_la-GreaterOrEqual.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GreaterOrEqual.cc' object='libbasefunctions_la-GreaterOrEqual.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-GreaterOrEqual.lo `test -f 'GreaterOrEqual.cc' || echo '$(srcdir)/'`GreaterOrEqual.cc libbasefunctions_la-LessThan.lo: LessThan.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-LessThan.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-LessThan.Tpo -c -o libbasefunctions_la-LessThan.lo `test -f 'LessThan.cc' || echo '$(srcdir)/'`LessThan.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-LessThan.Tpo $(DEPDIR)/libbasefunctions_la-LessThan.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LessThan.cc' object='libbasefunctions_la-LessThan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-LessThan.lo `test -f 'LessThan.cc' || echo '$(srcdir)/'`LessThan.cc libbasefunctions_la-LessOrEqual.lo: LessOrEqual.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-LessOrEqual.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-LessOrEqual.Tpo -c -o libbasefunctions_la-LessOrEqual.lo `test -f 'LessOrEqual.cc' || echo '$(srcdir)/'`LessOrEqual.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-LessOrEqual.Tpo $(DEPDIR)/libbasefunctions_la-LessOrEqual.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LessOrEqual.cc' object='libbasefunctions_la-LessOrEqual.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-LessOrEqual.lo `test -f 'LessOrEqual.cc' || echo '$(srcdir)/'`LessOrEqual.cc libbasefunctions_la-Seq.lo: Seq.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasefunctions_la-Seq.lo -MD -MP -MF $(DEPDIR)/libbasefunctions_la-Seq.Tpo -c -o libbasefunctions_la-Seq.lo `test -f 'Seq.cc' || echo '$(srcdir)/'`Seq.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefunctions_la-Seq.Tpo $(DEPDIR)/libbasefunctions_la-Seq.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Seq.cc' object='libbasefunctions_la-Seq.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasefunctions_la-Seq.lo `test -f 'Seq.cc' || echo '$(srcdir)/'`Seq.cc libbasefuntest_la-testbasefun.lo: testbasefun.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefuntest_la_CPPFLAGS) $(CPPFLAGS) $(libbasefuntest_la_CXXFLAGS) $(CXXFLAGS) -MT libbasefuntest_la-testbasefun.lo -MD -MP -MF $(DEPDIR)/libbasefuntest_la-testbasefun.Tpo -c -o libbasefuntest_la-testbasefun.lo `test -f 'testbasefun.cc' || echo '$(srcdir)/'`testbasefun.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasefuntest_la-testbasefun.Tpo $(DEPDIR)/libbasefuntest_la-testbasefun.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testbasefun.cc' object='libbasefuntest_la-testbasefun.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasefuntest_la_CPPFLAGS) $(CPPFLAGS) $(libbasefuntest_la_CXXFLAGS) $(CXXFLAGS) -c -o libbasefuntest_la-testbasefun.lo `test -f 'testbasefun.cc' || echo '$(srcdir)/'`testbasefun.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libbasefunctions_la-Add.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-And.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Divide.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Equal.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-GreaterOrEqual.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-GreaterThan.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Infix.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-LessOrEqual.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-LessThan.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Multiply.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Neg.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Not.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-NotEqual.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Or.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Pow.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Seq.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Subtract.Plo -rm -f ./$(DEPDIR)/libbasefuntest_la-testbasefun.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libbasefunctions_la-Add.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-And.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Divide.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Equal.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-GreaterOrEqual.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-GreaterThan.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Infix.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-LessOrEqual.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-LessThan.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Multiply.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Neg.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Not.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-NotEqual.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Or.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Pow.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Seq.Plo -rm -f ./$(DEPDIR)/libbasefunctions_la-Subtract.Plo -rm -f ./$(DEPDIR)/libbasefuntest_la-testbasefun.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/base/functions/Infix.cc0000664000175000017500000000072014224052371015733 00000000000000#include #include "Infix.h" using std::vector; using std::string; namespace jags { namespace base { Infix::Infix(string const &name, unsigned int npar) : ScalarFunction (name, npar) { } string Infix::deparse(vector const &par) const { string const &fname = this->name(); string name; for (unsigned int i = 0; i < par.size(); ++i) { if (i > 0) { name.append(fname); } name.append(par[i]); } return name; } }} JAGS-4.3.2/src/modules/base/functions/Add.cc0000664000175000017500000000213214224052514015344 00000000000000#include #include #include "Add.h" using std::vector; namespace jags { namespace base { Add::Add () : Infix ("+", 0) { } double Add::evaluate(vector const &args) const { double out = *args[0]; for (unsigned int i = 1; i < args.size(); ++i) { out += *args[i]; } return out; } bool Add::isDiscreteValued(vector const &mask) const { return allTrue(mask); } bool Add::isAdditive(vector const &mask, vector const &fix) const { //There should be exactly one argument that is an additive function bool found = false; //Have we found it yet? for (unsigned int i = 0; i < mask.size(); ++i) { if (mask[i]) { if (found) return false; else found = true; } else if (!fix.empty() && !fix[i]) { return false; } } return found; } bool Add::isLinear(vector const &mask, vector const &fix) const { return true; } bool Add::isScale(vector const &mask, vector const &fix) const { return allTrue(mask); } }} JAGS-4.3.2/src/modules/base/functions/Subtract.cc0000664000175000017500000000157614224052514016456 00000000000000#include #include #include "Subtract.h" using std::vector; namespace jags { namespace base { Subtract::Subtract () : Infix ("-") { } double Subtract::evaluate(vector const &args) const { return *args[0] - *args[1]; } bool Subtract::isDiscreteValued(vector const &mask) const { return allTrue(mask); } bool Subtract::isAdditive(vector const &mask, vector const &fix) const { if (!mask[0] || mask[1]) return false; if (fix.empty()) { return true; } else { return (!fix[0] && fix[1]); } } bool Subtract::isScale(vector const &mask, vector const &fix) const { return allTrue(mask); } bool Subtract::isLinear(vector const &mask, vector const &fix) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/Divide.cc0000664000175000017500000000124514224052514016064 00000000000000#include #include "Divide.h" using std::vector; namespace jags { namespace base { Divide::Divide () : Infix ("/") { } double Divide::evaluate(vector const &args) const { return *args[0] / *args[1]; } bool Divide::checkParameterValue(vector const &args) const { return *args[1] != 0; } bool Divide::isScale(vector const &mask, vector const &fix) const { if (mask[1]) return false; //No reciprocal terms return fix.empty() || fix[1]; } bool Divide::isPower(vector const &mask, vector const &fix) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/Multiply.cc0000664000175000017500000000242514224052514016500 00000000000000#include #include #include "Multiply.h" using std::vector; namespace jags { namespace base { Multiply::Multiply () : Infix ("*", 0) { } double Multiply::evaluate(vectorconst &args) const { double val = *args[0]; /* We adopt the convention that any argument multiplied by zero is zero. This is required to do calculations like x*log(x) when x is zero. */ if (val == 0) { return 0; } for (unsigned int i = 1; i < args.size(); ++i) { double vali = *args[i]; if (vali == 0) { return 0; } val *= vali; } return val; } bool Multiply::isDiscreteValued(vector const &mask) const { return allTrue(mask); } bool Multiply::isScale(vector const &mask, vector const &fix) const { //Test for quadratic or higher terms unsigned long nfactor = 0; for (unsigned long i = 0; i < mask.size(); ++i) { nfactor += mask[i]; } if (nfactor > 1) { return false; } if (!fix.empty()) { for (unsigned int i = 0; i < fix.size(); ++i) { if (!mask[i] && !fix[i]) { return false; } } } return true; } bool Multiply::isPower(vector const &mask, vector const &fix) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/Neg.cc0000664000175000017500000000106514224052514015371 00000000000000#include #include #include "Neg.h" #include using std::vector; using std::string; namespace jags { namespace base { Neg::Neg () : ScalarFunction ("NEG", 1) { } double Neg::evaluate(vector const &args) const { return -args[0][0]; } bool Neg::isDiscreteValued(vector const &mask) const { return mask[0]; } bool Neg::isScale(vector const &mask, vector const &fix) const { return true; } string Neg::deparse(vector const &par) const { return string("-") + par[0]; } }} JAGS-4.3.2/src/modules/base/functions/Pow.cc0000664000175000017500000000141114224052514015420 00000000000000#include #include "Pow.h" #include #include using std::vector; using std::pow; using std::string; namespace jags { namespace base { Pow::Pow () : Infix ("^") { } string Pow::alias() const { return "pow"; } double Pow::evaluate(vector const &args) const { return pow (*args[0], *args[1]); } bool Pow::checkParameterValue(vector const &args) const { if (*args[0] > 0) { return true; } else if (*args[0] == 0) { return *args[1] >= 0; } else { return *args[1] == static_cast(*args[1]); } } bool Pow::isPower(vector const &mask, vector const &fix) const { if (mask[1]) return false; else return fix.empty() || fix[1]; } }} JAGS-4.3.2/src/modules/base/functions/And.cc0000664000175000017500000000046314224052514015363 00000000000000#include #include "And.h" using std::vector; namespace jags { namespace base { And::And () : Infix ("&&") { } double And::evaluate(vector const &args) const { return *args[0] && *args[1]; } bool And::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/Or.cc0000664000175000017500000000052014224052514015233 00000000000000#include #include "Or.h" using std::vector; namespace jags { namespace base { Or::Or () : Infix ("||") { } double Or::evaluate(vector const &args) const { return *args[0] || *args[1]; } bool Or::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/Not.cc0000664000175000017500000000064714224052514015425 00000000000000#include #include "Not.h" using std::vector; using std::string; namespace jags { namespace base { Not::Not () : ScalarFunction ("!", 1) { } double Not::evaluate(vector const &args) const { return *args[0] == 0; } bool Not::isDiscreteValued(vector const &mask) const { return true; } string Not::deparse(vector const &par) const { return string("!") + par[0]; } }} JAGS-4.3.2/src/modules/base/functions/Equal.cc0000664000175000017500000000054014224052514015724 00000000000000#include #include "Equal.h" #include #include using std::vector; namespace jags { namespace base { Equal::Equal () : Infix ("==") { } double Equal::evaluate(vector const &args) const { return *args[0] == *args[1]; } bool Equal::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/NotEqual.cc0000664000175000017500000000055714224052514016415 00000000000000#include #include "NotEqual.h" #include #include using std::vector; namespace jags { namespace base { NotEqual::NotEqual () : Infix ("!=") { } double NotEqual::evaluate(vector const &args) const { return *args[0] != *args[1]; } bool NotEqual::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/GreaterThan.cc0000664000175000017500000000057414224052514017070 00000000000000#include #include "GreaterThan.h" #include #include using std::vector; namespace jags { namespace base { GreaterThan::GreaterThan () : Infix (">") { } double GreaterThan::evaluate(vector const &args) const { return *args[0] > *args[1]; } bool GreaterThan::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/GreaterOrEqual.cc0000664000175000017500000000061514224052514017542 00000000000000#include #include "GreaterOrEqual.h" #include #include using std::vector; namespace jags { namespace base { GreaterOrEqual::GreaterOrEqual () : Infix (">=") { } double GreaterOrEqual::evaluate(vector const &args) const { return *args[0] >= *args[1]; } bool GreaterOrEqual::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/LessThan.cc0000664000175000017500000000055514224052514016404 00000000000000#include #include "LessThan.h" #include #include using std::vector; namespace jags { namespace base { LessThan::LessThan () : Infix ("<") { } double LessThan::evaluate(vector const &args) const { return *args[0] < *args[1]; } bool LessThan::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/LessOrEqual.cc0000664000175000017500000000057614224052514017065 00000000000000#include #include "LessOrEqual.h" #include #include using std::vector; namespace jags { namespace base { LessOrEqual::LessOrEqual () : Infix ("<=") { } double LessOrEqual::evaluate(vector const &args) const { return *args[0] <= *args[1]; } bool LessOrEqual::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/base/functions/Seq.cc0000664000175000017500000000277314224052514015417 00000000000000#include #include "Seq.h" using std::vector; using std::string; namespace jags { namespace base { Seq::Seq() : VectorFunction(":", 2) { } void Seq::evaluate(double *value, vector const &par_values, vector const &par_lengths) const { int lhs = static_cast(*par_values[0]); int rhs = static_cast(*par_values[1]); if (rhs < lhs) return; int N = rhs - lhs + 1; for (int i = 0; i < N; ++i) { value[i] = lhs + i; } } unsigned int Seq::length(vector const &lengths, vector const &values) const { int lhs = static_cast(*values[0]); int rhs = static_cast(*values[1]); if (rhs < lhs) { return 0; } else { return rhs - lhs + 1; } } bool Seq::checkParameterLength(vector const &len) const { return (len[0] == 1) && (len[1] == 1); } bool Seq::isDiscreteValued(vector const &mask) const { return true; } bool Seq::checkParameterDiscrete(vector const &mask) const { //Both parameters must be discrete return mask[0] && mask[1]; } bool Seq::checkParameterFixed(vector const &mask) const { //Both parameters must be fixed so that the length of the //output vector is fixed return mask[0] && mask[1]; } string Seq::deparse(vector const &par) const { return par[0] + ":" + par[1]; } } /* namespace base */ } /* namespace jags */ JAGS-4.3.2/src/modules/base/functions/testbasefun.cc0000664000175000017500000003150314224052514017203 00000000000000#include "testbasefun.h" #include "Add.h" #include "And.h" #include "Divide.h" #include "Equal.h" #include "GreaterOrEqual.h" #include "GreaterThan.h" #include "LessOrEqual.h" #include "LessThan.h" #include "Multiply.h" #include "Neg.h" #include "NotEqual.h" #include "Not.h" #include "Or.h" #include "Pow.h" #include "Seq.h" #include "Subtract.h" #include #include #include using jags::checkInteger; #include using std::pow; using std::vector; using std::string; #include void BaseFunTest::setUp() { _add = new jags::base::Add; _and = new jags::base::And; _divide = new jags::base::Divide; _equal = new jags::base::Equal; _geq = new jags::base::GreaterOrEqual; _gt = new jags::base::GreaterThan; _leq = new jags::base::LessOrEqual; _lt = new jags::base::LessThan; _multiply = new jags::base::Multiply; _neg = new jags::base::Neg; _neq = new jags::base::NotEqual; _not = new jags::base::Not; _or = new jags::base::Or; _pow = new jags::base::Pow; _seq = new jags::base::Seq; _subtract = new jags::base::Subtract; } void BaseFunTest::tearDown() { delete _add; delete _and; delete _divide; delete _equal; delete _geq; delete _gt; delete _leq; delete _lt; delete _multiply; delete _neg; delete _neq; delete _not; delete _or; delete _pow; delete _seq; delete _subtract; } void BaseFunTest::name() { CPPUNIT_ASSERT_EQUAL(string("+"), _add->name()); CPPUNIT_ASSERT_EQUAL(string("&&"), _and->name()); CPPUNIT_ASSERT_EQUAL(string("/"), _divide->name()); CPPUNIT_ASSERT_EQUAL(string("=="), _equal->name()); CPPUNIT_ASSERT_EQUAL(string(">="), _geq->name()); CPPUNIT_ASSERT_EQUAL(string(">"), _gt->name()); CPPUNIT_ASSERT_EQUAL(string("<="), _leq->name()); CPPUNIT_ASSERT_EQUAL(string("<"), _lt->name()); CPPUNIT_ASSERT_EQUAL(string("*"), _multiply->name()); //Unary minus is converted to the token NEG to avoid //confusing with binary minus CPPUNIT_ASSERT_EQUAL(string("NEG"), _neg->name()); CPPUNIT_ASSERT_EQUAL(string("!="), _neq->name()); CPPUNIT_ASSERT_EQUAL(string("!"), _not->name()); CPPUNIT_ASSERT_EQUAL(string("||"), _or->name()); CPPUNIT_ASSERT_EQUAL(string("^"), _pow->name()); CPPUNIT_ASSERT_EQUAL(string("-"), _subtract->name()); CPPUNIT_ASSERT_EQUAL(string(":"), _seq->name()); } void BaseFunTest::alias() { //None of the built-in functions has an alias, except pow CPPUNIT_ASSERT_EQUAL(string(""), _add->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _and->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _divide->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _equal->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _geq->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _gt->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _leq->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _lt->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _multiply->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _neg->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _neq->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _not->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _or->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _subtract->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _seq->alias()); CPPUNIT_ASSERT_EQUAL(string("pow"), _pow->alias()); } void BaseFunTest::arithmetic1(double v) { //Arithmetic functions taking a single argument CPPUNIT_ASSERT_EQUAL(_neg->npar(), 1U); CPPUNIT_ASSERT(checkNPar(_add, 1)); CPPUNIT_ASSERT(checkNPar(_multiply, 1)); CPPUNIT_ASSERT_EQUAL(-v, eval(_neg, v)); CPPUNIT_ASSERT_EQUAL(v, eval(_add, v)); CPPUNIT_ASSERT_EQUAL(v, eval(_multiply, v)); } void BaseFunTest::arithmetic2(double v1, double v2) { //Arithmetic functions taking two arguments CPPUNIT_ASSERT(checkNPar(_add, 2)); CPPUNIT_ASSERT(checkNPar(_multiply, 2)); CPPUNIT_ASSERT_EQUAL(_subtract->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_divide->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_pow->npar(), 2U); CPPUNIT_ASSERT_EQUAL(v1 + v2, eval(_add, v1, v2)); CPPUNIT_ASSERT_DOUBLES_EQUAL(v1 - v2, eval(_subtract, v1, v2), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(v1 * v2, eval(_multiply, v1, v2), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(v1 / v2, eval(_divide, v1, v2), tol); if (v1 < 0 && !checkInteger(v2)) { CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_pow, v1, v2)); } else { CPPUNIT_ASSERT_DOUBLES_EQUAL(pow(v1, v2), eval(_pow, v1, v2), tol); } } void BaseFunTest::arithmetic3(double v1, double v2, double v3) { //Arithmetic functions taking 3 arguments CPPUNIT_ASSERT(checkNPar(_add, 3)); CPPUNIT_ASSERT(checkNPar(_multiply, 3)); vector args(3); args[0] = &v1; args[1] = &v2; args[2] = &v3; CPPUNIT_ASSERT_EQUAL(_add->evaluate(args), v1 + v2 + v3); CPPUNIT_ASSERT_DOUBLES_EQUAL(_multiply->evaluate(args), v1 * v2 * v3, tol); } void BaseFunTest::arithmetic() { arithmetic1(0.0); arithmetic1(-3.7); arithmetic1(28.16); arithmetic2( 1.0, 2.0); arithmetic2(-1.0, 3.0); arithmetic2(-2.5, 8.3); arithmetic2(-3.7, -1.9); arithmetic3( 0.0, 0.0, 0.0); arithmetic3( 1.0, 2.0, 3.0); arithmetic3(-1.0, 3.0, -19.2); arithmetic3(-2.5, 8.3, -8.62); arithmetic3(-3.7, -1.9, -3.8); } void BaseFunTest::logical1() { //Logical Not takes one argument CPPUNIT_ASSERT_EQUAL(_not->npar(), 1U); CPPUNIT_ASSERT_EQUAL(1.0, eval(_not, 0)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_not, 1)); //Any non-zero value should be interpreted as TRUE CPPUNIT_ASSERT_EQUAL(0.0, eval(_not, 2)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_not, -0.5)); } void BaseFunTest::logical2() { //Logical And and Logical Or take two arguments CPPUNIT_ASSERT_EQUAL(_and->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_or->npar(), 2U); double TRUE=1, FALSE=0; CPPUNIT_ASSERT_EQUAL(FALSE, eval(_and, FALSE, FALSE)); CPPUNIT_ASSERT_EQUAL(FALSE, eval(_and, FALSE, TRUE)); CPPUNIT_ASSERT_EQUAL(FALSE, eval(_and, TRUE, FALSE)); CPPUNIT_ASSERT_EQUAL(TRUE, eval(_and, TRUE, TRUE)); CPPUNIT_ASSERT_EQUAL(FALSE, eval(_or, FALSE, FALSE)); CPPUNIT_ASSERT_EQUAL(TRUE, eval(_or, FALSE, TRUE)); CPPUNIT_ASSERT_EQUAL(TRUE, eval(_or, TRUE, FALSE)); CPPUNIT_ASSERT_EQUAL(TRUE, eval(_or, TRUE, TRUE)); //Any non-zero value should be interpreted as "true". //Try it with a few arbitrary non-zero values. double truevals[4] = {-3.872, 1e100, DBL_EPSILON, 3}; for (unsigned int i = 0; i < 4; ++i) { CPPUNIT_ASSERT_EQUAL(FALSE, eval(_and, FALSE, truevals[i])); CPPUNIT_ASSERT_EQUAL(FALSE, eval(_and, truevals[i], FALSE)); CPPUNIT_ASSERT_EQUAL(TRUE, eval(_and, truevals[i], truevals[i])); CPPUNIT_ASSERT_EQUAL(TRUE, eval(_or, FALSE, truevals[i])); CPPUNIT_ASSERT_EQUAL(TRUE, eval(_or, truevals[i], FALSE)); CPPUNIT_ASSERT_EQUAL(TRUE, eval(_or, truevals[i], truevals[i])); } } void BaseFunTest::logical() { logical1(); logical2(); } void BaseFunTest::comparison2(double v1, double v2) { CPPUNIT_ASSERT_EQUAL(static_cast(v1 == v2), eval(_equal, v1, v2)); CPPUNIT_ASSERT_EQUAL(static_cast(v1 >= v2), eval(_geq, v1, v2)); CPPUNIT_ASSERT_EQUAL(static_cast(v1 > v2), eval(_gt, v1, v2)); CPPUNIT_ASSERT_EQUAL(static_cast(v1 <= v2), eval(_leq, v1, v2)); CPPUNIT_ASSERT_EQUAL(static_cast(v1 < v2), eval(_lt, v1, v2)); CPPUNIT_ASSERT_EQUAL(static_cast(v1 != v2), eval(_neq, v1, v2)); } void BaseFunTest::comparison() { //All of the comparison functions take 2 arguments CPPUNIT_ASSERT_EQUAL(_equal->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_geq->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_gt->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_leq->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_lt->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_neq->npar(), 2U); comparison2( 0.0, 0.0); comparison2( 1.0, 2.0); comparison2( 1.0, 1.0); comparison2(-1.0, 3.0); comparison2(-2.5, 8.3); comparison2(-3.7, -1.9); comparison2( -2.8, -2.8); comparison2( 0.0, DBL_EPSILON); comparison2( DBL_EPSILON, 0.0); } void BaseFunTest::discrete() { CPPUNIT_ASSERT(isdiscrete(_not, 1, always)); CPPUNIT_ASSERT(isdiscrete(_and, 2, always)); CPPUNIT_ASSERT(isdiscrete(_equal, 2, always)); CPPUNIT_ASSERT(isdiscrete(_geq, 2, always)); CPPUNIT_ASSERT(isdiscrete(_gt, 2, always)); CPPUNIT_ASSERT(isdiscrete(_leq, 2, always)); CPPUNIT_ASSERT(isdiscrete(_lt, 2, always)); CPPUNIT_ASSERT(isdiscrete(_neq, 2, always)); CPPUNIT_ASSERT(isdiscrete(_not, 1, always)); CPPUNIT_ASSERT(isdiscrete(_or, 2, always)); CPPUNIT_ASSERT(isdiscrete(_multiply, 3, all)); CPPUNIT_ASSERT(isdiscrete(_add, 3, all)); CPPUNIT_ASSERT(isdiscrete(_divide, 2, never)); CPPUNIT_ASSERT(isdiscrete(_subtract, 2, all)); CPPUNIT_ASSERT(isdiscrete(_seq, 2, always)); CPPUNIT_ASSERT(isdiscrete(_pow, 2, never)); } void BaseFunTest::slp() { //Functions that are not scale, linear or power functions CPPUNIT_ASSERT(neverclosed(_and, 2)); CPPUNIT_ASSERT(neverclosed(_equal, 2)); CPPUNIT_ASSERT(neverclosed(_geq, 2)); CPPUNIT_ASSERT(neverclosed(_gt, 2)); CPPUNIT_ASSERT(neverclosed(_leq, 2)); CPPUNIT_ASSERT(neverclosed(_gt, 2)); CPPUNIT_ASSERT(neverclosed(_leq, 2)); CPPUNIT_ASSERT(neverclosed(_lt, 2)); CPPUNIT_ASSERT(neverclosed(_neq, 2)); CPPUNIT_ASSERT(neverclosed(_not, 1)); CPPUNIT_ASSERT(neverclosed(_or, 2)); CPPUNIT_ASSERT(neverclosed(_seq, 2)); } void BaseFunTest::linear() { CPPUNIT_ASSERT(_add->isLinear(TT, vector())); CPPUNIT_ASSERT(_add->isLinear(TF, vector())); CPPUNIT_ASSERT(_add->isLinear(FT, vector())); CPPUNIT_ASSERT(_add->isLinear(TF, FT)); CPPUNIT_ASSERT(_add->isLinear(TF, FF)); CPPUNIT_ASSERT(_add->isLinear(FT, TF)); CPPUNIT_ASSERT(_add->isLinear(FT, FF)); CPPUNIT_ASSERT(_subtract->isLinear(TT, vector())); CPPUNIT_ASSERT(_subtract->isLinear(TF, vector())); CPPUNIT_ASSERT(_subtract->isLinear(FT, vector())); CPPUNIT_ASSERT(_subtract->isLinear(TF, FT)); CPPUNIT_ASSERT(_subtract->isLinear(TF, FF)); CPPUNIT_ASSERT(_subtract->isLinear(FT, TF)); CPPUNIT_ASSERT(_subtract->isLinear(FT, FF)); CPPUNIT_ASSERT(!_divide->isLinear(TT, vector())); CPPUNIT_ASSERT(!_divide->isLinear(FT, vector())); CPPUNIT_ASSERT(_divide->isLinear(TF, vector())); CPPUNIT_ASSERT(_divide->isLinear(TF, FT)); CPPUNIT_ASSERT(!_multiply->isLinear(TT, vector())); CPPUNIT_ASSERT(_multiply->isLinear(FT, vector())); CPPUNIT_ASSERT(_multiply->isLinear(TF, vector())); CPPUNIT_ASSERT(_multiply->isLinear(TF, FT)); CPPUNIT_ASSERT(_multiply->isLinear(FT, TF)); CPPUNIT_ASSERT(neverlinear(_pow, 2)); } void BaseFunTest::scale() { CPPUNIT_ASSERT(_add->isScale(TT, vector())); CPPUNIT_ASSERT(!_add->isScale(TF, vector())); CPPUNIT_ASSERT(!_add->isScale(FT, vector())); CPPUNIT_ASSERT(_subtract->isScale(TT, vector())); CPPUNIT_ASSERT(!_subtract->isScale(TF, vector())); CPPUNIT_ASSERT(!_subtract->isScale(FT, vector())); CPPUNIT_ASSERT(!_divide->isScale(TT, vector())); CPPUNIT_ASSERT(!_divide->isScale(FT, vector())); CPPUNIT_ASSERT(_divide->isScale(TF, vector())); CPPUNIT_ASSERT(_divide->isScale(TF, FT)); CPPUNIT_ASSERT(!_multiply->isScale(TT, vector())); CPPUNIT_ASSERT(_multiply->isScale(FT, vector())); CPPUNIT_ASSERT(_multiply->isScale(TF, vector())); CPPUNIT_ASSERT(_multiply->isScale(TF, FT)); CPPUNIT_ASSERT(_multiply->isScale(FT, TF)); CPPUNIT_ASSERT(neverscale(_pow, 2)); } void BaseFunTest::power() { CPPUNIT_ASSERT(neverpow(_add, 2)); CPPUNIT_ASSERT(neverpow(_add, 3)); CPPUNIT_ASSERT(neverpow(_subtract, 2)); CPPUNIT_ASSERT(_divide->isPower(TT, vector())); CPPUNIT_ASSERT(_divide->isPower(FT, vector())); CPPUNIT_ASSERT(_divide->isPower(FT, TF)); CPPUNIT_ASSERT(_divide->isPower(TF, vector())); CPPUNIT_ASSERT(_divide->isPower(TF, FT)); CPPUNIT_ASSERT(_multiply->isPower(TT, vector())); CPPUNIT_ASSERT(_multiply->isPower(FT, vector())); CPPUNIT_ASSERT(_multiply->isPower(FT, TF)); CPPUNIT_ASSERT(_multiply->isPower(TF, vector())); CPPUNIT_ASSERT(_multiply->isPower(TF, FT)); CPPUNIT_ASSERT(_pow->isPower(TF, vector())); CPPUNIT_ASSERT(_pow->isPower(TF, FT)); CPPUNIT_ASSERT(!_pow->isPower(FT, vector())); } void BaseFunTest::seq() { for (int i = -5; i < 6; ++i) { for (int j = -6; j < 5; ++j) { int len = (j < i) ? 0 : j - i + 1; vector out = veval(_seq, i, j); CPPUNIT_ASSERT(out.size() == static_cast(len)); for (int k = 0; k < len; ++k) { CPPUNIT_ASSERT_EQUAL(out[k], static_cast(i + k)); } } } } JAGS-4.3.2/src/modules/base/functions/testbasefun.h0000664000175000017500000000330014224052514017037 00000000000000#ifndef BASE_FUN_TEST_H #define BASE_FUN_TEST_H #include #include namespace jags { class ScalarFunction; class VectorFunction; } class BaseFunTest : public CppUnit::TestFixture, public JAGSFixture { CPPUNIT_TEST_SUITE( BaseFunTest ); CPPUNIT_TEST( name ); CPPUNIT_TEST( alias ); CPPUNIT_TEST( logical ); CPPUNIT_TEST( arithmetic ); CPPUNIT_TEST( comparison ); CPPUNIT_TEST( discrete ); CPPUNIT_TEST( slp ); CPPUNIT_TEST( linear ); CPPUNIT_TEST( power ); CPPUNIT_TEST( scale ); CPPUNIT_TEST( seq ); CPPUNIT_TEST_SUITE_END(); jags::ScalarFunction *_add; jags::ScalarFunction *_and; jags::ScalarFunction *_divide; jags::ScalarFunction *_equal; jags::ScalarFunction *_geq; jags::ScalarFunction *_gt; jags::ScalarFunction *_leq; jags::ScalarFunction *_lt; jags::ScalarFunction *_multiply; jags::ScalarFunction *_neg; jags::ScalarFunction *_neq; jags::ScalarFunction *_not; jags::ScalarFunction *_or; jags::ScalarFunction *_pow; jags::VectorFunction *_seq; jags::ScalarFunction *_subtract; void arithmetic1(double); void arithmetic2(double, double); void arithmetic3(double, double, double); void logical1(); void logical2(); void logical3(); void comparison1(); void comparison2(double, double); void comparison3(); public: void setUp(); void tearDown(); void name(); void alias(); void logical(); void arithmetic(); void comparison(); void discrete(); void slp(); void linear(); void power(); void scale(); void seq(); }; #endif // BASE_FUN_TEST_H JAGS-4.3.2/src/modules/base/samplers/0000755000175000017500000000000014400711324014240 500000000000000JAGS-4.3.2/src/modules/base/samplers/Makefile.am0000664000175000017500000000051314224052371016221 00000000000000noinst_LTLIBRARIES = libbasesamplers.la libbasesamplers_la_SOURCES = DiscreteSlicer.cc FiniteFactory.cc \ FiniteMethod.cc RealSlicer.cc SliceFactory.cc MSlicer.cc libbasesamplers_la_CPPFLAGS = -I$(top_srcdir)/src/include noinst_HEADERS = DiscreteSlicer.h FiniteFactory.h \ FiniteMethod.h RealSlicer.h SliceFactory.h MSlicer.h JAGS-4.3.2/src/modules/base/samplers/DiscreteSlicer.h0000664000175000017500000000235014224052514017242 00000000000000#ifndef DISCRETE_SLICER_H_ #define DISCRETE_SLICER_H_ #include #include namespace jags { class StochasticNode; class SingletonGraphView; namespace base { /** * @short Discrete slice sampler * * Slice sampler for discrete valued distributions. * * To sample a discrete valued random variable X, we create an * auxiliary variable Y which is real valued, and for which p_[Y](y) = * p_[X](floor(y)). Hence Y has a piecewise-constant density function * on the real line. We sample Y and then set X = floor(Y). */ class DiscreteSlicer : public Slicer { SingletonGraphView const *_gv; const unsigned int _chain; double _x; public: /** * Constructor for Slice Sampler * @param width Initial width of slice * @param ndoubles Maximum number of doublings of slice */ DiscreteSlicer(SingletonGraphView const *gv, unsigned int chain, double width=2, long ndoubles = 10); void setValue(double x); double value() const; void getLimits(double *lower, double *upper) const; void update(RNG*); static bool canSample(StochasticNode const *node); double logDensity() const; }; }} #endif /* DISCRETE_SLICER_H_ */ JAGS-4.3.2/src/modules/base/samplers/FiniteFactory.h0000664000175000017500000000073114224052514017105 00000000000000#ifndef FINITE_FACTORY_H_ #define FINITE_FACTORY_H_ #include namespace jags { namespace base { /** * @short Factory object for finite samplers */ class FiniteFactory : public SingletonFactory { public: bool canSample(StochasticNode *snode, Graph const &graph) const; Sampler *makeSampler(StochasticNode *snode, Graph const &graph) const; std::string name() const; }; }} #endif /* FINITE_FACTORY_H_ */ JAGS-4.3.2/src/modules/base/samplers/FiniteMethod.h0000664000175000017500000000105414224052514016715 00000000000000#ifndef FINITE_METHOD_H_ #define FINITE_METHOD_H_ #include namespace jags { namespace base { /** * Sampler for discrete distributions with support on a finite set. */ class FiniteMethod : public ImmutableSampleMethod { SingletonGraphView const * const _gv; const int _lower, _upper; public: FiniteMethod(SingletonGraphView const *gv); void update(unsigned int chain, RNG *rng) const; static bool canSample(StochasticNode const *snode); }; } } #endif /* FINITE_METHOD_H_ */ JAGS-4.3.2/src/modules/base/samplers/RealSlicer.h0000664000175000017500000000176514224052514016374 00000000000000#ifndef REAL_SLICER_H_ #define REAL_SLICER_H_ #include namespace jags { class StochasticNode; class SingletonGraphView; namespace base { /** * Slice sampler for real-valued distributions */ class RealSlicer : public Slicer { SingletonGraphView const *_gv; unsigned int _chain; public: /** * Constructor for Slice Sampler * @param gv GraphView containing node to sample * @param chain Index number of chain to sample (starting from zero) * @param width Initial width of slice * @param maxwidth Maximal width of slice as a multiple of the width * parameter * @param nburn Length of burnin */ RealSlicer(SingletonGraphView const *gv, unsigned int chain, double width = 1, long maxwidth = 10); double value() const; void setValue(double value); void getLimits(double *lower, double *upper) const; void update(RNG *rng); static bool canSample(StochasticNode const *node); double logDensity() const; }; }} #endif /* REAL_SLICER_H_ */ JAGS-4.3.2/src/modules/base/samplers/SliceFactory.h0000664000175000017500000000074614224052514016734 00000000000000#ifndef SLICE_FACTORY_H_ #define SLICE_FACTORY_H_ #include class StochasticNode; class Graph; namespace jags { namespace base { /** * @short Factory object for slice samplers */ class SliceFactory : public SingletonFactory { public: bool canSample(StochasticNode *snode, Graph const &graph) const; Sampler *makeSampler(StochasticNode *snode, Graph const &graph) const; std::string name() const; }; }} #endif /* SLICE_FACTORY_H_ */ JAGS-4.3.2/src/modules/base/samplers/MSlicer.h0000664000175000017500000000240514224052514015675 00000000000000#ifndef M_SLICER_H_ #define M_SLICER_H_ #include #include namespace jags { class StochasticNode; class SingletonGraphView; namespace base { /** * Slice sampler for real-valued distributions */ class MSlicer : public MutableSampleMethod { SingletonGraphView const *_gv; unsigned int _chain; unsigned int _length; std::vector _width; double _max; std::vector _value; bool _adapt; unsigned int _iter; std::vector _sumdiff; double update0(RNG *rng, unsigned int i, std::vector const &lower, std::vector const &upper); void update1(RNG *rng, std::vector const &lower, std::vector const &upper); double const * value() const; void setValue(double value, unsigned int i); void setValue(std::vector const &value); double logDensity() const; public: MSlicer(SingletonGraphView const *gv, unsigned int chain, double width = 1, long maxwidth = 10); void update(RNG *rng); static bool canSample(StochasticNode const *node); bool isAdaptive() const; void adaptOff(); bool checkAdaptation() const; }; } } #endif /* M_SLICER_H_ */ JAGS-4.3.2/src/modules/base/samplers/Makefile.in0000644000175000017500000006763014400675235016253 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/base/samplers ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbasesamplers_la_LIBADD = am_libbasesamplers_la_OBJECTS = libbasesamplers_la-DiscreteSlicer.lo \ libbasesamplers_la-FiniteFactory.lo \ libbasesamplers_la-FiniteMethod.lo \ libbasesamplers_la-RealSlicer.lo \ libbasesamplers_la-SliceFactory.lo \ libbasesamplers_la-MSlicer.lo libbasesamplers_la_OBJECTS = $(am_libbasesamplers_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = \ ./$(DEPDIR)/libbasesamplers_la-DiscreteSlicer.Plo \ ./$(DEPDIR)/libbasesamplers_la-FiniteFactory.Plo \ ./$(DEPDIR)/libbasesamplers_la-FiniteMethod.Plo \ ./$(DEPDIR)/libbasesamplers_la-MSlicer.Plo \ ./$(DEPDIR)/libbasesamplers_la-RealSlicer.Plo \ ./$(DEPDIR)/libbasesamplers_la-SliceFactory.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libbasesamplers_la_SOURCES) DIST_SOURCES = $(libbasesamplers_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libbasesamplers.la libbasesamplers_la_SOURCES = DiscreteSlicer.cc FiniteFactory.cc \ FiniteMethod.cc RealSlicer.cc SliceFactory.cc MSlicer.cc libbasesamplers_la_CPPFLAGS = -I$(top_srcdir)/src/include noinst_HEADERS = DiscreteSlicer.h FiniteFactory.h \ FiniteMethod.h RealSlicer.h SliceFactory.h MSlicer.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/base/samplers/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/base/samplers/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libbasesamplers.la: $(libbasesamplers_la_OBJECTS) $(libbasesamplers_la_DEPENDENCIES) $(EXTRA_libbasesamplers_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libbasesamplers_la_OBJECTS) $(libbasesamplers_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasesamplers_la-DiscreteSlicer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasesamplers_la-FiniteFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasesamplers_la-FiniteMethod.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasesamplers_la-MSlicer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasesamplers_la-RealSlicer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasesamplers_la-SliceFactory.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libbasesamplers_la-DiscreteSlicer.lo: DiscreteSlicer.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasesamplers_la-DiscreteSlicer.lo -MD -MP -MF $(DEPDIR)/libbasesamplers_la-DiscreteSlicer.Tpo -c -o libbasesamplers_la-DiscreteSlicer.lo `test -f 'DiscreteSlicer.cc' || echo '$(srcdir)/'`DiscreteSlicer.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasesamplers_la-DiscreteSlicer.Tpo $(DEPDIR)/libbasesamplers_la-DiscreteSlicer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DiscreteSlicer.cc' object='libbasesamplers_la-DiscreteSlicer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasesamplers_la-DiscreteSlicer.lo `test -f 'DiscreteSlicer.cc' || echo '$(srcdir)/'`DiscreteSlicer.cc libbasesamplers_la-FiniteFactory.lo: FiniteFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasesamplers_la-FiniteFactory.lo -MD -MP -MF $(DEPDIR)/libbasesamplers_la-FiniteFactory.Tpo -c -o libbasesamplers_la-FiniteFactory.lo `test -f 'FiniteFactory.cc' || echo '$(srcdir)/'`FiniteFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasesamplers_la-FiniteFactory.Tpo $(DEPDIR)/libbasesamplers_la-FiniteFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='FiniteFactory.cc' object='libbasesamplers_la-FiniteFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasesamplers_la-FiniteFactory.lo `test -f 'FiniteFactory.cc' || echo '$(srcdir)/'`FiniteFactory.cc libbasesamplers_la-FiniteMethod.lo: FiniteMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasesamplers_la-FiniteMethod.lo -MD -MP -MF $(DEPDIR)/libbasesamplers_la-FiniteMethod.Tpo -c -o libbasesamplers_la-FiniteMethod.lo `test -f 'FiniteMethod.cc' || echo '$(srcdir)/'`FiniteMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasesamplers_la-FiniteMethod.Tpo $(DEPDIR)/libbasesamplers_la-FiniteMethod.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='FiniteMethod.cc' object='libbasesamplers_la-FiniteMethod.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasesamplers_la-FiniteMethod.lo `test -f 'FiniteMethod.cc' || echo '$(srcdir)/'`FiniteMethod.cc libbasesamplers_la-RealSlicer.lo: RealSlicer.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasesamplers_la-RealSlicer.lo -MD -MP -MF $(DEPDIR)/libbasesamplers_la-RealSlicer.Tpo -c -o libbasesamplers_la-RealSlicer.lo `test -f 'RealSlicer.cc' || echo '$(srcdir)/'`RealSlicer.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasesamplers_la-RealSlicer.Tpo $(DEPDIR)/libbasesamplers_la-RealSlicer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RealSlicer.cc' object='libbasesamplers_la-RealSlicer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasesamplers_la-RealSlicer.lo `test -f 'RealSlicer.cc' || echo '$(srcdir)/'`RealSlicer.cc libbasesamplers_la-SliceFactory.lo: SliceFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasesamplers_la-SliceFactory.lo -MD -MP -MF $(DEPDIR)/libbasesamplers_la-SliceFactory.Tpo -c -o libbasesamplers_la-SliceFactory.lo `test -f 'SliceFactory.cc' || echo '$(srcdir)/'`SliceFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasesamplers_la-SliceFactory.Tpo $(DEPDIR)/libbasesamplers_la-SliceFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SliceFactory.cc' object='libbasesamplers_la-SliceFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasesamplers_la-SliceFactory.lo `test -f 'SliceFactory.cc' || echo '$(srcdir)/'`SliceFactory.cc libbasesamplers_la-MSlicer.lo: MSlicer.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasesamplers_la-MSlicer.lo -MD -MP -MF $(DEPDIR)/libbasesamplers_la-MSlicer.Tpo -c -o libbasesamplers_la-MSlicer.lo `test -f 'MSlicer.cc' || echo '$(srcdir)/'`MSlicer.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasesamplers_la-MSlicer.Tpo $(DEPDIR)/libbasesamplers_la-MSlicer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MSlicer.cc' object='libbasesamplers_la-MSlicer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasesamplers_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasesamplers_la-MSlicer.lo `test -f 'MSlicer.cc' || echo '$(srcdir)/'`MSlicer.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libbasesamplers_la-DiscreteSlicer.Plo -rm -f ./$(DEPDIR)/libbasesamplers_la-FiniteFactory.Plo -rm -f ./$(DEPDIR)/libbasesamplers_la-FiniteMethod.Plo -rm -f ./$(DEPDIR)/libbasesamplers_la-MSlicer.Plo -rm -f ./$(DEPDIR)/libbasesamplers_la-RealSlicer.Plo -rm -f ./$(DEPDIR)/libbasesamplers_la-SliceFactory.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libbasesamplers_la-DiscreteSlicer.Plo -rm -f ./$(DEPDIR)/libbasesamplers_la-FiniteFactory.Plo -rm -f ./$(DEPDIR)/libbasesamplers_la-FiniteMethod.Plo -rm -f ./$(DEPDIR)/libbasesamplers_la-MSlicer.Plo -rm -f ./$(DEPDIR)/libbasesamplers_la-RealSlicer.Plo -rm -f ./$(DEPDIR)/libbasesamplers_la-SliceFactory.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/base/samplers/DiscreteSlicer.cc0000664000175000017500000000327014224052514017402 00000000000000#include #include #include #include #include #include #include "DiscreteSlicer.h" #include using std::floor; using std::vector; using std::string; namespace jags { namespace base { DiscreteSlicer::DiscreteSlicer(SingletonGraphView const *gv, unsigned int chain, double width, long ndoubles) : Slicer(width, ndoubles), _gv(gv), _chain(chain), _x(0) { if (!canSample(gv->node())) { throwLogicError("Invalid DiscreteSlicer"); } //Check finite likelihood and copy current value gv->checkFinite(chain); _x = _gv->node()->value(chain)[0]; } bool DiscreteSlicer::canSample(StochasticNode const *node) { if (!node->isDiscreteValued() || node->length() != 1) return false; return true; } void DiscreteSlicer::setValue(double x) { _x = x; x = floor(x); _gv->setValue(&x, 1, _chain); } double DiscreteSlicer::value() const { return _x; } void DiscreteSlicer::getLimits(double *lower, double *upper) const { _gv->node()->support(lower, upper, 1, _chain); *upper += 1; } void DiscreteSlicer::update(RNG *rng) { if (!updateDouble(rng)) { switch(state()) { case SLICER_POSINF: throwNodeError(_gv->node(), "Slicer stuck at value with infinite density"); break; case SLICER_NEGINF: throwNodeError(_gv->node(), "Current value is inconsistent with data"); break; case SLICER_OK: break; } } } double DiscreteSlicer::logDensity() const { return _gv->logFullConditional(_chain); } }} JAGS-4.3.2/src/modules/base/samplers/FiniteFactory.cc0000664000175000017500000000133714224052514017246 00000000000000#include #include #include #include "FiniteMethod.h" #include "FiniteFactory.h" #include using std::vector; using std::string; namespace jags { namespace base { bool FiniteFactory::canSample(StochasticNode *snode, Graph const &graph) const { return FiniteMethod::canSample(snode); } Sampler * FiniteFactory::makeSampler(StochasticNode *snode, Graph const &graph) const { SingletonGraphView *gv = new SingletonGraphView(snode, graph); FiniteMethod *method = new FiniteMethod(gv); return new ImmutableSampler(gv, method, name()); } string FiniteFactory::name() const { return "base::Finite"; } }} JAGS-4.3.2/src/modules/base/samplers/FiniteMethod.cc0000664000175000017500000000617614224052514017065 00000000000000#include #include #include #include #include #include #include #include #include "FiniteMethod.h" #include #include #include #include using std::string; using std::vector; using std::exp; using std::string; using std::binary_search; using std::upper_bound; namespace jags { static int mkLower(SingletonGraphView const *gv) { double lower=0, upper=0; gv->node()->support(&lower, &upper, 1, 0); return static_cast(lower); } static int mkUpper(SingletonGraphView const *gv) { double lower=0, upper=0; gv->node()->support(&lower, &upper, 1, 0); return static_cast(upper); } namespace base { FiniteMethod::FiniteMethod(SingletonGraphView const *gv) : _gv(gv), _lower(mkLower(gv)), _upper(mkUpper(gv)) { if (!canSample(gv->node())) { throwLogicError("Invalid FiniteMethod"); } } void FiniteMethod::update(unsigned int chain, RNG *rng) const { int size = _upper - _lower + 1; vector lik(size); //Calculate log-likelihood double lik_max = JAGS_NEGINF; for (int i = 0; i < size; i++) { double ivalue = _lower + i; _gv->setValue(&ivalue, 1, chain); lik[i] = _gv->logFullConditional(chain); if (lik[i] > lik_max) lik_max = lik[i]; } //Transform log-likelihood to likelihood, avoiding overflow //and calculate partial sums double liksum = 0; for (int i = 0; i < size; ++i) { liksum += exp(lik[i] - lik_max); lik[i] = liksum; } if (!jags_finite(liksum)) { throwNodeError(_gv->node(), "Cannot normalize density"); } // Sample double urand = rng->uniform() * liksum; int i = upper_bound(lik.begin(), lik.end(), urand) - lik.begin(); double ivalue = _lower + i; _gv->setValue(&ivalue, 1, chain); } bool FiniteMethod::canSample(StochasticNode const * node) { //Node must be scalar with discrete-valued distribution of full rank if (!node->isDiscreteValued()) return false; if (node->length() != 1) return false; if (node->df() == 0) return false; //Support must be fixed if (!isSupportFixed(node)) { return false; } //Distribution cannot be unbounded double ulimit = JAGS_NEGINF, llimit = JAGS_POSINF; node->support(&llimit, &ulimit, 1, 0); if (!jags_finite(ulimit) || !jags_finite(llimit)) return false; /* If there are too many possibilities then FiniteMethod, becomes slow as it has to evaluate the likelihood at each point (inversion). So we drop FiniteMethod in favour of the discrete slice sampler if the number of possibilities is too large. It's not clear what "too large" is. Here we use a cutoff size of 100, unless the node has a categorical prior, noting that dcat can take an arbitrary, unordered vector of probabilities as argument. FIXME: a more careful criterion would be to test whether the log-density is unimodal. */ if (node->distribution()->name() != "dcat") { if (ulimit - llimit >= 100) return false; } return true; } }} JAGS-4.3.2/src/modules/base/samplers/RealSlicer.cc0000664000175000017500000000302714224052514016523 00000000000000#include #include #include #include #include #include "RealSlicer.h" #include using std::vector; using std::string; namespace jags { namespace base { RealSlicer::RealSlicer(SingletonGraphView const *gv, unsigned int chain, double width, long maxwidth) : Slicer(width, maxwidth), _gv(gv), _chain(chain) { if (!canSample(gv->node())) { throwLogicError("Invalid RealSlicer"); } gv->checkFinite(chain); } bool RealSlicer::canSample(StochasticNode const *node) { if (node->isDiscreteValued() || node->length() != 1) return false; if (node->df() == 0) return false; return true; } double RealSlicer::value() const { return _gv->node()->value(_chain)[0]; } void RealSlicer::setValue(double value) { _gv->setValue(&value, 1, _chain); } void RealSlicer::getLimits(double *lower, double *upper) const { _gv->node()->support(lower, upper, 1, _chain); } void RealSlicer::update(RNG *rng) { if (!updateStep(rng)) { switch(state()) { case SLICER_POSINF: throwNodeError(_gv->node(), "Slicer stuck at value with infinite density"); break; case SLICER_NEGINF: throwNodeError(_gv->node(), "Current value is inconsistent with data"); break; case SLICER_OK: break; } } } double RealSlicer::logDensity() const { return _gv->logFullConditional(_chain); } }} JAGS-4.3.2/src/modules/base/samplers/SliceFactory.cc0000664000175000017500000000276514224052514017075 00000000000000#include #include "RealSlicer.h" #include "DiscreteSlicer.h" #include "MSlicer.h" #include "SliceFactory.h" #include #include #include #include using std::vector; using std::string; namespace jags { namespace base { bool SliceFactory::canSample(StochasticNode * node, Graph const &graph) const { if (node->length() == 1) { if (node->isDiscreteValued()) { return DiscreteSlicer::canSample(node); } else { return RealSlicer::canSample(node); } } else { return MSlicer::canSample(node); } } Sampler *SliceFactory::makeSampler(StochasticNode *snode, Graph const &graph) const { unsigned int nchain = snode->nchain(); vector methods(nchain, 0); SingletonGraphView *gv = new SingletonGraphView(snode, graph); string name; if (snode->length() == 1) { bool discrete = snode->isDiscreteValued(); for (unsigned int ch = 0; ch < nchain; ++ch) { if (discrete) { methods[ch] = new DiscreteSlicer(gv, ch); } else { methods[ch] = new RealSlicer(gv, ch); } } name = discrete ? "base::DiscreteSlicer" : "base::RealSlicer"; } else { for (unsigned int ch = 0; ch < nchain; ++ch) { methods[ch] = new MSlicer(gv, ch); } name = "base::MSlicer"; } return new MutableSampler(gv, methods, name); } string SliceFactory::name() const { return "base::Slice"; } }} JAGS-4.3.2/src/modules/base/samplers/MSlicer.cc0000664000175000017500000001252714224052514016041 00000000000000#include #include #include #include #include #include #include #include "MSlicer.h" #include #include using std::vector; using std::string; using std::fabs; #define MIN_ADAPT 50 namespace jags { namespace base { MSlicer::MSlicer(SingletonGraphView const *gv, unsigned int chain, double width, long maxwidth) : _gv(gv), _chain(chain), _length(gv->length()), _width(_length, width), _max(maxwidth), _value(_length), _adapt(true), _iter(0), _sumdiff(_length) { if (!canSample(gv->node())) { throwLogicError("Invalid MSlicer"); } gv->checkFinite(chain); gv->getValue(_value, chain); } bool MSlicer::canSample(StochasticNode const *node) { if (node->isDiscreteValued() || node->length() <= 1) return false; if (node->df() < node->length()) return false; return true; } double MSlicer::update0(RNG *rng, unsigned int i, vector const &lower, vector const &upper) { // Generate auxiliary variable double g0 = logDensity(); double z = g0 - rng->exponential();; // Generate random interval of width "_width[i]" about current value double xold = _value[i]; double L = xold - rng->uniform() * _width[i]; double R = L + _width[i]; // Stepping out // Randomly set number of steps in left and right directions, // subject to the limit in the maximal size of the interval int j = static_cast(rng->uniform() * _max); int k = _max - 1 - j; if (L < lower[i]) { L = lower[i]; } else { setValue(L, i); while (j-- > 0 && logDensity() > z) { L -= _width[i]; if (L < lower[i]) { L = lower[i]; break; } setValue(L, i); } } if (R > upper[i]) { R = upper[i]; } else { setValue(R, i); while (k-- > 0 && logDensity() > z) { R += _width[i]; if (R > upper[i]) { R = upper[i]; break; } setValue(R, i); } } // Keep sampling from the interval until acceptance (the loop is // guaranteed to terminate). double xnew; for(;;) { xnew = L + rng->uniform() * (R - L); setValue(xnew, i); double g = logDensity(); if (g >= z - DBL_EPSILON) { // Accept point break; } else { // shrink the interval if (xnew < xold) { L = xnew; } else { R = xnew; } } } return xnew; } void MSlicer::update1(RNG *rng, vector const &lower, vector const &upper) { // Generate auxiliary variable double g0 = logDensity(); double z = g0 - rng->exponential();; // Generate random interval of width "_width" about current value vector L(_length), R(_length); for (unsigned int i = 0; i < _length; ++i) { L[i] = _value[i] - rng->uniform() * 2 * _width[i]; R[i] = L[i] + 2 * _width[i]; } // Keep sampling from the interval until acceptance (the loop is // guaranteed to terminate). vector xold(_value); vector xnew(_length); for(;;) { for (unsigned int i = 0; i < _length; ++i) { xnew[i] = L[i] + rng->uniform() * (R[i] - L[i]); } setValue(xnew); double g = logDensity(); if (g >= z - DBL_EPSILON) { // Accept point break; } else { // shrink the interval for (unsigned int i = 0; i < _length; ++i) { if (xnew[i] < xold[i]) { L[i] = xnew[i]; } else { R[i] = xnew[i]; } } } } } void MSlicer::update(RNG *rng) { // Test current value double g0 = logDensity(); if (!jags_finite(g0)) { if (g0 > 0) { throwNodeError(_gv->node(), "Slicer stuck at value with infinite density"); } else { throwNodeError(_gv->node(), "Current value is inconsistent with data"); } } vector lower(_length), upper(_length); _gv->node()->support(&lower[0], &upper[0], _length, _chain); if (_adapt) { //During adaptation we do univariate slices ++_iter; for (unsigned int i = 0; i < _length; ++i) { double xold = _value[i]; double xnew = update0(rng, i, lower, upper); double delta = fabs(xnew - xold) - _width[i]; _width[i] += 2 * delta / (_iter+1); } } /* else { for (unsigned int i = 0; i < _length; ++i) { update0(rng, i, lower, upper); } } */ update1(rng, lower, upper); } double const * MSlicer::value() const { return _gv->node()->value(_chain); } void MSlicer::setValue(double value, unsigned int i) { _value[i] = value; _gv->setValue(&_value[0], _value.size(), _chain); } void MSlicer::setValue(vector const &value) { _value = value; _gv->setValue(&_value[0], _value.size(), _chain); } double MSlicer::logDensity() const { return _gv->logFullConditional(_chain); } bool MSlicer::isAdaptive() const { return true; } void MSlicer::adaptOff() { _adapt = false; /* std::cout << "chain " << _chain << " node " << _gv->node() << std::endl; for (unsigned int i = 0; i < _length; ++i) { std::cout << _width[i] << " "; } std::cout << std::endl; */ } bool MSlicer::checkAdaptation() const { return _iter > MIN_ADAPT; } } } JAGS-4.3.2/src/modules/base/monitors/0000755000175000017500000000000014400711325014265 500000000000000JAGS-4.3.2/src/modules/base/monitors/Makefile.am0000664000175000017500000000060514224052514016246 00000000000000noinst_LTLIBRARIES = libbasemonitors.la libbasemonitors_la_CPPFLAGS = -I$(top_srcdir)/src/include libbasemonitors_la_SOURCES = TraceMonitor.cc TraceMonitorFactory.cc \ MeanMonitor.cc MeanMonitorFactory.cc \ VarianceMonitor.cc VarianceMonitorFactory.cc noinst_HEADERS = TraceMonitor.h TraceMonitorFactory.h MeanMonitor.h \ MeanMonitorFactory.h VarianceMonitor.h VarianceMonitorFactory.h JAGS-4.3.2/src/modules/base/monitors/TraceMonitor.h0000664000175000017500000000123114224052514016765 00000000000000#ifndef TRACE_MONITOR_H_ #define TRACE_MONITOR_H_ #include #include #include namespace jags { namespace base { /** * @short Stores sampled values of a given Node */ class TraceMonitor : public Monitor { NodeArraySubset _subset; std::vector > _values; // sampled values public: TraceMonitor(NodeArraySubset const &subset); void update(); std::vector const &value(unsigned int chain) const; std::vector dim() const; bool poolChains() const; bool poolIterations() const; }; } } #endif /* TRACE_MONITOR_H_ */ JAGS-4.3.2/src/modules/base/monitors/TraceMonitorFactory.h0000664000175000017500000000066314224052514020325 00000000000000#ifndef TRACE_MONITOR_FACTORY_H_ #define TRACE_MONITOR_FACTORY_H_ #include namespace jags { namespace base { class TraceMonitorFactory : public MonitorFactory { public: Monitor *getMonitor(std::string const &name, Range const &range, BUGSModel *model, std::string const &type, std::string &msg); std::string name() const; }; }} #endif /* TRACE_MONITOR_FACTORY_H_ */ JAGS-4.3.2/src/modules/base/monitors/MeanMonitor.h0000664000175000017500000000121214224052514016606 00000000000000#ifndef MEAN_MONITOR_H_ #define MEAN_MONITOR_H_ #include #include #include namespace jags { namespace base { /** * @short Stores running mean of a given Node */ class MeanMonitor : public Monitor { NodeArraySubset _subset; std::vector > _values; // sampled values unsigned int _n; public: MeanMonitor(NodeArraySubset const &subset); void update(); std::vector const &value(unsigned int chain) const; std::vector dim() const; bool poolChains() const; bool poolIterations() const; }; }} #endif /* MEAN_MONITOR_H_ */ JAGS-4.3.2/src/modules/base/monitors/MeanMonitorFactory.h0000664000175000017500000000065714224052514020152 00000000000000#ifndef MEAN_MONITOR_FACTORY_H_ #define MEAN_MONITOR_FACTORY_H_ #include namespace jags { namespace base { class MeanMonitorFactory : public MonitorFactory { public: Monitor *getMonitor(std::string const &name, Range const &range, BUGSModel *model, std::string const &type, std::string &msg); std::string name() const; }; }} #endif /* MEAN_MONITOR_FACTORY_H_ */ JAGS-4.3.2/src/modules/base/monitors/VarianceMonitor.h0000664000175000017500000000134614224052514017466 00000000000000#ifndef VARIANCE_MONITOR_H_ #define VARIANCE_MONITOR_H_ #include #include #include namespace jags { namespace base { /** * @short Stores running variance of a given Node */ class VarianceMonitor : public Monitor { NodeArraySubset _subset; std::vector > _means; std::vector > _mms; std::vector > _variances; unsigned int _n; public: VarianceMonitor(NodeArraySubset const &subset); void update(); std::vector const &value(unsigned int chain) const; std::vector dim() const; bool poolChains() const; bool poolIterations() const; }; }} #endif /* VARIANCE_MONITOR_H_ */ JAGS-4.3.2/src/modules/base/monitors/VarianceMonitorFactory.h0000664000175000017500000000067714224052514021024 00000000000000#ifndef VARIANCE_MONITOR_FACTORY_H_ #define VARIANCE_MONITOR_FACTORY_H_ #include namespace jags { namespace base { class VarianceMonitorFactory : public MonitorFactory { public: Monitor *getMonitor(std::string const &name, Range const &range, BUGSModel *model, std::string const &type, std::string &msg); std::string name() const; }; }} #endif /* VARIANCE_MONITOR_FACTORY_H_ */ JAGS-4.3.2/src/modules/base/monitors/Makefile.in0000644000175000017500000007076614400675235016303 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/base/monitors ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbasemonitors_la_LIBADD = am_libbasemonitors_la_OBJECTS = libbasemonitors_la-TraceMonitor.lo \ libbasemonitors_la-TraceMonitorFactory.lo \ libbasemonitors_la-MeanMonitor.lo \ libbasemonitors_la-MeanMonitorFactory.lo \ libbasemonitors_la-VarianceMonitor.lo \ libbasemonitors_la-VarianceMonitorFactory.lo libbasemonitors_la_OBJECTS = $(am_libbasemonitors_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libbasemonitors_la-MeanMonitor.Plo \ ./$(DEPDIR)/libbasemonitors_la-MeanMonitorFactory.Plo \ ./$(DEPDIR)/libbasemonitors_la-TraceMonitor.Plo \ ./$(DEPDIR)/libbasemonitors_la-TraceMonitorFactory.Plo \ ./$(DEPDIR)/libbasemonitors_la-VarianceMonitor.Plo \ ./$(DEPDIR)/libbasemonitors_la-VarianceMonitorFactory.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libbasemonitors_la_SOURCES) DIST_SOURCES = $(libbasemonitors_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libbasemonitors.la libbasemonitors_la_CPPFLAGS = -I$(top_srcdir)/src/include libbasemonitors_la_SOURCES = TraceMonitor.cc TraceMonitorFactory.cc \ MeanMonitor.cc MeanMonitorFactory.cc \ VarianceMonitor.cc VarianceMonitorFactory.cc noinst_HEADERS = TraceMonitor.h TraceMonitorFactory.h MeanMonitor.h \ MeanMonitorFactory.h VarianceMonitor.h VarianceMonitorFactory.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/base/monitors/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/base/monitors/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libbasemonitors.la: $(libbasemonitors_la_OBJECTS) $(libbasemonitors_la_DEPENDENCIES) $(EXTRA_libbasemonitors_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libbasemonitors_la_OBJECTS) $(libbasemonitors_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasemonitors_la-MeanMonitor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasemonitors_la-MeanMonitorFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasemonitors_la-TraceMonitor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasemonitors_la-TraceMonitorFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasemonitors_la-VarianceMonitor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbasemonitors_la-VarianceMonitorFactory.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libbasemonitors_la-TraceMonitor.lo: TraceMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasemonitors_la-TraceMonitor.lo -MD -MP -MF $(DEPDIR)/libbasemonitors_la-TraceMonitor.Tpo -c -o libbasemonitors_la-TraceMonitor.lo `test -f 'TraceMonitor.cc' || echo '$(srcdir)/'`TraceMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasemonitors_la-TraceMonitor.Tpo $(DEPDIR)/libbasemonitors_la-TraceMonitor.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='TraceMonitor.cc' object='libbasemonitors_la-TraceMonitor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasemonitors_la-TraceMonitor.lo `test -f 'TraceMonitor.cc' || echo '$(srcdir)/'`TraceMonitor.cc libbasemonitors_la-TraceMonitorFactory.lo: TraceMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasemonitors_la-TraceMonitorFactory.lo -MD -MP -MF $(DEPDIR)/libbasemonitors_la-TraceMonitorFactory.Tpo -c -o libbasemonitors_la-TraceMonitorFactory.lo `test -f 'TraceMonitorFactory.cc' || echo '$(srcdir)/'`TraceMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasemonitors_la-TraceMonitorFactory.Tpo $(DEPDIR)/libbasemonitors_la-TraceMonitorFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='TraceMonitorFactory.cc' object='libbasemonitors_la-TraceMonitorFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasemonitors_la-TraceMonitorFactory.lo `test -f 'TraceMonitorFactory.cc' || echo '$(srcdir)/'`TraceMonitorFactory.cc libbasemonitors_la-MeanMonitor.lo: MeanMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasemonitors_la-MeanMonitor.lo -MD -MP -MF $(DEPDIR)/libbasemonitors_la-MeanMonitor.Tpo -c -o libbasemonitors_la-MeanMonitor.lo `test -f 'MeanMonitor.cc' || echo '$(srcdir)/'`MeanMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasemonitors_la-MeanMonitor.Tpo $(DEPDIR)/libbasemonitors_la-MeanMonitor.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MeanMonitor.cc' object='libbasemonitors_la-MeanMonitor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasemonitors_la-MeanMonitor.lo `test -f 'MeanMonitor.cc' || echo '$(srcdir)/'`MeanMonitor.cc libbasemonitors_la-MeanMonitorFactory.lo: MeanMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasemonitors_la-MeanMonitorFactory.lo -MD -MP -MF $(DEPDIR)/libbasemonitors_la-MeanMonitorFactory.Tpo -c -o libbasemonitors_la-MeanMonitorFactory.lo `test -f 'MeanMonitorFactory.cc' || echo '$(srcdir)/'`MeanMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasemonitors_la-MeanMonitorFactory.Tpo $(DEPDIR)/libbasemonitors_la-MeanMonitorFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MeanMonitorFactory.cc' object='libbasemonitors_la-MeanMonitorFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasemonitors_la-MeanMonitorFactory.lo `test -f 'MeanMonitorFactory.cc' || echo '$(srcdir)/'`MeanMonitorFactory.cc libbasemonitors_la-VarianceMonitor.lo: VarianceMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasemonitors_la-VarianceMonitor.lo -MD -MP -MF $(DEPDIR)/libbasemonitors_la-VarianceMonitor.Tpo -c -o libbasemonitors_la-VarianceMonitor.lo `test -f 'VarianceMonitor.cc' || echo '$(srcdir)/'`VarianceMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasemonitors_la-VarianceMonitor.Tpo $(DEPDIR)/libbasemonitors_la-VarianceMonitor.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='VarianceMonitor.cc' object='libbasemonitors_la-VarianceMonitor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasemonitors_la-VarianceMonitor.lo `test -f 'VarianceMonitor.cc' || echo '$(srcdir)/'`VarianceMonitor.cc libbasemonitors_la-VarianceMonitorFactory.lo: VarianceMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbasemonitors_la-VarianceMonitorFactory.lo -MD -MP -MF $(DEPDIR)/libbasemonitors_la-VarianceMonitorFactory.Tpo -c -o libbasemonitors_la-VarianceMonitorFactory.lo `test -f 'VarianceMonitorFactory.cc' || echo '$(srcdir)/'`VarianceMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbasemonitors_la-VarianceMonitorFactory.Tpo $(DEPDIR)/libbasemonitors_la-VarianceMonitorFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='VarianceMonitorFactory.cc' object='libbasemonitors_la-VarianceMonitorFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbasemonitors_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbasemonitors_la-VarianceMonitorFactory.lo `test -f 'VarianceMonitorFactory.cc' || echo '$(srcdir)/'`VarianceMonitorFactory.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libbasemonitors_la-MeanMonitor.Plo -rm -f ./$(DEPDIR)/libbasemonitors_la-MeanMonitorFactory.Plo -rm -f ./$(DEPDIR)/libbasemonitors_la-TraceMonitor.Plo -rm -f ./$(DEPDIR)/libbasemonitors_la-TraceMonitorFactory.Plo -rm -f ./$(DEPDIR)/libbasemonitors_la-VarianceMonitor.Plo -rm -f ./$(DEPDIR)/libbasemonitors_la-VarianceMonitorFactory.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libbasemonitors_la-MeanMonitor.Plo -rm -f ./$(DEPDIR)/libbasemonitors_la-MeanMonitorFactory.Plo -rm -f ./$(DEPDIR)/libbasemonitors_la-TraceMonitor.Plo -rm -f ./$(DEPDIR)/libbasemonitors_la-TraceMonitorFactory.Plo -rm -f ./$(DEPDIR)/libbasemonitors_la-VarianceMonitor.Plo -rm -f ./$(DEPDIR)/libbasemonitors_la-VarianceMonitorFactory.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/base/monitors/TraceMonitor.cc0000664000175000017500000000156314224052514017133 00000000000000#include #include #include #include "TraceMonitor.h" using std::vector; using std::string; namespace jags { namespace base { TraceMonitor::TraceMonitor(NodeArraySubset const &subset) : Monitor("trace", subset.nodes()), _subset(subset), _values(subset.nchain()) { } void TraceMonitor::update() { for (unsigned int ch = 0; ch < _values.size(); ++ch) { vector v = _subset.value(ch); _values[ch].insert(_values[ch].end(), v.begin(), v.end()); } } vector const &TraceMonitor::value(unsigned int chain) const { return _values[chain]; } vector TraceMonitor::dim() const { return _subset.dim(); } bool TraceMonitor::poolChains() const { return false; } bool TraceMonitor::poolIterations() const { return false; } }} JAGS-4.3.2/src/modules/base/monitors/TraceMonitorFactory.cc0000664000175000017500000000241414224052514020457 00000000000000#include "TraceMonitorFactory.h" #include "TraceMonitor.h" #include #include #include #include using std::set; using std::string; using std::vector; namespace jags { namespace base { Monitor *TraceMonitorFactory::getMonitor(string const &name, Range const &range, BUGSModel *model, string const &type, string &msg) { if (type != "trace") return 0; NodeArray *array = model->symtab().getVariable(name); if (!array) { msg = string("Variable ") + name + " not found"; return 0; } TraceMonitor *m = new TraceMonitor(NodeArraySubset(array, range)); //Set name attributes m->setName(name + print(range)); Range node_range = range; if (isNULL(range)) { //Special syntactic rule: a null range corresponds to the whole //array node_range = array->range(); } vector elt_names; if (node_range.length() > 1) { for (RangeIterator i(node_range); !i.atEnd(); i.nextLeft()) { elt_names.push_back(name + print(i)); } } else { elt_names.push_back(name + print(range)); } m->setElementNames(elt_names); return m; } string TraceMonitorFactory::name() const { return "base::Trace"; } }} JAGS-4.3.2/src/modules/base/monitors/MeanMonitor.cc0000664000175000017500000000212614224052514016751 00000000000000#include #include #include #include #include "MeanMonitor.h" using std::vector; using std::string; namespace jags { namespace base { MeanMonitor::MeanMonitor(NodeArraySubset const &subset) : Monitor("mean", subset.nodes()), _subset(subset), _values(subset.nchain(), vector(subset.length())), _n(0) { } void MeanMonitor::update() { _n++; for (unsigned int ch = 0; ch < _values.size(); ++ch) { vector value = _subset.value(ch); vector &rmean = _values[ch]; for (unsigned int i = 0; i < value.size(); ++i) { if (value[i] == JAGS_NA) { rmean[i] = JAGS_NA; } else { rmean[i] -= (rmean[i] - value[i])/_n; } } } } vector const &MeanMonitor::value(unsigned int chain) const { return _values[chain]; } vector MeanMonitor::dim() const { return _subset.dim(); } bool MeanMonitor::poolChains() const { return false; } bool MeanMonitor::poolIterations() const { return true; } }} JAGS-4.3.2/src/modules/base/monitors/MeanMonitorFactory.cc0000664000175000017500000000240414224052514020300 00000000000000#include "MeanMonitorFactory.h" #include "MeanMonitor.h" #include #include #include #include using std::set; using std::string; using std::vector; namespace jags { namespace base { Monitor *MeanMonitorFactory::getMonitor(string const &name, Range const &range, BUGSModel *model, string const &type, string &msg) { if (type != "mean") return 0; NodeArray *array = model->symtab().getVariable(name); if (!array) { msg = string("Variable ") + name + " not found"; return 0; } MeanMonitor *m = new MeanMonitor(NodeArraySubset(array, range)); //Set name attributes m->setName(name + print(range)); Range node_range = range; if (isNULL(range)) { //Special syntactic rule: a null range corresponds to the whole //array node_range = array->range(); } vector elt_names; if (node_range.length() > 1) { for (RangeIterator i(node_range); !i.atEnd(); i.nextLeft()) { elt_names.push_back(name + print(i)); } } else { elt_names.push_back(name + print(range)); } m->setElementNames(elt_names); return m; } string MeanMonitorFactory::name() const { return "base::Mean"; } }} JAGS-4.3.2/src/modules/base/monitors/VarianceMonitor.cc0000664000175000017500000000366314224052514017630 00000000000000#include #include #include #include #include "VarianceMonitor.h" using std::vector; using std::string; namespace jags { namespace base { VarianceMonitor::VarianceMonitor(NodeArraySubset const &subset) : Monitor("variance", subset.nodes()), _subset(subset), _means(subset.nchain(), vector(subset.length())), _mms(subset.nchain(), vector(subset.length())), _variances(subset.nchain(), vector(subset.length())), _n(0) { } void VarianceMonitor::update() { _n++; for (unsigned int ch = 0; ch < _means.size(); ++ch) { vector value = _subset.value(ch); vector &rmean = _means[ch]; vector &rmm = _mms[ch]; vector &rvar = _variances[ch]; for (unsigned int i = 0; i < value.size(); ++i) { if (value[i] == JAGS_NA) { rmean[i] = JAGS_NA; rmm[i] = JAGS_NA; rvar[i] = JAGS_NA; } else { double delta = value[i] - rmean[i]; rmean[i] += delta / _n; rmm[i] += delta * (value[i] - rmean[i]); /* [MD - 2016-03-31] The variance would be more efficiently calculated on-demand, but the functions are all marked as const except this one. It is possible to get around this restriction, but the value function is const for a good reason, so hacking around this seems to me to be a bad idea. I do have an alternative implementation that calculates variance on demand, which we could consider using for the sake of efficiency... */ rvar[i] = rmm[i] / (double) (_n - 1); } } } } vector const &VarianceMonitor::value(unsigned int chain) const { return _variances[chain]; } vector VarianceMonitor::dim() const { return _subset.dim(); } bool VarianceMonitor::poolChains() const { return false; } bool VarianceMonitor::poolIterations() const { return true; } }} JAGS-4.3.2/src/modules/base/monitors/VarianceMonitorFactory.cc0000664000175000017500000000244414224052514021154 00000000000000#include "VarianceMonitorFactory.h" #include "VarianceMonitor.h" #include #include #include #include using std::set; using std::string; using std::vector; namespace jags { namespace base { Monitor *VarianceMonitorFactory::getMonitor(string const &name, Range const &range, BUGSModel *model, string const &type, string &msg) { if (type != "variance") return 0; NodeArray *array = model->symtab().getVariable(name); if (!array) { msg = string("Variable ") + name + " not found"; return 0; } VarianceMonitor *m = new VarianceMonitor(NodeArraySubset(array, range)); //Set name attributes m->setName(name + print(range)); Range node_range = range; if (isNULL(range)) { //Special syntactic rule: a null range corresponds to the whole //array node_range = array->range(); } vector elt_names; if (node_range.length() > 1) { for (RangeIterator i(node_range); !i.atEnd(); i.nextLeft()) { elt_names.push_back(name + print(i)); } } else { elt_names.push_back(name + print(range)); } m->setElementNames(elt_names); return m; } string VarianceMonitorFactory::name() const { return "base::Variance"; } }} JAGS-4.3.2/src/modules/base/rngs/0000755000175000017500000000000014400711325013364 500000000000000JAGS-4.3.2/src/modules/base/rngs/Makefile.am0000664000175000017500000000047714224052371015355 00000000000000noinst_LTLIBRARIES = libbaserngs.la libbaserngs_la_CPPFLAGS = -I$(top_srcdir)/src/include libbaserngs_la_SOURCES = MarsagliaRNG.cc WichmannHillRNG.cc SuperDuperRNG.cc \ MersenneTwisterRNG.cc BaseRNGFactory.cc noinst_HEADERS = MarsagliaRNG.h WichmannHillRNG.h SuperDuperRNG.h \ MersenneTwisterRNG.h BaseRNGFactory.h JAGS-4.3.2/src/modules/base/rngs/MarsagliaRNG.h0000664000175000017500000000070714224052514015734 00000000000000#ifndef _MARSAGLIA_RNG_H_ #define _MARSAGLIA_RNG_H_ #include namespace jags { namespace base { class MarsagliaRNG : public RmathRNG { unsigned int I[2]; void fixupSeeds(); public: MarsagliaRNG(unsigned int seed, NormKind norm_kind); void init(unsigned int seed); bool setState(std::vector const &state); void getState(std::vector &state) const; double uniform(); }; }} #endif /* _MARSAGLIA_RNG_H_ */ JAGS-4.3.2/src/modules/base/rngs/WichmannHillRNG.h0000664000175000017500000000073114224052514016406 00000000000000#ifndef _WICHMANN_HILL_RNG_H_ #define _WICHMANN_HILL_RNG_H_ #include namespace jags { namespace base { class WichmannHillRNG : public RmathRNG { unsigned int I[3]; void fixupSeeds(); public: WichmannHillRNG(unsigned int seed, NormKind norm_kind); double uniform(); void init(unsigned int seed); bool setState(std::vector const &state); void getState(std::vector &state) const; }; }} #endif /* _WICHMANN_HILL_RNG_H_ */ JAGS-4.3.2/src/modules/base/rngs/SuperDuperRNG.h0000664000175000017500000000071714224052514016133 00000000000000#ifndef _SUPER_DUPER_RNG_H_ #define _SUPER_DUPER_RNG_H_ #include namespace jags { namespace base { class SuperDuperRNG : public RmathRNG { unsigned int I[2]; void fixupSeeds(); public: SuperDuperRNG(unsigned int seed, NormKind norm_kind); double uniform(); void init(unsigned int seed); bool setState(std::vector const &state); void getState(std::vector &state) const; }; }} #endif /* _SUPER_DUPER_RNG_H_ */ JAGS-4.3.2/src/modules/base/rngs/MersenneTwisterRNG.h0000664000175000017500000000113614224052514017167 00000000000000#ifndef _MERSENNE_TWISTER_RNG_H_ #define _MERSENNE_TWISTER_RNG_H_ #include namespace jags { namespace base { class MersenneTwisterRNG : public RmathRNG { unsigned int dummy[625]; unsigned int *mt; /* the array for the state vector */ int mti; void fixupSeeds(bool init); void MT_sgenrand(unsigned int seed); public: MersenneTwisterRNG(unsigned int seed, NormKind norm_kind); void init(unsigned int seed); bool setState(std::vector const &state); void getState(std::vector &state) const; double uniform(); }; }} #endif /* MERSENNE_TWISTER_RNG_H_ */ JAGS-4.3.2/src/modules/base/rngs/BaseRNGFactory.h0000664000175000017500000000105614224052514016234 00000000000000#ifndef BASE_RNG_FACTORY_H_ #define BASE_RNG_FACTORY_H_ #include namespace jags { namespace base { /** * @short Factory object for Base Random Number Generators */ class BaseRNGFactory : public RNGFactory { unsigned int _index; unsigned int _seed; std::vector _rngvec; public: BaseRNGFactory(); ~BaseRNGFactory(); void setSeed(unsigned int seed); std::vector makeRNGs(unsigned int n); RNG * makeRNG(std::string const &name); std::string name() const; }; }} #endif /* BASE_RNG_FACTORY_H_ */ JAGS-4.3.2/src/modules/base/rngs/Makefile.in0000644000175000017500000006453314400675235015375 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/base/rngs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbaserngs_la_LIBADD = am_libbaserngs_la_OBJECTS = libbaserngs_la-MarsagliaRNG.lo \ libbaserngs_la-WichmannHillRNG.lo \ libbaserngs_la-SuperDuperRNG.lo \ libbaserngs_la-MersenneTwisterRNG.lo \ libbaserngs_la-BaseRNGFactory.lo libbaserngs_la_OBJECTS = $(am_libbaserngs_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libbaserngs_la-BaseRNGFactory.Plo \ ./$(DEPDIR)/libbaserngs_la-MarsagliaRNG.Plo \ ./$(DEPDIR)/libbaserngs_la-MersenneTwisterRNG.Plo \ ./$(DEPDIR)/libbaserngs_la-SuperDuperRNG.Plo \ ./$(DEPDIR)/libbaserngs_la-WichmannHillRNG.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libbaserngs_la_SOURCES) DIST_SOURCES = $(libbaserngs_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libbaserngs.la libbaserngs_la_CPPFLAGS = -I$(top_srcdir)/src/include libbaserngs_la_SOURCES = MarsagliaRNG.cc WichmannHillRNG.cc SuperDuperRNG.cc \ MersenneTwisterRNG.cc BaseRNGFactory.cc noinst_HEADERS = MarsagliaRNG.h WichmannHillRNG.h SuperDuperRNG.h \ MersenneTwisterRNG.h BaseRNGFactory.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/base/rngs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/base/rngs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libbaserngs.la: $(libbaserngs_la_OBJECTS) $(libbaserngs_la_DEPENDENCIES) $(EXTRA_libbaserngs_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libbaserngs_la_OBJECTS) $(libbaserngs_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbaserngs_la-BaseRNGFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbaserngs_la-MarsagliaRNG.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbaserngs_la-MersenneTwisterRNG.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbaserngs_la-SuperDuperRNG.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbaserngs_la-WichmannHillRNG.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libbaserngs_la-MarsagliaRNG.lo: MarsagliaRNG.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbaserngs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbaserngs_la-MarsagliaRNG.lo -MD -MP -MF $(DEPDIR)/libbaserngs_la-MarsagliaRNG.Tpo -c -o libbaserngs_la-MarsagliaRNG.lo `test -f 'MarsagliaRNG.cc' || echo '$(srcdir)/'`MarsagliaRNG.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbaserngs_la-MarsagliaRNG.Tpo $(DEPDIR)/libbaserngs_la-MarsagliaRNG.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MarsagliaRNG.cc' object='libbaserngs_la-MarsagliaRNG.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbaserngs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbaserngs_la-MarsagliaRNG.lo `test -f 'MarsagliaRNG.cc' || echo '$(srcdir)/'`MarsagliaRNG.cc libbaserngs_la-WichmannHillRNG.lo: WichmannHillRNG.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbaserngs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbaserngs_la-WichmannHillRNG.lo -MD -MP -MF $(DEPDIR)/libbaserngs_la-WichmannHillRNG.Tpo -c -o libbaserngs_la-WichmannHillRNG.lo `test -f 'WichmannHillRNG.cc' || echo '$(srcdir)/'`WichmannHillRNG.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbaserngs_la-WichmannHillRNG.Tpo $(DEPDIR)/libbaserngs_la-WichmannHillRNG.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='WichmannHillRNG.cc' object='libbaserngs_la-WichmannHillRNG.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbaserngs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbaserngs_la-WichmannHillRNG.lo `test -f 'WichmannHillRNG.cc' || echo '$(srcdir)/'`WichmannHillRNG.cc libbaserngs_la-SuperDuperRNG.lo: SuperDuperRNG.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbaserngs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbaserngs_la-SuperDuperRNG.lo -MD -MP -MF $(DEPDIR)/libbaserngs_la-SuperDuperRNG.Tpo -c -o libbaserngs_la-SuperDuperRNG.lo `test -f 'SuperDuperRNG.cc' || echo '$(srcdir)/'`SuperDuperRNG.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbaserngs_la-SuperDuperRNG.Tpo $(DEPDIR)/libbaserngs_la-SuperDuperRNG.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SuperDuperRNG.cc' object='libbaserngs_la-SuperDuperRNG.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbaserngs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbaserngs_la-SuperDuperRNG.lo `test -f 'SuperDuperRNG.cc' || echo '$(srcdir)/'`SuperDuperRNG.cc libbaserngs_la-MersenneTwisterRNG.lo: MersenneTwisterRNG.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbaserngs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbaserngs_la-MersenneTwisterRNG.lo -MD -MP -MF $(DEPDIR)/libbaserngs_la-MersenneTwisterRNG.Tpo -c -o libbaserngs_la-MersenneTwisterRNG.lo `test -f 'MersenneTwisterRNG.cc' || echo '$(srcdir)/'`MersenneTwisterRNG.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbaserngs_la-MersenneTwisterRNG.Tpo $(DEPDIR)/libbaserngs_la-MersenneTwisterRNG.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MersenneTwisterRNG.cc' object='libbaserngs_la-MersenneTwisterRNG.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbaserngs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbaserngs_la-MersenneTwisterRNG.lo `test -f 'MersenneTwisterRNG.cc' || echo '$(srcdir)/'`MersenneTwisterRNG.cc libbaserngs_la-BaseRNGFactory.lo: BaseRNGFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbaserngs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbaserngs_la-BaseRNGFactory.lo -MD -MP -MF $(DEPDIR)/libbaserngs_la-BaseRNGFactory.Tpo -c -o libbaserngs_la-BaseRNGFactory.lo `test -f 'BaseRNGFactory.cc' || echo '$(srcdir)/'`BaseRNGFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbaserngs_la-BaseRNGFactory.Tpo $(DEPDIR)/libbaserngs_la-BaseRNGFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='BaseRNGFactory.cc' object='libbaserngs_la-BaseRNGFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbaserngs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbaserngs_la-BaseRNGFactory.lo `test -f 'BaseRNGFactory.cc' || echo '$(srcdir)/'`BaseRNGFactory.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libbaserngs_la-BaseRNGFactory.Plo -rm -f ./$(DEPDIR)/libbaserngs_la-MarsagliaRNG.Plo -rm -f ./$(DEPDIR)/libbaserngs_la-MersenneTwisterRNG.Plo -rm -f ./$(DEPDIR)/libbaserngs_la-SuperDuperRNG.Plo -rm -f ./$(DEPDIR)/libbaserngs_la-WichmannHillRNG.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libbaserngs_la-BaseRNGFactory.Plo -rm -f ./$(DEPDIR)/libbaserngs_la-MarsagliaRNG.Plo -rm -f ./$(DEPDIR)/libbaserngs_la-MersenneTwisterRNG.Plo -rm -f ./$(DEPDIR)/libbaserngs_la-SuperDuperRNG.Plo -rm -f ./$(DEPDIR)/libbaserngs_la-WichmannHillRNG.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/base/rngs/MarsagliaRNG.cc0000664000175000017500000000242714224052371016074 00000000000000#include #include "MarsagliaRNG.h" using std::vector; #define i2_32m1 2.328306437080797e-10/* = 1/(2^32 - 1) */ namespace jags { namespace base { MarsagliaRNG::MarsagliaRNG(unsigned int seed, NormKind normkind) : RmathRNG("base::Marsaglia-Multicarry", normkind) { init(seed); } void MarsagliaRNG::fixupSeeds() { if (I[0] == 0) I[0] = 1; if (I[1] == 0) I[1] = 1; } void MarsagliaRNG::init(unsigned int seed) { /* Initial scrambling */ for(unsigned int j = 0; j < 50; j++) seed = (69069 * seed + 1); for (unsigned int j = 0; j < 2; j++) { seed = (69069 * seed + 1); I[j] = seed; } fixupSeeds(); } bool MarsagliaRNG::setState(vector const &state) { if (state.size() != 2) return false; I[0] = static_cast(state[0]); I[1] = static_cast(state[1]); fixupSeeds(); return true; } void MarsagliaRNG::getState(vector &state) const { state.clear(); state.push_back(static_cast(I[0])); state.push_back(static_cast(I[1])); } double MarsagliaRNG::uniform() { I[0]= 36969*(I[0] & 0177777) + (I[0]>>16); I[1]= 18000*(I[1] & 0177777) + (I[1]>>16); /* result in in [0,1) */ return fixup(((I[0] << 16)^(I[1] & 0177777)) * i2_32m1); } }} JAGS-4.3.2/src/modules/base/rngs/WichmannHillRNG.cc0000664000175000017500000000260714224052371016551 00000000000000#include "WichmannHillRNG.h" using std::vector; namespace jags { namespace base { void WichmannHillRNG::fixupSeeds() { I[0] = I[0] % 30269; I[1] = I[1] % 30307; I[2] = I[2] % 30323; /* map values equal to 0 mod modulus to 1. */ if(I[0] == 0) I[0] = 1; if(I[1] == 0) I[1] = 1; if(I[2] == 0) I[2] = 1; } WichmannHillRNG::WichmannHillRNG(unsigned int seed, NormKind normkind) : RmathRNG("base::Wichmann-Hill", normkind) { init(seed); } double WichmannHillRNG::uniform() { I[0] = I[0] * 171 % 30269; I[1] = I[1] * 172 % 30307; I[2] = I[2] * 170 % 30323; double value = I[0] / 30269.0 + I[1] / 30307.0 + I[2] / 30323.0; return fixup(value - (int) value); /* in [0,1) */ } void WichmannHillRNG::init(unsigned int seed) { /* Initial scrambling */ for(unsigned int j = 0; j < 50; j++) seed = (69069 * seed + 1); for(unsigned int j = 0; j < 3; ++j) { seed = (69069 * seed + 1); I[j] = seed; } fixupSeeds(); } bool WichmannHillRNG::setState(vector const &state) { if (state.size() != 3) return false; for (unsigned int i = 0; i < 3; ++i) { I[i] = static_cast(state[i]); } fixupSeeds(); return true; } void WichmannHillRNG::getState(vector &state) const { state.clear(); for (unsigned int i = 0; i < 3; ++i) { state.push_back(static_cast(I[i])); } } }} JAGS-4.3.2/src/modules/base/rngs/SuperDuperRNG.cc0000664000175000017500000000264014224052371016267 00000000000000#include "SuperDuperRNG.h" #define I1 I[0] #define I2 I[1] #define i2_32m1 2.328306437080797e-10/* = 1/(2^32 - 1) */ using std::vector; namespace jags { namespace base { SuperDuperRNG::SuperDuperRNG(unsigned int seed, NormKind norm_kind) : RmathRNG("base::Super-Duper", norm_kind) { init(seed); } void SuperDuperRNG::fixupSeeds() { if(I1 == 0) I1 = 1; /* I2 = Congruential: must be ODD */ I2 |= 1; } double SuperDuperRNG::uniform() { /* This is Reeds et al (1984) implementation; * modified using __unsigned__ seeds instead of signed ones */ I1 ^= ((I1 >> 15) & 0377777); /* Tausworthe */ I1 ^= I1 << 17; I2 *= 69069; /* Congruential */ return fixup((I1^I2) * i2_32m1); /* in [0,1) */ } void SuperDuperRNG::init(unsigned int seed) { /* Initial scrambling */ for(unsigned int j = 0; j < 50; j++) seed = (69069 * seed + 1); for (unsigned int j = 0; j < 2; j++) { seed = (69069 * seed + 1); I[j] = seed; } fixupSeeds(); } bool SuperDuperRNG::setState(vector const &state) { if (state.size() != 2) return false; for (unsigned int j = 0; j < 2; j++) { I[j] = static_cast(state[j]); } fixupSeeds(); return true; } void SuperDuperRNG::getState(vector &state) const { state.clear(); for (unsigned int j = 0; j < 2; j++) { state.push_back(static_cast(I[j])); } } }} JAGS-4.3.2/src/modules/base/rngs/MersenneTwisterRNG.cc0000664000175000017500000001160714224052371017332 00000000000000#include #include "MersenneTwisterRNG.h" /* =================== Mersenne Twister ========================== */ /* From http://www.math.keio.ac.jp/~matumoto/emt.html */ /* A C-program for MT19937: Real number version([0,1)-interval) (1999/10/28) genrand() generates one pseudorandom real number (double) which is uniformly distributed on [0,1)-interval, for each call. sgenrand(seed) sets initial values to the working area of 624 words. Before genrand(), sgenrand(seed) must be called once. (seed is any 32-bit integer.) Integer generator is obtained by modifying two lines. Coded by Takuji Nishimura, considering the suggestions by Topher Cooper and Marc Rieffel in July-Aug. 1997. Copyright (C) 1997, 1999 Makoto Matsumoto and Takuji Nishimura. When you use this, send an email to: matumoto@math.keio.ac.jp with an appropriate reference to your work. REFERENCE M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions on Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3--30. */ /* 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) using std::vector; namespace jags { namespace base { MersenneTwisterRNG::MersenneTwisterRNG(unsigned int seed, NormKind norm_kind) : RmathRNG("base::Mersenne-Twister", norm_kind), mt(dummy+1), mti(N+1) { /* mti==N+1 means mt[N] is not initialized */ init(seed); } void MersenneTwisterRNG::MT_sgenrand(unsigned int seed) { int i; for (i = 0; i < N; i++) { mt[i] = seed & 0xffff0000; seed = 69069 * seed + 1; mt[i] |= (seed & 0xffff0000) >> 16; seed = 69069 * seed + 1; } mti = N; } /* Theoretically, there are 2^19937-1 possible states as an intial state. Essential bits in "seed_array[]" is following 19937 bits: (seed_array[0]&UPPER_MASK), seed_array[1], ..., seed_array[N-1]. (seed_array[0]&LOWER_MASK) is discarded. Theoretically, (seed_array[0]&UPPER_MASK), seed_array[1], ..., seed_array[N-1] can take any values except all zeros. */ double MersenneTwisterRNG::uniform() { unsigned int y; static const unsigned int mag01[2]={0x0, MATRIX_A}; /* mag01[x] = x * MATRIX_A for x=0,1 */ mti = dummy[0]; if (mti >= N) { /* generate N words at one time */ int kk; if (mti == N+1) /* if init() has not been called, */ MT_sgenrand(4357); /* a default initial seed is used */ for (kk = 0; kk < N - M; kk++) { y = (mt[kk] & UPPER_MASK) | (mt[kk+1] & LOWER_MASK); mt[kk] = mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1]; } for (; kk < N - 1; kk++) { y = (mt[kk] & UPPER_MASK) | (mt[kk+1] & LOWER_MASK); mt[kk] = mt[kk+(M-N)] ^ (y >> 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); dummy[0] = mti; /* reals: [0,1)-interval */ return fixup( (double)y * 2.3283064365386963e-10 ); } void MersenneTwisterRNG::init(unsigned int seed) { /* Initial scrambling */ for(unsigned int j = 0; j < 50; j++) seed = (69069 * seed + 1); for(unsigned int j = 0; j < 625; j++) { seed = (69069 * seed + 1); dummy[j] = seed; } fixupSeeds(true); } void MersenneTwisterRNG::fixupSeeds(bool initial) { //bool notallzero = false; if(initial) dummy[0] = 624; /* No action unless user has corrupted .Random.seed */ if(dummy[0] <= 0) dummy[0] = 624; } static bool notAllZero(unsigned int const *I) { /* Check that not all seeds are zero. This is an invalid seed. Whereas R randomizes the seed based on the current time stamp, we want to return an error when this happens. */ for (unsigned int j = 1; j <= 624; j++) { if(I[j] != 0) { return true; } } return false; } bool MersenneTwisterRNG::setState(vector const &state) { if (state.size() != 625) return false; for (unsigned int j = 0; j < 625; ++j) { dummy[j] = static_cast(state[j]); } fixupSeeds(false); return notAllZero(dummy); } void MersenneTwisterRNG::getState(vector &state) const { state.clear(); state.reserve(625); for (unsigned int j = 0; j < 625; ++j) { state.push_back(static_cast(dummy[j])); } } }} JAGS-4.3.2/src/modules/base/rngs/BaseRNGFactory.cc0000664000175000017500000000407414224052514016375 00000000000000#include "BaseRNGFactory.h" #include "WichmannHillRNG.h" #include "MarsagliaRNG.h" #include "SuperDuperRNG.h" #include "MersenneTwisterRNG.h" #include #include using std::vector; using std::time; using std::string; #define DEFAULT_NORM_KIND KINDERMAN_RAMAGE namespace jags { namespace base { BaseRNGFactory::BaseRNGFactory() : _index(0), _seed(static_cast(time(NULL))) { } BaseRNGFactory::~BaseRNGFactory() { for (unsigned int i = 0; i < _rngvec.size(); ++i) { delete _rngvec[i]; } } void BaseRNGFactory::setSeed(unsigned int seed) { _seed = seed; } vector BaseRNGFactory::makeRNGs(unsigned int n) { vector ans; for (unsigned int i = 0; i < n; i++) { RNG *rng = 0; switch(_index) { case 0: rng = new WichmannHillRNG(_seed, DEFAULT_NORM_KIND); break; case 1: rng = new MarsagliaRNG(_seed, DEFAULT_NORM_KIND); break; case 2: rng = new SuperDuperRNG(_seed, DEFAULT_NORM_KIND); break; case 3: rng = new MersenneTwisterRNG(_seed, DEFAULT_NORM_KIND); break; default: break; } //Move onto the next generator _index = (_index + 1) % 4; //Reset the seed _seed = static_cast(rng->uniform() * UINT_MAX); // Store generated RNG for memory management _rngvec.push_back(rng); ans.push_back(rng); } return ans; } RNG * BaseRNGFactory::makeRNG(string const &name) { unsigned int seed = static_cast(time(NULL)); RNG *rng = 0; if (name == "base::Wichmann-Hill") rng = new WichmannHillRNG(seed, DEFAULT_NORM_KIND); else if (name == "base::Marsaglia-Multicarry") rng = new MarsagliaRNG(seed, DEFAULT_NORM_KIND); else if (name == "base::Super-Duper") rng = new SuperDuperRNG(seed, DEFAULT_NORM_KIND); else if (name == "base::Mersenne-Twister") rng = new MersenneTwisterRNG(seed, DEFAULT_NORM_KIND); else return 0; _rngvec.push_back(rng); return rng; } string BaseRNGFactory::name() const { return "base::BaseRNG"; } }} JAGS-4.3.2/src/modules/bugs/0000755000175000017500000000000014400711325012441 500000000000000JAGS-4.3.2/src/modules/bugs/Makefile.am0000664000175000017500000000253014224052371014422 00000000000000SUBDIRS = distributions functions samplers matrix jagsmod_LTLIBRARIES = bugs.la bugs_la_SOURCES = bugs.cc bugs_la_CPPFLAGS = -I$(top_srcdir)/src/include bugs_la_LIBADD = distributions/libbugsdist.la \ functions/libbugsfunc.la \ samplers/libbugssampler.la \ matrix/libbugsmatrix.la \ $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la \ @LAPACK_LIBS@ @BLAS_LIBS@ bugs_la_LDFLAGS = -module -avoid-version if WINDOWS bugs_la_LDFLAGS += -no-undefined endif ### Test library if CANCHECK check_LTLIBRARIES = libbugstest.la libbugstest_la_SOURCES = testbugs.cc testbugs.h libbugstest_la_CPPFLAGS = -I$(top_srcdir)/src/include libbugstest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) libbugstest_la_LDFLAGS = $(CPPUNIT_LDFLAGS) libbugstest_la_LIBADD = functions/libbugsfuntest.la \ functions/libbugsfunc.la \ distributions/libbugsdisttest.la \ distributions/libbugsdist.la \ matrix/libbugsmatrix.la \ $(top_builddir)/src/modules/base/rngs/libbaserngs.la \ $(top_builddir)/src/lib/libtest.la \ $(top_builddir)/src/lib/libjags.la \ $(top_builddir)/src/jrmath/libjrmath.la \ @LAPACK_LIBS@ @BLAS_LIBS@ if WINDOWS libbugstest_la_LDFLAGS += -no-undefined else libbugstest_la_LIBADD += @FLIBS@ endif endif JAGS-4.3.2/src/modules/bugs/Makefile.in0000644000175000017500000010010514400675235014434 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WINDOWS_TRUE@am__append_1 = -no-undefined @CANCHECK_TRUE@@WINDOWS_TRUE@am__append_2 = -no-undefined @CANCHECK_TRUE@@WINDOWS_FALSE@am__append_3 = @FLIBS@ subdir = src/modules/bugs ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(jagsmoddir)" LTLIBRARIES = $(jagsmod_LTLIBRARIES) bugs_la_DEPENDENCIES = distributions/libbugsdist.la \ functions/libbugsfunc.la samplers/libbugssampler.la \ matrix/libbugsmatrix.la \ $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la am_bugs_la_OBJECTS = bugs_la-bugs.lo bugs_la_OBJECTS = $(am_bugs_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = bugs_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(bugs_la_LDFLAGS) $(LDFLAGS) -o $@ am__DEPENDENCIES_1 = @CANCHECK_TRUE@libbugstest_la_DEPENDENCIES = \ @CANCHECK_TRUE@ functions/libbugsfuntest.la \ @CANCHECK_TRUE@ functions/libbugsfunc.la \ @CANCHECK_TRUE@ distributions/libbugsdisttest.la \ @CANCHECK_TRUE@ distributions/libbugsdist.la \ @CANCHECK_TRUE@ matrix/libbugsmatrix.la \ @CANCHECK_TRUE@ $(top_builddir)/src/modules/base/rngs/libbaserngs.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libtest.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libjags.la \ @CANCHECK_TRUE@ $(top_builddir)/src/jrmath/libjrmath.la \ @CANCHECK_TRUE@ $(am__DEPENDENCIES_1) am__libbugstest_la_SOURCES_DIST = testbugs.cc testbugs.h @CANCHECK_TRUE@am_libbugstest_la_OBJECTS = libbugstest_la-testbugs.lo libbugstest_la_OBJECTS = $(am_libbugstest_la_OBJECTS) libbugstest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libbugstest_la_CXXFLAGS) $(CXXFLAGS) \ $(libbugstest_la_LDFLAGS) $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libbugstest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/bugs_la-bugs.Plo \ ./$(DEPDIR)/libbugstest_la-testbugs.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(bugs_la_SOURCES) $(libbugstest_la_SOURCES) DIST_SOURCES = $(bugs_la_SOURCES) $(am__libbugstest_la_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = distributions functions samplers matrix jagsmod_LTLIBRARIES = bugs.la bugs_la_SOURCES = bugs.cc bugs_la_CPPFLAGS = -I$(top_srcdir)/src/include bugs_la_LIBADD = distributions/libbugsdist.la \ functions/libbugsfunc.la \ samplers/libbugssampler.la \ matrix/libbugsmatrix.la \ $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la \ @LAPACK_LIBS@ @BLAS_LIBS@ bugs_la_LDFLAGS = -module -avoid-version $(am__append_1) ### Test library @CANCHECK_TRUE@check_LTLIBRARIES = libbugstest.la @CANCHECK_TRUE@libbugstest_la_SOURCES = testbugs.cc testbugs.h @CANCHECK_TRUE@libbugstest_la_CPPFLAGS = -I$(top_srcdir)/src/include @CANCHECK_TRUE@libbugstest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) @CANCHECK_TRUE@libbugstest_la_LDFLAGS = $(CPPUNIT_LDFLAGS) \ @CANCHECK_TRUE@ $(am__append_2) @CANCHECK_TRUE@libbugstest_la_LIBADD = functions/libbugsfuntest.la \ @CANCHECK_TRUE@ functions/libbugsfunc.la \ @CANCHECK_TRUE@ distributions/libbugsdisttest.la \ @CANCHECK_TRUE@ distributions/libbugsdist.la \ @CANCHECK_TRUE@ matrix/libbugsmatrix.la \ @CANCHECK_TRUE@ $(top_builddir)/src/modules/base/rngs/libbaserngs.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libtest.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libjags.la \ @CANCHECK_TRUE@ $(top_builddir)/src/jrmath/libjrmath.la \ @CANCHECK_TRUE@ @LAPACK_LIBS@ @BLAS_LIBS@ $(am__append_3) all: all-recursive .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/bugs/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/bugs/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-jagsmodLTLIBRARIES: $(jagsmod_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(jagsmoddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(jagsmoddir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(jagsmoddir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(jagsmoddir)"; \ } uninstall-jagsmodLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(jagsmoddir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(jagsmoddir)/$$f"; \ done clean-jagsmodLTLIBRARIES: -test -z "$(jagsmod_LTLIBRARIES)" || rm -f $(jagsmod_LTLIBRARIES) @list='$(jagsmod_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } bugs.la: $(bugs_la_OBJECTS) $(bugs_la_DEPENDENCIES) $(EXTRA_bugs_la_DEPENDENCIES) $(AM_V_CXXLD)$(bugs_la_LINK) -rpath $(jagsmoddir) $(bugs_la_OBJECTS) $(bugs_la_LIBADD) $(LIBS) libbugstest.la: $(libbugstest_la_OBJECTS) $(libbugstest_la_DEPENDENCIES) $(EXTRA_libbugstest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libbugstest_la_LINK) $(am_libbugstest_la_rpath) $(libbugstest_la_OBJECTS) $(libbugstest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bugs_la-bugs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugstest_la-testbugs.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< bugs_la-bugs.lo: bugs.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bugs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT bugs_la-bugs.lo -MD -MP -MF $(DEPDIR)/bugs_la-bugs.Tpo -c -o bugs_la-bugs.lo `test -f 'bugs.cc' || echo '$(srcdir)/'`bugs.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bugs_la-bugs.Tpo $(DEPDIR)/bugs_la-bugs.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='bugs.cc' object='bugs_la-bugs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bugs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o bugs_la-bugs.lo `test -f 'bugs.cc' || echo '$(srcdir)/'`bugs.cc libbugstest_la-testbugs.lo: testbugs.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugstest_la_CPPFLAGS) $(CPPFLAGS) $(libbugstest_la_CXXFLAGS) $(CXXFLAGS) -MT libbugstest_la-testbugs.lo -MD -MP -MF $(DEPDIR)/libbugstest_la-testbugs.Tpo -c -o libbugstest_la-testbugs.lo `test -f 'testbugs.cc' || echo '$(srcdir)/'`testbugs.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugstest_la-testbugs.Tpo $(DEPDIR)/libbugstest_la-testbugs.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testbugs.cc' object='libbugstest_la-testbugs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugstest_la_CPPFLAGS) $(CPPFLAGS) $(libbugstest_la_CXXFLAGS) $(CXXFLAGS) -c -o libbugstest_la-testbugs.lo `test -f 'testbugs.cc' || echo '$(srcdir)/'`testbugs.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(jagsmoddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-checkLTLIBRARIES clean-generic \ clean-jagsmodLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/bugs_la-bugs.Plo -rm -f ./$(DEPDIR)/libbugstest_la-testbugs.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-jagsmodLTLIBRARIES install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/bugs_la-bugs.Plo -rm -f ./$(DEPDIR)/libbugstest_la-testbugs.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-jagsmodLTLIBRARIES .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-checkLTLIBRARIES \ clean-generic clean-jagsmodLTLIBRARIES clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-jagsmodLTLIBRARIES \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-jagsmodLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/bugs/bugs.cc0000664000175000017500000001314514224052514013640 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::vector; namespace jags { namespace bugs { class BUGSModule : public Module { public: BUGSModule(); ~BUGSModule(); }; BUGSModule::BUGSModule() : Module("bugs") { //Load distributions insert(new DBern); insert(new DBeta); insert(new DBin); insert(new DCat); insert(new DChisqr); insert(new DDexp); insert(new DDirch); insert(new DExp); insert(new DF); insert(new DGamma); insert(new DGenGamma); insert(new DLnorm); insert(new DLogis); insert(new DMNorm); insert(new DMNormVC); insert(new DMT); insert(new DMulti); insert(new DNChisqr); insert(new DNegBin); insert(new DNorm); insert(new DNT); insert(new DPar); insert(new DPois); insert(new DRW1); insert(new DSample); insert(new DT); insert(new DUnif); insert(new DWeib); insert(new DWish); insert(new DHyper); //Load functions insert(new Abs); insert(new ArcCos); insert(new ArcCosh); insert(new ArcSin); insert(new ArcSinh); insert(new ArcTan); insert(new ArcTanh); insert(new Combine); insert(new Cos); insert(new Cosh); insert(new CLogLog); insert(new Exp); insert(new Equals); insert(new ICLogLog); insert(new IfElse); insert(new ILogit); insert(new InProd); insert(new InterpLin); insert(new Inverse); insert(new Log); insert(new LogDet); insert(new LogFact); insert(new LogGam); insert(new Logit); insert(new MatMult); insert(new Max); insert(new Mean); insert(new Min); insert(new Order); insert(new Phi); insert(new Probit); insert(new Prod); insert(new Rank); insert(new Rep); insert(new Round); insert(new SD); insert(new Sin); insert(new Sinh); insert(new Sort); insert(new Sqrt); insert(new Step); insert(new Sum); insert(new Tan); insert(new Tanh); insert(new Transpose); insert(new Trunc); //Load observable functions insert(new DSum, new DSumFunc); insert(new DInterval, new DIntervalFunc); insert(new DRound, new DRoundFunc); insert(new SumDist, new Sum); //Load sampler factories insert(new MNormalFactory); insert(new DirichletFactory); insert(new ConjugateFactory); //insert(new REFactory); insert(new DSumFactory); insert(new SumFactory); insert(new CensoredFactory); insert(new RW1Factory); insert(new BinomSliceFactory); } BUGSModule::~BUGSModule() { vector const &dvec = distributions(); for (unsigned int i = 0; i < dvec.size(); ++i) { delete dvec[i]; } vector const &fvec = functions(); for (unsigned int i = 0; i < fvec.size(); ++i) { delete fvec[i]; } vector const &svec = samplerFactories(); for (unsigned int i = 0; i < svec.size(); ++i) { delete svec[i]; } } }} jags::bugs::BUGSModule _bugs_module; JAGS-4.3.2/src/modules/bugs/testbugs.cc0000664000175000017500000000042214224052515014533 00000000000000#include "testbugs.h" #include "functions/testbugsfun.h" #include "distributions/testbugsdist.h" #include void init_bugs_test() { CPPUNIT_TEST_SUITE_REGISTRATION( BugsFunTest ); CPPUNIT_TEST_SUITE_REGISTRATION( BugsDistTest ); } JAGS-4.3.2/src/modules/bugs/testbugs.h0000664000175000017500000000013514224052371014376 00000000000000#ifndef BUGS_TEST_H_ #define BUGS_TEST_H_ void init_bugs_test(); #endif /* BUGS_TEST_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/0000755000175000017500000000000014400711325015343 500000000000000JAGS-4.3.2/src/modules/bugs/distributions/Makefile.am0000664000175000017500000000210114224052514017315 00000000000000noinst_LTLIBRARIES = libbugsdist.la libbugsdist_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/bugs/matrix libbugsdist_la_SOURCES = DBern.cc DCat.cc DDirch.cc DHyper.cc DLogis.cc \ DMulti.cc DSum.cc DWeib.cc DBeta.cc DChisqr.cc DExp.cc DInterval.cc \ DMNorm.cc DNegBin.cc DPar.cc DT.cc DWish.cc DBin.cc DDexp.cc DGamma.cc \ DLnorm.cc DNorm.cc DPois.cc DUnif.cc DMT.cc DGenGamma.cc \ DF.cc DNChisqr.cc DRound.cc DNT.cc SumDist.cc DSample.cc DRW1.cc \ DMNormVC.cc noinst_HEADERS = DBern.h DCat.h DDirch.h DHyper.h DLogis.h DMulti.h \ DSum.h DWeib.h DBeta.h DChisqr.h DExp.h DInterval.h DMNorm.h \ DNegBin.h DPar.h DT.h DWish.h DBin.h DDexp.h DGamma.h DLnorm.h \ DNorm.h DPois.h DUnif.h DMT.h DGenGamma.h DF.h DNChisqr.h DRound.h \ DNT.h SumDist.h DSample.h DRW1.h DMNormVC.h ### Test library if CANCHECK check_LTLIBRARIES = libbugsdisttest.la libbugsdisttest_la_SOURCES = testbugsdist.cc testbugsdist.h libbugsdisttest_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/base/rngs libbugsdisttest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) endif JAGS-4.3.2/src/modules/bugs/distributions/DBern.h0000664000175000017500000000224514224052514016435 00000000000000#ifndef DBERN_H_ #define DBERN_H_ #include namespace jags { namespace bugs { /** * @short Bernoulli distribution *
 * R ~ dbern(p)
 * f(r | p) = p^r * (1 - p)^(1 -r) ; r in 0:1
 * 
*/ class DBern : public ScalarDist { public: DBern(); double logDensity(double x, PDFType type, std::vector const ¶meters, double const *lbound, double const *ubound) const; double randomSample(std::vector const ¶meters, double const *lbound, double const *ubound, RNG *rng) const; double typicalValue(std::vector const ¶meters, double const *lbound, double const *ubound) const; /** Checks that p lies in the open interval (0,1) */ bool checkParameterValue(std::vector const ¶meters) const; /** Bernoulli distribution cannot be bounded */ bool canBound() const; /** Bernoulli distribution is discrete valued */ bool isDiscreteValued(std::vector const &mask) const; double KL(std::vector const &par1, std::vector const &par2) const; }; }} #endif /* DBERN_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DCat.h0000664000175000017500000000341414224052514016255 00000000000000#ifndef DCAT_H_ #define DCAT_H_ #include namespace jags { namespace bugs { /** * @short Categorical distribution *
 * R ~ dcat(p[])
 * f(r|p[]) = p[r] ; r in 1:length(p)
 * 
*/ class DCat : public VectorDist { public: DCat(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lbound, double const *ubound, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lbound, double const *ubound) const; /** * Checks that all elements of p are positive */ bool checkParameterValue(std::vector const ¶meters, std::vector const &lengths) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector const &lengths) const; bool isSupportFixed(std::vector const &fixmask) const; bool isDiscreteValued(std::vector const &mask) const; bool checkParameterLength(std::vector const &lengths) const; unsigned int length(std::vector const &lengths) const; double KL(std::vector const &par0, std::vector const &par1, std::vector const &lengths) const; }; }} #endif /* DCAT_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DDirch.h0000664000175000017500000000443414224052514016602 00000000000000#ifndef DDIRCH_H_ #define DDIRCH_H_ #include namespace jags { namespace bugs { /** * @short Dirichlet distribution * * Zero shape parameters are allowed. These represent structural * zeros: when x ~ ddirch(alpha) is forward sampled, x[i] = 0 when * alpha[i] = 0. * *
 * p[] ~ ddirch(alpha[])
 * f(p | alpha) = C * prod(p^(alpha-1))
 * 
*/ class DDirch : public VectorDist { public: DDirch(); std::string alias() const; double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meter, std::vector const &lengths, double const *lower, double const *upper) const; unsigned int length(std::vector const &lengths) const; /** * Checks that alpha is a vector of length at least 2 */ bool checkParameterLength(std::vector const &lengths) const; /** * Checks that each element of alpha is >= 0. * * Structural zeros are allowed in the Dirichlet distribution. * These are represented by the elements of alpha that are set to * zero. This is permitted only if alpha is fixed and there is at * least one non-zero element of alpha. */ bool checkParameterValue(std::vector const ¶meters, std::vector const &lengths) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector const &lengths) const; bool isSupportFixed(std::vector const &fixmask) const; unsigned int df(std::vector const &lengths) const; double KL(std::vector const &par0, std::vector const &par1, std::vector const &len) const; }; }} #endif /* DDIRCH_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DHyper.h0000664000175000017500000000230014224052514016626 00000000000000#ifndef DHYPER_H_ #define DHYPER_H_ #include namespace jags { namespace bugs { /** * @short Hypergeometric distribution *
 * R ~ dhyper(n1,n2,m1,psi)
 * 
*/ class DHyper : public RScalarDist { public: DHyper(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double x, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; double l(std::vector const ¶meters) const; double u(std::vector const ¶meters) const; /** * Checks that n1, n2, m1 are discrete */ bool checkParameterDiscrete (std::vector const &mask) const; bool checkParameterValue(std::vector const ¶meters) const; bool isSupportFixed(std::vector const &fixmask) const; bool canBound() const; double KL(std::vector const &par1, std::vector const &par2) const; }; }} #endif /* DHYPER_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DLogis.h0000664000175000017500000000151014224052514016616 00000000000000#ifndef DLOGIS_H_ #define DLOGIS_H_ #include namespace jags { namespace bugs { /** * Logistic distribution *
 * X ~ dlogis(mu, tau)
 * P(X <= x | mu, tau) = 1/(1 + exp(-(x - mu) * tau))
 * 
*/ class DLogis : public RScalarDist { public: DLogis(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that tau > 0 */ bool checkParameterValue(std::vector const ¶meters) const; }; }} #endif /* DLOGIS_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DMulti.h0000664000175000017500000000404714224052514016643 00000000000000#ifndef DMULTI_H_ #define DMULTI_H_ #include struct RNG; namespace jags { namespace bugs { /** *
 * X[] ~ dmulti(p[], N)
 * f(x | p, N) = prod (p^x) ; sum(x) = N
 * 
* @short Multinomial distribution */ class DMulti : public VectorDist { public: DMulti(); double logDensity(double const *x, unsigned int length, PDFType tpye, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const &par, std::vector const &lengths, double const *lower, double const *upper) const; /** * Checks that elements of p lie in range (0,1) and * and sum to 1. Checks that N >= 1 */ bool checkParameterValue(std::vector const ¶meters, std::vector const &lengths) const; /** Checks that N is a scalar */ bool checkParameterLength(std::vector const &lengths) const; /** Checks that N is discrete-valued */ bool checkParameterDiscrete(std::vector const &mask) const; unsigned int length(std::vector const &dim) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector const &lengths) const; bool isSupportFixed(std::vector const &fixmask) const; unsigned int df(std::vector const &lengths) const; bool isDiscreteValued(std::vector const &mask) const; double KL(std::vector const &par1, std::vector const &par2, std::vector const &lengths) const; std::string alias() const; }; }} #endif /* DMULTI_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DSum.h0000664000175000017500000000331714224052514016314 00000000000000#ifndef DSUM_H_ #define DSUM_H_ #include namespace jags { namespace bugs { /** * @short Sum of 2 or more random variables */ class DSum : public ArrayDist { public: DSum(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; bool isSupportFixed(std::vector const &fixmask) const; bool isDiscreteValued(std::vector const &mask) const; unsigned int df(std::vector > const &dims) const; bool checkParameterValue(std::vector const ¶ms, std::vector > const &dims) const; bool checkParameterDim(std::vector > const &dims) const; bool checkParameterDiscrete(std::vector const &mask) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector > const &dims) const; std::vector dim(std::vector > const &dims) const; }; }} #endif /* DSUM_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DWeib.h0000664000175000017500000000154614224052514016440 00000000000000#ifndef DWEIB_H_ #define DWEIB_H_ #include namespace jags { namespace bugs { /** *
 * x ~ dweib(a, b)
 * f(x|b,a) = a * b * x^(b - 1) * exp (- a * x^b)
 * 
* @short Weibull distribution */ class DWeib : public RScalarDist { public: DWeib(); std::string alias() const; double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that a > 0, b > 0 */ bool checkParameterValue(std::vector const ¶meters) const; }; }} #endif /* DWEIB_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DBeta.h0000664000175000017500000000167614224052514016431 00000000000000#ifndef DBETA_H_ #define DBETA_H_ #include namespace jags { namespace bugs { /** * @short Beta distribution *
 * P ~ dbeta(a, b)
 * f(p|a,b) = C(a,b) * p^(a -1) * (1 - p)^(b - 1) ; 0 < p < 1
 * 
*/ class DBeta : public RScalarDist { public: DBeta(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that a > 0, b > 0 */ bool checkParameterValue(std::vector const ¶meters) const; double KL(std::vector const &par1, std::vector const &par2) const; }; }} #endif /* DBETA_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DChisqr.h0000664000175000017500000000174314224052514017002 00000000000000#ifndef DCHISQ_H_ #define DCHISQ_H_ #include namespace jags { namespace bugs { /** * @short Chi square distribution *
 * x ~ dchisq(k)
 * f(x|k) = 2^(-k/2) * x^(k/2 - 1) * exp(-x/2) / gamma(x/2); k > 0
 * 
*/ class DChisqr : public RScalarDist { public: DChisqr(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that k > 0 */ bool checkParameterValue(std::vector const ¶meters) const; std::string alias() const; double KL(std::vector const &par0, std::vector const &par1) const; }; }} #endif /* DCHISQ_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DExp.h0000664000175000017500000000166314224052514016306 00000000000000#ifndef DEXP_H_ #define DEXP_H_ #include namespace jags { namespace bugs { /** * @short Exponential distribution *
 *  x ~ dexp(lambda)
 *  f(x | lambda) = lambda * exp(-lambda * x) ; x >= 0
 * 
*/ class DExp : public RScalarDist { public: DExp(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that lambda > 0 */ bool checkParameterValue(std::vector const ¶meters) const; double KL(std::vector const &par0, std::vector const &par1) const; }; }} #endif /* DEXP_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DInterval.h0000664000175000017500000000364414224052514017337 00000000000000#ifndef DINTERVAL_H_ #define DINTERVAL_H_ #include namespace jags { namespace bugs { /** * @short Interval censored distribution *
 * i ~ dinterval(t, cutpoints[])
 * f(i|t) = 1 if t < cutpoints[i] and t >= cutpoints[i-1]
 *        = 0 otherwise
 * 
*/ class DInterval : public VectorDist { public: DInterval(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; /** * Checks that cutpoints are in ascending order */ bool checkParameterValue(std::vector const ¶meters, std::vector const &lengths) const; bool checkParameterLength(std::vector const &lengths) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector const &lengths) const; bool isSupportFixed(std::vector const &fixmask) const; unsigned int df(std::vector const &lengths) const; bool isDiscreteValued(std::vector const &mask) const; unsigned int length(std::vector const ¶ms) const; double KL(std::vector const &par0, std::vector const &par1, std::vector const &lengths) const; }; }} #endif /* DINTERVAL_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DMNorm.h0000664000175000017500000000521314224052514016575 00000000000000#ifndef DMNORM_H_ #define DMNORM_H_ #include namespace jags { struct RNG; namespace bugs { /** * @short Multivariate normal distribution *
 * x[] ~ dmnorm(mu[], T[,])
 * f(x | mu, T) = sqrt(det(T)) * exp(-1/2 * (x-mu) %*% T %*% t(x-mu))
 * 
*/ class DMNorm : public ArrayDist { public: DMNorm(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; /** * Checks that mu is a vector, T is a square matrix and the sizes of * mu and T conform. */ bool checkParameterDim(std::vector > const &dims) const; /** * Checks that T is symmetric. Note that there is currently NO CHECK * that T is positive definite. */ bool checkParameterValue(std::vector const ¶meters, std::vector > const &dims) const; std::vector dim(std::vector > const &dims) const; /** * Convenience random sampler function * * @param x Array that will hold the result * * @param mu Array of mean values. A null pointer may be given, and in * this case a mean of zero is used. * * @param tau Either the precision matrix or the variance-covariance * matrix. Only the lower triangle is used. * * @param prec Logical flag. If true then tau represents the * precision matrix (the parameterization used in the bugs language). * If false then tau represents the variance-covariance matrix. * * @param nrow length of x and mu; number of rows of the square matrix tau * * @param rng Random number generator */ static void randomsample(double *x, double const *mu, double const *tau, bool prec, int nrow, RNG *rng); void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector > const &dims) const; bool isSupportFixed(std::vector const &fixmask) const; }; }} #endif /* DMNORM_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DNegBin.h0000664000175000017500000000200314224052514016701 00000000000000#ifndef DNEGBIN_H_ #define DNEGBIN_H_ #include namespace jags { namespace bugs { /** *
 * x ~ dnegbin(p, r)
 * f(x|p,r) = ((x+r-1)!/(x!*(r-1)!)) * p^r * (1-p)^x
 * 
* @short Negative Binomial distribution */ class DNegBin : public RScalarDist { public: DNegBin(); std::string alias() const; double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that p lies in the interval (0,1) and r > 0 */ bool checkParameterValue(std::vector const ¶meters) const; double KL(std::vector const &par0, std::vector const &par1) const; }; }} #endif /* DNEGBIN_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DPar.h0000664000175000017500000000201714224052514016266 00000000000000#ifndef DPAR_H_ #define DPAR_H_ #include namespace jags { namespace bugs { /** *
 * x ~ dpar(alpha, c);
 * f(x|alpha,c) = alpha * c^alpha * x^-(alpha + 1); x > c
 * 
* @short Pareto distribution */ class DPar : public RScalarDist { public: DPar(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; double l(std::vector const ¶meters) const; double u(std::vector const ¶meters) const; /** * Checks that alpha > 0, c > 0 */ bool checkParameterValue(std::vector const ¶meters) const; bool isSupportFixed(std::vector const &fixmask) const; }; }} #endif /* DPAR_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DT.h0000664000175000017500000000164214224052514015752 00000000000000#ifndef DT_H_ #define DT_H_ #include namespace jags { namespace bugs { /** * t-distribution on k degrees of freedom, with median mu and * scale parameter tau. *
 * f(x|mu, tau, k)
 * f(x|0,1,k) = Gamma((k+1)/2) / (sqrt(k*pi) Gamma(k/2)) (1 + x^2/k)^-((k+1)/2)
 * 
* @short t distribution */ class DT : public RScalarDist { public: DT(); double d(double x, PDFType type, std::vector const ¶meters, bool log) const; double p(double x, std::vector const ¶meters, bool lower, bool log) const; double q(double x, std::vector const ¶meters, bool lower, bool log) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Check that tau > 0 and k > 0 */ bool checkParameterValue(std::vector const ¶meters) const; }; }} #endif /* DT_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DWish.h0000664000175000017500000000373114224052514016462 00000000000000#ifndef DWISH_H_ #define DWISH_H_ #include namespace jags { namespace bugs { /** *
 * x[] ~ dwish(R[,], k)
 * 
* @short Wishart distribution */ class DWish : public ArrayDist { public: DWish(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper, RNG *rng) const; //FIXME: Can we retire this? static void randomSample(double *x, int length, double const *R, double k, int nrow, RNG *rng); void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; /** * Checks that R is a square matrix and k is a scalar */ bool checkParameterDim(std::vector > const &dims) const; /** * Checks that R is symmetric and k >= nrow(R). There is * currently no check that R is positive definite */ bool checkParameterValue(std::vector const ¶meters, std::vector > const &dims) const; std::vector dim(std::vector > const &dims) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector > const &dims) const; bool isSupportFixed(std::vector const &fixmask) const; unsigned int df(std::vector > const &dims) const; }; }} #endif /* DWISH_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DBin.h0000664000175000017500000000243614224052514016261 00000000000000#ifndef DBIN_H_ #define DBIN_H_ #include namespace jags { namespace bugs { /** * @short Binomial distribution *
 * R ~ dbin(p, n)
 * f(r|p,n) = n!/r!.(n - r)! p^r * (1 - p)^(n - r) ; r in 0:n
 * 
*/ class DBin : public RScalarDist { public: DBin(); std::string alias() const; double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double x, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; double l(std::vector const ¶meters) const; double u(std::vector const ¶meters) const; /** * Checks that n is discrete-valued. */ bool checkParameterDiscrete (std::vector const &mask) const; /** * Checks that p lies in (0,1) and n > 1 */ bool checkParameterValue(std::vector const ¶meters) const; bool isSupportFixed(std::vector const &fixmask) const; double KL(std::vector const &par1, std::vector const &par2) const; }; }} #endif /* DBIN_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DDexp.h0000664000175000017500000000167414224052514016454 00000000000000#ifndef DDEXP_H_ #define DDEXP_H_ #include namespace jags { namespace bugs { /** * @short Double exponential distribution *
 * x ~ ddexp(mu,tau)
 * f(x|mu,tau) = (tau/2) * exp(-tau * abs(x-mu))
 * 
*/ class DDexp : public RScalarDist { public: DDexp(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that tau > 0 */ bool checkParameterValue(std::vector const ¶meters) const; double KL(std::vector const &par1, std::vector const &par2) const; }; }} #endif /* DDEXP_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DGamma.h0000664000175000017500000000210514224052514016564 00000000000000#ifndef DGAMMA_H_ #define DGAMMA_H_ #include namespace jags { namespace bugs { /** * @short gamma distribution *
 * X ~ dgamma(r, mu)
 * f(x|r,mu) = mu^r * x^(r - 1) * exp(-mu * x)
 * 
*/ class DGamma : public RScalarDist { public: DGamma(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that r > 0, mu > 0 */ bool checkParameterValue(std::vector const ¶meters) const; /** * The mean */ double typicalValue(std::vector const &par, double const *lower, double const *upper) const; double KL(std::vector const &par0, std::vector const &par1) const; }; }} #endif /* DGAMMA_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DLnorm.h0000664000175000017500000000171114224052514016633 00000000000000#ifndef DLNORM_H_ #define DLNORM_H_ #include namespace jags { namespace bugs { /** * @short Lognormal distribution *
 * x ~ dlnorm(mu, tau)
 * f(x|mu,tau) = (sqrt(tau)/x) * exp(tau * (log(x) - mu)^2 / 2)
 * 
*/ class DLnorm : public RScalarDist { public: DLnorm(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that tau > 0 */ bool checkParameterValue(std::vector const ¶meters) const; double KL(std::vector const &par0, std::vector const &par1) const; }; }} #endif /* DLNORM_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DNorm.h0000664000175000017500000000237114224052514016462 00000000000000#ifndef DNORM_H_ #define DNORM_H_ #include namespace jags { namespace bugs { /** *
 * x ~ dnorm(mu, tau)
 * f(x | mu, tau) = sqrt(tau) * exp(-1/2 * tau * (x - mu)^2)
 * 
* @short Normal distribution */ class DNorm : public RScalarDist { public: DNorm(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that tau > 0 */ bool checkParameterValue(std::vector const ¶meters) const; /** * Exploits the capacity to sample truncted normal distributions * that is built into the JAGS library, overloading the generic * functionality of RScalarDist. */ double randomSample(std::vector const &par, double const *lower, double const *upper, RNG *rng) const; double KL(std::vector const &par0, std::vector const &par1) const; }; }} #endif /* DNORM_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DPois.h0000664000175000017500000000170014224052514016454 00000000000000#ifndef DPOIS_H_ #define DPOIS_H_ #include namespace jags { namespace bugs { /** *
 * r ~ dpois(lambda)
 * f(r|lambda) = exp(-lambda) * lambda^r / r! ; r = 0, 1 ,...
 * 
* @short Poisson distribution */ class DPois : public RScalarDist { public: DPois(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that lambda > 0 */ bool checkParameterValue(std::vector const ¶meters) const; double KL(std::vector const &par0, std::vector const &par1) const; }; }} #endif /* DPOIS_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DUnif.h0000664000175000017500000000221014224052514016440 00000000000000#ifndef DUNIF_H_ #define DUNIF_H_ #include namespace jags { namespace bugs { /** *
 * x ~ dunif(a, b)
 * f(x|a,b) = 1/(a - b) ; a <= x <= b
 * 
* @short Uniform distribution */ class DUnif : public ScalarDist { public: DUnif(); double logDensity(double x, PDFType type, std::vector const ¶meters, double const *lower, double const *upper) const; double randomSample(std::vector const ¶meters, double const *lower, double const *upper, RNG *rng) const; double typicalValue(std::vector const ¶meters, double const *lower, double const *upper) const; double l(std::vector const ¶meters) const; double u(std::vector const ¶meters) const; /** * Checks that a < b */ bool checkParameterValue(std::vector const ¶meters) const; bool isSupportFixed(std::vector const &fixmask) const; double KL(std::vector const &par0, std::vector const &par1) const; }; }} #endif /* DUNIF_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DMT.h0000664000175000017500000000343114224052514016065 00000000000000#ifndef DMT_H_ #define DMT_H_ #include namespace jags { namespace bugs { /** * @short Multivariate t distribution *
 * x[] ~ dmt(mu[], T[,], k)
 * 
*/ class DMT: public ArrayDist { public: DMT(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; /** * Checks that mu is a vector, T is a square matrix and the sizes of * mu and T conform. */ bool checkParameterDim(std::vector > const &dims) const; /** * Checks that T is symmetric and that k >= 2. Note that there is * currently NO CHECK that T is positive definite. */ bool checkParameterValue(std::vector const ¶meters, std::vector > const &dims) const; std::vector dim(std::vector > const &dims) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector > const &dims) const; bool isSupportFixed(std::vector const &fixmask) const; }; }} #endif /* DMT_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DGenGamma.h0000664000175000017500000000205114224052514017216 00000000000000#ifndef DGEN_GAMMA_H_ #define DGEN_GAMMA_H_ #include namespace jags { namespace bugs { /** * @short Generalizedgamma distribution *
 * X ~ dgen.gamma(r, mu, beta)
 * f(x|r,mu) = beta * mu^(beta*r) * x^(beta*r - 1) * exp(-(mu * x)^beta) / gamma(r)
 * 
*/ class DGenGamma : public RScalarDist { public: DGenGamma(); std::string alias() const; double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Checks that r > 0, mu > 0, beta > 0 */ bool checkParameterValue(std::vector const ¶meters) const; double KL(std::vector const &par1, std::vector const &par2) const; }; }} #endif /* DGEN_GAMMA_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DF.h0000664000175000017500000000173514224052514015737 00000000000000#ifndef DF_H_ #define DF_H_ #include namespace jags { namespace bugs { /** * F distribution on n1, n2 degrees of freedom *
 * f(x| n1, n2) = Gamma((n1 + n2)/2) / (Gamma(n1/2) Gamma(n2/2))       
 *                (n1/n2)^(n1/2) x^(n1/2 - 1)                  
 *                (1 + (n1/n2) x)^-(n1 + n2)/2   
 * 
* @short F distribution */ class DF : public RScalarDist { public: DF(); double d(double x, PDFType type, std::vector const ¶meters, bool log) const; double p(double x, std::vector const ¶meters, bool lower, bool log) const; double q(double x, std::vector const ¶meters, bool lower, bool log) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Check that tau > 0 and n1 > 0 and n2 > 0 */ bool checkParameterValue(std::vector const ¶meters) const; }; }} #endif /* DF_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DNChisqr.h0000664000175000017500000000167414224052514017123 00000000000000#ifndef DNCHISQ_H_ #define DNCHISQ_H_ #include namespace jags { namespace bugs { /** * @short Non-central Chi square distribution *
     * x ~ dnchisqr(k, delta)
     * f(x | k, delta) = exp(-delta/2) 
     *                   SUM_{r=0}^Inf ((delta/2)^r / r!) dchisq(x, k + 2r)
     * 
*/ class DNChisqr : public RScalarDist { public: DNChisqr(); double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double q, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; bool checkParameterValue(std::vector const ¶meters) const; std::string alias() const; }; }} #endif /* DNCHISQ_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DRound.h0000664000175000017500000000237014224052514016635 00000000000000#ifndef DROUND_H_ #define DROUND_H_ #include namespace jags { namespace bugs { /** * @short Rounded observations *
 * x ~ dround(t, d)
 * f(x|t,d) = 1 if x = t rounded to d decimal places
 *          = 0 otherwise
 * 
*/ class DRound : public ScalarDist { public: DRound(); bool checkParameterValue(std::vector const ¶meters) const; bool checkParameterDiscrete(std::vector const &mask) const; double logDensity(double const x, PDFType type, std::vector const ¶meters, double const *lower, double const *upper) const; double randomSample(std::vector const ¶meters, double const *lower, double const *upper, RNG *rng) const; double typicalValue(std::vector const ¶meters, double const *lower, double const *upper) const; double l(std::vector const ¶meters) const; double u(std::vector const ¶meters) const; bool isSupportFixed(std::vector const &fixmask) const; unsigned int df() const; double KL(std::vector const &par0, std::vector const &par1) const; }; }} #endif /* DROUND_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DNT.h0000664000175000017500000000312714224052514016070 00000000000000#ifndef DNT_H_ #define DNT_H_ #include namespace jags { namespace bugs { /** * Non-central t-distribution on k degrees of freedom, with * location/non-centrality parameter parameter mu, and * precision parameter tau. * * The non-central t has no simple closed-form expression for * its density but it can be defined constructively in terms * of underlying normal and chi-squared distributions. * *
         * X ~ dnt(mu, tau, k)
	 * X = U/sqrt(V/k))
	 * U ~ N(mu, tau)
	 * V ~ Chi2(k)
	 * 
* * The non-central t-distribution is normally only defined for * tau=1, in which case mu is the non-centrality * parameter. The 3-parameter form here is a scaled version of * a standard non-central t with non-centrality parameter * delta = mu * sqrt(tau). * * @short non-central t distribution */ class DNT : public RScalarDist { public: DNT(); double d(double x, PDFType type, std::vector const ¶meters, bool log) const; double p(double x, std::vector const ¶meters, bool lower, bool log) const; double q(double x, std::vector const ¶meters, bool lower, bool log) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Check that tau > 0 and k > 0 also that the non-centrality * parameter delta = mu * sqrt(tau) is no larger than 37.62 */ bool checkParameterValue(std::vector const & parameters) const; }; } } #endif /* DNT_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/SumDist.h0000664000175000017500000000320114224052514017024 00000000000000#ifndef SUM_DIST_H_ #define SUM_DIST_H_ #include namespace jags { namespace bugs { /** * @short Sum of 2 or more random variables */ class SumDist : public VectorDist { public: SumDist(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; bool isSupportFixed(std::vector const &fixmask) const; bool isDiscreteValued(std::vector const &mask) const; unsigned int df(std::vector const &lengths) const; bool checkParameterValue(std::vector const ¶ms, std::vector const &lengths) const; bool checkParameterLength(std::vector const &lengths) const; bool checkParameterDiscrete(std::vector const &mask) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector const &lengths) const; unsigned int length(std::vector const &lengths) const; }; }} #endif /* SUM_DIST_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DSample.h0000664000175000017500000000367014224052514016773 00000000000000#ifndef DSAMPLE_H_ #define DSAMPLE_H_ #include struct RNG; namespace jags { namespace bugs { /** *
 X[] ~ dsample(p[], K) 
* * Sample K elements without replacement using a vector of * probability weights p. Sampled values have indicator * 1. Non-sampled values have indicator 0. * * For sampling with replacement see DMulti. * * @short Sample without replacement */ class DSample : public VectorDist { public: DSample(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const &par, std::vector const &lengths, double const *lower, double const *upper) const; bool checkParameterValue(std::vector const &par, std::vector const &lengths) const; bool checkParameterLength(std::vector const &lengths) const; bool checkParameterDiscrete(std::vector const &mask) const; unsigned int length(std::vector const &lengths) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector const &lengths) const; bool isSupportFixed(std::vector const &fixmask) const; unsigned int df(std::vector const &lengths) const; bool isDiscreteValued(std::vector const &mask) const; }; } } #endif /* DSAMPLE_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DRW1.h0000664000175000017500000000300714224052514016155 00000000000000#ifndef DRW1_H_ #define DRW1_H_ #include namespace jags { namespace bugs { /** * @short First order random walk * *
 * y[] ~ drw1(tau, x[])
 * 
*/ class DRW1 : public VectorDist { public: DRW1(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meter, std::vector const &lengths, double const *lower, double const *upper) const; unsigned int length(std::vector const &lengths) const; bool checkParameterLength(std::vector const &lengths) const; bool checkParameterValue(std::vector const ¶meters, std::vector const &lengths) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector const &lengths) const; bool isSupportFixed(std::vector const &fixmask) const; unsigned int df(std::vector const &lengths) const; }; }} #endif /* DRW1_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/DMNormVC.h0000664000175000017500000000531214224052514017026 00000000000000#ifndef DMNORM_VC_H_ #define DMNORM_VC_H_ #include namespace jags { struct RNG; namespace bugs { /** * @short Multivariate normal distribution with mean-variance parameterization *
 * x[] ~ dmnorm.vcov(mu[], T[,])
 * f(x | mu, T) = exp(-1/2 * (x-mu) %*% inverse(T) %*% t(x-mu)) / sqrt(det(T))
 * 
*/ class DMNormVC : public ArrayDist { public: DMNormVC(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; /** * Checks that mu is a vector, T is a square matrix and the sizes of * mu and T conform. */ bool checkParameterDim(std::vector > const &dims) const; /** * Checks that T is symmetric. Note that there is currently NO CHECK * that T is positive definite. */ bool checkParameterValue(std::vector const ¶meters, std::vector > const &dims) const; std::vector dim(std::vector > const &dims) const; /** * Convenience random sampler function * * @param x Array that will hold the result * * @param mu Array of mean values. A null pointer may be given, and in * this case a mean of zero is used. * * @param tau Either the precision matrix or the variance-covariance * matrix. Only the lower triangle is used. * * @param prec Logical flag. If true then tau represents the * precision matrix (the parameterization used in the bugs language). * If false then tau represents the variance-covariance matrix. * * @param nrow length of x and mu; number of rows of the square matrix tau * * @param rng Random number generator */ static void randomsample(double *x, double const *mu, double const *tau, bool prec, int nrow, RNG *rng); void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector > const &dims) const; bool isSupportFixed(std::vector const &fixmask) const; }; }} #endif /* DMNORM_VC_H_ */ JAGS-4.3.2/src/modules/bugs/distributions/Makefile.in0000644000175000017500000020730614400675235017351 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/bugs/distributions ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbugsdist_la_LIBADD = am_libbugsdist_la_OBJECTS = libbugsdist_la-DBern.lo \ libbugsdist_la-DCat.lo libbugsdist_la-DDirch.lo \ libbugsdist_la-DHyper.lo libbugsdist_la-DLogis.lo \ libbugsdist_la-DMulti.lo libbugsdist_la-DSum.lo \ libbugsdist_la-DWeib.lo libbugsdist_la-DBeta.lo \ libbugsdist_la-DChisqr.lo libbugsdist_la-DExp.lo \ libbugsdist_la-DInterval.lo libbugsdist_la-DMNorm.lo \ libbugsdist_la-DNegBin.lo libbugsdist_la-DPar.lo \ libbugsdist_la-DT.lo libbugsdist_la-DWish.lo \ libbugsdist_la-DBin.lo libbugsdist_la-DDexp.lo \ libbugsdist_la-DGamma.lo libbugsdist_la-DLnorm.lo \ libbugsdist_la-DNorm.lo libbugsdist_la-DPois.lo \ libbugsdist_la-DUnif.lo libbugsdist_la-DMT.lo \ libbugsdist_la-DGenGamma.lo libbugsdist_la-DF.lo \ libbugsdist_la-DNChisqr.lo libbugsdist_la-DRound.lo \ libbugsdist_la-DNT.lo libbugsdist_la-SumDist.lo \ libbugsdist_la-DSample.lo libbugsdist_la-DRW1.lo \ libbugsdist_la-DMNormVC.lo libbugsdist_la_OBJECTS = $(am_libbugsdist_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libbugsdisttest_la_LIBADD = am__libbugsdisttest_la_SOURCES_DIST = testbugsdist.cc testbugsdist.h @CANCHECK_TRUE@am_libbugsdisttest_la_OBJECTS = \ @CANCHECK_TRUE@ libbugsdisttest_la-testbugsdist.lo libbugsdisttest_la_OBJECTS = $(am_libbugsdisttest_la_OBJECTS) libbugsdisttest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libbugsdisttest_la_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libbugsdisttest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libbugsdist_la-DBern.Plo \ ./$(DEPDIR)/libbugsdist_la-DBeta.Plo \ ./$(DEPDIR)/libbugsdist_la-DBin.Plo \ ./$(DEPDIR)/libbugsdist_la-DCat.Plo \ ./$(DEPDIR)/libbugsdist_la-DChisqr.Plo \ ./$(DEPDIR)/libbugsdist_la-DDexp.Plo \ ./$(DEPDIR)/libbugsdist_la-DDirch.Plo \ ./$(DEPDIR)/libbugsdist_la-DExp.Plo \ ./$(DEPDIR)/libbugsdist_la-DF.Plo \ ./$(DEPDIR)/libbugsdist_la-DGamma.Plo \ ./$(DEPDIR)/libbugsdist_la-DGenGamma.Plo \ ./$(DEPDIR)/libbugsdist_la-DHyper.Plo \ ./$(DEPDIR)/libbugsdist_la-DInterval.Plo \ ./$(DEPDIR)/libbugsdist_la-DLnorm.Plo \ ./$(DEPDIR)/libbugsdist_la-DLogis.Plo \ ./$(DEPDIR)/libbugsdist_la-DMNorm.Plo \ ./$(DEPDIR)/libbugsdist_la-DMNormVC.Plo \ ./$(DEPDIR)/libbugsdist_la-DMT.Plo \ ./$(DEPDIR)/libbugsdist_la-DMulti.Plo \ ./$(DEPDIR)/libbugsdist_la-DNChisqr.Plo \ ./$(DEPDIR)/libbugsdist_la-DNT.Plo \ ./$(DEPDIR)/libbugsdist_la-DNegBin.Plo \ ./$(DEPDIR)/libbugsdist_la-DNorm.Plo \ ./$(DEPDIR)/libbugsdist_la-DPar.Plo \ ./$(DEPDIR)/libbugsdist_la-DPois.Plo \ ./$(DEPDIR)/libbugsdist_la-DRW1.Plo \ ./$(DEPDIR)/libbugsdist_la-DRound.Plo \ ./$(DEPDIR)/libbugsdist_la-DSample.Plo \ ./$(DEPDIR)/libbugsdist_la-DSum.Plo \ ./$(DEPDIR)/libbugsdist_la-DT.Plo \ ./$(DEPDIR)/libbugsdist_la-DUnif.Plo \ ./$(DEPDIR)/libbugsdist_la-DWeib.Plo \ ./$(DEPDIR)/libbugsdist_la-DWish.Plo \ ./$(DEPDIR)/libbugsdist_la-SumDist.Plo \ ./$(DEPDIR)/libbugsdisttest_la-testbugsdist.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libbugsdist_la_SOURCES) $(libbugsdisttest_la_SOURCES) DIST_SOURCES = $(libbugsdist_la_SOURCES) \ $(am__libbugsdisttest_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libbugsdist.la libbugsdist_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/bugs/matrix libbugsdist_la_SOURCES = DBern.cc DCat.cc DDirch.cc DHyper.cc DLogis.cc \ DMulti.cc DSum.cc DWeib.cc DBeta.cc DChisqr.cc DExp.cc DInterval.cc \ DMNorm.cc DNegBin.cc DPar.cc DT.cc DWish.cc DBin.cc DDexp.cc DGamma.cc \ DLnorm.cc DNorm.cc DPois.cc DUnif.cc DMT.cc DGenGamma.cc \ DF.cc DNChisqr.cc DRound.cc DNT.cc SumDist.cc DSample.cc DRW1.cc \ DMNormVC.cc noinst_HEADERS = DBern.h DCat.h DDirch.h DHyper.h DLogis.h DMulti.h \ DSum.h DWeib.h DBeta.h DChisqr.h DExp.h DInterval.h DMNorm.h \ DNegBin.h DPar.h DT.h DWish.h DBin.h DDexp.h DGamma.h DLnorm.h \ DNorm.h DPois.h DUnif.h DMT.h DGenGamma.h DF.h DNChisqr.h DRound.h \ DNT.h SumDist.h DSample.h DRW1.h DMNormVC.h ### Test library @CANCHECK_TRUE@check_LTLIBRARIES = libbugsdisttest.la @CANCHECK_TRUE@libbugsdisttest_la_SOURCES = testbugsdist.cc testbugsdist.h @CANCHECK_TRUE@libbugsdisttest_la_CPPFLAGS = -I$(top_srcdir)/src/include \ @CANCHECK_TRUE@ -I$(top_srcdir)/src/modules/base/rngs @CANCHECK_TRUE@libbugsdisttest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/bugs/distributions/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/bugs/distributions/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libbugsdist.la: $(libbugsdist_la_OBJECTS) $(libbugsdist_la_DEPENDENCIES) $(EXTRA_libbugsdist_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libbugsdist_la_OBJECTS) $(libbugsdist_la_LIBADD) $(LIBS) libbugsdisttest.la: $(libbugsdisttest_la_OBJECTS) $(libbugsdisttest_la_DEPENDENCIES) $(EXTRA_libbugsdisttest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libbugsdisttest_la_LINK) $(am_libbugsdisttest_la_rpath) $(libbugsdisttest_la_OBJECTS) $(libbugsdisttest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DBern.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DBeta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DBin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DCat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DChisqr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DDexp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DDirch.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DExp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DF.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DGamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DGenGamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DHyper.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DInterval.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DLnorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DLogis.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DMNorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DMNormVC.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DMT.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DMulti.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DNChisqr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DNT.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DNegBin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DNorm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DPar.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DPois.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DRW1.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DRound.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DSample.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DSum.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DT.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DUnif.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DWeib.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-DWish.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdist_la-SumDist.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsdisttest_la-testbugsdist.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libbugsdist_la-DBern.lo: DBern.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DBern.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DBern.Tpo -c -o libbugsdist_la-DBern.lo `test -f 'DBern.cc' || echo '$(srcdir)/'`DBern.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DBern.Tpo $(DEPDIR)/libbugsdist_la-DBern.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DBern.cc' object='libbugsdist_la-DBern.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DBern.lo `test -f 'DBern.cc' || echo '$(srcdir)/'`DBern.cc libbugsdist_la-DCat.lo: DCat.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DCat.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DCat.Tpo -c -o libbugsdist_la-DCat.lo `test -f 'DCat.cc' || echo '$(srcdir)/'`DCat.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DCat.Tpo $(DEPDIR)/libbugsdist_la-DCat.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DCat.cc' object='libbugsdist_la-DCat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DCat.lo `test -f 'DCat.cc' || echo '$(srcdir)/'`DCat.cc libbugsdist_la-DDirch.lo: DDirch.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DDirch.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DDirch.Tpo -c -o libbugsdist_la-DDirch.lo `test -f 'DDirch.cc' || echo '$(srcdir)/'`DDirch.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DDirch.Tpo $(DEPDIR)/libbugsdist_la-DDirch.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DDirch.cc' object='libbugsdist_la-DDirch.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DDirch.lo `test -f 'DDirch.cc' || echo '$(srcdir)/'`DDirch.cc libbugsdist_la-DHyper.lo: DHyper.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DHyper.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DHyper.Tpo -c -o libbugsdist_la-DHyper.lo `test -f 'DHyper.cc' || echo '$(srcdir)/'`DHyper.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DHyper.Tpo $(DEPDIR)/libbugsdist_la-DHyper.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DHyper.cc' object='libbugsdist_la-DHyper.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DHyper.lo `test -f 'DHyper.cc' || echo '$(srcdir)/'`DHyper.cc libbugsdist_la-DLogis.lo: DLogis.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DLogis.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DLogis.Tpo -c -o libbugsdist_la-DLogis.lo `test -f 'DLogis.cc' || echo '$(srcdir)/'`DLogis.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DLogis.Tpo $(DEPDIR)/libbugsdist_la-DLogis.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DLogis.cc' object='libbugsdist_la-DLogis.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DLogis.lo `test -f 'DLogis.cc' || echo '$(srcdir)/'`DLogis.cc libbugsdist_la-DMulti.lo: DMulti.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DMulti.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DMulti.Tpo -c -o libbugsdist_la-DMulti.lo `test -f 'DMulti.cc' || echo '$(srcdir)/'`DMulti.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DMulti.Tpo $(DEPDIR)/libbugsdist_la-DMulti.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DMulti.cc' object='libbugsdist_la-DMulti.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DMulti.lo `test -f 'DMulti.cc' || echo '$(srcdir)/'`DMulti.cc libbugsdist_la-DSum.lo: DSum.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DSum.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DSum.Tpo -c -o libbugsdist_la-DSum.lo `test -f 'DSum.cc' || echo '$(srcdir)/'`DSum.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DSum.Tpo $(DEPDIR)/libbugsdist_la-DSum.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DSum.cc' object='libbugsdist_la-DSum.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DSum.lo `test -f 'DSum.cc' || echo '$(srcdir)/'`DSum.cc libbugsdist_la-DWeib.lo: DWeib.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DWeib.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DWeib.Tpo -c -o libbugsdist_la-DWeib.lo `test -f 'DWeib.cc' || echo '$(srcdir)/'`DWeib.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DWeib.Tpo $(DEPDIR)/libbugsdist_la-DWeib.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DWeib.cc' object='libbugsdist_la-DWeib.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DWeib.lo `test -f 'DWeib.cc' || echo '$(srcdir)/'`DWeib.cc libbugsdist_la-DBeta.lo: DBeta.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DBeta.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DBeta.Tpo -c -o libbugsdist_la-DBeta.lo `test -f 'DBeta.cc' || echo '$(srcdir)/'`DBeta.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DBeta.Tpo $(DEPDIR)/libbugsdist_la-DBeta.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DBeta.cc' object='libbugsdist_la-DBeta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DBeta.lo `test -f 'DBeta.cc' || echo '$(srcdir)/'`DBeta.cc libbugsdist_la-DChisqr.lo: DChisqr.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DChisqr.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DChisqr.Tpo -c -o libbugsdist_la-DChisqr.lo `test -f 'DChisqr.cc' || echo '$(srcdir)/'`DChisqr.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DChisqr.Tpo $(DEPDIR)/libbugsdist_la-DChisqr.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DChisqr.cc' object='libbugsdist_la-DChisqr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DChisqr.lo `test -f 'DChisqr.cc' || echo '$(srcdir)/'`DChisqr.cc libbugsdist_la-DExp.lo: DExp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DExp.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DExp.Tpo -c -o libbugsdist_la-DExp.lo `test -f 'DExp.cc' || echo '$(srcdir)/'`DExp.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DExp.Tpo $(DEPDIR)/libbugsdist_la-DExp.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DExp.cc' object='libbugsdist_la-DExp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DExp.lo `test -f 'DExp.cc' || echo '$(srcdir)/'`DExp.cc libbugsdist_la-DInterval.lo: DInterval.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DInterval.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DInterval.Tpo -c -o libbugsdist_la-DInterval.lo `test -f 'DInterval.cc' || echo '$(srcdir)/'`DInterval.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DInterval.Tpo $(DEPDIR)/libbugsdist_la-DInterval.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DInterval.cc' object='libbugsdist_la-DInterval.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DInterval.lo `test -f 'DInterval.cc' || echo '$(srcdir)/'`DInterval.cc libbugsdist_la-DMNorm.lo: DMNorm.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DMNorm.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DMNorm.Tpo -c -o libbugsdist_la-DMNorm.lo `test -f 'DMNorm.cc' || echo '$(srcdir)/'`DMNorm.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DMNorm.Tpo $(DEPDIR)/libbugsdist_la-DMNorm.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DMNorm.cc' object='libbugsdist_la-DMNorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DMNorm.lo `test -f 'DMNorm.cc' || echo '$(srcdir)/'`DMNorm.cc libbugsdist_la-DNegBin.lo: DNegBin.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DNegBin.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DNegBin.Tpo -c -o libbugsdist_la-DNegBin.lo `test -f 'DNegBin.cc' || echo '$(srcdir)/'`DNegBin.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DNegBin.Tpo $(DEPDIR)/libbugsdist_la-DNegBin.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DNegBin.cc' object='libbugsdist_la-DNegBin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DNegBin.lo `test -f 'DNegBin.cc' || echo '$(srcdir)/'`DNegBin.cc libbugsdist_la-DPar.lo: DPar.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DPar.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DPar.Tpo -c -o libbugsdist_la-DPar.lo `test -f 'DPar.cc' || echo '$(srcdir)/'`DPar.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DPar.Tpo $(DEPDIR)/libbugsdist_la-DPar.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DPar.cc' object='libbugsdist_la-DPar.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DPar.lo `test -f 'DPar.cc' || echo '$(srcdir)/'`DPar.cc libbugsdist_la-DT.lo: DT.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DT.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DT.Tpo -c -o libbugsdist_la-DT.lo `test -f 'DT.cc' || echo '$(srcdir)/'`DT.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DT.Tpo $(DEPDIR)/libbugsdist_la-DT.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DT.cc' object='libbugsdist_la-DT.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DT.lo `test -f 'DT.cc' || echo '$(srcdir)/'`DT.cc libbugsdist_la-DWish.lo: DWish.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DWish.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DWish.Tpo -c -o libbugsdist_la-DWish.lo `test -f 'DWish.cc' || echo '$(srcdir)/'`DWish.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DWish.Tpo $(DEPDIR)/libbugsdist_la-DWish.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DWish.cc' object='libbugsdist_la-DWish.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DWish.lo `test -f 'DWish.cc' || echo '$(srcdir)/'`DWish.cc libbugsdist_la-DBin.lo: DBin.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DBin.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DBin.Tpo -c -o libbugsdist_la-DBin.lo `test -f 'DBin.cc' || echo '$(srcdir)/'`DBin.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DBin.Tpo $(DEPDIR)/libbugsdist_la-DBin.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DBin.cc' object='libbugsdist_la-DBin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DBin.lo `test -f 'DBin.cc' || echo '$(srcdir)/'`DBin.cc libbugsdist_la-DDexp.lo: DDexp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DDexp.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DDexp.Tpo -c -o libbugsdist_la-DDexp.lo `test -f 'DDexp.cc' || echo '$(srcdir)/'`DDexp.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DDexp.Tpo $(DEPDIR)/libbugsdist_la-DDexp.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DDexp.cc' object='libbugsdist_la-DDexp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DDexp.lo `test -f 'DDexp.cc' || echo '$(srcdir)/'`DDexp.cc libbugsdist_la-DGamma.lo: DGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DGamma.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DGamma.Tpo -c -o libbugsdist_la-DGamma.lo `test -f 'DGamma.cc' || echo '$(srcdir)/'`DGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DGamma.Tpo $(DEPDIR)/libbugsdist_la-DGamma.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DGamma.cc' object='libbugsdist_la-DGamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DGamma.lo `test -f 'DGamma.cc' || echo '$(srcdir)/'`DGamma.cc libbugsdist_la-DLnorm.lo: DLnorm.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DLnorm.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DLnorm.Tpo -c -o libbugsdist_la-DLnorm.lo `test -f 'DLnorm.cc' || echo '$(srcdir)/'`DLnorm.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DLnorm.Tpo $(DEPDIR)/libbugsdist_la-DLnorm.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DLnorm.cc' object='libbugsdist_la-DLnorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DLnorm.lo `test -f 'DLnorm.cc' || echo '$(srcdir)/'`DLnorm.cc libbugsdist_la-DNorm.lo: DNorm.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DNorm.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DNorm.Tpo -c -o libbugsdist_la-DNorm.lo `test -f 'DNorm.cc' || echo '$(srcdir)/'`DNorm.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DNorm.Tpo $(DEPDIR)/libbugsdist_la-DNorm.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DNorm.cc' object='libbugsdist_la-DNorm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DNorm.lo `test -f 'DNorm.cc' || echo '$(srcdir)/'`DNorm.cc libbugsdist_la-DPois.lo: DPois.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DPois.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DPois.Tpo -c -o libbugsdist_la-DPois.lo `test -f 'DPois.cc' || echo '$(srcdir)/'`DPois.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DPois.Tpo $(DEPDIR)/libbugsdist_la-DPois.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DPois.cc' object='libbugsdist_la-DPois.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DPois.lo `test -f 'DPois.cc' || echo '$(srcdir)/'`DPois.cc libbugsdist_la-DUnif.lo: DUnif.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DUnif.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DUnif.Tpo -c -o libbugsdist_la-DUnif.lo `test -f 'DUnif.cc' || echo '$(srcdir)/'`DUnif.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DUnif.Tpo $(DEPDIR)/libbugsdist_la-DUnif.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DUnif.cc' object='libbugsdist_la-DUnif.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DUnif.lo `test -f 'DUnif.cc' || echo '$(srcdir)/'`DUnif.cc libbugsdist_la-DMT.lo: DMT.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DMT.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DMT.Tpo -c -o libbugsdist_la-DMT.lo `test -f 'DMT.cc' || echo '$(srcdir)/'`DMT.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DMT.Tpo $(DEPDIR)/libbugsdist_la-DMT.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DMT.cc' object='libbugsdist_la-DMT.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DMT.lo `test -f 'DMT.cc' || echo '$(srcdir)/'`DMT.cc libbugsdist_la-DGenGamma.lo: DGenGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DGenGamma.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DGenGamma.Tpo -c -o libbugsdist_la-DGenGamma.lo `test -f 'DGenGamma.cc' || echo '$(srcdir)/'`DGenGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DGenGamma.Tpo $(DEPDIR)/libbugsdist_la-DGenGamma.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DGenGamma.cc' object='libbugsdist_la-DGenGamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DGenGamma.lo `test -f 'DGenGamma.cc' || echo '$(srcdir)/'`DGenGamma.cc libbugsdist_la-DF.lo: DF.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DF.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DF.Tpo -c -o libbugsdist_la-DF.lo `test -f 'DF.cc' || echo '$(srcdir)/'`DF.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DF.Tpo $(DEPDIR)/libbugsdist_la-DF.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DF.cc' object='libbugsdist_la-DF.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DF.lo `test -f 'DF.cc' || echo '$(srcdir)/'`DF.cc libbugsdist_la-DNChisqr.lo: DNChisqr.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DNChisqr.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DNChisqr.Tpo -c -o libbugsdist_la-DNChisqr.lo `test -f 'DNChisqr.cc' || echo '$(srcdir)/'`DNChisqr.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DNChisqr.Tpo $(DEPDIR)/libbugsdist_la-DNChisqr.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DNChisqr.cc' object='libbugsdist_la-DNChisqr.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DNChisqr.lo `test -f 'DNChisqr.cc' || echo '$(srcdir)/'`DNChisqr.cc libbugsdist_la-DRound.lo: DRound.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DRound.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DRound.Tpo -c -o libbugsdist_la-DRound.lo `test -f 'DRound.cc' || echo '$(srcdir)/'`DRound.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DRound.Tpo $(DEPDIR)/libbugsdist_la-DRound.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DRound.cc' object='libbugsdist_la-DRound.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DRound.lo `test -f 'DRound.cc' || echo '$(srcdir)/'`DRound.cc libbugsdist_la-DNT.lo: DNT.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DNT.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DNT.Tpo -c -o libbugsdist_la-DNT.lo `test -f 'DNT.cc' || echo '$(srcdir)/'`DNT.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DNT.Tpo $(DEPDIR)/libbugsdist_la-DNT.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DNT.cc' object='libbugsdist_la-DNT.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DNT.lo `test -f 'DNT.cc' || echo '$(srcdir)/'`DNT.cc libbugsdist_la-SumDist.lo: SumDist.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-SumDist.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-SumDist.Tpo -c -o libbugsdist_la-SumDist.lo `test -f 'SumDist.cc' || echo '$(srcdir)/'`SumDist.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-SumDist.Tpo $(DEPDIR)/libbugsdist_la-SumDist.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SumDist.cc' object='libbugsdist_la-SumDist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-SumDist.lo `test -f 'SumDist.cc' || echo '$(srcdir)/'`SumDist.cc libbugsdist_la-DSample.lo: DSample.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DSample.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DSample.Tpo -c -o libbugsdist_la-DSample.lo `test -f 'DSample.cc' || echo '$(srcdir)/'`DSample.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DSample.Tpo $(DEPDIR)/libbugsdist_la-DSample.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DSample.cc' object='libbugsdist_la-DSample.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DSample.lo `test -f 'DSample.cc' || echo '$(srcdir)/'`DSample.cc libbugsdist_la-DRW1.lo: DRW1.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DRW1.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DRW1.Tpo -c -o libbugsdist_la-DRW1.lo `test -f 'DRW1.cc' || echo '$(srcdir)/'`DRW1.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DRW1.Tpo $(DEPDIR)/libbugsdist_la-DRW1.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DRW1.cc' object='libbugsdist_la-DRW1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DRW1.lo `test -f 'DRW1.cc' || echo '$(srcdir)/'`DRW1.cc libbugsdist_la-DMNormVC.lo: DMNormVC.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsdist_la-DMNormVC.lo -MD -MP -MF $(DEPDIR)/libbugsdist_la-DMNormVC.Tpo -c -o libbugsdist_la-DMNormVC.lo `test -f 'DMNormVC.cc' || echo '$(srcdir)/'`DMNormVC.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdist_la-DMNormVC.Tpo $(DEPDIR)/libbugsdist_la-DMNormVC.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DMNormVC.cc' object='libbugsdist_la-DMNormVC.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdist_la-DMNormVC.lo `test -f 'DMNormVC.cc' || echo '$(srcdir)/'`DMNormVC.cc libbugsdisttest_la-testbugsdist.lo: testbugsdist.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdisttest_la_CPPFLAGS) $(CPPFLAGS) $(libbugsdisttest_la_CXXFLAGS) $(CXXFLAGS) -MT libbugsdisttest_la-testbugsdist.lo -MD -MP -MF $(DEPDIR)/libbugsdisttest_la-testbugsdist.Tpo -c -o libbugsdisttest_la-testbugsdist.lo `test -f 'testbugsdist.cc' || echo '$(srcdir)/'`testbugsdist.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsdisttest_la-testbugsdist.Tpo $(DEPDIR)/libbugsdisttest_la-testbugsdist.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testbugsdist.cc' object='libbugsdisttest_la-testbugsdist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsdisttest_la_CPPFLAGS) $(CPPFLAGS) $(libbugsdisttest_la_CXXFLAGS) $(CXXFLAGS) -c -o libbugsdisttest_la-testbugsdist.lo `test -f 'testbugsdist.cc' || echo '$(srcdir)/'`testbugsdist.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libbugsdist_la-DBern.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DBeta.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DBin.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DCat.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DChisqr.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DDexp.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DDirch.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DExp.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DF.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DGamma.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DGenGamma.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DHyper.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DInterval.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DLnorm.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DLogis.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DMNorm.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DMNormVC.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DMT.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DMulti.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DNChisqr.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DNT.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DNegBin.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DNorm.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DPar.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DPois.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DRW1.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DRound.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DSample.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DSum.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DT.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DUnif.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DWeib.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DWish.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-SumDist.Plo -rm -f ./$(DEPDIR)/libbugsdisttest_la-testbugsdist.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libbugsdist_la-DBern.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DBeta.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DBin.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DCat.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DChisqr.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DDexp.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DDirch.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DExp.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DF.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DGamma.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DGenGamma.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DHyper.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DInterval.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DLnorm.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DLogis.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DMNorm.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DMNormVC.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DMT.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DMulti.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DNChisqr.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DNT.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DNegBin.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DNorm.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DPar.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DPois.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DRW1.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DRound.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DSample.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DSum.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DT.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DUnif.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DWeib.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-DWish.Plo -rm -f ./$(DEPDIR)/libbugsdist_la-SumDist.Plo -rm -f ./$(DEPDIR)/libbugsdisttest_la-testbugsdist.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/bugs/distributions/DBern.cc0000664000175000017500000000317414224052514016575 00000000000000#include #include "DBern.h" #include #include #include #include #include using std::vector; using std::min; using std::max; #define PROB(par) (*par[0]) namespace jags { namespace bugs { DBern::DBern() : ScalarDist("dbern", 1, DIST_PROPORTION) {} bool DBern::checkParameterValue (vector const ¶meters) const { return (PROB(parameters) >= 0.0 && PROB(parameters) <= 1.0); } double DBern::logDensity(double x, PDFType type, vector const ¶meters, double const *lbound, double const *ubound) const { double d = 0; if (x == 1) d = PROB(parameters); else if (x == 0) d = 1 - PROB(parameters); return d == 0 ? JAGS_NEGINF : log(d); } double DBern::randomSample(vector const ¶meters, double const *lbound, double const *ubound, RNG *rng) const { return rng->uniform() < PROB(parameters) ? 1 : 0; } double DBern::typicalValue(vector const ¶meters, double const *lbound, double const *ubound) const { return PROB(parameters) > 0.5 ? 1 : 0; } bool DBern::canBound() const { return false; } bool DBern::isDiscreteValued(vector const &mask) const { return true; } double DBern::KL(vector const &par0, vector const &par1) const { double p0 = PROB(par0); double p1 = PROB(par1); if (p0 == 0) { return - log(1 - p1); } else if (p0 == 1) { return - log(p1); } else { return (p0 * (log(p0) - log(p1)) + (1 - p0) * (log(1 - p0) - log(1 - p1))); } } }} JAGS-4.3.2/src/modules/bugs/distributions/DCat.cc0000664000175000017500000000645714224052514016425 00000000000000#include #include "DCat.h" #include #include #include #include #include #include #include #include using std::min; using std::max; using std::vector; using std::max_element; #define PROB(par) (par[0]) #define NCAT(lengths) (lengths[0]) namespace jags { namespace bugs { DCat::DCat() : VectorDist("dcat", 1) {} bool DCat::isDiscreteValued(vector const &mask) const { return true; } bool DCat::checkParameterValue(vector const &par, vector const &lengths) const { bool nz = false; for (unsigned int i = 0; i < NCAT(lengths); i++) { if (PROB(par)[i] < 0.0) { return false; } if (PROB(par)[i] > 0.0) { nz = true; //at least one non-zero probability } } return nz; } double DCat::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector const &lengths, double const *lower, double const *upper) const { unsigned int y = static_cast(*x); if (y < 1 || y > NCAT(lengths)) { return JAGS_NEGINF; } if (type == PDF_PRIOR) { //No need to calculate the normalizing constant return log(PROB(par)[y-1]); } else { //Need to normalize the log density double sump = 0.0; for (unsigned int i = 0; i < NCAT(lengths); i++) { sump += PROB(par)[i]; } return log(PROB(par)[y-1]) - log(sump); } } void DCat::randomSample(double *x, unsigned int length, vector const &par, vector const &lengths, double const *lower, double const *upper, RNG *rng) const { double sump = 0; unsigned int i = 0; for ( ; i < NCAT(lengths); ++i) { sump += PROB(par)[i]; } double p = sump * rng->uniform(); for ( ; i > 1; --i) { sump -= PROB(par)[i-1]; if (sump <= p) break; } *x = i; } void DCat::support(double *lower, double *upper, unsigned int length, vector const &par, vector const &lengths) const { if (length != 1) throwLogicError("Invalid length in DCat::support"); *lower = 1; *upper = NCAT(lengths); } void DCat::typicalValue(double *x, unsigned int length, vector const &par, vector const &lengths, double const *lower, double const *upper) const { *x = max_element(PROB(par), PROB(par) + NCAT(lengths)) - PROB(par) + 1; } bool DCat::isSupportFixed(vector const &fixmask) const { return true; } bool DCat::checkParameterLength(vector const &lengths) const { return NCAT(lengths) > 0; } unsigned int DCat::length(vector const &lengths) const { return 1; } double DCat::KL(vector const &par0, vector const &par1, vector const &lengths) const { double psum0 = 0, psum1 = 0, y = 0; for (unsigned int i = 0; i < NCAT(lengths); ++i) { double p0 = PROB(par0)[i]; double p1 = PROB(par1)[i]; if (p0 == 0) { psum1 += p1; } else if (p1 == 0) { return JAGS_POSINF; } else { y += p0 * (log(p0) - log(p1)); psum0 += p0; psum1 += p1; } } y /= psum0; y -= (log(psum0) - log(psum1)); return y; } }} JAGS-4.3.2/src/modules/bugs/distributions/DDirch.cc0000664000175000017500000001037614224052514016742 00000000000000#include #include "DDirch.h" #include #include #include #include #include using std::vector; using std::string; #define ALPHA(par) (par[0]) #define LENGTH(len) (len[0]) /* The Dirichlet distribution is extended to allow zero shape parameters. These represent structural zeros: when x ~ ddirch(alpha) is forward sampled, x[i] = 0 when alpha[i] = 0. To avoid trapping states in the model, structural zeros are only allowed when the alpha parameter is fixed. */ namespace jags { namespace bugs { DDirch::DDirch() : VectorDist("ddirch", 1) {} string DDirch::alias() const { return "ddirich"; } unsigned int DDirch::length(vector const &len) const { return LENGTH(len); } bool DDirch::checkParameterLength(vector const &len) const { return LENGTH(len) > 1; } bool DDirch::checkParameterValue(vector const &par, vector const &len) const { double const *alpha = ALPHA(par); unsigned int length = LENGTH(len); bool has_nonzero_alpha = false; for (unsigned int i = 0; i < length; i++) { if (alpha[i] < 0) { return false; } if (alpha[i] > 0) { has_nonzero_alpha = true; } } return has_nonzero_alpha; } double DDirch::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector const &len, double const *lower, double const *upper) const { double const *alpha = ALPHA(par); double loglik = 0.0; for (unsigned int i = 0; i < length; i++) { if (alpha[i] == 0) { if (x[i] > 0) return JAGS_NEGINF; } else { loglik += (alpha[i] - 1) * log(x[i]); } } if (type != PDF_PRIOR) { //Need to calculate normalizing constant double alphasum = 0.0; for (unsigned int i = 0; i < length; i++) { if (alpha[i] != 0) { loglik -= lgammafn(alpha[i]); alphasum += alpha[i]; } } loglik += lgammafn(alphasum); } return loglik; } void DDirch::randomSample(double *x, unsigned int length, vector const &par, vector const &len, double const *lower, double const *upper, RNG *rng) const { double const *alpha = ALPHA(par); /* Generate independent gamma random variables, then normalize to create Dirichlet distribution. */ double sumx = 0.0; for (unsigned int i = 0; i < length; i++) { x[i] = (alpha[i]==0) ? 0 : rgamma(alpha[i], 1, rng); sumx += x[i]; } for (unsigned int j = 0; j < length; j++) { x[j] /= sumx; } } void DDirch::support(double *lower, double *upper, unsigned int length, vector const &par, vector const &len) const { for (unsigned int i = 0; i < length; ++i) { lower[i] = 0; if (ALPHA(par)[i] == 0) upper[i] = 0; else upper[i] = JAGS_POSINF; } } void DDirch::typicalValue(double *x, unsigned int length, vector const &par, vector const &len, double const *lower, double const *upper) const { double alphasum = 0.0; for (unsigned int i = 0; i < length; ++i) { alphasum += ALPHA(par)[i]; } for (unsigned int i = 0; i < length; ++i) { x[i] = ALPHA(par)[i]/alphasum; } } bool DDirch::isSupportFixed(vector const &fixmask) const { return fixmask[0]; } unsigned int DDirch::df(vector const &len) const { return LENGTH(len) - 1; } double DDirch::KL(vector const &par0, vector const &par1, vector const &len) const { //Generalization of the Kullback-Leibler divergence for the beta //distribution. We also have to take care of structural zeros as //in DCat unsigned int N = LENGTH(len); double S0 = 0, S1 = 0, y = 0; for (unsigned int i = 0; i < N; ++i) { double a1 = ALPHA(par0)[i]; double a2 = ALPHA(par1)[i]; if (a1 == 0) { S1 += a2; } else if (a2 == 0) { return JAGS_POSINF; } else { y += (a1 - a2) * digamma(a1) + lgammafn(a2) - lgammafn(a1); S0 += a1; S1 += a2; } } y -= (S0 - S1) * digamma(S0) + lgammafn(S1) - lgammafn(S0); return y; } }} JAGS-4.3.2/src/modules/bugs/distributions/DHyper.cc0000664000175000017500000002267114224052514017001 00000000000000/* * Adapted from R code published in conjunction with: * * Liao, J.G. And Rosen, O. (2001) Fast and Stable Algorithms for * Computing and Sampling from the Noncentral Hypergeometric * Distribution. The American Statistician 55, 366-369. */ #include #include "DHyper.h" #include #include #include #include #include #include #include using std::vector; using std::max; using std::min; using std::vector; using std::logic_error; namespace jags { namespace bugs { DHyper::DHyper() : RScalarDist("dhyper", 4, DIST_SPECIAL, true) {} bool DHyper::canBound() const { return false; } static void getParameters(int &n1, int &n2, int &m1, double &psi, vector const ¶meters) { n1 = static_cast(*parameters[0]); n2 = static_cast(*parameters[1]); m1 = static_cast(*parameters[2]); psi = *parameters[3]; } bool DHyper::checkParameterDiscrete (vector const &mask) const { // Check that n1, n2, m1 are discrete-valued for (unsigned int i = 0; i < 3; ++i) { if (mask[i] == false) return false; } return true; } bool DHyper::checkParameterValue (vector const ¶ms) const { int n1,n2,m1; double psi; getParameters(n1, n2, m1, psi, params); if (n1 < 0 || n2 < 0) return false; else if (m1 < 0 || m1 > n1 + n2) return false; else if (psi <= 0) return false; else return true; } /* * Calculates the mode of the hypergeometric distribution * * Extending the unnormalized density function to continuous x, We * solve the equation p(x) = p(x-1). Using the recurrence relation * given in rfunction (see below) this reduces to a quadratic * equation. The maximum value for integer values must lie between x-1 * and x, so to find the mode we take the floor of x. */ static int modeCompute(int n1, int n2, int m1, double psi) { double a = psi - 1; double b = -((m1 + n1 + 2) * psi + n2 - m1); double c = psi * (n1 + 1) * (m1 + 1); double q = b; if (b > 0) { q += sqrt(b * b - 4 * a * c); } else { q -= sqrt(b * b - 4 * a * c); } q = -q/2; int mode = static_cast(c/q); if (mode >= 0 && mode >= m1 - n2 && mode <= n1 && mode <= m1) { return mode; } else { return static_cast(q/a); } } /* * Recurrence relation that allows us to calculate hypergeometric * probabilities without running into combinatoric problems: * * p(x) = p(x - 1) * rfunction(n1, n2, m1, psi, x) */ static inline double rfunction(int n1, int n2, int m1, double psi, int i) { return psi * (n1 - i + 1) * (m1 - i + 1)/(i * (n2 - m1 + i)); } /** * Calculates the unnormalized density of x. The mode has reference * density value 1. */ static double density_unnormalized(int x, int n1, int n2, int m1, double psi) { int ll = max(0, m1 - n2); int uu = min(n1, m1); if (x < ll || x > uu) return 0; // Density at mode has reference value 1 int mode = modeCompute(n1, n2, m1, psi); double r = 1; if (x > mode) { for (int i = mode + 1; i <= x; ++i) { r *= rfunction(n1, n2, m1, psi, i); } } else if (x < mode) { for (int i = mode - 1; i >= x; --i) { r /= rfunction(n1, n2, m1, psi, i + 1); } } return r; } /* * Calculates the normalized density of x */ static double density_normalized(int x, int n1, int n2, int m1, double psi) { int ll = max(0, m1 - n2); int uu = min(n1, m1); if (x < ll || x > uu) return 0; // Density at mode has reference value 1 int mode = modeCompute(n1, n2, m1, psi); double psum = 1, px = 1; // Calculate relative density above the mode if (mode < uu) { double r = 1; for (int i = mode + 1; i <= uu; ++i) { r *= rfunction(n1, n2, m1, psi, i); if (i == x) px = r; psum += r; } } // Calculate relative density below the node if (mode > ll) { double r = 1; for (int i = mode - 1; i >= ll; --i) { r /= rfunction(n1, n2, m1, psi, i + 1); if (i == x) px = r; psum += r; } } // Normalize return px/psum; } /* * Returns a vector of normalized probabilities for a hypergeometric * distribution. If the returned vector p is of length N, then p[0] * represents the probability of the lowest possible value ll = max(0, * m1 - n2) and p[N - 1] represents the probability of the largest * possible value uu = min(n1, m1). */ static vector density_full(int n1, int n2, int m1, double psi) { int ll = max(0, m1 - n2); int uu = min(n1, m1); int N = uu - ll + 1; vector p(N); // Density at mode has reference value 1 int mode = modeCompute(n1, n2, m1, psi); p[mode - ll] = 1; double sump = 1; // Calculate relative density above the mode if (mode < uu) { double r = 1; for (int i = mode + 1; i <= uu; ++i) { r *= rfunction(n1, n2, m1, psi, i); p[i - ll] = r; sump += r; } } // Calculate relative density below the node if (mode > ll) { double r = 1; for (int i = mode - 1; i >= ll; --i) { r /= rfunction(n1, n2, m1, psi, i + 1); p[i - ll] = r; sump += r; } } //Normalize for (int i = 0; i < N; ++i) { p[i] /= sump; } return p; } /* * Sample from a discrete unimodal distribution given a vector of * normalized probabilities pi[] and an estimate of the mode. U should * be drawn from a uniform(0,1) distribution. We spend our probability * allocation U as rapidly as possible, starting at the mode and then * stepping out to the left and the right. * * This function is quite general and could be used for other discrete * distributions when we have a good guess of the mode. The function * also works if "mode" is not actually the mode, but is * correspondingly less efficient. */ static int sampleWithMode(int mode, vector const &pi, double U) { int N = pi.size(); int left = mode - 1; int right = mode; while (left >= 0 || right < N) { if (right < N && (left < 0 || pi[right] > pi[left])) { U -= pi[right]; if (U <= 0) return right; else ++right; } else { U -= pi[left]; if (U <= 0) return left; else --left; } } //Only reachable with bad arguments return mode; } double DHyper::d(double z, PDFType type, vector const ¶meters, bool give_log) const { int n1,n2,m1; double psi; getParameters(n1, n2, m1, psi, parameters); int x = static_cast(z); double den = 0; if (type == PDF_PRIOR) { den = density_unnormalized(x, n1, n2, m1, psi); } else { den = density_normalized(x, n1, n2, m1, psi); } if (give_log) { return den == 0 ? JAGS_NEGINF : log(den); } else { return den; } } double DHyper::p(double x, vector const ¶meters, bool lower, bool give_log) const { int n1,n2,m1; double psi; getParameters(n1, n2, m1, psi, parameters); int ll = max(0, m1 - n2); int uu = min(n1, m1); double sumpi = 0; if (x >= ll) { if (x >= uu) { sumpi = 1; } else { vector pi = density_full(n1, n2, m1, psi); for (int i = ll; i <= x; ++i) { sumpi += pi[i - ll]; } } } if (!lower) sumpi = max(1 - sumpi, 0.0); if (give_log) { return sumpi == 0 ? JAGS_NEGINF : log(sumpi); } else { return sumpi; } } double DHyper::q(double p, vector const ¶meters, bool lower, bool log_p) const { double tol = 64 * DBL_EPSILON; int n1,n2,m1; double psi; getParameters(n1, n2, m1, psi, parameters); int ll = max((int) 0, m1 - n2); int uu = min(n1, m1); vector pi = density_full(n1, n2, m1, psi); if (log_p) p = exp(p); if (!lower) p = 1 - p; double sumpi = 0; for (int i = ll; i < uu; ++i) { sumpi += pi[i - ll]; if (sumpi > p - tol) { return i; } } return uu; } double DHyper::r(vector const ¶meters, RNG *rng) const { int n1,n2,m1; double psi; getParameters(n1, n2, m1, psi, parameters); int ll = max(0, m1 - n2); int mode = modeCompute(n1, n2, m1, psi); vector pi = density_full(n1, n2, m1, psi); return sampleWithMode(mode - ll, pi, rng->uniform()) + ll; } double DHyper::l(vector const ¶meters) const { int n1,n2,m1; double psi; getParameters(n1, n2, m1, psi, parameters); return max(0, m1 - n2); } double DHyper::u(vector const ¶meters) const { int n1,n2,m1; double psi; getParameters(n1, n2, m1, psi, parameters); return min(n1, m1); } bool DHyper::isSupportFixed(vector const &fixmask) const { return fixmask[0] && fixmask[1] && fixmask[2]; //Margins fixed } double DHyper::KL(vector const ¶, vector const &parb) const { int n1a,n2a,m1a; double psia; getParameters(n1a, n2a, m1a, psia, para); int lla = max(0, m1a - n2a); int uua = min(n1a, m1a); int n1b,n2b,m1b; double psib; getParameters(n1b, n2b, m1b, psib, parb); int llb = max(0, m1b - n2b); int uub = min(n1b, m1b); if (lla < llb || uua > uub) return JAGS_POSINF; vector da = density_full(n1a, n2a, m1a, psia); vector db = density_full(n1b, n2b, m1b, psib); double y = 0; for (int i = lla; i <= uua; ++i) { double proba = da[i - lla]; double probb = db[i - llb]; y += proba * (log(proba) - log(probb)); } return y; } }} JAGS-4.3.2/src/modules/bugs/distributions/DLogis.cc0000664000175000017500000000175314224052514016765 00000000000000#include #include "DLogis.h" #include using std::vector; #define MU(par) (*par[0]) #define SCALE(par) (1 / *par[1]) #define TAU(par) (*par[1]) namespace jags { namespace bugs { DLogis::DLogis() : RScalarDist("dlogis", 2, DIST_UNBOUNDED) {} bool DLogis::checkParameterValue (vector const &par) const { return (TAU(par) > 0); } double DLogis::d(double x, PDFType type, vector const &par, bool give_log) const { return dlogis(x, MU(par), SCALE(par), give_log); } double DLogis::p(double q, vector const &par, bool lower, bool give_log) const { return plogis(q, MU(par), SCALE(par), lower, give_log); } double DLogis::q(double p, vector const &par, bool lower, bool log_p) const { return qlogis(p, MU(par), SCALE(par), lower, log_p); } double DLogis::r(vector const &par, RNG *rng) const { double ans = rlogis(MU(par), SCALE(par), rng); return ans; } }} JAGS-4.3.2/src/modules/bugs/distributions/DMulti.cc0000664000175000017500000001161014224052514016773 00000000000000#include #include "DMulti.h" #include #include #include #include #include using std::vector; using std::string; #define PROB(par) (par[0]) #define SIZE(par) (*par[1]) namespace jags { namespace bugs { DMulti::DMulti() : VectorDist("dmulti", 2) {} string DMulti::alias() const { return "dmultinom"; } bool DMulti::isDiscreteValued(vector const &mask) const { return true; } bool DMulti::checkParameterLength(vector const &len) const { //Check that PROB is non-empty and SIZE is a scalar return len[0] >= 1 && len[1] == 1; } bool DMulti::checkParameterDiscrete(vector const &mask) const { return mask[1]; //SIZE is discrete-valued } bool DMulti::checkParameterValue(vector const &par, vector const &len) const { if (SIZE(par) < 0) return false; // If SIZE is non-zero, we need at least one non-zero probability bool nz = SIZE(par) == 0; for (unsigned int i = 0; i < len[0]; ++i) { if (PROB(par)[i] < 0) return false; else if (PROB(par)[i] > 0) nz = true; } return nz; } double DMulti::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector const &len, double const *lower, double const *upper) const { double loglik = 0.0; double S = 0; for (unsigned int i = 0; i < length; i++) { if (x[i] < 0 || floor(x[i]) != x[i]) { return JAGS_NEGINF; } else if (x[i] != 0) { if (PROB(par)[i] == 0) { return JAGS_NEGINF; } else { loglik += x[i] * log(PROB(par)[i]); } S += x[i]; } } //Check consistency between parameters and data if (S != SIZE(par)) return JAGS_NEGINF; if (type != PDF_PRIOR) { //Terms depending on parameters only double sump = 0.0; for (unsigned int i = 0; i < length; ++i) { sump += PROB(par)[i]; } if (SIZE(par) != 0) { loglik -= SIZE(par) * log(sump); } } if (type != PDF_LIKELIHOOD) { //Terms depending on sampled value only for (unsigned int i = 0; i < length; ++i) { loglik -= lgammafn(x[i] + 1); } } if (type == PDF_FULL) { //If either data or parameters are fixed then this term is constant //bearing in mind consistency check above. loglik += lgammafn(SIZE(par) + 1); } return loglik; } void DMulti::randomSample(double *x, unsigned int length, vector const &par, vector const &len, double const *lower, double const *upper, RNG *rng) const { /* Sample multinomial as a series of binomial distributions */ double N = SIZE(par); double const *prob = PROB(par); //Normalize probability double sump = 0; for (unsigned int i = 0; i < length; ++i) { sump += prob[i]; } for (unsigned int i = 0; i < length - 1; i++) { if (N == 0) { x[i] = 0; } else { x[i] = rbinom(N, prob[i]/sump, rng); N -= x[i]; sump -= prob[i]; } } x[length - 1] = N; } void DMulti::support(double *lower, double *upper, unsigned int length, vector const &par, vector const &len) const { for (unsigned int i = 0; i < length; ++i) { lower[i] = 0; if (PROB(par)[i] == 0) upper[i] = 0; else upper[i] = SIZE(par); } } unsigned int DMulti::length(vector const &len) const { return len[0]; } void DMulti::typicalValue(double *x, unsigned int length, vector const &par, vector const &len, double const *lower, double const *upper) const { /* Draw a typical value in the same way as a random sample, but substituting the median at each stage */ double N = SIZE(par); double const *prob = PROB(par); double sump = 0.0; for (unsigned int i = 0; i < length; ++i) { sump += prob[i]; } for (unsigned int i = 0; i < length - 1; i++) { if (N == 0) { x[i] = 0; } else { x[i] = qbinom(0.5, N, prob[i]/sump, true, false); N -= x[i]; sump -= prob[i]; } } x[length - 1] = N; } bool DMulti::isSupportFixed(vector const &fixmask) const { return fixmask[1]; } unsigned int DMulti::df(vector const &len) const { return len[0] - 1; } double DMulti::KL(vector const &par1, vector const &par2, vector const &lengths) const { if (SIZE(par1) != SIZE(par2)) return JAGS_POSINF; unsigned int ncat = lengths[0]; double y = 0, S1 = 0, S2 = 0; for (unsigned int i = 0; i < ncat; ++i) { double p1 = PROB(par1)[i]; double p2 = PROB(par2)[i]; if (p1 == 0) { S2 += p2; } else if (p2 == 0) { return JAGS_POSINF; } else { y += p1 * (log(p1) - log(p2)); S1 += p1; S2 += p2; } } y /= S1; y += log(S2) - log(S1); y *= SIZE(par1); return y; } }} JAGS-4.3.2/src/modules/bugs/distributions/DSum.cc0000664000175000017500000000541314224052514016451 00000000000000#include #include #include #include #include #include "DSum.h" #include #include using std::vector; using std::fabs; using std::sqrt; namespace jags { namespace bugs { DSum::DSum() : ArrayDist("dsum", 0) { } bool DSum::isDiscreteValued(vector const &mask) const { return allTrue(mask); } double DSum::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector > const &dims, double const *lower, double const *upper) const { const double tol = sqrt(DBL_EPSILON); for (unsigned int i = 0; i < length; ++i) { double s = x[i]; for (unsigned int j = 0; j < par.size(); ++j) { s -= par[j][i]; } if (fabs(s) > tol) { return JAGS_NEGINF; } } return 0; } void DSum::randomSample(double *x, unsigned int length, vector const &par, vector > const &dims, double const *lower, double const *upper, RNG *rng) const { for (unsigned int i = 0; i < length; ++i) { x[i] = 0; for (unsigned int j = 0; j < par.size(); ++j) { x[i] += par[j][i]; } } } void DSum::typicalValue(double *x, unsigned int length, vector const &par, vector > const &dims, double const *lower, double const *upper) const { for (unsigned int i = 0; i < length; ++i) { x[i] = 0; for (unsigned int j = 0; j < par.size(); ++j) { x[i] += par[j][i]; } } } bool DSum::isSupportFixed(vector const &fixmask) const { return allTrue(fixmask); } unsigned int DSum::df(vector > const &dims) const { return 0; } bool DSum::checkParameterValue(vector const ¶ms, vector > const &dims) const { return true; } bool DSum::checkParameterDim (vector > const &dims) const { if (dims.empty()) return false; if (isFlat(dims[0])) return false; for (unsigned int i = 1; i < dims.size(); ++i) { if (dims[i] != dims[0]) return false; } return true; } bool DSum::checkParameterDiscrete(vector const &mask) const { for (unsigned int i = 1; i < mask.size(); ++i) { if (mask[i] != mask[0]) return false; } return true; } void DSum::support(double *lower, double *upper, unsigned int length, vector const &par, vector > const &dims) const { for (unsigned int i = 0; i < length; ++i) { lower[i] = 0; for (unsigned int j = 0; j < par.size(); ++j) { lower[i] += par[j][i]; } upper[i] = lower[i]; } } vector DSum::dim(vector > const &dims) const { return dims[0]; } }} JAGS-4.3.2/src/modules/bugs/distributions/DWeib.cc0000664000175000017500000000231014224052514016564 00000000000000#include #include "DWeib.h" #include #include #include #include #include using std::vector; using std::string; #define SHAPE(par) (*par[0]) #define RATE(par) (*par[1]) namespace jags { namespace bugs { DWeib::DWeib() : RScalarDist("dweib", 2, DIST_POSITIVE) {} string DWeib::alias() const { return "dweibull"; } bool DWeib::checkParameterValue (vector const &par) const { return SHAPE(par) >= 0 && RATE(par) > 0; } double DWeib::d(double x, PDFType type, vector const &par, bool give_log) const { return dweibull2(x, SHAPE(par), RATE(par), give_log); } double DWeib::p(double q, vector const &par, bool lower, bool give_log) const { return pweibull2(q, SHAPE(par), RATE(par), lower, give_log); } double DWeib::q(double p, vector const &par, bool lower, bool log_p) const { return qweibull2(p, SHAPE(par), RATE(par), lower, log_p); } double DWeib::r(vector const &par, RNG *rng) const { return rweibull2(SHAPE(par), RATE(par), rng); } }} JAGS-4.3.2/src/modules/bugs/distributions/DBeta.cc0000664000175000017500000000332514224052514016560 00000000000000#include #include "DBeta.h" #include #include using std::vector; namespace jags { namespace bugs { DBeta::DBeta() : RScalarDist("dbeta", 2, DIST_PROPORTION) {} bool DBeta::checkParameterValue (vector const &par) const { return (*par[0] > 0.0 && *par[1] > 0.0); } double DBeta::d(double x, PDFType type, vector const &par, bool give_log) const { if (type == PDF_PRIOR) { //Avoid expensive evaluation of the beta function if (x < 0 || x > 1) { return give_log ? JAGS_NEGINF : 0; } else if (x == 0) { //Density at 0 defined by continuity return xlog0(*par[0] - 1, give_log); } else if (x == 1) { //Density at 1 defined by continuity return xlog0(*par[1] - 1, give_log); } else { double y = (*par[0] - 1) * log(x) + (*par[1] - 1) * log(1 - x); return give_log ? y : exp(y); } } else { return dbeta(x, *par[0], *par[1], give_log); } } double DBeta::p(double q, vector const &par, bool lower, bool log_p) const { return pbeta(q, *par[0], *par[1], lower, log_p); } double DBeta::q(double p, vector const &par, bool lower, bool log_p) const { return qbeta(p, *par[0], *par[1], lower, log_p); } double DBeta::r(vector const &par, RNG *rng) const { return rbeta(*par[0], *par[1], rng); } double DBeta::KL(vector const &par1, vector const &par2) const { double a1 = *par1[0]; double b1 = *par1[1]; double a2 = *par2[0]; double b2 = *par2[1]; return lbeta(a2, b2) - lbeta(a1, b1) - (a2 - a1) * digamma(a1) - (b2 - b1) * digamma(b1) + (a2 + b2 - a1 - b1) * digamma(a1 + b1); } }} JAGS-4.3.2/src/modules/bugs/distributions/DChisqr.cc0000664000175000017500000000312014224052514017127 00000000000000#include #include "DChisqr.h" #include #include using std::vector; using std::string; #define DF(par) (*par[0]) namespace jags { namespace bugs { DChisqr::DChisqr() : RScalarDist("dchisqr", 1, DIST_POSITIVE) {} string DChisqr::alias() const { return "dchisq"; } bool DChisqr::checkParameterValue (vector const &par) const { return (DF(par) > 0); } double DChisqr::d(double x, PDFType type, vector const &par, bool give_log) const { if (type == PDF_PRIOR) { //Avoid expensive evaluation of gamma function if (x < 0) { return give_log ? JAGS_NEGINF : 0; } else if (x == 0) { //Density at zero defined by continuity return xlog0(DF(par) - 2, give_log); } else { double y = (DF(par)/2 - 1) * log(x) - x/2; return give_log ? y : exp(y); } } else { return dchisq(x, DF(par), give_log); } } double DChisqr::p(double q, vector const &par, bool lower, bool log_p) const { return pchisq(q, DF(par), lower, log_p); } double DChisqr::q(double p, vector const &par, bool lower, bool log_p) const { return qchisq(p, DF(par), lower, log_p); } double DChisqr::r(vector const &par, RNG *rng) const { return rchisq(DF(par), rng); } double DChisqr::KL(vector const &par0, vector const &par1) const { //Specialisation of the gamma Kullback-Leibler divergence double b0 = DF(par0)/2, b1 = DF(par1)/2; return (b0 - b1) * digamma(b0) + lgammafn(b1) - lgammafn(b0); } }} JAGS-4.3.2/src/modules/bugs/distributions/DExp.cc0000664000175000017500000000226014224052514016436 00000000000000#include #include "DExp.h" #include #include #include using std::max; using std::vector; namespace jags { namespace bugs { DExp::DExp() : RScalarDist("dexp", 1, DIST_POSITIVE) {} /* R functions are parameterized in terms of scale = 1/rate */ static inline double SCALE(vector const &par) { return 1 /(*par[0]); } bool DExp::checkParameterValue (vector const &par) const { return (*par[0] > 0); } double DExp::d(double x, PDFType type, vector const &par, bool give_log) const { return dexp(x, SCALE(par), give_log); } double DExp::p(double q, vector const &par, bool lower, bool log_p) const { return pexp(q, SCALE(par), lower, log_p); } double DExp::q(double p, vector const &par, bool lower, bool log_p) const { return qexp(p, SCALE(par), lower, log_p); } double DExp::r(vector const &par, RNG *rng) const { return rexp(SCALE(par), rng); } double DExp::KL(vector const &par0, vector const &par1) const { double r = (*par1[0]) / (*par0[0]); return r - 1 - log(r); } }} JAGS-4.3.2/src/modules/bugs/distributions/DInterval.cc0000664000175000017500000000613314224052514017471 00000000000000#include #include "DInterval.h" #include #include #include #include using std::min; using std::max; using std::vector; #define T(par) (*par[0]) #define CUTPOINTS(par) (par[1]) #define NCUT(lengths) (lengths[1]) static unsigned int value(vector const &par, unsigned int ncut) { double t = T(par); for (unsigned int i = 0; i < ncut; ++i) { if (t <= CUTPOINTS(par)[i]) return i; } return ncut; } namespace jags { namespace bugs { DInterval::DInterval() : VectorDist("dinterval", 2) { } bool DInterval::isDiscreteValued(vector const &mask) const { return true; } bool DInterval::checkParameterLength(vector const &lengths) const { return lengths[0] == 1 && lengths[1] >= 1; } bool DInterval::checkParameterValue(vector const &par, vector const &lengths) const { for (unsigned int i = 1; i < NCUT(lengths); ++i) { if (CUTPOINTS(par)[i] <= CUTPOINTS(par)[i-1]) return false; } return true; } double DInterval::logDensity(double const *y, unsigned int length, PDFType type, vector const &par, vector const &lengths, double const *lower, double const *upper) const { if (*y < 0) return JAGS_NEGINF; unsigned int x = static_cast(*y); if (x > NCUT(lengths)) { return JAGS_NEGINF; } else { double t = T(par); if (x > 0 && t <= CUTPOINTS(par)[x-1]) return JAGS_NEGINF; else if (x < NCUT(lengths) && t > CUTPOINTS(par)[x]) return JAGS_NEGINF; else return 0; } } void DInterval::randomSample(double *x, unsigned int length, vector const &par, vector const &lengths, double const *lower, double const *upper, RNG *rng) const { /* The random sample from DInterval is not random at all, but deterministic. */ *x = static_cast(value(par, NCUT(lengths))); } void DInterval::typicalValue(double *x, unsigned int length, vector const &par, vector const &lengths, double const *lower, double const *upper) const { *x = static_cast(value(par, NCUT(lengths))); } unsigned int DInterval::df(vector const &lengths) const { return 0; } void DInterval::support(double *lower, double *upper, unsigned int length, vector const &par, vector const &lengths) const { unsigned int y = value(par, NCUT(lengths)); *lower = y; *upper = y; } bool DInterval::isSupportFixed(vector const &fixmask) const { return fixmask[0] && fixmask[1]; } unsigned int DInterval::length(vector const ¶ms) const { return 1; } double DInterval::KL(vector const &par0, vector const &par1, vector const &lengths) const { unsigned int y0 = value(par0, NCUT(lengths)); unsigned int y1 = value(par1, NCUT(lengths)); return (y0 == y1) ? 0 : JAGS_POSINF; } }} JAGS-4.3.2/src/modules/bugs/distributions/DMNorm.cc0000664000175000017500000001011114224052514016724 00000000000000#include #include #include #include "DMNorm.h" #include #include #include #include #include #include using std::vector; namespace jags { namespace bugs { DMNorm::DMNorm() : ArrayDist("dmnorm", 2) {} double DMNorm::logDensity(double const *x, unsigned int m, PDFType type, vector const ¶meters, vector > const &dims, double const *lower, double const *upper) const { double const * mu = parameters[0]; double const * T = parameters[1]; double loglik = 0; vector delta(m); for (unsigned int i = 0; i < m; ++i) { delta[i] = x[i] - mu[i]; loglik -= (delta[i] * T[i + i * m] * delta[i])/2; for (unsigned int j = 0; j < i; ++j) { loglik -= (delta[i] * T[i + j * m] * delta[j]); } } switch(type) { case PDF_PRIOR: break; case PDF_LIKELIHOOD: loglik += logdet(T, m)/2; break; case PDF_FULL: loglik += logdet(T, m)/2 - m * M_LN_SQRT_2PI; break; } return loglik; } void DMNorm::randomSample(double *x, unsigned int m, vector const ¶meters, vector > const &dims, double const *lower, double const *upper, RNG *rng) const { double const * mu = parameters[0]; double const * T = parameters[1]; randomsample(x, mu, T, true, m, rng); } void DMNorm::randomsample(double *x, double const *mu, double const *T, bool prec, int nrow, RNG *rng) { //FIXME: do something with rng int N = nrow*nrow; double * Tcopy = new double[N]; for (int i = 0; i < N; ++i) { Tcopy[i] = T[i]; } double * w = new double[nrow]; int info = 0; double worktest; int lwork = -1; // Workspace query F77_DSYEV ("V", "L", &nrow, Tcopy, &nrow, w, &worktest, &lwork, &info); // Now get eigenvalues/vectors with optimal work space lwork = static_cast(worktest + DBL_EPSILON); double * work = new double[lwork]; F77_DSYEV ("V", "L", &nrow, Tcopy, &nrow, w, work, &lwork, &info); delete [] work; /* Generate independent random normal variates, scaled by the eigen values. We reuse the array w. */ if (prec) { for (int i = 0; i < nrow; ++i) { w[i] = rnorm(0, 1/sqrt(w[i]), rng); } } else { for (int i = 0; i < nrow; ++i) { w[i] = rnorm(0, sqrt(w[i]), rng); } } /* Now transform them to dependant variates (On exit from DSYEV, Tcopy contains the eigenvectors) */ for (int i = 0; i < nrow; ++i) { x[i] = mu ? mu[i] : 0; for (int j = 0; j < nrow; ++j) { x[i] += Tcopy[i + j * nrow] * w[j]; } } delete [] w; delete [] Tcopy; } bool DMNorm::checkParameterDim(vector > const &dims) const { //Allow scalar mean and precision. if (isScalar(dims[0]) && isScalar(dims[1])) return true; //Vector mean and matrix precision if (!isVector(dims[0])) return false; if (!isSquareMatrix(dims[1])) return false; if (dims[0][0] != dims[1][0]) return false; return true; } vector DMNorm::dim(vector > const &dims) const { return dims[0]; } bool DMNorm::checkParameterValue(vector const ¶meters, vector > const &dims) const { double const *precision = parameters[1]; unsigned int n = dims[0][0]; return check_symmetry(precision, n) && check_symmetric_ispd(precision, n); } void DMNorm::support(double *lower, double *upper, unsigned int length, vector const ¶meters, vector > const &dims) const { for (unsigned int i = 0; i < length; ++i) { lower[i] = JAGS_NEGINF; upper[i] = JAGS_POSINF; } } void DMNorm::typicalValue(double *x, unsigned int m, vector const ¶meters, vector > const &dims, double const *lower, double const *upper) const { for (unsigned int i = 0; i < m; ++i) { x[i] = parameters[0][i]; } } bool DMNorm::isSupportFixed(vector const &fixmask) const { return true; } }} JAGS-4.3.2/src/modules/bugs/distributions/DNegBin.cc0000664000175000017500000000372314224052514017051 00000000000000#include #include "DNegBin.h" #include #include #include #include #include using std::vector; using std::max; using std::string; #define PROB(par) (*par[0]) #define SIZE(par) (*par[1]) namespace jags { namespace bugs { DNegBin::DNegBin() : RScalarDist("dnegbin", 2, DIST_POSITIVE, true) {} string DNegBin::alias() const { return "dnbinom"; } bool DNegBin::checkParameterValue (vector const &par) const { double p = PROB(par); return (SIZE(par) >= 0 && p > 0 && p <= 1); } double DNegBin::d(double x, PDFType type, vector const &par, bool give_log) const { if (SIZE(par) == 0) { if (give_log) { return (x == 0) ? 0 : JAGS_NEGINF; } else { return (x == 0) ? 1 : 0; } } else { return dnbinom(x, SIZE(par), PROB(par), give_log); } } double DNegBin::p(double q, vector const &par, bool lower, bool give_log) const { if (SIZE(par) == 0) { return give_log ? 0 : 1; } else { return pnbinom(q, SIZE(par), PROB(par), lower, give_log); } } double DNegBin::q(double p, vector const &par, bool lower, bool log_p) const { if (SIZE(par) == 0) { return 0; } else { return qnbinom(p, SIZE(par), PROB(par), lower, log_p); } } double DNegBin::r(vector const &par, RNG *rng) const { if (SIZE(par) == 0) { return 0; } else { return rnbinom(SIZE(par), PROB(par), rng); } } double DNegBin::KL(vector const &par0, vector const &par1) const { double p0 = PROB(par0); double r0 = SIZE(par0); double p1 = PROB(par1); double r1 = SIZE(par1); if (fabs(r0 - r1) > 1e-16) { //We can't calculat Kullback-Leibler divergence in closed form when //r0 and r1 are different return JAGS_NA; } return r0 * (log(p0) - log(p1)) + (1 - p0) * r0 * (log(1 - p0) - log(1 - p1)) / p0; } }} JAGS-4.3.2/src/modules/bugs/distributions/DPar.cc0000664000175000017500000000371514224052514016432 00000000000000#include #include "DPar.h" #include #include #include #include using std::vector; using std::exp; using std::log; #define ALPHA(par) (*par[0]) #define C(par) (*par[1]) namespace jags { namespace bugs { DPar::DPar() : RScalarDist("dpar", 2, DIST_SPECIAL) {} bool DPar::checkParameterValue (vector const &par) const { return (ALPHA(par) > 0 && C(par) > 0); } double DPar::d(double x, PDFType type, vector const &par, bool give_log) const { double alpha = ALPHA(par); double c = C(par); if (x < c) return give_log ? JAGS_NEGINF : 0; if (give_log) return log(alpha) + alpha * log(c) - (alpha + 1) * log(x); else return alpha * exp(alpha * log(c) - (alpha + 1) * log(x)); } double DPar::p(double x, vector const &par, bool lower, bool give_log) const { double alpha = ALPHA(par); double c = C(par); if (x < c) return give_log ? JAGS_NEGINF : 0; double logq = alpha * log(c/x); if (!lower) { return give_log ? logq : exp(logq); } else { return give_log ? log(1 - exp(logq)) : 1 - exp(logq); } } double DPar::q(double p, vector const &par, bool lower, bool log_p) const { if ( (log_p && p > 0) || (!log_p && (p < 0 || p > 1)) ) return JAGS_NAN; double logp; if (!lower) { if (log_p) logp = p; else logp = log(p); } else { if (log_p) logp = log(1 - exp(p)); else logp = log(1 - p); } return exp(log(C(par)) - logp/ALPHA(par)); } double DPar::r(vector const &par, RNG *rng) const { return C(par) * exp(rng->exponential()/ALPHA(par)); } double DPar::l(vector const &par) const { return C(par); } double DPar::u(vector const &par) const { return JAGS_POSINF; } bool DPar::isSupportFixed(vector const &fixmask) const { return fixmask[1]; //Fixed if C is fixed } }} JAGS-4.3.2/src/modules/bugs/distributions/DT.cc0000664000175000017500000000235014224052514016105 00000000000000#include #include "DT.h" #include #include using std::vector; #define MU(par) (*par[0]) #define TAU(par) (*par[1]) #define DF(par) (*par[2]) namespace jags { namespace bugs { DT::DT() : RScalarDist("dt", 3, DIST_UNBOUNDED) {} bool DT::checkParameterValue (vector const &par) const { return (TAU(par) > 0 && DF(par) > 0); } double DT::d(double x, PDFType type, vector const &par, bool give_log) const { x = (x - MU(par)) * sqrt(TAU(par)); if (type == PDF_PRIOR) { double y = - (DF(par) + 1) * log(1 + x * x / DF(par)) / 2; return give_log ? y : exp(y); } else if (give_log) { return dt(x, DF(par), 1) + log(TAU(par))/2; } else { return dt(x, DF(par), 0) * sqrt(TAU(par)); } } double DT::p(double x, vector const &par, bool lower, bool use_log) const { return pt((x - MU(par)) * sqrt(TAU(par)), DF(par), lower, use_log); } double DT::q(double p, vector const &par, bool lower, bool log_p) const { return MU(par) + qt(p, DF(par), lower, log_p) / sqrt(TAU(par)); } double DT::r(vector const &par, RNG *rng) const { return rt(DF(par), rng) / sqrt(TAU(par)) + MU(par); } }} JAGS-4.3.2/src/modules/bugs/distributions/DWish.cc0000664000175000017500000001232014224052514016612 00000000000000#include #include #include #include #include #include "lapack.h" #include "matrix.h" #include "DWish.h" #include #include #include #include #include using std::vector; using std::log; using std::reverse; #define SCALE(par) (par[0]) #define DF(par) (*par[1]) #define NROW(dims) (dims[0][0]) static double log_multigamma(double n, unsigned int p) { double y = (p * (p-1) * log(M_PI))/4; for (unsigned int j = 0; j < p; ++j) { y += lgammafn((n-j)/2); } return y; } namespace jags { namespace bugs { DWish::DWish() : ArrayDist("dwish", 2) {} double DWish::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector > const &dims, double const *lower, double const *upper) const { double const *scale = SCALE(par); unsigned int p = NROW(dims); double loglik = (DF(par) - p - 1) * logdet(x, p); for (unsigned int i = 0; i < length; ++i) { loglik -= scale[i] * x[i]; } if (type != PDF_PRIOR) { //Normalize density loglik += DF(par) * logdet(scale, p) - DF(par) * p * log(2.0) - 2 * log_multigamma(DF(par), p); } return loglik/2; } void DWish::randomSample(double *X, int length, double const *R, double k, int nrow, RNG *rng) { /* Generate random Wishart variable, using an algorithm proposed by Bill Venables and originally implemented in S. */ if (length != nrow*nrow) { jags::throwLogicError("invalid length in DWish::randomSample"); } /* Get Cholesky decomposition of the inverse of R. First we factorize R (dpotrf) and then we invert the triangular factor (dtrtri). At the end, C contains the upper triangular Cholesky factor. NB We must reverse the elements of the matrix at start and end of the calculations. */ vector C(length); copy(R, R + length, C.rbegin()); int info = 0; F77_DPOTRF("L", &nrow, &C[0], &nrow, &info); if (info != 0) { jags::throwRuntimeError("Failed to get Cholesky decomposition of R"); } F77_DTRTRI("L", "N", &nrow, &C[0], &nrow, &info); if (info != 0) { jags::throwRuntimeError("Failed to invert Cholesky decomposition of R"); } reverse(C.begin(), C.end()); /* Generate square root of Wishart random variable: - diagonal elements are square root of Chi square - upper off-diagonal elements are normal - lower off-diagonal elements are zero */ vector Z(length); for (int j = 0; j < nrow; j++) { double *Z_j = &Z[j*nrow]; //jth column of Z for (int i = 0; i < j; i++) { Z_j[i] = rnorm(0, 1, rng); } Z_j[j] = sqrt(rchisq(k - j, rng)); for (int i = j + 1; i < nrow; i++) { Z_j[i] = 0; } } // Z = Z %*% C double one = 1; F77_DTRMM("R", "U", "N", "N", &nrow, &nrow, &one, &C[0], &nrow, &Z[0], &nrow); // X = t(Z) %*% Z double zero = 0; F77_DSYRK("U", "T", &nrow, &nrow, &one, &Z[0], &nrow, &zero, X, &nrow); // Copy lower triangle of X from upper triangle for (int i = 0; i < nrow; ++i) { for (int j = 0; j < i; ++j) { X[j * nrow + i] = X[i * nrow + j]; } } } void DWish::randomSample(double *x, unsigned int length, vector const &par, vector > const &dims, double const *lower, double const *upper, RNG *rng) const { randomSample(x, length, SCALE(par), DF(par), NROW(dims), rng); } bool DWish::checkParameterDim (vector > const &dims) const { return isSquareMatrix(dims[0]) && isScalar(dims[1]); } vector DWish::dim(vector > const &dims) const { return dims[0]; } bool DWish::checkParameterValue(vector const &par, vector > const &dims) const { // Check that we have sufficient degrees of freedom if (DF(par) < NROW(dims)) return false; // Check scale matrix double const *scale = SCALE(par); unsigned int n = NROW(dims); return check_symmetry(scale, n) && check_symmetric_ispd(scale, n); } void DWish::support(double *lower, double *upper, unsigned int length, vector const &par, vector > const &dims) const { for (unsigned int i = 0; i < length; ++i) { if (i % NROW(dims) == i / NROW(dims)) { //Diagonal elements lower[i] = 0; } else { lower[i] = JAGS_NEGINF; } upper[i] = JAGS_POSINF; } } void DWish::typicalValue(double *x, unsigned int length, vector const &par, vector > const &dims, double const *lower, double const *upper) const { /* Returns the mean as a typical value. We need to invert the scale matrix */ if (!inverse_spd(x, SCALE(par), NROW(dims))) { throwDistError(this, "Inverse failed in typicalValue"); } for (unsigned int i = 0; i < length; ++i) { x[i] *= DF(par); } } bool DWish::isSupportFixed(vector const &fixmask) const { return true; } unsigned int DWish::df(vector > const &dims) const { return dims[0][0] * (dims[0][0] + 1) / 2; } }} JAGS-4.3.2/src/modules/bugs/distributions/DBin.cc0000664000175000017500000000415214224052514016414 00000000000000#include #include "DBin.h" #include #include #include #include using std::vector; using std::max; using std::min; using std::string; /* BUGS parameterization is in opposite order to R parameterization */ #define SIZE(par) (*par[1]) #define PROB(par) (*par[0]) namespace jags { namespace bugs { DBin::DBin() : RScalarDist("dbin", 2, DIST_SPECIAL, true) {} string DBin::alias() const { return "dbinom"; } bool DBin::checkParameterDiscrete (vector const &mask) const { return mask[1] == true; } bool DBin::checkParameterValue (vector const &par) const { return (SIZE(par) >= 0 && PROB(par) >= 0.0 && PROB(par) <= 1.0); } double DBin::d(double x, PDFType type, vector const &par, bool give_log) const { return dbinom(x, SIZE(par), PROB(par), give_log); } double DBin::p(double x, vector const &par, bool lower, bool give_log) const { return pbinom(x, SIZE(par), PROB(par), lower, give_log); } double DBin::q(double p, vector const &par, bool lower, bool log_p) const { return qbinom(p, SIZE(par), PROB(par), lower, log_p); } double DBin::r(vector const &par, RNG *rng) const { return rbinom(SIZE(par), PROB(par), rng); } double DBin::l(vector const &par) const { return 0; } double DBin::u(vector const &par) const { return SIZE(par); } bool DBin::isSupportFixed(vector const &fixmask) const { return fixmask[1]; //SIZE is fixed; } double DBin::KL(vector const &par0, vector const &par1) const { double N0 = SIZE(par0); double N1 = SIZE(par1); double p0 = PROB(par0); double p1 = PROB(par1); //FIXME: If N0 < N1 then we can still calculate finite KL if (N0 != N1) { return JAGS_POSINF; } else if (p0 == 0) { return - N0 * log(1 - p1); } else if (p0 == 1) { return - N0 * log(p1); } else { return (N0 * p0 * (log(p0) - log(p1)) + N0 * (1 - p0) * (log(1 - p0) - log(1 - p1))); } } }} JAGS-4.3.2/src/modules/bugs/distributions/DDexp.cc0000664000175000017500000000366614224052514016615 00000000000000#include #include "DDexp.h" #include #include #include using std::vector; static inline double MU(vector const &par) { return *par[0]; } static inline double SCALE(vector const &par) { return 1/(*par[1]); } static inline double RATE(vector const &par) { return *par[1]; } namespace jags { namespace bugs { DDexp::DDexp() : RScalarDist("ddexp", 2, DIST_UNBOUNDED) {} bool DDexp::checkParameterValue (vector const &par) const { return (*par[1] > 0); } double DDexp::d(double x, PDFType type, vector const &par, bool dolog) const { double d = dexp(fabs(x - MU(par)), SCALE(par), dolog); if (dolog) return d - log(2.0); else return d/2; } double DDexp::p(double x, vector const &par, bool lower, bool dolog) const { if (!lower) x = 2 * MU(par) - x; double p; if (x < MU(par)) { p = pexp(MU(par) - x, SCALE(par), false, false)/2; } else { p = 0.5 + pexp(x - MU(par), SCALE(par), true, false)/2; } if (dolog) return log(p); else return p; } double DDexp::q(double p, vector const &par, bool lower, bool log_p) const { if (log_p) p = exp(p); if (!lower) p = 1 - p; if (p < 0.5) { return MU(par) - qexp(2 * p, SCALE(par), false, false); } else { return MU(par) + qexp(2 * (p - 0.5), SCALE(par), true, false); } } double DDexp::r(vector const &par, RNG *rng) const { double ans = MU(par); if (rng->uniform() < 0.5) ans -= rexp(SCALE(par), rng); else ans += rexp(SCALE(par), rng); return ans; } double DDexp::KL(vector const &par0, vector const &par1) const { double r = RATE(par1) / RATE(par0); double delta = RATE(par0) * std::abs(MU(par1) - MU(par0)); return r * (delta + exp(-delta)) - 1 - log(r); } }} JAGS-4.3.2/src/modules/bugs/distributions/DGamma.cc0000664000175000017500000000366314224052514016734 00000000000000#include #include "DGamma.h" #include #include using std::vector; #define SHAPE(par) (*par[0]) #define SCALE(par) (1 / *par[1]) #define RATE(par) (*par[1]) namespace jags { namespace bugs { DGamma::DGamma() : RScalarDist("dgamma", 2, DIST_POSITIVE) {} bool DGamma::checkParameterValue (vector const &par) const { return (SHAPE(par) > 0 && RATE(par) > 0); } double DGamma::d(double x, PDFType type, vector const &par, bool give_log) const { if (type == PDF_PRIOR) { //Avoid expensive evaluation of gamma function if (x < 0) { return give_log ? JAGS_NEGINF : 0; } else if (x == 0) { //Density at zero defined by continuity return xlog0(SHAPE(par) - 1, give_log); } else { double y = (SHAPE(par) - 1) * log(x) - RATE(par) * x; return give_log ? y : exp(y); } } else { return dgamma(x, SHAPE(par), SCALE(par), give_log); } } double DGamma::p(double q, vector const &par, bool lower, bool give_log) const { return pgamma(q, SHAPE(par), SCALE(par), lower, give_log); } double DGamma::q(double p, vector const &par, bool lower, bool log_p) const { return qgamma(p, SHAPE(par), SCALE(par), lower, log_p); } double DGamma::r(vector const &par, RNG *rng) const { return rgamma(SHAPE(par), SCALE(par), rng); } double DGamma::typicalValue(vector const &par, double const *lower, double const *upper) const { if (lower == 0 && upper == 0) { return SHAPE(par) * SCALE(par); } else { return RScalarDist::typicalValue(par, lower, upper); } } double DGamma::KL(vector const &par0, vector const &par1) const { double b0 = SHAPE(par0), b1 = SHAPE(par1); double r = RATE(par1) / RATE(par0); return (r - 1) * b0 - b1 * log(r) + (b0 - b1) * digamma(b0) + lgammafn(b1) - lgammafn(b0); } }} JAGS-4.3.2/src/modules/bugs/distributions/DLnorm.cc0000664000175000017500000000246114224052514016774 00000000000000#include #include "DLnorm.h" #include #include using std::vector; #define MU(par) (*par[0]) #define TAU(par) (*par[1]) #define SDLOG(par) (1/sqrt(*par[1])) namespace jags { namespace bugs { DLnorm::DLnorm() : RScalarDist("dlnorm", 2, DIST_POSITIVE) {} bool DLnorm::checkParameterValue (vector const &par) const { return TAU(par) > 0; } double DLnorm::d(double x, PDFType type, vector const &par, bool give_log) const { return dlnorm(x, MU(par), SDLOG(par), give_log); } double DLnorm::p(double q, vector const &par, bool lower, bool give_log) const { return plnorm(q, MU(par), SDLOG(par), lower, give_log); } double DLnorm::q(double p, vector const &par, bool lower, bool log_p) const { return qlnorm(p, MU(par), SDLOG(par), lower, log_p); } double DLnorm::r(vector const &par, RNG *rng) const { return rlnorm(MU(par), SDLOG(par), rng); } double DLnorm::KL(vector const &par0, vector const &par1) const { //Same as the normal distribution double mu0 = MU(par0), tau0 = TAU(par0); double mu1 = MU(par1), tau1 = TAU(par1); return ((mu0 - mu1) * (mu0 - mu1) * tau1 + tau1/tau0 - 1 + log(tau0/tau1)) / 2; } }} JAGS-4.3.2/src/modules/bugs/distributions/DNorm.cc0000664000175000017500000000412614224052514016620 00000000000000#include #include "DNorm.h" #include #include #include #include using std::vector; #define MU(par) (*par[0]) #define SIGMA(par) (1/sqrt(*par[1])) #define TAU(par) (*par[1]) namespace jags { namespace bugs { DNorm::DNorm() : RScalarDist("dnorm", 2, DIST_UNBOUNDED) {} bool DNorm::checkParameterValue (vector const &par) const { return (TAU(par) > 0); } double DNorm::d(double x, PDFType type, vector const &par, bool give_log) const { return dnorm(x, MU(par), SIGMA(par), give_log); } double DNorm::p(double q, vector const &par, bool lower, bool give_log) const { return pnorm(q, MU(par), SIGMA(par), lower, give_log); } double DNorm::q(double p, vector const &par, bool lower, bool log_p) const { return qnorm(p, MU(par), SIGMA(par), lower, log_p); } double DNorm::r(vector const &par, RNG *rng) const { return rnorm(MU(par), SIGMA(par), rng); } double DNorm::randomSample(vector const &par, double const *lower, double const *upper, RNG *rng) const { double mu = MU(par); double sigma = SIGMA(par); //Fix non-finite boundaries: ilr-normal functions do not accept them if (lower && *lower == JAGS_NEGINF) lower = 0; if (upper && *upper == JAGS_POSINF) upper = 0; if (lower && upper) { double left = (*lower - mu)/sigma; double right = (*upper - mu)/sigma; return mu + sigma * inormal(left, right, rng); } else if (lower) { double left = (*lower - mu)/sigma; return mu + sigma * lnormal(left, rng); } else if (upper) { double right = (*upper - mu)/sigma; return mu + sigma * rnormal(right, rng); } else { return rnorm(mu, sigma, rng); } } double DNorm::KL(vector const &par0, vector const &par1) const { double mu0 = MU(par0), tau0 = TAU(par0); double mu1 = MU(par1), tau1 = TAU(par1); return ((mu0 - mu1) * (mu0 - mu1) * tau1 + tau1/tau0 - 1 + log(tau0/tau1)) / 2; } }} JAGS-4.3.2/src/modules/bugs/distributions/DPois.cc0000664000175000017500000000315514224052514016620 00000000000000#include #include "DPois.h" #include #include #include #include using std::vector; using std::max; #define LAMBDA(par) (*par[0]) #define R_D_nonint(x) (fabs((x) - floor((x)+0.5)) > 1e-7) namespace jags { namespace bugs { DPois::DPois() : RScalarDist("dpois", 1, DIST_POSITIVE, true) {} bool DPois::checkParameterValue (vector const &par) const { return (LAMBDA(par) >= 0); } double DPois::d(double x, PDFType type, vector const &par, bool give_log) const { if (type == PDF_LIKELIHOOD) { //Avoid expensive normalizing constant double lambda = LAMBDA(par); if (x < 0 || (lambda == 0 && x != 0) || R_D_nonint(x) || !jags_finite(lambda)) { return give_log ? JAGS_NEGINF : 0; } double y = -lambda; if (lambda > 0) { y += x * log(lambda); } return give_log ? y : exp(y); } else { return dpois(x, LAMBDA(par), give_log); } } double DPois::p(double q, vector const &par, bool lower, bool give_log) const { return ppois(q, LAMBDA(par), lower, give_log); } double DPois::q(double p, vector const &par, bool lower, bool log_p) const { return qpois(p, LAMBDA(par), lower, log_p); } double DPois::r(vector const &par, RNG *rng) const { return rpois(LAMBDA(par), rng); } double DPois::KL(vector const &par0, vector const &par1) const { double lambda0 = LAMBDA(par0); double lambda1 = LAMBDA(par1); return lambda0 * (log(lambda0) - log(lambda1)) - lambda0 + lambda1; } }} JAGS-4.3.2/src/modules/bugs/distributions/DUnif.cc0000664000175000017500000000322014224052514016600 00000000000000#include #include "DUnif.h" #include #include #include using std::vector; using std::log; #define LOWER(par) (*par[0]) #define UPPER(par) (*par[1]) namespace jags { namespace bugs { DUnif::DUnif() : ScalarDist("dunif", 2, DIST_SPECIAL) {} bool DUnif::checkParameterValue (vector const &par) const { return (LOWER(par) < UPPER(par)); } double DUnif::logDensity(double x, PDFType type, vector const &par, double const *lower, double const *upper) const { if (x < LOWER(par) || x > UPPER(par)) return JAGS_NEGINF; else if (type == PDF_PRIOR) return 0; else return - log(UPPER(par) - LOWER(par)); } double DUnif::randomSample(vector const &par, double const *lower, double const *upper, RNG *rng) const { return LOWER(par) + rng->uniform() * (UPPER(par) - LOWER(par)); } double DUnif::typicalValue(vector const &par, double const *lower, double const *upper) const { return (LOWER(par) + UPPER(par))/2; } double DUnif::l(vector const &par) const { return LOWER(par); } double DUnif::u(vector const &par) const { return UPPER(par); } bool DUnif::isSupportFixed(vector const &fixmask) const { return fixmask[0] && fixmask[1]; //Lower and upper bounds fixed } double DUnif::KL(vector const &par0, vector const &par1) const { if (LOWER(par0) < LOWER(par1)) return JAGS_POSINF; if (UPPER(par0) > UPPER(par1)) return JAGS_POSINF; return log(UPPER(par1) - LOWER(par1)) - log(UPPER(par0) - LOWER(par0)); } }} JAGS-4.3.2/src/modules/bugs/distributions/DMT.cc0000664000175000017500000000634014224052514016225 00000000000000#include #include #include #include "DMNorm.h" #include "DMT.h" #include #include #include #include #include using std::vector; namespace jags { namespace bugs { DMT::DMT() : ArrayDist("dmt", 3) {} double DMT::logDensity(double const *x, unsigned int m, PDFType type, vector const ¶meters, vector > const &dims, double const *lower, double const *upper) const { double const * mu = parameters[0]; double const * T = parameters[1]; double k = parameters[2][0]; /* Calculate inner product ip = t(x - mu) %*% T %*% (x - mu) */ double ip = 0; double * delta = new double[m]; for (unsigned int i = 0; i < m; ++i) { delta[i] = x[i] - mu[i]; double const *Ti = T + i*m; ip += (delta[i] * Ti[i] * delta[i]); for (unsigned int j = 0; j < i; ++j) { ip += 2 * delta[i] * Ti[j] * delta[j]; } } delete [] delta; double d = m; // Avoid problems with integer division if (type == PDF_PRIOR) { //No need to calculate normalizing constant return -((k + d)/2) * log(1 + ip/k); } else { return -((k + d)/2) * log(1 + ip/k) + logdet(T, m)/2 + lgammafn((k + d)/2) - lgammafn(k/2) - (d/2) * log(k) - (d/2) * log(M_PI); } } void DMT::randomSample(double *x, unsigned int length, vector const ¶meters, vector > const &dims, double const *lower, double const *upper, RNG *rng) const { double const * mu = parameters[0]; double const * T = parameters[1]; double k = *parameters[2]; DMNorm::randomsample(x, mu, T, true, length, rng); double C = sqrt(rchisq(k, rng)/k); for (unsigned int i = 0; i < length; ++i) { x[i] = mu[i] + (x[i] - mu[i]) / C; } } bool DMT::checkParameterDim(vector > const &dims) const { if (!isVector(dims[0])) return false; if (!isSquareMatrix(dims[1])) return false; if (dims[0][0] != dims[1][0]) return false; if (!isScalar(dims[2])) return false; return true; } vector DMT::dim(vector > const &dims) const { return dims[0]; } bool DMT::checkParameterValue(vector const ¶meters, vector > const &dims) const { unsigned int n = dims[0][0]; double const *T = parameters[1]; double k = *parameters[2]; if (k < 2) { return false; } else { //NB Not checking positive definiteness return check_symmetry(T, n); } } void DMT::support(double *lower, double *upper, unsigned int length, vector const ¶meters, vector > const &dims) const { for (unsigned int i = 0; i < length; ++i) { lower[i] = JAGS_NEGINF; upper[i] = JAGS_POSINF; } } void DMT::typicalValue(double *x, unsigned int length, vector const ¶meters, vector > const &dims, double const *lower, double const *upper) const { for (unsigned int i = 0; i < length; ++i) { x[i] = parameters[0][i]; } } bool DMT::isSupportFixed(vector const &fixmask) const { return true; } }} JAGS-4.3.2/src/modules/bugs/distributions/DGenGamma.cc0000664000175000017500000000455314224052514017365 00000000000000#include #include "DGenGamma.h" #include /* if x ~ dgen.gamma(r, mu, beta) then (mu*x)^beta ~ dgamma(r, 1) */ using std::vector; using std::string; #define SHAPE(par) (*par[0]) //The rate if POW(par) = 1 and we have a gamma distribution #define URATE(par) (*par[1]) #define POW(par) (*par[2]) static inline double transform(double x, vector const &par) { // y <- (mu*x)^beta return exp(POW(par) * (log(x) + log(URATE(par)))); } static inline double UNtransform(double y, vector const &par) { // x <- y^(1/beta) / mu return exp(log(y) / POW(par) - log(URATE(par))); } namespace jags { namespace bugs { DGenGamma::DGenGamma() : RScalarDist("dgen.gamma", 3, DIST_POSITIVE) {} string DGenGamma::alias() const { return "dggamma"; } bool DGenGamma::checkParameterValue (vector const &par) const { return (SHAPE(par) > 0 && URATE(par) > 0 && POW(par) > 0); } double DGenGamma::d(double x, PDFType type, vector const &par, bool give_log) const { double log_jacobian = (POW(par) - 1)*log(x) + log(POW(par)) + POW(par) * log(URATE(par)); x = transform(x, par); double d = dgamma(x, SHAPE(par), 1.0, give_log); if (give_log) { return log_jacobian + d; } else { return exp(log_jacobian) * d; } } double DGenGamma::p(double q, vector const &par, bool lower, bool give_log) const { q = transform(q, par); return pgamma(q, SHAPE(par), 1.0, lower, give_log); } double DGenGamma::q(double p, vector const &par, bool lower, bool log_p) const { double q = qgamma(p, SHAPE(par), 1.0, lower, log_p); return UNtransform(q, par); } double DGenGamma::r(vector const &par, RNG *rng) const { double x = rgamma(SHAPE(par), 1.0, rng); return UNtransform(x, par); } double DGenGamma::KL(vector const &par0, vector const &par1) const { // Collapses to gamma distribution with beta1 = beta2 = 1; double beta0 = POW(par0), beta1 = POW(par1); double theta = URATE(par1) / URATE(par0); double phi = beta1 / beta0; double r0 = SHAPE(par0), r1 = SHAPE(par1); return - log(phi) - beta1 * r1 * log(theta) + (r0 - phi * r1) * digamma(r0) + pow(theta, beta1) * gammafn(r0 + phi) / gammafn(r0) - r0 + lgammafn(r1) - lgammafn(r0); } }} JAGS-4.3.2/src/modules/bugs/distributions/DF.cc0000664000175000017500000000232014224052514016064 00000000000000#include #include "DF.h" #include #include using std::vector; namespace jags { namespace bugs { DF::DF() : RScalarDist("df", 2, DIST_POSITIVE) {} bool DF::checkParameterValue (vector const &par) const { return (*par[0] > 0 && *par[1] > 0); } double DF::d(double x, PDFType type, vector const &par, bool give_log) const { if (type == PDF_PRIOR) { double n = *par[0]/2, m = *par[1]/2; if (x < 0) { return give_log ? JAGS_NEGINF : 0; } else if (x == 0) { //Density at zero defined by continuity return xlog0(n - 1, give_log); } else { double y = (n - 1) * log(x) - (n + m) * log(1 + n * x / m); return give_log ? y : exp(y); } } else { return dF(x, *par[0], *par[1], give_log); } } double DF::p(double x, vector const &par, bool lower, bool use_log) const { return pF(x, *par[0], *par[1], lower, use_log); } double DF::q(double p, vector const &par, bool lower, bool log_p) const { return qF(p, *par[0], *par[1], lower, log_p); } double DF::r(vector const &par, RNG *rng) const { return rF(*par[0], *par[1], rng); } }} JAGS-4.3.2/src/modules/bugs/distributions/DNChisqr.cc0000664000175000017500000000214314224052514017251 00000000000000#include #include "DNChisqr.h" #include using std::vector; using std::string; #define DF(par) (*par[0]) #define NCP(par) (*par[1]) namespace jags { namespace bugs { DNChisqr::DNChisqr() : RScalarDist("dnchisqr", 2, DIST_POSITIVE) {} string DNChisqr::alias() const { return "dnchisq"; } bool DNChisqr::checkParameterValue (vector const &par) const { return (DF(par) > 0 && NCP(par) >= 0); } double DNChisqr::d(double x, PDFType type, vector const &par, bool give_log) const { return dnchisq(x, DF(par), NCP(par), give_log); } double DNChisqr::p(double q, vector const &par, bool lower, bool log_p) const { return pnchisq(q, DF(par), NCP(par), lower, log_p); } double DNChisqr::q(double p, vector const &par, bool lower, bool log_p) const { return qnchisq(p, DF(par), NCP(par), lower, log_p); } double DNChisqr::r(vector const &par, RNG *rng) const { return rnchisq(DF(par), NCP(par), rng); } }} JAGS-4.3.2/src/modules/bugs/distributions/DRound.cc0000664000175000017500000000365214224052514016777 00000000000000#include #include #include "JRmath.h" #include "DRound.h" #include #include using std::min; using std::max; using std::vector; using std::vector; #define T(par) (*par[0]) #define NDIGITS(par) (*par[1]) static inline double value(vector const &par) { return fround(T(par), NDIGITS(par)); } static double tol = 16 * DBL_EPSILON; namespace jags { namespace bugs { DRound::DRound() : ScalarDist("dround", 2, DIST_SPECIAL) { } bool DRound::checkParameterValue(vector const ¶meters) const { return true; } bool DRound::checkParameterDiscrete(vector const &mask) const { return mask[1]; } double DRound::logDensity(double y, PDFType type, vector const &par, double const *lower, double const *upper) const { return fabs(y - value(par)) < tol ? 0 : JAGS_NEGINF; } double DRound::randomSample(vector const &par, double const *lower, double const *upper, RNG *rng) const { /* The random sample from DRound is not random at all, but deterministic. */ return value(par); } double DRound::typicalValue(vector const &par, double const *lower, double const *upper) const { return value(par); } unsigned int DRound::df() const { return 0; } double DRound::l(vector const &par) const { return value(par); } double DRound::u(vector const &par) const { return value(par); } bool DRound::isSupportFixed(vector const &fixmask) const { return fixmask[0] && fixmask[1]; } double DRound::KL(vector const &par0, vector const &par1) const { if (value(par0) == value(par1)) { return 0; } else { return JAGS_POSINF; } } }} JAGS-4.3.2/src/modules/bugs/distributions/DNT.cc0000664000175000017500000000321314224052514016222 00000000000000#include #include "DNT.h" #include #include using std::vector; static inline double MU(vector const &par) { return *par[0]; } static inline double TAU(vector const &par) { return *par[1]; } static inline double DF(vector const &par) { return *par[2]; } static inline double SIGMA(vector const &par) { //Standard deviation of numerator return 1/sqrt(TAU(par)); } static inline double DELTA(vector const &par) { //Non-centrality parameter of scaled x return MU(par)/SIGMA(par); } namespace jags { namespace bugs { DNT::DNT() : RScalarDist("dnt", 3, DIST_UNBOUNDED) {} bool DNT::checkParameterValue (vector const &par) const { return (TAU(par) > 0 && DF(par) > 0 && fabs(DELTA(par)) <= 37.62); } double DNT::d(double x, PDFType type, vector const &par, bool give_log) const { x /= SIGMA(par); if (give_log) { return dnt(x, DF(par), DELTA(par), 1) - log(SIGMA(par)); } else { return dnt(x, DF(par), DELTA(par), 0) / SIGMA(par); } } double DNT::p(double x, vector const &par, bool lower, bool use_log) const { return pnt(x/SIGMA(par), DF(par), DELTA(par), lower, use_log); } double DNT::q(double p, vector const &par, bool lower, bool log_p) const { return qnt(p, DF(par), DELTA(par), lower, log_p) * SIGMA(par); } double DNT::r(vector const &par, RNG *rng) const { double k = DF(par); return rnorm(MU(par), SIGMA(par), rng)/sqrt(rchisq(k, rng)/k); } } } JAGS-4.3.2/src/modules/bugs/distributions/SumDist.cc0000664000175000017500000000540314224052514017170 00000000000000#include #include #include #include #include #include "SumDist.h" #include #include #include using std::vector; using std::fabs; using std::sqrt; using std::accumulate; namespace jags { namespace bugs { static const double TOL = sqrt(DBL_EPSILON); static double evaluate(vector const &args, vector const &lengths) { double value = 0; for (unsigned int j = 0; j < args.size(); ++j) { double const *a = args[j]; value = accumulate(a, a + lengths[j], value); } return value; } SumDist::SumDist() : VectorDist("sum", 0) { } bool SumDist::isDiscreteValued(vector const &mask) const { return allTrue(mask); } double SumDist::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector const &lengths, double const *lower, double const *upper) const { return fabs(*x - evaluate(par, lengths)) > TOL ? JAGS_NEGINF : 0; } void SumDist::randomSample(double *x, unsigned int length, vector const &par, vector const &lengths, double const *lower, double const *upper, RNG *rng) const { *x = evaluate(par, lengths); } void SumDist::typicalValue(double *x, unsigned int length, vector const &par, vector const &lengths, double const *lower, double const *upper) const { *x = evaluate(par, lengths); } bool SumDist::isSupportFixed(vector const &fixmask) const { return allTrue(fixmask); } unsigned int SumDist::df(vector const &lengths) const { return 0; } bool SumDist::checkParameterValue(vector const ¶ms, vector const &lengths) const { return true; } bool SumDist::checkParameterLength (vector const &lengths) const { if (lengths.empty()) return false; for (unsigned int i = 1; i < lengths.size(); ++i) { if (lengths[i] == 0) return false; } return true; } bool SumDist::checkParameterDiscrete(vector const &mask) const { for (unsigned int i = 1; i < mask.size(); ++i) { if (mask[i] != mask[0]) return false; } return true; } void SumDist::support(double *lower, double *upper, unsigned int length, vector const &par, vector const &lengths) const { *lower = *upper = evaluate(par, lengths); } unsigned int SumDist::length(vector const &lengths) const { return 1; } }} JAGS-4.3.2/src/modules/bugs/distributions/DSample.cc0000664000175000017500000001457014224052514017132 00000000000000#include #include "DSample.h" #include #include #include #include #include #include #include #include using std::vector; using std::list; using std::log; using std::min; using std::fill; using std::accumulate; using std::sort; using std::exp; static inline double SIZE(vector const &par) { return *par[1]; } /* Utility functions used to sort probabilities in descending order */ static inline bool gt_doubleptr (double const *arg1, double const *arg2) { return *arg1 > *arg2; } static inline bool gt_double (double arg1, double arg2) { return arg1 > arg2; } namespace jags { namespace bugs { DSample::DSample() : VectorDist("dsample", 2) {} bool DSample::isDiscreteValued(vector const &mask) const { return true; //Takes only 0, 1 values } bool DSample::checkParameterLength(vector const &len) const { //Check that PROB is non-empty and SIZE is a scalar return len[0] >= 1 && len[1] == 1; } bool DSample::checkParameterDiscrete(vector const &mask) const { return mask[1]; //SIZE is discrete-valued } bool DSample::checkParameterValue(vector const &par, vector const &len) const { if (SIZE(par) < 0 || SIZE(par) > len[0]) { //Too few or too many samples requested return false; } for (unsigned int i = 0; i < len[0]; ++i) { if (par[0][i] <= 0) { //Zero probablity of being sampled return false; } } return true; } unsigned int DSample::length(vector const &len) const { //Length of sample is the same as length of probability weights return len[0]; } double DSample::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector const &parlen, double const *lower, double const *upper) const { /* Basic sanity checks: is x consistent with parameters */ unsigned int T = length; // Length of x unsigned int K = 0; // Count number of sampled values for (unsigned int t = 0; t < T; ++t) { if (x[t] == 1) { ++K; } else if (x[t] != 0) { return JAGS_NEGINF; } } if (SIZE(par) != K) { return JAGS_NEGINF; } /* If there are more sampled than unsampled values then * we turn the calculations around: counting unsampled values * and inverting the probability weights. */ int sign = 1; int y = 1; if (K > T/2) { sign = -1; y = 0; K = T - K; } /* Probability weights are normalized to have maximum zero on the * log scale */ double const *p = par[0]; // Vector of probability weights vector logp(T); // Log probability weights double lpmax = JAGS_NEGINF; for (unsigned int t = 0; t < T; ++t) { logp[t] = sign * log(p[t]); if (logp[t] > lpmax) { lpmax = logp[t]; } } /* Likelihood calculations */ double loglik = 0; /* Numerator: contribution to log likelihood of all * sampled values */ for (unsigned int t = 0; t < T; ++t) { if (x[t] == y) { loglik += logp[t] - lpmax; } } if (type != PDF_PRIOR) { /* Denominator: Recursively calculate contributions over * all possible case sets of size K */ /* For numerical stability, sort elements of logp in descending order. This ensures that we are adding increasingly smaller terms to f[k] for k in 1:(K+1) */ sort(logp.begin(), logp.end(), gt_double); vector f(K + 1, 0); f[0] = 1; for (unsigned int t = 0; t < T; ++t) { double Ct = exp(logp[t] - lpmax); for (unsigned int k = min(K, t+1); k > 0; --k) { f[k] += Ct * f[k-1]; } } loglik -= log(f[K]); } return loglik; } void DSample::randomSample(double *x, unsigned int length, vector const &par, vector const &parlen, double const *lower, double const *upper, RNG *rng) const { double const * const probs = par[0]; const int N = parlen[0]; //Create a vector of pointers to the elements of the vector //of probability weights. Sort them in reverse order. list pptrs(N); list::iterator q; double const *y; for (q = pptrs.begin(), y = par[0]; q != pptrs.end(); ++q) { *q = y++; } pptrs.sort(gt_doubleptr); //Initialize sample value by setting all elements to zero fill(x, x + N, 0); double sump = accumulate(probs, probs + N, 0.0); unsigned int K = static_cast(SIZE(par)); for (unsigned int k = 0; k < K; ++k) { double prand = sump * rng->uniform(); for (q = pptrs.begin(); q != pptrs.end(); ++q) { prand -= **q; if (prand <= 0) { unsigned int i = *q - probs; x[i] = 1; sump -= **q; pptrs.erase(q); break; } } } } void DSample::support(double *lower, double *upper, unsigned int length, vector const &par, vector const &len) const { for (unsigned int i = 0; i < length; ++i) { lower[i] = 0; upper[i] = 1; } } void DSample::typicalValue(double *x, unsigned int length, vector const &par, vector const &parlen, double const *lower, double const *upper) const { int N = parlen[0]; double const * const probs = par[0]; //Create a vector of pointers to the elements of the vector //of probability weights. Sort them in reverse order. list pptrs(N); list::iterator q; double const *y = probs; for (q = pptrs.begin(); q != pptrs.end(); ++q) { *q = y++; } pptrs.sort(gt_doubleptr); //Initialize sample value by setting all elements to zero fill(x, x + N, 0); //Set elements of x corresponding to the K largest probability //weights to 1. unsigned int K = static_cast(SIZE(par)); for (q = pptrs.begin(); q != pptrs.end(); ++q) { unsigned int i = *q - probs; x[i] = 1; K--; if (K == 0) { break; } } } bool DSample::isSupportFixed(vector const &fixmask) const { return true; } unsigned int DSample::df(vector const &parlen) const { return parlen[0]; } } } JAGS-4.3.2/src/modules/bugs/distributions/DRW1.cc0000664000175000017500000000516114224052514016316 00000000000000#include #include "DRW1.h" #include #include #include #include #include using std::vector; using std::string; using std::abs; #define TAU(par) (*par[0]) #define XCOORDS(par) (par[1]) namespace jags { namespace bugs { DRW1::DRW1() : VectorDist("drw1", 2) {} unsigned int DRW1::length(vector const &len) const { return len[1]; } bool DRW1::checkParameterLength(vector const &len) const { return len[0] == 1 && len[1] > 1; } bool DRW1::checkParameterValue(vector const &par, vector const &len) const { unsigned int N = len[1]; double const *xcoords = XCOORDS(par); double tau = TAU(par); //Only regular random walks are supported for (unsigned int i = 1; i < N; ++i) { double delta = xcoords[i] - xcoords[i-1]; if (abs(delta - 1) > 1.0E-6) return false; } if (tau < 0) return false; return true; } double DRW1::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector const &len, double const *lower, double const *upper) const { double tau = TAU(par); double sigma = 1/sqrt(tau); double loglik = 0.0; for (unsigned int i = 1; i < length; i++) { loglik += dnorm(x[i] - x[i-1], 0, sigma, true); } return loglik; } void DRW1::randomSample(double *x, unsigned int length, vector const &par, vector const &len, double const *lower, double const *upper, RNG *rng) const { double tau = TAU(par); double sigma = 1/sqrt(tau); double S = 0.0; x[0] = 0; for (unsigned int i = 1; i < length; i++) { x[i] = x[i-1] + rnorm(0, sigma, rng); S += x[i]; } S /= length; for (unsigned int i = 0; i < length; i++) { x[i] -= S; } } void DRW1::support(double *lower, double *upper, unsigned int length, vector const &par, vector const &len) const { for (unsigned int i = 0; i < length; ++i) { lower[i] = JAGS_NEGINF; upper[i] = JAGS_POSINF; } } void DRW1::typicalValue(double *x, unsigned int length, vector const &par, vector const &len, double const *lower, double const *upper) const { for (unsigned int i = 0; i < length; ++i) { x[i] = 0; } } bool DRW1::isSupportFixed(vector const &fixmask) const { return true; } unsigned int DRW1::df(vector const &len) const { return len[1] - 1; } } } JAGS-4.3.2/src/modules/bugs/distributions/DMNormVC.cc0000664000175000017500000000614614224052514017172 00000000000000#include #include #include #include "DMNormVC.h" #include "DMNorm.h" #include #include #include #include #include #include #include "matrix.h" using std::vector; namespace jags { namespace bugs { DMNormVC::DMNormVC() : ArrayDist("dmnorm.vcov", 2) {} double DMNormVC::logDensity(double const *x, unsigned int m, PDFType type, vector const ¶meters, vector > const &dims, double const *lower, double const *upper) const { double const * mu = parameters[0]; double const * V = parameters[1]; vector T(m * m); inverse_spd (&T[0], V, m); double loglik = 0; vector delta(m); for (unsigned int i = 0; i < m; ++i) { delta[i] = x[i] - mu[i]; loglik -= (delta[i] * T[i + i * m] * delta[i])/2; for (unsigned int j = 0; j < i; ++j) { loglik -= delta[i] * T[i + j * m] * delta[j]; } } switch(type) { case PDF_PRIOR: break; case PDF_LIKELIHOOD: loglik -= logdet(V, m)/2; break; case PDF_FULL: loglik -= logdet(V, m)/2 + m * M_LN_SQRT_2PI; break; } return loglik; } void DMNormVC::randomSample(double *x, unsigned int m, vector const ¶meters, vector > const &dims, double const *lower, double const *upper, RNG *rng) const { double const * mu = parameters[0]; double const * T = parameters[1]; DMNorm::randomsample(x, mu, T, false, m, rng); } bool DMNormVC::checkParameterDim(vector > const &dims) const { //Allow scalar mean and precision. if (isScalar(dims[0]) && isScalar(dims[1])) return true; //Vector mean and matrix precision if (!isVector(dims[0])) return false; if (!isSquareMatrix(dims[1])) return false; if (dims[0][0] != dims[1][0]) return false; return true; } vector DMNormVC::dim(vector > const &dims) const { return dims[0]; } bool DMNormVC::checkParameterValue(vector const ¶meters, vector > const &dims) const { double const *precision = parameters[1]; unsigned int n = dims[0][0]; return check_symmetry(precision, n) && check_symmetric_ispd(precision, n); } void DMNormVC::support(double *lower, double *upper, unsigned int length, vector const ¶meters, vector > const &dims) const { for (unsigned int i = 0; i < length; ++i) { lower[i] = JAGS_NEGINF; upper[i] = JAGS_POSINF; } } void DMNormVC::typicalValue(double *x, unsigned int m, vector const ¶meters, vector > const &dims, double const *lower, double const *upper) const { for (unsigned int i = 0; i < m; ++i) { x[i] = parameters[0][i]; } } bool DMNormVC::isSupportFixed(vector const &fixmask) const { return true; } } } JAGS-4.3.2/src/modules/bugs/distributions/testbugsdist.cc0000664000175000017500000006114614224052514020332 00000000000000#include "testbugsdist.h" #include "DBern.h" #include "DBeta.h" #include "DBin.h" #include "DCat.h" #include "DChisqr.h" #include "DDexp.h" #include "DDirch.h" #include "DExp.h" #include "DF.h" #include "DGamma.h" #include "DGenGamma.h" #include "DHyper.h" #include "DInterval.h" #include "DLnorm.h" #include "DLogis.h" #include "DMNorm.h" #include "DMNormVC.h" #include "DMT.h" #include "DMulti.h" #include "DNChisqr.h" #include "DNegBin.h" #include "DNorm.h" #include "DNT.h" #include "DPar.h" #include "DPois.h" #include "DRound.h" #include "DSample.h" #include "DSum.h" #include "DT.h" #include "DUnif.h" #include "DWeib.h" #include "DWish.h" #include #include #include #include #include #include #include using std::string; using std::vector; using std::sqrt; using std::max; using std::min; using std::multiset; using std::abs; using std::ostringstream; using std::sort; using jags::ScalarDist; using jags::RScalarDist; void BugsDistTest::setUp() { _rng = new jags::base::MersenneTwisterRNG(1234567, jags::KINDERMAN_RAMAGE); _dbern = new jags::bugs::DBern(); _dbeta = new jags::bugs::DBeta(); _dbin = new jags::bugs::DBin(); _dcat = new jags::bugs::DCat(); _dchisqr = new jags::bugs::DChisqr(); _ddirch = new jags::bugs::DDirch(); _ddexp = new jags::bugs::DDexp(); _dexp = new jags::bugs::DExp(); _df = new jags::bugs::DF(); _dgamma = new jags::bugs::DGamma(); _dgengamma = new jags::bugs::DGenGamma(); _dhyper = new jags::bugs::DHyper(); _dinterval = new jags::bugs::DInterval(); _dlnorm = new jags::bugs::DLnorm(); _dlogis = new jags::bugs::DLogis(); _dmnorm = new jags::bugs::DMNorm(); _dmnormvc = new jags::bugs::DMNormVC(); _dmt = new jags::bugs::DMT(); _dmulti = new jags::bugs::DMulti(); _dnchisqr = new jags::bugs::DNChisqr(); _dnegbin = new jags::bugs::DNegBin(); _dnorm = new jags::bugs::DNorm(); _dnt = new jags::bugs::DNT(); _dpar = new jags::bugs::DPar(); _dpois = new jags::bugs::DPois(); _dround = new jags::bugs::DRound(); _dsample = new jags::bugs::DSample(); _dsum = new jags::bugs::DSum(); _dt = new jags::bugs::DT(); _dunif = new jags::bugs::DUnif(); _dweib = new jags::bugs::DWeib(); _dwish = new jags::bugs::DWish(); } void BugsDistTest::tearDown() { delete _rng; delete _dbern; delete _dbeta; delete _dbin; delete _dcat; delete _dchisqr; delete _ddirch; delete _ddexp; delete _dexp; delete _df; delete _dgamma; delete _dgengamma; delete _dhyper; delete _dinterval; delete _dlnorm; delete _dlogis; delete _dmnorm; delete _dmnormvc; delete _dmt; delete _dmulti; delete _dnchisqr; delete _dnegbin; delete _dnorm; delete _dnt; delete _dpar; delete _dpois; delete _dround; delete _dsample; delete _dsum; delete _dt; delete _dunif; delete _dweib; delete _dwish; } void BugsDistTest::npar() { //CPPUNIT_ASSERT_MESSAGE("npar check", false); CPPUNIT_ASSERT_EQUAL(_dbern->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_dbeta->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dbin->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dcat->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_dchisqr->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_ddirch->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_ddexp->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dexp->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_df->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dgamma->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dgengamma->npar(), 3U); CPPUNIT_ASSERT_EQUAL(_dhyper->npar(), 4U); CPPUNIT_ASSERT_EQUAL(_dinterval->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dlnorm->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dlogis->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dmnorm->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dmnormvc->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dmt->npar(), 3U); CPPUNIT_ASSERT_EQUAL(_dmulti->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dchisqr->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_dnegbin->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dnorm->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dnt->npar(), 3U); CPPUNIT_ASSERT_EQUAL(_dpar->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dpois->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_dround->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dsample->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dsum->npar(), 0U); CPPUNIT_ASSERT_EQUAL(_dt->npar(), 3U); CPPUNIT_ASSERT_EQUAL(_dunif->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dweib->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dwish->npar(), 2U); } void BugsDistTest::name() { CPPUNIT_ASSERT_EQUAL(string("dbern"), _dbern->name()); CPPUNIT_ASSERT_EQUAL(string("dbeta"), _dbeta->name()); CPPUNIT_ASSERT_EQUAL(string("dbin"), _dbin->name()); CPPUNIT_ASSERT_EQUAL(string("dcat"), _dcat->name()); CPPUNIT_ASSERT_EQUAL(string("dchisqr"), _dchisqr->name()); CPPUNIT_ASSERT_EQUAL(string("ddirch"), _ddirch->name()); CPPUNIT_ASSERT_EQUAL(string("ddexp"), _ddexp->name()); CPPUNIT_ASSERT_EQUAL(string("dexp"), _dexp->name()); CPPUNIT_ASSERT_EQUAL(string("df"), _df->name()); CPPUNIT_ASSERT_EQUAL(string("dgamma"), _dgamma->name()); CPPUNIT_ASSERT_EQUAL(string("dgen.gamma"), _dgengamma->name()); CPPUNIT_ASSERT_EQUAL(string("dhyper"), _dhyper->name()); CPPUNIT_ASSERT_EQUAL(string("dinterval"), _dinterval->name()); CPPUNIT_ASSERT_EQUAL(string("dlnorm"), _dlnorm->name()); CPPUNIT_ASSERT_EQUAL(string("dlogis"), _dlogis->name()); CPPUNIT_ASSERT_EQUAL(string("dmnorm"), _dmnorm->name()); CPPUNIT_ASSERT_EQUAL(string("dmnorm.vcov"), _dmnormvc->name()); CPPUNIT_ASSERT_EQUAL(string("dmt"), _dmt->name()); CPPUNIT_ASSERT_EQUAL(string("dmulti"), _dmulti->name()); CPPUNIT_ASSERT_EQUAL(string("dnchisqr"), _dnchisqr->name()); CPPUNIT_ASSERT_EQUAL(string("dnegbin"), _dnegbin->name()); CPPUNIT_ASSERT_EQUAL(string("dnorm"), _dnorm->name()); CPPUNIT_ASSERT_EQUAL(string("dnt"), _dnt->name()); CPPUNIT_ASSERT_EQUAL(string("dpar"), _dpar->name()); CPPUNIT_ASSERT_EQUAL(string("dpois"), _dpois->name()); CPPUNIT_ASSERT_EQUAL(string("dround"), _dround->name()); CPPUNIT_ASSERT_EQUAL(string("dsample"), _dsample->name()); CPPUNIT_ASSERT_EQUAL(string("dsum"), _dsum->name()); CPPUNIT_ASSERT_EQUAL(string("dt"), _dt->name()); CPPUNIT_ASSERT_EQUAL(string("dunif"), _dunif->name()); CPPUNIT_ASSERT_EQUAL(string("dweib"), _dweib->name()); CPPUNIT_ASSERT_EQUAL(string("dwish"), _dwish->name()); } void BugsDistTest::alias() { CPPUNIT_ASSERT_EQUAL(string(""), _dbern->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dbeta->alias()); CPPUNIT_ASSERT_EQUAL(string("dbinom"), _dbin->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dcat->alias()); CPPUNIT_ASSERT_EQUAL(string("dchisq"), _dchisqr->alias()); CPPUNIT_ASSERT_EQUAL(string("ddirich"), _ddirch->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _ddexp->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dexp->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _df->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dgamma->alias()); CPPUNIT_ASSERT_EQUAL(string("dggamma"), _dgengamma->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dhyper->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dinterval->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dlnorm->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dlogis->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dmnorm->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dmnormvc->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dmt->alias()); CPPUNIT_ASSERT_EQUAL(string("dmultinom"), _dmulti->alias()); CPPUNIT_ASSERT_EQUAL(string("dnchisq"), _dnchisqr->alias()); CPPUNIT_ASSERT_EQUAL(string("dnbinom"), _dnegbin->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dnorm->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dnt->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dpar->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dpois->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dround->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dsample->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dsum->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dt->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dunif->alias()); CPPUNIT_ASSERT_EQUAL(string("dweibull"), _dweib->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dwish->alias()); } void BugsDistTest::rscalar_rpq(RScalarDist const *dist, vector const &par) { /* Simultaneous test of r, p, and q functions for distributions inheriting from RScalarDist. */ unsigned int nsim = 100; unsigned int nsim2 = 10; unsigned int nquant = 10; CPPUNIT_ASSERT_MESSAGE(dist->name(), checkNPar(dist, par.size())); CPPUNIT_ASSERT_MESSAGE(dist->name(), dist->checkParameterValue(par)); for (unsigned int s = 0; s < nsim; ++s) { //Generate random variable from distribution double y = dist->r(par, _rng); //Pass to distribution function and then to quantile function double p = dist->p(y, par, true, false); CPPUNIT_ASSERT_MESSAGE(dist->name(), p >= 0 && p <= 1); double z = dist->q(p, par, true, false); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); //Now do the same on a log scale double logp = dist->p(y, par, true, true); CPPUNIT_ASSERT_MESSAGE(dist->name(), logp <= 0); z = dist->q(logp, par, true, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); //Using upper tail p = dist->p(y, par, false, false); CPPUNIT_ASSERT_MESSAGE(dist->name(), p >= 0 && p <= 1); z = dist->q(p, par, false, false); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); //Upper tail on log scale logp = dist->p(y, par, false, true); CPPUNIT_ASSERT_MESSAGE(dist->name(), logp <= 0); z = dist->q(logp, par, false, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); } for (unsigned int s = 0; s < nsim2; ++s) { // Test truncated sampling for (unsigned int i = 0; i <= nquant; ++i) { double plim1 = static_cast(i)/nquant; double lim1 = dist->q(plim1, par, true, false); if (i > 0) { // Test sampling from lower tail double y = dist->randomSample(par, 0, &lim1, _rng); CPPUNIT_ASSERT_MESSAGE(dist->name(), y <= lim1); double logpy = dist->p(y, par, true, true); double z = dist->q(logpy, par, true, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol * abs(y)); } if (i < nquant) { // Test sampling from upper tail double y = dist->randomSample(par, &lim1, 0, _rng); CPPUNIT_ASSERT_MESSAGE(dist->name(), y >= lim1); double logpy = dist->p(y, par, false, true); double z = dist->q(logpy, par, false, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol * abs(y)); } for (unsigned int j = i+1; j <= nquant; ++j) { // Test sampling between lower and upper limits double plim2 = static_cast(j)/nquant; double lim2 = dist->q(plim2, par, true, false); double y = dist->randomSample(par, &lim1, &lim2, _rng); CPPUNIT_ASSERT_MESSAGE(dist->name(), y >= lim1 && y <= lim2); double py = dist->p(y, par, true, false); double z = dist->q(py, par, true, false); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol * abs(y)); } } } rscalar_trunclik(dist, par); } static void scalar_trunclik_discrete(RScalarDist const *dist, vector const &par, double bound, bool lower) { // Test normalization of truncated likelihood for discrete variables // by enumeration CPPUNIT_ASSERT(dist->discrete()); double delta = lower ? -1 : 1; double const *ll = 0; double const *uu = 0; if (lower) { uu = &bound; } else { ll = &bound; } double lik = 0; double likmax = dist->logDensity(bound, jags::PDF_FULL, par, ll, uu); double x = bound; for (unsigned int i = 0; i < 1000; ++i) { double y = dist->logDensity(x, jags::PDF_FULL, par, ll, uu); lik += exp(y); if (y > likmax) { likmax = y; } else if (y < likmax - 10) { break; } x += delta; } CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), 1.0, lik, 1e-2); } static void scalar_trunclik_cont(RScalarDist const *dist, vector const &par, double bound, bool lower) { // Test normalization of truncated likelihood for continuous // variables by approximate integration using the trapezoid method CPPUNIT_ASSERT(!dist->discrete()); CPPUNIT_ASSERT(jags_finite(bound)); //Ensure that the density is finite at the other boundary (ob) //If not then just return as this method will not work double ob = lower ? dist->l(par) : dist->u(par); if (jags_finite(ob)) { if (!jags_finite(dist->d(ob, jags::PDF_FULL, par, false))) { return; } } //Create grid of points for evaluating the likelihood //If lower==false then the grid is in reverse order vector x; unsigned int N = 1000; if (jags_finite(ob)) { x.push_back(ob); } double pmax = dist->p(bound, par, lower, false); for (unsigned int i = 1; i < N; ++i) { x.push_back(dist->q(i*pmax/N, par, lower, false)); } x.push_back(bound); // Calculate likelihood by trapezoid method // FIXME: WE could probably do better double lik = 0; double const *ll = lower ? 0 : &bound; double const *uu = lower ? &bound : 0; double y0 = exp(dist->logDensity(x[0], jags::PDF_FULL, par, ll, uu)); for (unsigned int i = 1; i < x.size(); ++i) { double y = exp(dist->logDensity(x[i], jags::PDF_FULL, par, ll, uu)); lik += (x[i] - x[i-1]) * (y + y0) / 2; y0 = y; } if (!lower) { lik = -lik; //adjust for reverse grid } CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), 1.0, lik, 1.1e-2); } void BugsDistTest::rscalar_trunclik(RScalarDist const *dist, vector const &par) { /* Test likelihood calculations for truncated distributions */ CPPUNIT_ASSERT_MESSAGE(dist->name(), checkNPar(dist, par.size())); CPPUNIT_ASSERT_MESSAGE(dist->name(), dist->checkParameterValue(par)); double ll = dist->q(0.1, par, true, false); double uu = dist->q(0.9, par, true, false); if (dist->discrete()) { scalar_trunclik_discrete(dist, par, ll, true); scalar_trunclik_discrete(dist, par, ll, false); scalar_trunclik_discrete(dist, par, uu, true); scalar_trunclik_discrete(dist, par, uu, false); } else { scalar_trunclik_cont(dist, par, ll, true); scalar_trunclik_cont(dist, par, ll, false); scalar_trunclik_cont(dist, par, uu, true); scalar_trunclik_cont(dist, par, uu, false); } } static vector mkPar(double const &v1) { vector par; par.push_back(&v1); return par; } static vector mkPar(double const &v1, double const &v2) { vector par; par.push_back(&v1); par.push_back(&v2); return par; } static vector mkPar(double const &v1, double const &v2, double const &v3) { vector par; par.push_back(&v1); par.push_back(&v2); par.push_back(&v3); return par; } static vector mkPar(double const &v1, double const &v2, double const &v3, double const &v4) { vector par; par.push_back(&v1); par.push_back(&v2); par.push_back(&v3); par.push_back(&v4); return par; } void BugsDistTest::rscalar() { rscalar_rpq(_dbeta, mkPar(0.3, 0.5)); rscalar_rpq(_dbeta, mkPar(2, 6)); rscalar_rpq(_dbin, mkPar(0.1, 10)); rscalar_rpq(_dbin, mkPar(0.9, 1)); rscalar_rpq(_dchisqr, mkPar(1)); rscalar_rpq(_dchisqr, mkPar(2)); rscalar_rpq(_dchisqr, mkPar(3)); rscalar_rpq(_dchisqr, mkPar(10)); rscalar_rpq(_ddexp, mkPar(2, 0.1)); rscalar_rpq(_ddexp, mkPar(-5, 2.8)); rscalar_rpq(_dexp, mkPar(0.1)); rscalar_rpq(_dexp, mkPar(7)); rscalar_rpq(_df, mkPar(1, 1)); rscalar_rpq(_df, mkPar(3, 7)); rscalar_rpq(_dgamma, mkPar(1, 0.1)); rscalar_rpq(_dgamma, mkPar(0.1, 3)); rscalar_rpq(_dgengamma, mkPar(1, 0.1, 3)); rscalar_rpq(_dgengamma, mkPar(0.1, 3, 0.5)); for (int i = 1; i <= 10; ++i) { for (int j = 0; j <= i; ++j ) { rscalar_rpq(_dhyper, mkPar(i, i, j, 1)); rscalar_rpq(_dhyper, mkPar(i, i, j, 0.5)); rscalar_rpq(_dhyper, mkPar(i, i, j, 3)); } } rscalar_rpq(_dhyper, mkPar(10, 8, 7, 0.5)); rscalar_rpq(_dlnorm, mkPar(-0.5, 33)); rscalar_rpq(_dlogis, mkPar(-7, 0.3)); rscalar_rpq(_dnchisqr, mkPar(5, 1.5)); rscalar_rpq(_dnorm, mkPar(3, 10)); rscalar_rpq(_dnt, mkPar(0, 1, 4)); rscalar_rpq(_dnt, mkPar(-5, 3, 1)); rscalar_rpq(_dpar, mkPar(1.3, 1)); rscalar_rpq(_dpois, mkPar(0.12)); rscalar_rpq(_dpois, mkPar(10.7)); rscalar_rpq(_dt, mkPar(18, 1.7, 1)); rscalar_rpq(_dt, mkPar(0, 1, 4)); rscalar_rpq(_dweib, mkPar(3, 10)); rscalar_rpq(_dweib, mkPar(0.9, 0.9)); } void BugsDistTest::kl_scalar(ScalarDist const *dist, vector const &par0, vector const &par1) { /* Test closed form expression for Kullback-Leibler divergence against Monte Carlo estimate */ //Sanity checks CPPUNIT_ASSERT_EQUAL_MESSAGE(dist->name(), par0.size(), par1.size()); CPPUNIT_ASSERT_MESSAGE(dist->name(), checkNPar(dist, par0.size())); CPPUNIT_ASSERT_MESSAGE(dist->name(), dist->checkParameterValue(par0)); CPPUNIT_ASSERT_MESSAGE(dist->name(), dist->checkParameterValue(par1)); unsigned int nrep = 1000L; //Monte Carlo estimate of Kullback-Leibler divergence vector y(nrep); double ysum = 0; for (unsigned int i = 0; i < nrep; ++i) { y[i] = dist->KL(par0, par1, 0, 0, _rng, 100); ysum += y[i]; } double ymean = ysum/nrep; double ysum2 = 0; for (unsigned int i = 0; i < nrep; ++i) { ysum2 += (y[i] - ymean) * (y[i] - ymean); } double ysd = sqrt(ysum2/(nrep - 1)); //Standard deviation //Standard error of the mean double ysem = ysd/sqrt(static_cast(nrep)); //Closed form expression for Kullback-Leibler divergence double z = dist->KL(par0, par1); CPPUNIT_ASSERT(z != JAGS_NA); //Difference between closed-form and Monte Carlo estimates CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), z, ymean, max(5*ysem, tol)); } void BugsDistTest::kl() { /* Kullback-Leibler test: see kl_scalar for details */ kl_scalar(_dbern, mkPar(0.6), mkPar(0.5)); kl_scalar(_dbern, mkPar(0.1), mkPar(0.9)); kl_scalar(_dbin, mkPar(0.5, 10), mkPar(0.9, 10)); kl_scalar(_dbin, mkPar(0.1, 5), mkPar(0.2, 5)); kl_scalar(_dbeta, mkPar(2, 3), mkPar(2.5, 2.8)); kl_scalar(_dbeta, mkPar(0.5, 1), mkPar(0.7, 1)); kl_scalar(_dchisqr, mkPar(1), mkPar(1.5)); kl_scalar(_dchisqr, mkPar(5), mkPar(7)); kl_scalar(_ddexp, mkPar(0, 1), mkPar(-1, 3)); kl_scalar(_ddexp, mkPar(5, 0.2), mkPar(7, 0.25)); kl_scalar(_dexp, mkPar(10), mkPar(12)); kl_scalar(_dexp, mkPar(0.5), mkPar(0.7)); kl_scalar(_dgamma, mkPar(3,2), mkPar(3.5, 1.8)); kl_scalar(_dgamma, mkPar(1, 0.5), mkPar(2, 0.1)); kl_scalar(_dgengamma, mkPar(2,5,3), mkPar(2.5, 4.8, 2.8)); kl_scalar(_dgengamma, mkPar(1, 3, 0.5), mkPar(1.1, 2.2, 0.7)); kl_scalar(_dhyper, mkPar(5,5,6,0.2), mkPar(5,5,6,0.4)); kl_scalar(_dhyper, mkPar(20, 10, 12, 0.8), mkPar(20,10, 12, 0.6)); kl_scalar(_dlnorm, mkPar(0, 1), mkPar(0.5, 1.5)); kl_scalar(_dlnorm, mkPar(3, 2), mkPar(5, 2.8)); //Can only calculate for negative binomial when sizes are equal kl_scalar(_dnegbin, mkPar(0.3, 10), mkPar(0.6, 10)); kl_scalar(_dnegbin, mkPar(0.1, 3), mkPar(0.2, 3)); kl_scalar(_dnorm, mkPar(0, 1), mkPar(-3, 2)); kl_scalar(_dnorm, mkPar(2, 0.3), mkPar(2.5, 0.1)); kl_scalar(_dpois, mkPar(3), mkPar(5)); kl_scalar(_dpois, mkPar(12), mkPar(10)); kl_scalar(_dunif, mkPar(-5,10), mkPar(-8, 12)); kl_scalar(_dunif, mkPar(2,3), mkPar(1,5)); /* FIXME Need tests for DCat, DDirch Should implemnt DMNorm::KL */ } static double superror(RScalarDist const *dist, unsigned int N, vector const &par, jags::RNG *rng) { //Calculate test statistic for DKW test multiset xmset; for (unsigned int i =0; i < N; ++i) { double x = dist->r(par, rng); x = fprec(x, 12); xmset.insert(x); } double fhat=0, delta=0; for (multiset::const_iterator q = xmset.begin(); q != xmset.end(); q = xmset.upper_bound(*q)) { double f = dist->p(*q, par, true, false); fhat += static_cast(xmset.count(*q))/N; delta = max(delta, abs(fhat - f)); } return delta; } static double pdkwbound(double n, double t) { return 2*exp(-2*n*t*t); } static double qdkwbound(double n, double p) { return sqrt(log(p/2)/(-2*n)); } void BugsDistTest::dkwtest(RScalarDist const *dist, vector const &par, unsigned int N, double pthresh) { /* Test using the Dvoretzky-Kiefer-Wolfowitz (1956) bound on the difference between the empirical distribution function and the theoretical one, with a tight constant derived by Massart (1990) */ //Sanity checks CPPUNIT_ASSERT_MESSAGE(dist->name(), checkNPar(dist, par.size())); CPPUNIT_ASSERT_MESSAGE(dist->name(), dist->checkParameterValue(par)); double s = superror(dist, N, par, _rng); string msg = dist->name(); if (s >= qdkwbound(N, pthresh)) { ostringstream ostr; ostr << "Distribution " << dist->name() << "("; for (unsigned int i = 0; i < par.size(); ++i) { if (i > 0) ostr << ", "; ostr << *par[i]; } ostr << ")\n"; ostr << "supremum error = " << fprec(s, 2) << " with p-value=" << min(1.0, fround(pdkwbound(N,s), 4)); CPPUNIT_FAIL(ostr.str()); } } //FIXME: We should have a atest for simulation from a truncated distribution void BugsDistTest::dkw() { //DKW test of random number generation and distribution function //See dkwtest for details //CPPUNIT_ASSERT_MESSAGE("dkw check", false); dkwtest(_dbeta, mkPar(1,1)); dkwtest(_dbeta, mkPar(2,1)); dkwtest(_dbeta, mkPar(1,2)); dkwtest(_dbeta, mkPar(2,2)); dkwtest(_dbeta, mkPar(0.2,0.2)); dkwtest(_dbin, mkPar(0.2, 1)); dkwtest(_dbin, mkPar(0.2, 2)); dkwtest(_dbin, mkPar(0.2, 100)); dkwtest(_dbin, mkPar(0.2, 1e4)); dkwtest(_dbin, mkPar(0.8, 1)); dkwtest(_dbin, mkPar(0.8, 100)); dkwtest(_dbin, mkPar(0.999, 100)); dkwtest(_dchisqr, mkPar(1)); dkwtest(_dchisqr, mkPar(10)); dkwtest(_ddexp, mkPar(0, 1)); dkwtest(_ddexp, mkPar(0, 2)); dkwtest(_ddexp, mkPar(-3, 0.5)); dkwtest(_dexp, mkPar(1)); dkwtest(_dexp, mkPar(10)); dkwtest(_dexp, mkPar(0.01)); dkwtest(_df, mkPar(1, 1)); dkwtest(_df, mkPar(1, 10)); dkwtest(_df, mkPar(10, 10)); dkwtest(_df, mkPar(30, 3)); dkwtest(_dgamma, mkPar(0.1, 1)); dkwtest(_dgamma, mkPar(0.2, 1)); dkwtest(_dgamma, mkPar(10, 1)); dkwtest(_dgamma, mkPar(20, 1)); dkwtest(_dgengamma, mkPar(1, 0.1, 0.5)); dkwtest(_dgengamma, mkPar(0.1, 7, 2)); dkwtest(_dpois, mkPar(0.095)); dkwtest(_dpois, mkPar(0.95)); dkwtest(_dpois, mkPar(9.5)); dkwtest(_dpois, mkPar(95)); dkwtest(_dnegbin, mkPar(0.2, 1)); dkwtest(_dnegbin, mkPar(0.2, 2)); dkwtest(_dnegbin, mkPar(0.2, 100)); dkwtest(_dnegbin, mkPar(0.2, 1e4)); dkwtest(_dnegbin, mkPar(0.8, 1)); dkwtest(_dnegbin, mkPar(0.8, 100)); dkwtest(_dnegbin, mkPar(0.999, 100)); dkwtest(_dnorm, mkPar(0, 1)); dkwtest(_dnorm, mkPar(5, 3)); //Central hypergeometric dkwtest(_dhyper, mkPar(40, 30, 10, 1)); dkwtest(_dhyper, mkPar(40, 3, 20, 1)); dkwtest(_dhyper, mkPar(40, 3, 20, 1)); dkwtest(_dhyper, mkPar(6, 3, 2, 1)); dkwtest(_dhyper, mkPar(5, 3, 2, 1)); dkwtest(_dhyper, mkPar(4, 3, 2, 1)); //Large sample test for central hypergeometric dkwtest(_dhyper, mkPar(60,100,50, 1)); dkwtest(_dhyper, mkPar(600, 1000, 500, 1)); //Non-central hypergeometric dkwtest(_dhyper, mkPar(40, 30, 10, 2)); dkwtest(_dhyper, mkPar(40, 3, 20, 0.5)); dkwtest(_dhyper, mkPar(40, 3, 20, 0.3)); dkwtest(_dhyper, mkPar(6, 3, 2, 5)); dkwtest(_dhyper, mkPar(5, 3, 2, 2)); dkwtest(_dhyper, mkPar(4, 3, 2, 2.5)); dkwtest(_dlnorm, mkPar(0, 1)); dkwtest(_dlnorm, mkPar(3, 3)); dkwtest(_dlnorm, mkPar(-8, 0.2)); dkwtest(_dlogis, mkPar(0, 1)); dkwtest(_dlogis, mkPar(4, 0.5)); dkwtest(_dnt, mkPar(10, 2, 3)); dkwtest(_dnt, mkPar(-7, 0.5, 1.5)); dkwtest(_dpar, mkPar(5,2)); dkwtest(_dt, mkPar(0,1,1)); dkwtest(_dt, mkPar(-3, 0.4, 1)); dkwtest(_dt, mkPar(0, 2, 10)); dkwtest(_dt, mkPar(5, 1, 40)); dkwtest(_dweib, mkPar(1, 1)); dkwtest(_dweib, mkPar(2, 2)); dkwtest(_dweib, mkPar(0.3, 0.5)); } JAGS-4.3.2/src/modules/bugs/distributions/testbugsdist.h0000664000175000017500000000430114224052514020162 00000000000000#ifndef BUGS_DIST_TEST_H #define BUGS_DIST_TEST_H namespace jags { class RScalarDist; class ScalarDist; class VectorDist; class ArrayDist; struct RNG; } #include #include class BugsDistTest : public CppUnit::TestFixture, public JAGSFixture { CPPUNIT_TEST_SUITE( BugsDistTest ); CPPUNIT_TEST( npar ); CPPUNIT_TEST( name ); CPPUNIT_TEST( alias ); CPPUNIT_TEST( rscalar ); CPPUNIT_TEST( kl ); CPPUNIT_TEST( dkw ); CPPUNIT_TEST_SUITE_END( ); jags::RNG *_rng; jags::ScalarDist *_dbern; jags::RScalarDist *_dbeta; jags::RScalarDist *_dbin; jags::VectorDist *_dcat; jags::RScalarDist *_dchisqr; jags::VectorDist *_ddirch; jags::RScalarDist *_ddexp; jags::RScalarDist *_dexp; jags::RScalarDist *_df; jags::RScalarDist *_dgamma; jags::RScalarDist *_dgengamma; jags::RScalarDist *_dhyper; jags::VectorDist *_dinterval; jags::RScalarDist *_dlnorm; jags::RScalarDist *_dlogis; jags::ArrayDist *_dmnorm; jags::ArrayDist *_dmnormvc; jags::ArrayDist *_dmt; jags::VectorDist *_dmulti; jags::RScalarDist *_dnchisqr; jags::RScalarDist *_dnegbin; jags::RScalarDist *_dnorm; jags::RScalarDist *_dnt; jags::RScalarDist *_dpar; jags::RScalarDist *_dpois; jags::ScalarDist *_dround; jags::VectorDist *_dsample; jags::ArrayDist *_dsum; jags::RScalarDist *_dt; jags::ScalarDist *_dunif; jags::RScalarDist *_dweib; jags::ArrayDist *_dwish; void rscalar_rpq(jags::RScalarDist const *dist, std::vector const &par); void rscalar_trunclik(jags::RScalarDist const *dist, std::vector const &par); void kl_scalar(jags::ScalarDist const *dist, std::vector const &par0, std::vector const &par1); void dkwtest(jags::RScalarDist const *dist, std::vector const &par, unsigned int N=10000, double pthresh=0.001); public: void setUp(); void tearDown(); void npar(); void name(); void alias(); void rscalar(); void kl(); void dkw(); }; #endif /* BUGS_DIST_TEST_H */ JAGS-4.3.2/src/modules/bugs/functions/0000755000175000017500000000000014400711325014451 500000000000000JAGS-4.3.2/src/modules/bugs/functions/Makefile.am0000664000175000017500000000262414224052514016435 00000000000000noinst_LTLIBRARIES = libbugsfunc.la libbugsfunc_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/bugs/matrix \ -I$(top_srcdir)/src/modules/bugs/distributions libbugsfunc_la_LDFLAGS = -no-undefined -module -avoid-version libbugsfunc_la_SOURCES = Max.cc Probit.cc InProd.cc Mean.cc SD.cc \ ICLogLog.cc Min.cc Sqrt.cc CLogLog.cc ILogit.cc Step.cc Log.cc Sum.cc \ Exp.cc LogFact.cc LogGam.cc Phi.cc Logit.cc Inverse.cc LogDet.cc \ Sort.cc Rank.cc Abs.cc Cos.cc Sin.cc Tan.cc Cosh.cc Sinh.cc Tanh.cc \ ArcCos.cc ArcSin.cc ArcTan.cc ArcCosh.cc ArcSinh.cc ArcTanh.cc \ InterpLin.cc Round.cc Trunc.cc Equals.cc Prod.cc MatMult.cc \ Transpose.cc DSumFunc.cc DIntervalFunc.cc DRoundFunc.cc IfElse.cc \ Order.cc Combine.cc Rep.cc noinst_HEADERS = LogGam.h Phi.h Sum.h Log.h Logit.h Probit.h \ CLogLog.h InProd.h Max.h SD.h ICLogLog.h Mean.h Sqrt.h ILogit.h Min.h \ Step.h Exp.h LogFact.h Inverse.h LogDet.h Sort.h Rank.h Abs.h Cos.h \ Sin.h Tan.h Cosh.h Sinh.h Tanh.h ArcCos.h ArcSin.h ArcTan.h ArcCosh.h \ ArcSinh.h ArcTanh.h InterpLin.h Round.h Trunc.h Equals.h Prod.h \ MatMult.h Transpose.h DSumFunc.h DIntervalFunc.h DRoundFunc.h \ IfElse.h Order.h Combine.h Rep.h ### Test library if CANCHECK check_LTLIBRARIES = libbugsfuntest.la libbugsfuntest_la_SOURCES = testbugsfun.cc testbugsfun.h libbugsfuntest_la_CPPFLAGS = -I$(top_srcdir)/src/include libbugsfuntest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) endif JAGS-4.3.2/src/modules/bugs/functions/LogGam.h0000664000175000017500000000076514224052514015724 00000000000000#ifndef FUNC_LOGGAM_H_ #define FUNC_LOGGAM_H_ #include namespace jags { namespace bugs { /** * @short Log gamma function *
     * y <- loggam(x)
     * y = log(gamma(x)) for x > 0
     * 
*/ class LogGam:public ScalarFunction { public: LogGam (); double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; }; }} #endif /* FUNC_LOGGAM_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Phi.h0000664000175000017500000000077514224052514015277 00000000000000#ifndef FUNC_PHI_H_ #define FUNC_PHI_H_ #include namespace jags { namespace bugs { /** * @short Standard normal distribution function * @see Probit *
     * p <- phi(x)
     * probit(p) <- x
     * p = Prob(X < x) where X ~ N(0,1)
     * 
*/ class Phi : public LinkFunction { public: Phi (); double inverseLink(double eta) const; double link(double mu) const; double grad(double eta) const; }; }} #endif /* FUNC_PHI_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Sum.h0000664000175000017500000000154514224052514015317 00000000000000#ifndef FUNC_SUM_H_ #define FUNC_SUM_H_ #include namespace jags { namespace bugs { /** * @short Sum of an array * Sum calculates the sum of the elements of an array * @see Mean *
     * y <- sum(x1[], x2[], ...)
     * 
*/ class Sum : public ScalarVectorFunction { public: Sum (); double scalarEval(std::vector const &args, std::vector const &lengths) const; bool isDiscreteValued(std::vector const &mask) const; bool isAdditive(std::vector const &mask, std::vector const &isfixed) const; bool isScale(std::vector const &mask, std::vector const &isfixed) const; bool isLinear(std::vector const &mask, std::vector const &isfixed) const; }; }} #endif /* FUNC_SUM_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Log.h0000664000175000017500000000075014224052514015271 00000000000000#ifndef FUNC_LOG_H_ #define FUNC_LOG_H_ #include namespace jags { namespace bugs { /** * @short Log function * @see Exp *
     * y <- log(x)
     * y = log(x) for x > 0
     * 
*/ class Log : public ScalarFunction { public: Log (); double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; }; }} #endif /* FUNC_LOG_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Logit.h0000664000175000017500000000100414224052514015617 00000000000000#ifndef FUNC_LOGIT_H_ #define FUNC_LOGIT_H_ #include namespace jags { namespace bugs { /** * @short Logistic function * @see ILogit *
     * y <- logit(p)
     * y = log(p/(1-p)) for 0 < p < 1
     * 
*/ class Logit:public ScalarFunction { public: Logit(); double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; }; }} #endif /* FUNC_LOGIT_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Probit.h0000664000175000017500000000103314224052514016002 00000000000000#ifndef FUNC_PROBIT_H_ #define FUNC_PROBIT_H_ #include namespace jags { namespace bugs { /** * @short Normal quantile function * @see Phi *
     * y <- probit(p)
     * Prob(Y < y) = p for Y ~ N(0,1); 0 < p < 1
     * 
*/ class Probit : public ScalarFunction { public: Probit (); double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; }; }} #endif /* FUNC_PROBIT_H_ */ JAGS-4.3.2/src/modules/bugs/functions/CLogLog.h0000664000175000017500000000105514224052514016035 00000000000000#ifndef FUNC_CLOGLOG_H_ #define FUNC_CLOGLOG_H_ #include namespace jags { namespace bugs { /** * @short the complementary log log link function * @see ICLogLog *
     * y <- cloglog(p)
     * y = log(-log(1-p)) for 0 < p < 1
     * 
*/ class CLogLog : public ScalarFunction { public: CLogLog (); double evaluate(std::vector const &args) const; bool checkParameterValue (std::vector const &args) const; }; }} #endif /* FUNC_CLOGLOG_H_ */ JAGS-4.3.2/src/modules/bugs/functions/InProd.h0000664000175000017500000000162214224052514015742 00000000000000#ifndef FUNC_INPROD_H_ #define FUNC_INPROD_H_ #include namespace jags { namespace bugs { /** * @short Inner product of two vectors * The InProd function returns the sum of the product of corresponding * elements from two arrays with the same dimension *
     * y <- inprod(a[],b[])
     * 
*/ class InProd : public ScalarVectorFunction { public: InProd (); double scalarEval(std::vector const &args, std::vector const &lengths) const; bool checkParameterLength (std::vector const &len) const; bool isDiscreteValued(std::vector const &mask) const; bool isScale(std::vector const &mask, std::vector const &fix) const; bool isScaleMix(std::vector const &mask, std::vector const &fix) const; }; }} #endif /* FUNC_INPROD_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Max.h0000664000175000017500000000102014224052514015264 00000000000000#ifndef FUNC_MAX_H_ #define FUNC_MAX_H_ #include namespace jags { namespace bugs { /** * @short Maximum element of a vector * @see Min */ class Max: public ScalarVectorFunction { public: Max (); double scalarEval(std::vector const &args, std::vector const &lengths) const; /** Returns true if all arguments are true */ bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_MAX_H_ */ JAGS-4.3.2/src/modules/bugs/functions/SD.h0000664000175000017500000000121714224052514015055 00000000000000#ifndef FUNC_SD_H_ #define FUNC_SD_H_ #include namespace jags { namespace bugs { /** * @short Standard deviation function * SD calculates the standard deviation of the elements of an array. * The array must have at least 2 elements. * @see mean *
     * y <- sd(x[])
     * 
*/ class SD : public ScalarVectorFunction { public: SD (); double scalarEval (std::vector const &args, std::vector const &lengths) const; bool checkParameterLength (std::vector const &len) const; }; }} #endif /* FUNC_SD_H_ */ JAGS-4.3.2/src/modules/bugs/functions/ICLogLog.h0000664000175000017500000000077614224052514016157 00000000000000#ifndef FUNC_ICLOGLOG_H_ #define FUNC_ICLOGLOG_H_ #include namespace jags { namespace bugs { /** * @short inverse complementary log log link * @see CLogLog *
     * cloglog(y) <- a + b*x
     * y <- icloglog(a + b*x)
     * 
*/ class ICLogLog : public LinkFunction { public: ICLogLog (); double inverseLink(double eta) const; double link(double mu) const; double grad(double eta) const; }; }} #endif /* FUNC_ICLOGLOG_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Mean.h0000664000175000017500000000113114224052514015422 00000000000000#ifndef FUNC_MEAN_H_ #define FUNC_MEAN_H_ #include namespace jags { namespace bugs { /** * @short Mean function * Mean calculates the mean of the elements of an array * @see SD *
     * y <- mean(x[])
     * 
*/ class Mean : public ScalarVectorFunction { public: Mean (); double scalarEval(std::vector const &args, std::vector const &dims) const; bool isScale(std::vector const &mask, std::vector const &fix) const; }; }} #endif /* FUNC_MEAN_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Sqrt.h0000664000175000017500000000114214224052514015475 00000000000000#ifndef FUNC_SQRT_H_ #define FUNC_SQRT_H_ #include namespace jags { namespace bugs { /** * @short Square root function *
     * sigma <- sqrt(tau)
     * tau = sigma * sigma; tau > 0
     * 
*/ class Sqrt : public ScalarFunction { public: Sqrt (); double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; bool isPower(std::vector const &mask, std::vector const &fix) const; }; }} #endif /* FUNC_SQRT_H_ */ JAGS-4.3.2/src/modules/bugs/functions/ILogit.h0000664000175000017500000000102014224052514015726 00000000000000#ifndef FUNC_ILOGIT_H_ #define FUNC_ILOGIT_H_ #include namespace jags { namespace bugs { /** * @short Inverse of the logistic link function * @see Logit *
     * logit(y) <- a + b*x
     * y <- ilogit(a + b*x)
     * y = 1/(1 + exp(-a - b*x))
     * 
*/ class ILogit:public LinkFunction { public: ILogit (); double inverseLink(double eta) const; double link(double mu) const; double grad(double eta) const; }; }} #endif /* FUNC_ILOGIT_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Min.h0000664000175000017500000000101614224052514015267 00000000000000#ifndef FUNC_MIN_H_ #define FUNC_MIN_H_ #include namespace jags { namespace bugs { /** * @short Minimum element of a vector * @see Max */ class Min: public ScalarVectorFunction { public: Min (); double scalarEval (std::vector const &args, std::vector const &lengths) const; /** Returns true if all arguments are true */ bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_MIN_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Step.h0000664000175000017500000000075014224052514015463 00000000000000#ifndef FUNC_STEP_H_ #define FUNC_STEP_H_ #include namespace jags { namespace bugs { /** *@short Step function *
     * y <- step(x)
     * y = 1 if x >= 0
     *     0 if x <  0
     * 
*/ class Step : public ScalarFunction { public: Step (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_STEP_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Exp.h0000664000175000017500000000065214224052514015305 00000000000000#ifndef FUNC_EXP_H_ #define FUNC_EXP_H_ #include namespace jags { namespace bugs { /** * @short Exponential function * @see Log *
     * y <- exp(x)
     * 
*/ class Exp: public LinkFunction { public: Exp (); double inverseLink(double eta) const; double link(double mu) const; double grad(double eta) const; }; }} #endif /* FUNC_EXP_H_ */ JAGS-4.3.2/src/modules/bugs/functions/LogFact.h0000664000175000017500000000105214224052514016063 00000000000000#ifndef FUNC_LOGFACT_H_ #define FUNC_LOGFACT_H_ #include namespace jags { namespace bugs { /** * @short Log factorial function * @see LogGamma *
     * y <- logfact(x)
     * y = x! 
     *   = log(gamma(x + 1)) for x > -1
     * 
*/ class LogFact : public ScalarFunction { public: LogFact (); double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; }; }} #endif /* FUNC_LOGFACT_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Inverse.h0000664000175000017500000000151414224052514016162 00000000000000#ifndef INVERSE_H_ #define INVERSE_H_ #include namespace jags { namespace bugs { /** * @short Inverts a square symmetric matrix *
     * y[,] <- inverse(x[,])
     * 
*/ class Inverse: public ArrayFunction { public: Inverse (); void evaluate (double *value, std::vector const &args, std::vector > const &dims) const; std::vector dim(std::vector > const &args, std::vector const &values) const; bool checkParameterDim(std::vector > const &dims) const; bool checkParameterValue(std::vector const &args, std::vector > const &dims) const; }; }} #endif /* INVERSE_H_ */ JAGS-4.3.2/src/modules/bugs/functions/LogDet.h0000664000175000017500000000204714224052514015727 00000000000000#ifndef LOG_DET_H_ #define LOG_DET_H_ #include namespace jags { namespace bugs { /** * @short Log determinant * LogDet calculates the log determinant of a square matrix. The * function assumes that the matrix is symmetric positive definite. * but currently does not test this. *
     * y <- logdet(x)
     * y <- log|x| for x an n x n symmetric positive definite matrix
     * 
*/ class LogDet : public ArrayFunction { public: LogDet (); void evaluate(double *x, std::vector const &args, std::vector > const &dims) const; bool checkParameterDim(std::vector > const &dims) const; std::vector dim(std::vector > const &dims, std::vector const &values) const; bool checkParameterValue(std::vector const &args, std::vector > const &dims) const; }; }} #endif /* LOG_DET_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Sort.h0000664000175000017500000000126014224052514015474 00000000000000#ifndef FUNC_SORT_H_ #define FUNC_SORT_H_ #include namespace jags { namespace bugs { /** * @short Sort function * Sorts the elements of a vector in ascending order *
     * y <- sort(x[])
     * 
*/ class Sort : public VectorFunction { public: Sort (); void evaluate(double *value, std::vector const &args, std::vector const &lengths) const; unsigned int length(std::vector const &parlengths, std::vector const &parvalues) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_SORT_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Rank.h0000664000175000017500000000152314224052514015442 00000000000000#ifndef FUNC_RANK_H_ #define FUNC_RANK_H_ #include namespace jags { namespace bugs { /** * @short Rank function * * Calculates the sample ranks of the values in a vector. The ranks * define a permutation that is the inverse of the one returned * by the Order function. * *
     * y <- rank(x[])
     * 
* * @see Order */ class Rank : public VectorFunction { public: Rank (); void evaluate(double *value, std::vector const &args, std::vector const &lengths) const; unsigned int length(std::vector const &parlengths, std::vector const &parvalues) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_RANK_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Abs.h0000664000175000017500000000073314224052514015256 00000000000000#ifndef FUNC_ABS_H_ #define FUNC_ABS_H_ #include namespace jags { namespace bugs { /** * @short Absolute value *
     * y <- abs(x)
     * y = x; x >= 0
     * y = -1; x < 0
     * 
*/ class Abs: public ScalarFunction { public: Abs (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_ABS_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Cos.h0000664000175000017500000000060514224052514015273 00000000000000#ifndef FUNC_COS_H_ #define FUNC_COS_H_ #include namespace jags { namespace bugs { /** * @short Cosine function * @see Sin *
     * y <- cos(x)
     * 
*/ class Cos : public ScalarFunction { public: Cos (); double evaluate(std::vector const &args) const; }; }} #endif /* FUNC_COS_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Sin.h0000664000175000017500000000060314224052514015276 00000000000000#ifndef FUNC_SIN_H_ #define FUNC_SIN_H_ #include namespace jags { namespace bugs { /** * @short Sine function * @see Cos *
     * y <- sin(x)
     * 
*/ class Sin : public ScalarFunction { public: Sin (); double evaluate(std::vector const &args) const; }; }} #endif /* FUNC_SIN_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Tan.h0000664000175000017500000000060614224052514015272 00000000000000#ifndef FUNC_TAN_H_ #define FUNC_TAN_H_ #include namespace jags { namespace bugs { /** * @short Tangent function * @see sin *
     * y <- tan(x)
     * 
*/ class Tan : public ScalarFunction { public: Tan (); double evaluate(std::vector const &args) const; }; }} #endif /* FUNC_TAN_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Cosh.h0000664000175000017500000000062714224052514015447 00000000000000#ifndef FUNC_COSH_H_ #define FUNC_COSH_H_ #include namespace jags { namespace bugs { /** * @short Hyperbolic cosine function * @see sinh *
     * y <- cosh(x)
     * 
*/ class Cosh : public ScalarFunction { public: Cosh (); double evaluate(std::vector const &args) const; }; }} #endif /* FUNC_COSH_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Sinh.h0000664000175000017500000000062514224052514015452 00000000000000#ifndef FUNC_SINH_H_ #define FUNC_SINH_H_ #include namespace jags { namespace bugs { /** * @short Hyperbolic sine function * @see sinh *
     * y <- sinh(x)
     * 
*/ class Sinh : public ScalarFunction { public: Sinh (); double evaluate(std::vector const &args) const; }; }} #endif /* FUNC_SINH_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Tanh.h0000664000175000017500000000063014224052514015437 00000000000000#ifndef FUNC_TANH_H_ #define FUNC_TANH_H_ #include namespace jags { namespace bugs { /** * @short Hyperbolic tangent function * @see tanh *
     * y <- tanh(x)
     * 
*/ class Tanh : public ScalarFunction { public: Tanh (); double evaluate(std::vector const &args) const; }; }} #endif /* FUNC_TANH_H_ */ JAGS-4.3.2/src/modules/bugs/functions/ArcCos.h0000664000175000017500000000100514224052514015714 00000000000000#ifndef FUNC_ARCCOS_H_ #define FUNC_ARCCOS_H_ #include namespace jags { namespace bugs { /** * @short Inverse cosine function * @see Cos *
     * y <- arccos(x)
     * 
*/ class ArcCos : public ScalarFunction { public: ArcCos (); std::string alias() const; double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; }; }} #endif /* FUNC_ARCCOS_H_ */ JAGS-4.3.2/src/modules/bugs/functions/ArcSin.h0000664000175000017500000000100314224052514015717 00000000000000#ifndef FUNC_ARCSIN_H_ #define FUNC_ARCSIN_H_ #include namespace jags { namespace bugs { /** * @short Inverse sine function * @see Sin *
     * y <- arcsin(x)
     * 
*/ class ArcSin : public ScalarFunction { public: ArcSin (); std::string alias() const; double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; }; }} #endif /* FUNC_ARCSIN_H_ */ JAGS-4.3.2/src/modules/bugs/functions/ArcTan.h0000664000175000017500000000067414224052514015725 00000000000000#ifndef FUNC_ARCTAN_H_ #define FUNC_ARCTAN_H_ #include namespace jags { namespace bugs { /** * @short Inverse tangent function * @see Tan *
     * y <- arctan(x)
     * 
*/ class ArcTan : public ScalarFunction { public: ArcTan (); std::string alias() const; double evaluate(std::vector const &args) const; }; }} #endif /* FUNC_ARCTAN_H_ */ JAGS-4.3.2/src/modules/bugs/functions/ArcCosh.h0000664000175000017500000000102714224052514016070 00000000000000#ifndef FUNC_ARCCOSH_H_ #define FUNC_ARCCOSH_H_ #include namespace jags { namespace bugs { /** * @short Inverse hyperbolic cosine function * @see cosh *
     * y <- arccosh(x)
     * 
*/ class ArcCosh : public ScalarFunction { public: ArcCosh (); std::string alias() const; double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; }; }} #endif /* FUNC_ARCCOSH_H_ */ JAGS-4.3.2/src/modules/bugs/functions/ArcSinh.h0000664000175000017500000000071314224052514016076 00000000000000#ifndef FUNC_ARCSINH_H_ #define FUNC_ARCSINH_H_ #include namespace jags { namespace bugs { /** * @short Inverse hyperbolic sine function * @see sinh *
     * y <- arcsinh(x)
     * 
*/ class ArcSinh : public ScalarFunction { public: ArcSinh (); std::string alias() const; double evaluate(std::vector const &args) const; }; }} #endif /* FUNC_ARCSINH_H_ */ JAGS-4.3.2/src/modules/bugs/functions/ArcTanh.h0000664000175000017500000000103014224052514016060 00000000000000#ifndef FUNC_ARCTANH_H_ #define FUNC_ARCTANH_H_ #include namespace jags { namespace bugs { /** * @short Inverse hyperbolic tangent function * @see tanh *
     * y <- arctanh(x)
     * 
*/ class ArcTanh : public ScalarFunction { public: ArcTanh (); std::string alias() const; double evaluate(std::vector const &args) const; bool checkParameterValue(std::vector const &args) const; }; }} #endif /* FUNC_ARCTANH_H_ */ JAGS-4.3.2/src/modules/bugs/functions/InterpLin.h0000664000175000017500000000126614224052514016457 00000000000000#ifndef FUNC_INTERP_LIN_H_ #define FUNC_INTERP_LIN_H_ #include namespace jags { namespace bugs { /** * @short Linear interpolation function *
     * y <- interp.lin(e,v1,v2)
     * 
*/ class InterpLin : public ScalarVectorFunction { public: InterpLin (); double scalarEval(std::vector const &args, std::vector const &lengths) const; bool checkParameterLength(std::vector const &len) const; bool checkParameterValue(std::vector const &args, std::vector const &lengths) const; }; }} #endif /* FUNC_INTERP_LIN_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Round.h0000664000175000017500000000071714224052514015642 00000000000000#ifndef FUNC_ROUND_H_ #define FUNC_ROUND_H_ #include namespace jags { namespace bugs { /** * @short Round to integer, away from zero *
     * y <- round(x)
     * 
*/ class Round : public ScalarFunction { public: Round (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_ROUND_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Trunc.h0000664000175000017500000000066514224052514015650 00000000000000#ifndef FUNC_TRUNC_H_ #define FUNC_TRUNC_H_ #include namespace jags { namespace bugs { /** * @short Round to integer, towards zero *
 * y <- trunc(x)
 * 
*/ class Trunc : public ScalarFunction { public: Trunc (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_TRUNC_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Equals.h0000664000175000017500000000102714224052514016000 00000000000000#ifndef FUNC_EQUALS_H_ #define FUNC_EQUALS_H_ #include namespace jags { namespace bugs { /** * @short Test for equality using infix notation *
     * y <- a == b
     * y = 1 if a==b
     *     0 if a!=b
     * 
*/ class Equals : public ScalarFunction { public: Equals (); double evaluate(std::vector const &args) const; /** Returns true */ bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_EQUALS_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Prod.h0000664000175000017500000000111214224052514015445 00000000000000#ifndef FUNC_PROD_H_ #define FUNC_PROD_H_ #include namespace jags { namespace bugs { /** * @short Product of an array * Sum calculates the product of the elements of an array * @see Sum *
     * y <- prod(x[])
     * 
*/ class Prod : public ScalarVectorFunction { public: Prod (); double scalarEval(std::vector const &args, std::vector const &lengths) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_PROD_H_ */ JAGS-4.3.2/src/modules/bugs/functions/MatMult.h0000664000175000017500000000135014224052514016130 00000000000000#ifndef MAT_MULT_H_ #define MAT_MULT_H_ #include namespace jags { namespace bugs { class MatMult : public ArrayFunction { public: MatMult(); void evaluate(double *value, std::vector const &args, std::vector > const &dims) const; std::vector dim(std::vector > const &dims, std::vector const &values) const; bool checkParameterDim(std::vector > const &dims) const; bool isScale(std::vector const &mask, std::vector const &fix) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* MAT_MULT_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Transpose.h0000664000175000017500000000151514224052514016526 00000000000000#ifndef TRANSPOSE_H_ #define TRANSPOSE_H_ #include namespace jags { namespace bugs { class Transpose : public ArrayFunction { public: Transpose(); void evaluate(double *value, std::vector const &args, std::vector > const &dims) const; std::vector dim(std::vector > const &dims, std::vector const &values) const; bool checkParameterDim(std::vector > const &dims) const; bool isAdditive(std::vector const &mask, std::vector const &isfixed) const; bool isScale(std::vector const &mask, std::vector const &isfixed) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* TRANSPOSE_H_ */ JAGS-4.3.2/src/modules/bugs/functions/DSumFunc.h0000664000175000017500000000164414224052514016237 00000000000000#ifndef DSUM_FUNC_H_ #define DSUM_FUNC_H_ #include namespace jags { namespace bugs { /** * @short Sum of two discrete random variables */ class DSumFunc : public ArrayFunction { public: DSumFunc(); void evaluate(double *x, std::vector const &args, std::vector > const &dims) const; bool checkParameterDim(std::vector > const &dims) const; std::vector dim(std::vector > const &dims, std::vector const &values) const; bool isDiscreteValued(std::vector const &mask) const; bool isLinear(std::vector const &mask, std::vector const &fixed) const; bool isScale(std::vector const &mask, std::vector const &fixed) const; }; }} #endif /* DSUM_FUNC_H_ */ JAGS-4.3.2/src/modules/bugs/functions/DIntervalFunc.h0000664000175000017500000000111614224052514017251 00000000000000#ifndef FUNC_DINTERVAL_H_ #define FUNC_DINTERVAL_H_ #include namespace jags { namespace bugs { /** * @short Function version of dinterval distribution */ class DIntervalFunc: public ScalarVectorFunction { public: DIntervalFunc (); double scalarEval (std::vector const &args, std::vector const &lengths) const; bool checkParameterLength (std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_DINTERVAL_H_ */ JAGS-4.3.2/src/modules/bugs/functions/DRoundFunc.h0000664000175000017500000000056714224052514016565 00000000000000#ifndef FUNC_DROUND_H_ #define FUNC_DROUND_H_ #include namespace jags { namespace bugs { /** * @short Function version of dround distribution */ class DRoundFunc: public ScalarFunction { public: DRoundFunc (); double evaluate (std::vector const &args) const; }; }} #endif /* FUNC_DROUND_H_ */ JAGS-4.3.2/src/modules/bugs/functions/IfElse.h0000664000175000017500000000151414224052514015716 00000000000000#ifndef IF_ELSE_H_ #define IF_ELSE_H_ #include namespace jags { namespace bugs { /** * The ifelse function returns either a or b depending on whether the * value of x is zero or not * * @short Conditional selection *
 * y <- ifelse(x,a,b)
 * y = a if x != 0 
 * y = b if x == 0
 * 
*/ class IfElse : public ScalarFunction { public: IfElse (); double evaluate(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; bool isAdditive(std::vector const &mask, std::vector const &fixed) const; bool isScale(std::vector const &mask, std::vector const &fixed) const; bool isLinear(std::vector const &mask, std::vector const &fixed) const; }; }} #endif /* IF_ELSE_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Order.h0000664000175000017500000000153114224052514015621 00000000000000#ifndef FUNC_ORDER_H_ #define FUNC_ORDER_H_ #include namespace jags { namespace bugs { /** * @short Order function * * Returns a permutation that sorts the elements of a vector in * ascending order. This is the inverse of the permutation * returned by the Rank function. * *
 
     * y <- sort(x[])
     * 
* * @see Rank */ class Order : public VectorFunction { public: Order (); void evaluate(double *value, std::vector const &args, std::vector const &lengths) const; unsigned int length(std::vector const &parlengths, std::vector const &parvalues) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* FUNC_ORDER_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Combine.h0000664000175000017500000000211014224052514016114 00000000000000#ifndef FUNC_COMBINE_H_ #define FUNC_COMBINE_H_ #include namespace jags { namespace bugs { /** * @short Combine values into a vector * * Concatenates all arguments into a single vector *
	 * y <- c(x[],y, z[,])
	 * 
*/ class Combine : public VectorFunction { public: Combine (); void evaluate(double *value, std::vector const &args, std::vector const &lengths) const; unsigned int length(std::vector const &parlengths, std::vector const &parvalues) const; bool isDiscreteValued(std::vector const &mask) const; bool isAdditive(std::vector const &mask, std::vector const &isfixed) const; bool isScale(std::vector const &mask, std::vector const &isfixed) const; bool isLinear(std::vector const &mask, std::vector const &isfixed) const; bool checkParameterLength(std::vector const &args) const; }; } } #endif /* FUNC_COMBINE_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Rep.h0000664000175000017500000000200114224052514015265 00000000000000#ifndef REP_H_ #define REP_H_ #include namespace jags { namespace bugs { /** * @short Replicate elements of a vector * *
     * y <- rep(x, times)
     * 
* */ class Rep : public VectorFunction { public: Rep(); void evaluate(double *value, std::vector const &values, std::vector const &lengths) const; unsigned int length(std::vector const &lengths, std::vector const &values) const; bool checkParameterLength(std::vector const &args) const; bool isDiscreteValued(std::vector const &mask) const; bool checkParameterDiscrete(std::vector const &mask) const; bool checkParameterFixed(std::vector const &mask) const; bool checkParameterValue(std::vector const &args, std::vector const &lens) const; }; } /* namespace bugs */ } /* namespace jags */ #endif /* REP_H_ */ JAGS-4.3.2/src/modules/bugs/functions/Makefile.in0000644000175000017500000025735714400675236016473 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/bugs/functions ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbugsfunc_la_LIBADD = am_libbugsfunc_la_OBJECTS = libbugsfunc_la-Max.lo \ libbugsfunc_la-Probit.lo libbugsfunc_la-InProd.lo \ libbugsfunc_la-Mean.lo libbugsfunc_la-SD.lo \ libbugsfunc_la-ICLogLog.lo libbugsfunc_la-Min.lo \ libbugsfunc_la-Sqrt.lo libbugsfunc_la-CLogLog.lo \ libbugsfunc_la-ILogit.lo libbugsfunc_la-Step.lo \ libbugsfunc_la-Log.lo libbugsfunc_la-Sum.lo \ libbugsfunc_la-Exp.lo libbugsfunc_la-LogFact.lo \ libbugsfunc_la-LogGam.lo libbugsfunc_la-Phi.lo \ libbugsfunc_la-Logit.lo libbugsfunc_la-Inverse.lo \ libbugsfunc_la-LogDet.lo libbugsfunc_la-Sort.lo \ libbugsfunc_la-Rank.lo libbugsfunc_la-Abs.lo \ libbugsfunc_la-Cos.lo libbugsfunc_la-Sin.lo \ libbugsfunc_la-Tan.lo libbugsfunc_la-Cosh.lo \ libbugsfunc_la-Sinh.lo libbugsfunc_la-Tanh.lo \ libbugsfunc_la-ArcCos.lo libbugsfunc_la-ArcSin.lo \ libbugsfunc_la-ArcTan.lo libbugsfunc_la-ArcCosh.lo \ libbugsfunc_la-ArcSinh.lo libbugsfunc_la-ArcTanh.lo \ libbugsfunc_la-InterpLin.lo libbugsfunc_la-Round.lo \ libbugsfunc_la-Trunc.lo libbugsfunc_la-Equals.lo \ libbugsfunc_la-Prod.lo libbugsfunc_la-MatMult.lo \ libbugsfunc_la-Transpose.lo libbugsfunc_la-DSumFunc.lo \ libbugsfunc_la-DIntervalFunc.lo libbugsfunc_la-DRoundFunc.lo \ libbugsfunc_la-IfElse.lo libbugsfunc_la-Order.lo \ libbugsfunc_la-Combine.lo libbugsfunc_la-Rep.lo libbugsfunc_la_OBJECTS = $(am_libbugsfunc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libbugsfunc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libbugsfunc_la_LDFLAGS) \ $(LDFLAGS) -o $@ libbugsfuntest_la_LIBADD = am__libbugsfuntest_la_SOURCES_DIST = testbugsfun.cc testbugsfun.h @CANCHECK_TRUE@am_libbugsfuntest_la_OBJECTS = \ @CANCHECK_TRUE@ libbugsfuntest_la-testbugsfun.lo libbugsfuntest_la_OBJECTS = $(am_libbugsfuntest_la_OBJECTS) libbugsfuntest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libbugsfuntest_la_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libbugsfuntest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libbugsfunc_la-Abs.Plo \ ./$(DEPDIR)/libbugsfunc_la-ArcCos.Plo \ ./$(DEPDIR)/libbugsfunc_la-ArcCosh.Plo \ ./$(DEPDIR)/libbugsfunc_la-ArcSin.Plo \ ./$(DEPDIR)/libbugsfunc_la-ArcSinh.Plo \ ./$(DEPDIR)/libbugsfunc_la-ArcTan.Plo \ ./$(DEPDIR)/libbugsfunc_la-ArcTanh.Plo \ ./$(DEPDIR)/libbugsfunc_la-CLogLog.Plo \ ./$(DEPDIR)/libbugsfunc_la-Combine.Plo \ ./$(DEPDIR)/libbugsfunc_la-Cos.Plo \ ./$(DEPDIR)/libbugsfunc_la-Cosh.Plo \ ./$(DEPDIR)/libbugsfunc_la-DIntervalFunc.Plo \ ./$(DEPDIR)/libbugsfunc_la-DRoundFunc.Plo \ ./$(DEPDIR)/libbugsfunc_la-DSumFunc.Plo \ ./$(DEPDIR)/libbugsfunc_la-Equals.Plo \ ./$(DEPDIR)/libbugsfunc_la-Exp.Plo \ ./$(DEPDIR)/libbugsfunc_la-ICLogLog.Plo \ ./$(DEPDIR)/libbugsfunc_la-ILogit.Plo \ ./$(DEPDIR)/libbugsfunc_la-IfElse.Plo \ ./$(DEPDIR)/libbugsfunc_la-InProd.Plo \ ./$(DEPDIR)/libbugsfunc_la-InterpLin.Plo \ ./$(DEPDIR)/libbugsfunc_la-Inverse.Plo \ ./$(DEPDIR)/libbugsfunc_la-Log.Plo \ ./$(DEPDIR)/libbugsfunc_la-LogDet.Plo \ ./$(DEPDIR)/libbugsfunc_la-LogFact.Plo \ ./$(DEPDIR)/libbugsfunc_la-LogGam.Plo \ ./$(DEPDIR)/libbugsfunc_la-Logit.Plo \ ./$(DEPDIR)/libbugsfunc_la-MatMult.Plo \ ./$(DEPDIR)/libbugsfunc_la-Max.Plo \ ./$(DEPDIR)/libbugsfunc_la-Mean.Plo \ ./$(DEPDIR)/libbugsfunc_la-Min.Plo \ ./$(DEPDIR)/libbugsfunc_la-Order.Plo \ ./$(DEPDIR)/libbugsfunc_la-Phi.Plo \ ./$(DEPDIR)/libbugsfunc_la-Probit.Plo \ ./$(DEPDIR)/libbugsfunc_la-Prod.Plo \ ./$(DEPDIR)/libbugsfunc_la-Rank.Plo \ ./$(DEPDIR)/libbugsfunc_la-Rep.Plo \ ./$(DEPDIR)/libbugsfunc_la-Round.Plo \ ./$(DEPDIR)/libbugsfunc_la-SD.Plo \ ./$(DEPDIR)/libbugsfunc_la-Sin.Plo \ ./$(DEPDIR)/libbugsfunc_la-Sinh.Plo \ ./$(DEPDIR)/libbugsfunc_la-Sort.Plo \ ./$(DEPDIR)/libbugsfunc_la-Sqrt.Plo \ ./$(DEPDIR)/libbugsfunc_la-Step.Plo \ ./$(DEPDIR)/libbugsfunc_la-Sum.Plo \ ./$(DEPDIR)/libbugsfunc_la-Tan.Plo \ ./$(DEPDIR)/libbugsfunc_la-Tanh.Plo \ ./$(DEPDIR)/libbugsfunc_la-Transpose.Plo \ ./$(DEPDIR)/libbugsfunc_la-Trunc.Plo \ ./$(DEPDIR)/libbugsfuntest_la-testbugsfun.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libbugsfunc_la_SOURCES) $(libbugsfuntest_la_SOURCES) DIST_SOURCES = $(libbugsfunc_la_SOURCES) \ $(am__libbugsfuntest_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libbugsfunc.la libbugsfunc_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/bugs/matrix \ -I$(top_srcdir)/src/modules/bugs/distributions libbugsfunc_la_LDFLAGS = -no-undefined -module -avoid-version libbugsfunc_la_SOURCES = Max.cc Probit.cc InProd.cc Mean.cc SD.cc \ ICLogLog.cc Min.cc Sqrt.cc CLogLog.cc ILogit.cc Step.cc Log.cc Sum.cc \ Exp.cc LogFact.cc LogGam.cc Phi.cc Logit.cc Inverse.cc LogDet.cc \ Sort.cc Rank.cc Abs.cc Cos.cc Sin.cc Tan.cc Cosh.cc Sinh.cc Tanh.cc \ ArcCos.cc ArcSin.cc ArcTan.cc ArcCosh.cc ArcSinh.cc ArcTanh.cc \ InterpLin.cc Round.cc Trunc.cc Equals.cc Prod.cc MatMult.cc \ Transpose.cc DSumFunc.cc DIntervalFunc.cc DRoundFunc.cc IfElse.cc \ Order.cc Combine.cc Rep.cc noinst_HEADERS = LogGam.h Phi.h Sum.h Log.h Logit.h Probit.h \ CLogLog.h InProd.h Max.h SD.h ICLogLog.h Mean.h Sqrt.h ILogit.h Min.h \ Step.h Exp.h LogFact.h Inverse.h LogDet.h Sort.h Rank.h Abs.h Cos.h \ Sin.h Tan.h Cosh.h Sinh.h Tanh.h ArcCos.h ArcSin.h ArcTan.h ArcCosh.h \ ArcSinh.h ArcTanh.h InterpLin.h Round.h Trunc.h Equals.h Prod.h \ MatMult.h Transpose.h DSumFunc.h DIntervalFunc.h DRoundFunc.h \ IfElse.h Order.h Combine.h Rep.h ### Test library @CANCHECK_TRUE@check_LTLIBRARIES = libbugsfuntest.la @CANCHECK_TRUE@libbugsfuntest_la_SOURCES = testbugsfun.cc testbugsfun.h @CANCHECK_TRUE@libbugsfuntest_la_CPPFLAGS = -I$(top_srcdir)/src/include @CANCHECK_TRUE@libbugsfuntest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/bugs/functions/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/bugs/functions/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libbugsfunc.la: $(libbugsfunc_la_OBJECTS) $(libbugsfunc_la_DEPENDENCIES) $(EXTRA_libbugsfunc_la_DEPENDENCIES) $(AM_V_CXXLD)$(libbugsfunc_la_LINK) $(libbugsfunc_la_OBJECTS) $(libbugsfunc_la_LIBADD) $(LIBS) libbugsfuntest.la: $(libbugsfuntest_la_OBJECTS) $(libbugsfuntest_la_DEPENDENCIES) $(EXTRA_libbugsfuntest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libbugsfuntest_la_LINK) $(am_libbugsfuntest_la_rpath) $(libbugsfuntest_la_OBJECTS) $(libbugsfuntest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Abs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-ArcCos.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-ArcCosh.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-ArcSin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-ArcSinh.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-ArcTan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-ArcTanh.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-CLogLog.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Combine.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Cos.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Cosh.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-DIntervalFunc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-DRoundFunc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-DSumFunc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Equals.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Exp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-ICLogLog.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-ILogit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-IfElse.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-InProd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-InterpLin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Inverse.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Log.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-LogDet.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-LogFact.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-LogGam.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Logit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-MatMult.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Max.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Mean.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Min.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Order.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Phi.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Probit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Prod.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Rank.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Rep.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Round.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-SD.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Sin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Sinh.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Sort.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Sqrt.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Step.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Sum.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Tan.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Tanh.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Transpose.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfunc_la-Trunc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsfuntest_la-testbugsfun.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libbugsfunc_la-Max.lo: Max.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Max.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Max.Tpo -c -o libbugsfunc_la-Max.lo `test -f 'Max.cc' || echo '$(srcdir)/'`Max.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Max.Tpo $(DEPDIR)/libbugsfunc_la-Max.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Max.cc' object='libbugsfunc_la-Max.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Max.lo `test -f 'Max.cc' || echo '$(srcdir)/'`Max.cc libbugsfunc_la-Probit.lo: Probit.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Probit.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Probit.Tpo -c -o libbugsfunc_la-Probit.lo `test -f 'Probit.cc' || echo '$(srcdir)/'`Probit.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Probit.Tpo $(DEPDIR)/libbugsfunc_la-Probit.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Probit.cc' object='libbugsfunc_la-Probit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Probit.lo `test -f 'Probit.cc' || echo '$(srcdir)/'`Probit.cc libbugsfunc_la-InProd.lo: InProd.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-InProd.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-InProd.Tpo -c -o libbugsfunc_la-InProd.lo `test -f 'InProd.cc' || echo '$(srcdir)/'`InProd.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-InProd.Tpo $(DEPDIR)/libbugsfunc_la-InProd.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InProd.cc' object='libbugsfunc_la-InProd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-InProd.lo `test -f 'InProd.cc' || echo '$(srcdir)/'`InProd.cc libbugsfunc_la-Mean.lo: Mean.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Mean.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Mean.Tpo -c -o libbugsfunc_la-Mean.lo `test -f 'Mean.cc' || echo '$(srcdir)/'`Mean.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Mean.Tpo $(DEPDIR)/libbugsfunc_la-Mean.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Mean.cc' object='libbugsfunc_la-Mean.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Mean.lo `test -f 'Mean.cc' || echo '$(srcdir)/'`Mean.cc libbugsfunc_la-SD.lo: SD.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-SD.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-SD.Tpo -c -o libbugsfunc_la-SD.lo `test -f 'SD.cc' || echo '$(srcdir)/'`SD.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-SD.Tpo $(DEPDIR)/libbugsfunc_la-SD.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SD.cc' object='libbugsfunc_la-SD.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-SD.lo `test -f 'SD.cc' || echo '$(srcdir)/'`SD.cc libbugsfunc_la-ICLogLog.lo: ICLogLog.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-ICLogLog.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-ICLogLog.Tpo -c -o libbugsfunc_la-ICLogLog.lo `test -f 'ICLogLog.cc' || echo '$(srcdir)/'`ICLogLog.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-ICLogLog.Tpo $(DEPDIR)/libbugsfunc_la-ICLogLog.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ICLogLog.cc' object='libbugsfunc_la-ICLogLog.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-ICLogLog.lo `test -f 'ICLogLog.cc' || echo '$(srcdir)/'`ICLogLog.cc libbugsfunc_la-Min.lo: Min.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Min.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Min.Tpo -c -o libbugsfunc_la-Min.lo `test -f 'Min.cc' || echo '$(srcdir)/'`Min.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Min.Tpo $(DEPDIR)/libbugsfunc_la-Min.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Min.cc' object='libbugsfunc_la-Min.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Min.lo `test -f 'Min.cc' || echo '$(srcdir)/'`Min.cc libbugsfunc_la-Sqrt.lo: Sqrt.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Sqrt.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Sqrt.Tpo -c -o libbugsfunc_la-Sqrt.lo `test -f 'Sqrt.cc' || echo '$(srcdir)/'`Sqrt.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Sqrt.Tpo $(DEPDIR)/libbugsfunc_la-Sqrt.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Sqrt.cc' object='libbugsfunc_la-Sqrt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Sqrt.lo `test -f 'Sqrt.cc' || echo '$(srcdir)/'`Sqrt.cc libbugsfunc_la-CLogLog.lo: CLogLog.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-CLogLog.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-CLogLog.Tpo -c -o libbugsfunc_la-CLogLog.lo `test -f 'CLogLog.cc' || echo '$(srcdir)/'`CLogLog.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-CLogLog.Tpo $(DEPDIR)/libbugsfunc_la-CLogLog.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CLogLog.cc' object='libbugsfunc_la-CLogLog.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-CLogLog.lo `test -f 'CLogLog.cc' || echo '$(srcdir)/'`CLogLog.cc libbugsfunc_la-ILogit.lo: ILogit.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-ILogit.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-ILogit.Tpo -c -o libbugsfunc_la-ILogit.lo `test -f 'ILogit.cc' || echo '$(srcdir)/'`ILogit.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-ILogit.Tpo $(DEPDIR)/libbugsfunc_la-ILogit.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ILogit.cc' object='libbugsfunc_la-ILogit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-ILogit.lo `test -f 'ILogit.cc' || echo '$(srcdir)/'`ILogit.cc libbugsfunc_la-Step.lo: Step.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Step.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Step.Tpo -c -o libbugsfunc_la-Step.lo `test -f 'Step.cc' || echo '$(srcdir)/'`Step.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Step.Tpo $(DEPDIR)/libbugsfunc_la-Step.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Step.cc' object='libbugsfunc_la-Step.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Step.lo `test -f 'Step.cc' || echo '$(srcdir)/'`Step.cc libbugsfunc_la-Log.lo: Log.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Log.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Log.Tpo -c -o libbugsfunc_la-Log.lo `test -f 'Log.cc' || echo '$(srcdir)/'`Log.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Log.Tpo $(DEPDIR)/libbugsfunc_la-Log.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Log.cc' object='libbugsfunc_la-Log.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Log.lo `test -f 'Log.cc' || echo '$(srcdir)/'`Log.cc libbugsfunc_la-Sum.lo: Sum.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Sum.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Sum.Tpo -c -o libbugsfunc_la-Sum.lo `test -f 'Sum.cc' || echo '$(srcdir)/'`Sum.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Sum.Tpo $(DEPDIR)/libbugsfunc_la-Sum.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Sum.cc' object='libbugsfunc_la-Sum.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Sum.lo `test -f 'Sum.cc' || echo '$(srcdir)/'`Sum.cc libbugsfunc_la-Exp.lo: Exp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Exp.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Exp.Tpo -c -o libbugsfunc_la-Exp.lo `test -f 'Exp.cc' || echo '$(srcdir)/'`Exp.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Exp.Tpo $(DEPDIR)/libbugsfunc_la-Exp.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Exp.cc' object='libbugsfunc_la-Exp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Exp.lo `test -f 'Exp.cc' || echo '$(srcdir)/'`Exp.cc libbugsfunc_la-LogFact.lo: LogFact.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-LogFact.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-LogFact.Tpo -c -o libbugsfunc_la-LogFact.lo `test -f 'LogFact.cc' || echo '$(srcdir)/'`LogFact.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-LogFact.Tpo $(DEPDIR)/libbugsfunc_la-LogFact.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LogFact.cc' object='libbugsfunc_la-LogFact.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-LogFact.lo `test -f 'LogFact.cc' || echo '$(srcdir)/'`LogFact.cc libbugsfunc_la-LogGam.lo: LogGam.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-LogGam.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-LogGam.Tpo -c -o libbugsfunc_la-LogGam.lo `test -f 'LogGam.cc' || echo '$(srcdir)/'`LogGam.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-LogGam.Tpo $(DEPDIR)/libbugsfunc_la-LogGam.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LogGam.cc' object='libbugsfunc_la-LogGam.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-LogGam.lo `test -f 'LogGam.cc' || echo '$(srcdir)/'`LogGam.cc libbugsfunc_la-Phi.lo: Phi.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Phi.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Phi.Tpo -c -o libbugsfunc_la-Phi.lo `test -f 'Phi.cc' || echo '$(srcdir)/'`Phi.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Phi.Tpo $(DEPDIR)/libbugsfunc_la-Phi.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Phi.cc' object='libbugsfunc_la-Phi.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Phi.lo `test -f 'Phi.cc' || echo '$(srcdir)/'`Phi.cc libbugsfunc_la-Logit.lo: Logit.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Logit.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Logit.Tpo -c -o libbugsfunc_la-Logit.lo `test -f 'Logit.cc' || echo '$(srcdir)/'`Logit.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Logit.Tpo $(DEPDIR)/libbugsfunc_la-Logit.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Logit.cc' object='libbugsfunc_la-Logit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Logit.lo `test -f 'Logit.cc' || echo '$(srcdir)/'`Logit.cc libbugsfunc_la-Inverse.lo: Inverse.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Inverse.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Inverse.Tpo -c -o libbugsfunc_la-Inverse.lo `test -f 'Inverse.cc' || echo '$(srcdir)/'`Inverse.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Inverse.Tpo $(DEPDIR)/libbugsfunc_la-Inverse.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Inverse.cc' object='libbugsfunc_la-Inverse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Inverse.lo `test -f 'Inverse.cc' || echo '$(srcdir)/'`Inverse.cc libbugsfunc_la-LogDet.lo: LogDet.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-LogDet.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-LogDet.Tpo -c -o libbugsfunc_la-LogDet.lo `test -f 'LogDet.cc' || echo '$(srcdir)/'`LogDet.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-LogDet.Tpo $(DEPDIR)/libbugsfunc_la-LogDet.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LogDet.cc' object='libbugsfunc_la-LogDet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-LogDet.lo `test -f 'LogDet.cc' || echo '$(srcdir)/'`LogDet.cc libbugsfunc_la-Sort.lo: Sort.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Sort.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Sort.Tpo -c -o libbugsfunc_la-Sort.lo `test -f 'Sort.cc' || echo '$(srcdir)/'`Sort.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Sort.Tpo $(DEPDIR)/libbugsfunc_la-Sort.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Sort.cc' object='libbugsfunc_la-Sort.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Sort.lo `test -f 'Sort.cc' || echo '$(srcdir)/'`Sort.cc libbugsfunc_la-Rank.lo: Rank.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Rank.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Rank.Tpo -c -o libbugsfunc_la-Rank.lo `test -f 'Rank.cc' || echo '$(srcdir)/'`Rank.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Rank.Tpo $(DEPDIR)/libbugsfunc_la-Rank.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Rank.cc' object='libbugsfunc_la-Rank.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Rank.lo `test -f 'Rank.cc' || echo '$(srcdir)/'`Rank.cc libbugsfunc_la-Abs.lo: Abs.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Abs.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Abs.Tpo -c -o libbugsfunc_la-Abs.lo `test -f 'Abs.cc' || echo '$(srcdir)/'`Abs.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Abs.Tpo $(DEPDIR)/libbugsfunc_la-Abs.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Abs.cc' object='libbugsfunc_la-Abs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Abs.lo `test -f 'Abs.cc' || echo '$(srcdir)/'`Abs.cc libbugsfunc_la-Cos.lo: Cos.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Cos.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Cos.Tpo -c -o libbugsfunc_la-Cos.lo `test -f 'Cos.cc' || echo '$(srcdir)/'`Cos.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Cos.Tpo $(DEPDIR)/libbugsfunc_la-Cos.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Cos.cc' object='libbugsfunc_la-Cos.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Cos.lo `test -f 'Cos.cc' || echo '$(srcdir)/'`Cos.cc libbugsfunc_la-Sin.lo: Sin.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Sin.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Sin.Tpo -c -o libbugsfunc_la-Sin.lo `test -f 'Sin.cc' || echo '$(srcdir)/'`Sin.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Sin.Tpo $(DEPDIR)/libbugsfunc_la-Sin.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Sin.cc' object='libbugsfunc_la-Sin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Sin.lo `test -f 'Sin.cc' || echo '$(srcdir)/'`Sin.cc libbugsfunc_la-Tan.lo: Tan.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Tan.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Tan.Tpo -c -o libbugsfunc_la-Tan.lo `test -f 'Tan.cc' || echo '$(srcdir)/'`Tan.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Tan.Tpo $(DEPDIR)/libbugsfunc_la-Tan.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tan.cc' object='libbugsfunc_la-Tan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Tan.lo `test -f 'Tan.cc' || echo '$(srcdir)/'`Tan.cc libbugsfunc_la-Cosh.lo: Cosh.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Cosh.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Cosh.Tpo -c -o libbugsfunc_la-Cosh.lo `test -f 'Cosh.cc' || echo '$(srcdir)/'`Cosh.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Cosh.Tpo $(DEPDIR)/libbugsfunc_la-Cosh.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Cosh.cc' object='libbugsfunc_la-Cosh.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Cosh.lo `test -f 'Cosh.cc' || echo '$(srcdir)/'`Cosh.cc libbugsfunc_la-Sinh.lo: Sinh.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Sinh.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Sinh.Tpo -c -o libbugsfunc_la-Sinh.lo `test -f 'Sinh.cc' || echo '$(srcdir)/'`Sinh.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Sinh.Tpo $(DEPDIR)/libbugsfunc_la-Sinh.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Sinh.cc' object='libbugsfunc_la-Sinh.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Sinh.lo `test -f 'Sinh.cc' || echo '$(srcdir)/'`Sinh.cc libbugsfunc_la-Tanh.lo: Tanh.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Tanh.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Tanh.Tpo -c -o libbugsfunc_la-Tanh.lo `test -f 'Tanh.cc' || echo '$(srcdir)/'`Tanh.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Tanh.Tpo $(DEPDIR)/libbugsfunc_la-Tanh.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Tanh.cc' object='libbugsfunc_la-Tanh.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Tanh.lo `test -f 'Tanh.cc' || echo '$(srcdir)/'`Tanh.cc libbugsfunc_la-ArcCos.lo: ArcCos.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-ArcCos.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-ArcCos.Tpo -c -o libbugsfunc_la-ArcCos.lo `test -f 'ArcCos.cc' || echo '$(srcdir)/'`ArcCos.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-ArcCos.Tpo $(DEPDIR)/libbugsfunc_la-ArcCos.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArcCos.cc' object='libbugsfunc_la-ArcCos.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-ArcCos.lo `test -f 'ArcCos.cc' || echo '$(srcdir)/'`ArcCos.cc libbugsfunc_la-ArcSin.lo: ArcSin.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-ArcSin.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-ArcSin.Tpo -c -o libbugsfunc_la-ArcSin.lo `test -f 'ArcSin.cc' || echo '$(srcdir)/'`ArcSin.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-ArcSin.Tpo $(DEPDIR)/libbugsfunc_la-ArcSin.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArcSin.cc' object='libbugsfunc_la-ArcSin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-ArcSin.lo `test -f 'ArcSin.cc' || echo '$(srcdir)/'`ArcSin.cc libbugsfunc_la-ArcTan.lo: ArcTan.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-ArcTan.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-ArcTan.Tpo -c -o libbugsfunc_la-ArcTan.lo `test -f 'ArcTan.cc' || echo '$(srcdir)/'`ArcTan.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-ArcTan.Tpo $(DEPDIR)/libbugsfunc_la-ArcTan.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArcTan.cc' object='libbugsfunc_la-ArcTan.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-ArcTan.lo `test -f 'ArcTan.cc' || echo '$(srcdir)/'`ArcTan.cc libbugsfunc_la-ArcCosh.lo: ArcCosh.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-ArcCosh.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-ArcCosh.Tpo -c -o libbugsfunc_la-ArcCosh.lo `test -f 'ArcCosh.cc' || echo '$(srcdir)/'`ArcCosh.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-ArcCosh.Tpo $(DEPDIR)/libbugsfunc_la-ArcCosh.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArcCosh.cc' object='libbugsfunc_la-ArcCosh.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-ArcCosh.lo `test -f 'ArcCosh.cc' || echo '$(srcdir)/'`ArcCosh.cc libbugsfunc_la-ArcSinh.lo: ArcSinh.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-ArcSinh.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-ArcSinh.Tpo -c -o libbugsfunc_la-ArcSinh.lo `test -f 'ArcSinh.cc' || echo '$(srcdir)/'`ArcSinh.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-ArcSinh.Tpo $(DEPDIR)/libbugsfunc_la-ArcSinh.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArcSinh.cc' object='libbugsfunc_la-ArcSinh.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-ArcSinh.lo `test -f 'ArcSinh.cc' || echo '$(srcdir)/'`ArcSinh.cc libbugsfunc_la-ArcTanh.lo: ArcTanh.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-ArcTanh.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-ArcTanh.Tpo -c -o libbugsfunc_la-ArcTanh.lo `test -f 'ArcTanh.cc' || echo '$(srcdir)/'`ArcTanh.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-ArcTanh.Tpo $(DEPDIR)/libbugsfunc_la-ArcTanh.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ArcTanh.cc' object='libbugsfunc_la-ArcTanh.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-ArcTanh.lo `test -f 'ArcTanh.cc' || echo '$(srcdir)/'`ArcTanh.cc libbugsfunc_la-InterpLin.lo: InterpLin.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-InterpLin.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-InterpLin.Tpo -c -o libbugsfunc_la-InterpLin.lo `test -f 'InterpLin.cc' || echo '$(srcdir)/'`InterpLin.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-InterpLin.Tpo $(DEPDIR)/libbugsfunc_la-InterpLin.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='InterpLin.cc' object='libbugsfunc_la-InterpLin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-InterpLin.lo `test -f 'InterpLin.cc' || echo '$(srcdir)/'`InterpLin.cc libbugsfunc_la-Round.lo: Round.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Round.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Round.Tpo -c -o libbugsfunc_la-Round.lo `test -f 'Round.cc' || echo '$(srcdir)/'`Round.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Round.Tpo $(DEPDIR)/libbugsfunc_la-Round.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Round.cc' object='libbugsfunc_la-Round.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Round.lo `test -f 'Round.cc' || echo '$(srcdir)/'`Round.cc libbugsfunc_la-Trunc.lo: Trunc.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Trunc.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Trunc.Tpo -c -o libbugsfunc_la-Trunc.lo `test -f 'Trunc.cc' || echo '$(srcdir)/'`Trunc.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Trunc.Tpo $(DEPDIR)/libbugsfunc_la-Trunc.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Trunc.cc' object='libbugsfunc_la-Trunc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Trunc.lo `test -f 'Trunc.cc' || echo '$(srcdir)/'`Trunc.cc libbugsfunc_la-Equals.lo: Equals.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Equals.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Equals.Tpo -c -o libbugsfunc_la-Equals.lo `test -f 'Equals.cc' || echo '$(srcdir)/'`Equals.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Equals.Tpo $(DEPDIR)/libbugsfunc_la-Equals.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Equals.cc' object='libbugsfunc_la-Equals.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Equals.lo `test -f 'Equals.cc' || echo '$(srcdir)/'`Equals.cc libbugsfunc_la-Prod.lo: Prod.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Prod.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Prod.Tpo -c -o libbugsfunc_la-Prod.lo `test -f 'Prod.cc' || echo '$(srcdir)/'`Prod.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Prod.Tpo $(DEPDIR)/libbugsfunc_la-Prod.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Prod.cc' object='libbugsfunc_la-Prod.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Prod.lo `test -f 'Prod.cc' || echo '$(srcdir)/'`Prod.cc libbugsfunc_la-MatMult.lo: MatMult.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-MatMult.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-MatMult.Tpo -c -o libbugsfunc_la-MatMult.lo `test -f 'MatMult.cc' || echo '$(srcdir)/'`MatMult.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-MatMult.Tpo $(DEPDIR)/libbugsfunc_la-MatMult.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MatMult.cc' object='libbugsfunc_la-MatMult.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-MatMult.lo `test -f 'MatMult.cc' || echo '$(srcdir)/'`MatMult.cc libbugsfunc_la-Transpose.lo: Transpose.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Transpose.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Transpose.Tpo -c -o libbugsfunc_la-Transpose.lo `test -f 'Transpose.cc' || echo '$(srcdir)/'`Transpose.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Transpose.Tpo $(DEPDIR)/libbugsfunc_la-Transpose.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Transpose.cc' object='libbugsfunc_la-Transpose.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Transpose.lo `test -f 'Transpose.cc' || echo '$(srcdir)/'`Transpose.cc libbugsfunc_la-DSumFunc.lo: DSumFunc.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-DSumFunc.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-DSumFunc.Tpo -c -o libbugsfunc_la-DSumFunc.lo `test -f 'DSumFunc.cc' || echo '$(srcdir)/'`DSumFunc.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-DSumFunc.Tpo $(DEPDIR)/libbugsfunc_la-DSumFunc.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DSumFunc.cc' object='libbugsfunc_la-DSumFunc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-DSumFunc.lo `test -f 'DSumFunc.cc' || echo '$(srcdir)/'`DSumFunc.cc libbugsfunc_la-DIntervalFunc.lo: DIntervalFunc.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-DIntervalFunc.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-DIntervalFunc.Tpo -c -o libbugsfunc_la-DIntervalFunc.lo `test -f 'DIntervalFunc.cc' || echo '$(srcdir)/'`DIntervalFunc.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-DIntervalFunc.Tpo $(DEPDIR)/libbugsfunc_la-DIntervalFunc.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DIntervalFunc.cc' object='libbugsfunc_la-DIntervalFunc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-DIntervalFunc.lo `test -f 'DIntervalFunc.cc' || echo '$(srcdir)/'`DIntervalFunc.cc libbugsfunc_la-DRoundFunc.lo: DRoundFunc.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-DRoundFunc.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-DRoundFunc.Tpo -c -o libbugsfunc_la-DRoundFunc.lo `test -f 'DRoundFunc.cc' || echo '$(srcdir)/'`DRoundFunc.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-DRoundFunc.Tpo $(DEPDIR)/libbugsfunc_la-DRoundFunc.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DRoundFunc.cc' object='libbugsfunc_la-DRoundFunc.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-DRoundFunc.lo `test -f 'DRoundFunc.cc' || echo '$(srcdir)/'`DRoundFunc.cc libbugsfunc_la-IfElse.lo: IfElse.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-IfElse.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-IfElse.Tpo -c -o libbugsfunc_la-IfElse.lo `test -f 'IfElse.cc' || echo '$(srcdir)/'`IfElse.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-IfElse.Tpo $(DEPDIR)/libbugsfunc_la-IfElse.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='IfElse.cc' object='libbugsfunc_la-IfElse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-IfElse.lo `test -f 'IfElse.cc' || echo '$(srcdir)/'`IfElse.cc libbugsfunc_la-Order.lo: Order.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Order.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Order.Tpo -c -o libbugsfunc_la-Order.lo `test -f 'Order.cc' || echo '$(srcdir)/'`Order.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Order.Tpo $(DEPDIR)/libbugsfunc_la-Order.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Order.cc' object='libbugsfunc_la-Order.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Order.lo `test -f 'Order.cc' || echo '$(srcdir)/'`Order.cc libbugsfunc_la-Combine.lo: Combine.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Combine.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Combine.Tpo -c -o libbugsfunc_la-Combine.lo `test -f 'Combine.cc' || echo '$(srcdir)/'`Combine.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Combine.Tpo $(DEPDIR)/libbugsfunc_la-Combine.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Combine.cc' object='libbugsfunc_la-Combine.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Combine.lo `test -f 'Combine.cc' || echo '$(srcdir)/'`Combine.cc libbugsfunc_la-Rep.lo: Rep.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsfunc_la-Rep.lo -MD -MP -MF $(DEPDIR)/libbugsfunc_la-Rep.Tpo -c -o libbugsfunc_la-Rep.lo `test -f 'Rep.cc' || echo '$(srcdir)/'`Rep.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfunc_la-Rep.Tpo $(DEPDIR)/libbugsfunc_la-Rep.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Rep.cc' object='libbugsfunc_la-Rep.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfunc_la-Rep.lo `test -f 'Rep.cc' || echo '$(srcdir)/'`Rep.cc libbugsfuntest_la-testbugsfun.lo: testbugsfun.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfuntest_la_CPPFLAGS) $(CPPFLAGS) $(libbugsfuntest_la_CXXFLAGS) $(CXXFLAGS) -MT libbugsfuntest_la-testbugsfun.lo -MD -MP -MF $(DEPDIR)/libbugsfuntest_la-testbugsfun.Tpo -c -o libbugsfuntest_la-testbugsfun.lo `test -f 'testbugsfun.cc' || echo '$(srcdir)/'`testbugsfun.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsfuntest_la-testbugsfun.Tpo $(DEPDIR)/libbugsfuntest_la-testbugsfun.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testbugsfun.cc' object='libbugsfuntest_la-testbugsfun.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsfuntest_la_CPPFLAGS) $(CPPFLAGS) $(libbugsfuntest_la_CXXFLAGS) $(CXXFLAGS) -c -o libbugsfuntest_la-testbugsfun.lo `test -f 'testbugsfun.cc' || echo '$(srcdir)/'`testbugsfun.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libbugsfunc_la-Abs.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcCos.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcCosh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcSin.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcSinh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcTan.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcTanh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-CLogLog.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Combine.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Cos.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Cosh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-DIntervalFunc.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-DRoundFunc.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-DSumFunc.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Equals.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Exp.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ICLogLog.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ILogit.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-IfElse.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-InProd.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-InterpLin.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Inverse.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Log.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-LogDet.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-LogFact.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-LogGam.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Logit.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-MatMult.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Max.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Mean.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Min.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Order.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Phi.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Probit.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Prod.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Rank.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Rep.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Round.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-SD.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Sin.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Sinh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Sort.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Sqrt.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Step.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Sum.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Tan.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Tanh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Transpose.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Trunc.Plo -rm -f ./$(DEPDIR)/libbugsfuntest_la-testbugsfun.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libbugsfunc_la-Abs.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcCos.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcCosh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcSin.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcSinh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcTan.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ArcTanh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-CLogLog.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Combine.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Cos.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Cosh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-DIntervalFunc.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-DRoundFunc.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-DSumFunc.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Equals.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Exp.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ICLogLog.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-ILogit.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-IfElse.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-InProd.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-InterpLin.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Inverse.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Log.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-LogDet.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-LogFact.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-LogGam.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Logit.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-MatMult.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Max.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Mean.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Min.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Order.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Phi.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Probit.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Prod.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Rank.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Rep.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Round.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-SD.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Sin.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Sinh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Sort.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Sqrt.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Step.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Sum.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Tan.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Tanh.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Transpose.Plo -rm -f ./$(DEPDIR)/libbugsfunc_la-Trunc.Plo -rm -f ./$(DEPDIR)/libbugsfuntest_la-testbugsfun.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/bugs/functions/Max.cc0000664000175000017500000000125714224052514015436 00000000000000#include #include #include "Max.h" #include using std::vector; using std::max_element; using std::max; namespace jags { namespace bugs { Max::Max () : ScalarVectorFunction("max", 0) { } double Max::scalarEval(vector const &args, vector const &lengths) const { double ans = *max_element(args[0], args[0] + lengths[0]); for (unsigned int i = 1; i < args.size(); ++i) { double maxi = *max_element(args[i], args[i] + lengths[i]); ans = max(ans, maxi); } return ans; } bool Max::isDiscreteValued(vector const &mask) const { return allTrue(mask); } }} JAGS-4.3.2/src/modules/bugs/functions/Probit.cc0000664000175000017500000000070414224052514016144 00000000000000#include #include "Probit.h" #include using std::vector; namespace jags { namespace bugs { Probit::Probit () : ScalarFunction ("probit", 1) { } double Probit::evaluate(vector const &args) const { return qnorm (*args[0], 0, 1, 1, 0); } bool Probit::checkParameterValue (vector const &args) const { double p = *args[0]; return (p >= 0 && p <= 1); } }} JAGS-4.3.2/src/modules/bugs/functions/InProd.cc0000664000175000017500000000174614224052514016107 00000000000000#include #include #include "InProd.h" #include "lapack.h" using std::vector; namespace jags { namespace bugs { InProd::InProd () : ScalarVectorFunction ("inprod", 2) { } double InProd::scalarEval(vector const &args, vector const &lengths) const { int one = 1, N = lengths[0]; return F77_DDOT(&N, args[0], &one, args[1], &one); } bool InProd::checkParameterLength (vector const &lengths) const { return (lengths[0] > 0) && (lengths[0] == lengths[1]); } bool InProd::isDiscreteValued(vector const &mask) const { return allTrue(mask); } bool InProd::isScale(vector const &mask, vector const &fix) const { //Test for quadratic term if (mask[0] && mask[1]) return false; if (fix.empty()) { return true; } else { return (mask[0] || fix[0]) && (mask[1] || fix[1]); } } }} JAGS-4.3.2/src/modules/bugs/functions/Mean.cc0000664000175000017500000000103114224052514015557 00000000000000#include #include "Mean.h" using std::vector; namespace jags { namespace bugs { Mean::Mean () : ScalarVectorFunction ("mean", 1) { } double Mean::scalarEval (vector const &args, vector const &lengths) const { double svalue = 0; for (unsigned int i = 0; i < lengths[0]; i++) { svalue += args[0][i]; } svalue /= lengths[0]; return svalue; } bool Mean::isScale(vector const &mask, vector const &fix) const { return true; } }} JAGS-4.3.2/src/modules/bugs/functions/SD.cc0000664000175000017500000000145314224052514015215 00000000000000#include #include "SD.h" #include using std::vector; using std::sqrt; namespace jags { namespace bugs { SD::SD () : ScalarVectorFunction ("sd", 1) { } double SD::scalarEval (vectorconst &args, vector const &lengths) const { double svalue = 0; if (lengths[0] > 1) { double sum = 0; for (unsigned int i = 0; i < lengths[0]; i++) { sum += args[0][i]; } double mean = sum / lengths[0]; double var = 0; for (unsigned int i = 0; i < lengths[0]; i++) { var += (args[0][i] - mean) * (args[0][i] - mean); } svalue = sqrt (var / (lengths[0] - 1)); } return svalue; } bool SD::checkParameterLength (vector const &lengths) const { return lengths[0] >= 2; } }} JAGS-4.3.2/src/modules/bugs/functions/ICLogLog.cc0000664000175000017500000000075614224052514016313 00000000000000#include #include "ICLogLog.h" #include using std::vector; using std::log; using std::exp; namespace jags { namespace bugs { ICLogLog::ICLogLog(): LinkFunction("icloglog", "cloglog") { } double ICLogLog::inverseLink(double eta) const { return 1 - exp(-exp(eta)); } double ICLogLog::link(double mu) const { return log (-log (1 - mu)); } double ICLogLog::grad(double eta) const { return exp(eta) * exp(-exp(eta)); } }} JAGS-4.3.2/src/modules/bugs/functions/Min.cc0000664000175000017500000000126014224052514015426 00000000000000#include #include #include "Min.h" #include using std::min_element; using std::min; using std::vector; namespace jags { namespace bugs { Min::Min () : ScalarVectorFunction ("min", 0) { } double Min::scalarEval(vector const &args, vector const &lengths) const { double ans = *min_element(args[0], args[0] + lengths[0]); for (unsigned int i = 1; i < args.size(); ++i) { double mini = *min_element(args[i], args[i] + lengths[i]); ans = min(ans, mini); } return ans; } bool Min::isDiscreteValued(vector const &mask) const { return allTrue(mask); } }} JAGS-4.3.2/src/modules/bugs/functions/Sqrt.cc0000664000175000017500000000101214224052514015627 00000000000000#include #include "Sqrt.h" #include using std::vector; using std::sqrt; namespace jags { namespace bugs { Sqrt::Sqrt ():ScalarFunction ("sqrt", 1) { } double Sqrt::evaluate(vector const &args) const { return sqrt(*args[0]); } bool Sqrt::checkParameterValue(vector const &args) const { return *args[0] >= 0; } bool Sqrt::isPower(vector const &mask, vector const &fix) const { return true; } }} JAGS-4.3.2/src/modules/bugs/functions/CLogLog.cc0000664000175000017500000000071514224052514016175 00000000000000#include #include "CLogLog.h" #include using std::vector; using std::log; namespace jags { namespace bugs { CLogLog::CLogLog ():ScalarFunction ("cloglog", 1) { } double CLogLog::evaluate(vector const &args) const { return log(-log(1 - *args[0])); } bool CLogLog::checkParameterValue(vector const &args) const { double p = *args[0]; return (p >= 0 && p <= 1); } }} JAGS-4.3.2/src/modules/bugs/functions/ILogit.cc0000664000175000017500000000102414224052371016071 00000000000000#include #include "ILogit.h" #include #include using std::vector; using std::exp; using std::log; namespace jags { namespace bugs { ILogit::ILogit () : LinkFunction ("ilogit", "logit") { } double ILogit::inverseLink(double eta) const { return 1/(1 + exp(-eta)); } double ILogit::link(double mu) const { return log(mu) - log(1- mu); } double ILogit::grad(double eta) const { double opexp = 1 + exp(eta); return exp(eta) / (opexp * opexp); } }} JAGS-4.3.2/src/modules/bugs/functions/Step.cc0000664000175000017500000000055514224052514015624 00000000000000#include #include "Step.h" using std::vector; namespace jags { namespace bugs { Step::Step () : ScalarFunction ("step", 1) { } double Step::evaluate(vector const &args) const { return *args[0] >= 0 ? 1 : 0; } bool Step::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/bugs/functions/Log.cc0000664000175000017500000000062314224052514015426 00000000000000#include #include "Log.h" #include using std::vector; using std::log; namespace jags { namespace bugs { Log::Log () : ScalarFunction ("log", 1) { } double Log::evaluate(vector const &args) const { return log(*args[0]); } bool Log::checkParameterValue(vector const &args) const { return *args[0] >= 0; } }} JAGS-4.3.2/src/modules/bugs/functions/Sum.cc0000664000175000017500000000222414224052514015450 00000000000000#include #include "Sum.h" #include using std::vector; namespace jags { namespace bugs { Sum::Sum () : ScalarVectorFunction("sum", 0) { } double Sum::scalarEval(vector const &args, vector const &lengths) const { double value = 0; for (unsigned int j = 0; j < args.size(); ++j) { for (unsigned int i = 0; i < lengths[j]; ++i) { value += args[j][i]; } } return value; } bool Sum::isDiscreteValued(vector const &mask) const { return allTrue(mask); } bool Sum::isAdditive(vector const &mask, vector const &fixed) const { //Only one argument may be additive. bool found = false; for (unsigned int i = 0; i < mask.size(); ++i) { if (mask[i]) { if (found) return false; else found = true; } if (!fixed.empty() && !fixed[i]) { return false; } } return found; } bool Sum::isScale(vector const &mask, vector const &fix) const { return allTrue(mask); } bool Sum::isLinear(vector const &mask, vector const &fix) const { return true; } }} JAGS-4.3.2/src/modules/bugs/functions/Exp.cc0000664000175000017500000000064514224052371015446 00000000000000#include #include "Exp.h" #include using std::vector; using std::exp; using std::log; namespace jags { namespace bugs { Exp::Exp () : LinkFunction ("exp", "log") { } double Exp::inverseLink(double eta) const { return exp(eta); } double Exp::link(double mu) const { return log(mu); } double Exp::grad(double eta) const { return exp(eta); } }} JAGS-4.3.2/src/modules/bugs/functions/LogFact.cc0000664000175000017500000000064714224052514016232 00000000000000#include #include "LogFact.h" #include using std::vector; namespace jags { namespace bugs { LogFact::LogFact () : ScalarFunction ("logfact", 1) { } double LogFact::evaluate(vector const &args) const { return lgammafn(*args[0] + 1); } bool LogFact::checkParameterValue(vector const &args) const { return *args[0] > -1; } }} JAGS-4.3.2/src/modules/bugs/functions/LogGam.cc0000664000175000017500000000063514224052514016056 00000000000000#include #include "LogGam.h" #include using std::vector; namespace jags { namespace bugs { LogGam::LogGam () : ScalarFunction ("loggam", 1) { } double LogGam::evaluate(vector const &args) const { return lgammafn (*args[0]); } bool LogGam::checkParameterValue(vector const &args) const { return *args[0] > 0; } }} JAGS-4.3.2/src/modules/bugs/functions/Phi.cc0000664000175000017500000000114414224052371015425 00000000000000#include #include "Phi.h" #include #include using std::vector; namespace jags { namespace bugs { Phi::Phi () : LinkFunction ("phi", "probit") { } double Phi::inverseLink(double q) const { if (!R_FINITE (q)) { return q > 0 ? 1 : 0; } double p = pnorm(q, 0, 1, 1, 0); if (p == 0) return DBL_EPSILON; else if (p == 1) return 1 - DBL_EPSILON; else return p; } double Phi::link(double mu) const { return qnorm (mu, 0, 1, 1, 0); } double Phi::grad(double eta) const { return dnorm (eta, 0, 1, 0); } }} JAGS-4.3.2/src/modules/bugs/functions/Logit.cc0000664000175000017500000000074214224052514015765 00000000000000#include #include "Logit.h" #include using std::vector; using std::log; namespace jags { namespace bugs { Logit::Logit ():ScalarFunction ("logit", 1) { } double Logit::evaluate(vector const &args) const { double arg = *args[0]; return log(arg) - log(1 - arg); } bool Logit::checkParameterValue (vector const &args) const { double arg = *args[0]; return (arg >= 0 && arg <= 1); } }} JAGS-4.3.2/src/modules/bugs/functions/Inverse.cc0000664000175000017500000000166114224052514016323 00000000000000#include #include "matrix.h" #include #include "Inverse.h" using std::vector; namespace jags { namespace bugs { Inverse::Inverse (): ArrayFunction ("inverse", 1) { } void Inverse::evaluate (double *value, vector const &args, vector > const &dims) const { //FIXME: RETURN VALUE IGNORED inverse_spd (value, args[0], dims[0][0]); } bool Inverse::checkParameterDim (vector > const &dims) const { return isSquareMatrix(dims[0]) || isScalar(dims[0]); } bool Inverse::checkParameterValue(vector const &args, vector > const &dims) const { return check_symmetry(args[0], dims[0][0]); } vector Inverse::dim (vector > const &dims, vector const &values) const { return dims[0]; } }} JAGS-4.3.2/src/modules/bugs/functions/LogDet.cc0000664000175000017500000000164014224052514016063 00000000000000#include #include "LogDet.h" #include "matrix.h" #include #include using std::vector; namespace jags { namespace bugs { LogDet::LogDet () : ArrayFunction ("logdet", 1) { } void LogDet::evaluate (double *x, vector const &args, vector > const &dims) const { *x = logdet(args[0], dims[0][0]); } bool LogDet::checkParameterDim (vector > const &dims) const { return isSquareMatrix(dims[0]) || isScalar(dims[0]); } vector LogDet::dim(vector > const &dims, vector const &values) const { return vector(1,1); } bool LogDet::checkParameterValue(vector const &args, vector > const &dims) const { return check_symmetry(args[0], dims[0][0]); } }} JAGS-4.3.2/src/modules/bugs/functions/Sort.cc0000664000175000017500000000137114224052514015635 00000000000000#include #include "Sort.h" #include #include #include using std::vector; using std::sort; namespace jags { namespace bugs { Sort::Sort () : VectorFunction ("sort", 1) { } void Sort::evaluate (double *value, vector const &args, vector const &lengths) const { for (unsigned int i = 0; i < lengths[0]; ++i) { value[i] = args[0][i]; } sort(value, value + lengths[0]); } unsigned int Sort::length (vector const &parlengths, vector const &parvalues) const { return parlengths[0]; } bool Sort::isDiscreteValued(vector const &mask) const { return allTrue(mask); } }} JAGS-4.3.2/src/modules/bugs/functions/Rank.cc0000664000175000017500000000211014224052514015571 00000000000000#include #include #include "Rank.h" #include using std::vector; using std::stable_sort; static inline bool lt_doubleptr (double const *arg1, double const *arg2) { return *arg1 < *arg2; } namespace jags { namespace bugs { Rank::Rank () : VectorFunction ("rank", 1) { } void Rank::evaluate(double *value, vector const &args, vector const &lengths) const { int N = lengths[0]; //Create a vector of pointers to the elements of arg and sort it vector argptrs(N); for (int i = 0; i < N; ++i) { argptrs[i] = args[0] + i; } stable_sort(argptrs.begin(), argptrs.end(), lt_doubleptr); //Ranks can be inferred from the sorted vector of pointers for (int i = 0; i < N; ++i) { value[argptrs[i] - args[0]] = i + 1; } } unsigned int Rank::length (vector const &lengths, vector const &parvalues) const { return lengths[0]; } bool Rank::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/bugs/functions/Abs.cc0000664000175000017500000000060014224052514015405 00000000000000#include #include "Abs.h" #include using std::vector; using std::fabs; namespace jags { namespace bugs { Abs::Abs ():ScalarFunction ("abs", 1) { } double Abs::evaluate(vector const &args) const { return fabs(*args[0]); } bool Abs::isDiscreteValued(vector const &mask) const { return mask[0]; } }} JAGS-4.3.2/src/modules/bugs/functions/Cos.cc0000664000175000017500000000044314224052514015431 00000000000000#include #include "Cos.h" #include using std::vector; using std::cos; namespace jags { namespace bugs { Cos::Cos () : ScalarFunction ("cos", 1) { } double Cos::evaluate(vector const &args) const { return cos(*args[0]); } }} JAGS-4.3.2/src/modules/bugs/functions/Sin.cc0000664000175000017500000000044414224052514015437 00000000000000#include #include "Sin.h" #include using std::vector; using std::sin; namespace jags { namespace bugs { Sin::Sin () : ScalarFunction ("sin", 1) { } double Sin::evaluate(vector const &args) const { return sin(*args[0]); } }} JAGS-4.3.2/src/modules/bugs/functions/Tan.cc0000664000175000017500000000044414224052514015430 00000000000000#include #include "Tan.h" #include using std::vector; using std::tan; namespace jags { namespace bugs { Tan::Tan () : ScalarFunction ("tan", 1) { } double Tan::evaluate(vector const &args) const { return tan(*args[0]); } }} JAGS-4.3.2/src/modules/bugs/functions/Cosh.cc0000664000175000017500000000045214224052514015601 00000000000000#include #include "Cosh.h" #include using std::vector; using std::cosh; namespace jags { namespace bugs { Cosh::Cosh () : ScalarFunction ("cosh", 1) { } double Cosh::evaluate(vector const &args) const { return cosh(*args[0]); } }} JAGS-4.3.2/src/modules/bugs/functions/Sinh.cc0000664000175000017500000000045214224052514015606 00000000000000#include #include "Sinh.h" #include using std::vector; using std::sinh; namespace jags { namespace bugs { Sinh::Sinh () : ScalarFunction ("sinh", 1) { } double Sinh::evaluate(vector const &args) const { return sinh(*args[0]); } }} JAGS-4.3.2/src/modules/bugs/functions/Tanh.cc0000664000175000017500000000045214224052514015577 00000000000000#include #include "Tanh.h" #include using std::vector; using std::tanh; namespace jags { namespace bugs { Tanh::Tanh () : ScalarFunction ("tanh", 1) { } double Tanh::evaluate(vector const &args) const { return tanh(*args[0]); } }} JAGS-4.3.2/src/modules/bugs/functions/ArcCos.cc0000664000175000017500000000101614224052514016054 00000000000000#include #include "ArcCos.h" #include using std::vector; using std::acos; using std::string; namespace jags { namespace bugs { ArcCos::ArcCos () : ScalarFunction ("arccos", 1) { } string ArcCos::alias() const { return "acos"; } double ArcCos::evaluate(vector const &args) const { return acos(*args[0]); } bool ArcCos::checkParameterValue(vector const &args) const { return *args[0] >= -1 && *args[0] <= 1; } }} JAGS-4.3.2/src/modules/bugs/functions/ArcSin.cc0000664000175000017500000000101614224052514016061 00000000000000#include #include "ArcSin.h" #include using std::vector; using std::asin; using std::string; namespace jags { namespace bugs { ArcSin::ArcSin () : ScalarFunction ("arcsin", 1) { } string ArcSin::alias() const { return "asin"; } double ArcSin::evaluate(vector const &args) const { return asin(*args[0]); } bool ArcSin::checkParameterValue(vector const &args) const { return *args[0] >= -1 && *args[0] <= 1; } }} JAGS-4.3.2/src/modules/bugs/functions/ArcTan.cc0000664000175000017500000000061114224052514016052 00000000000000#include #include "ArcTan.h" #include using std::vector; using std::atan; using std::string; namespace jags { namespace bugs { ArcTan::ArcTan () : ScalarFunction ("arctan", 1) { } string ArcTan::alias() const { return "atan"; } double ArcTan::evaluate(vector const &args) const { return atan(*args[0]); } }} JAGS-4.3.2/src/modules/bugs/functions/ArcCosh.cc0000664000175000017500000000106214224052514016225 00000000000000#include #include "ArcCosh.h" #include using std::vector; using std::log; using std::sqrt; using std::string; namespace jags { namespace bugs { ArcCosh::ArcCosh () : ScalarFunction ("arccosh", 1) { } string ArcCosh::alias() const { return "acosh"; } double ArcCosh::evaluate(vector const &args) const { double x = *args[0]; return log(x + sqrt(x*x - 1)); } bool ArcCosh::checkParameterValue(vector const &args) const { return *args[0] >= 1; } }} JAGS-4.3.2/src/modules/bugs/functions/ArcSinh.cc0000664000175000017500000000137714224052514016243 00000000000000#include #include "ArcSinh.h" #include using std::vector; using std::log; using std::sqrt; using std::string; /* We don't use the cmath function asinh because it is defined in C99 and is not necessarily available in C++, which uses the C90 standard. This creates portability problems as we cannot guarantee that asinh will be in the std namespace or not.x The same issue affects ArcCosh (acosh) and ArcTanh (atanh). */ namespace jags { namespace bugs { ArcSinh::ArcSinh () : ScalarFunction ("arcsinh", 1) { } string ArcSinh::alias() const { return "asinh"; } double ArcSinh::evaluate(vector const &args) const { double x = *args[0]; return log(x + sqrt(1 + x*x)); } }} JAGS-4.3.2/src/modules/bugs/functions/ArcTanh.cc0000664000175000017500000000107614224052514016230 00000000000000#include #include "ArcTanh.h" #include using std::vector; using std::log; using std::string; namespace jags { namespace bugs { ArcTanh::ArcTanh () : ScalarFunction ("arctanh", 1) { } string ArcTanh::alias() const { return "atanh"; } double ArcTanh::evaluate(vector const &args) const { double x = *args[0]; return (log(1 + x) - log(1 - x))/2; } bool ArcTanh::checkParameterValue(vector const &args) const { return *args[0] >= -1 && *args[0] <= 1; } }} JAGS-4.3.2/src/modules/bugs/functions/InterpLin.cc0000664000175000017500000000257014224052514016614 00000000000000#include #include "InterpLin.h" #include #include using std::vector; namespace jags { namespace bugs { InterpLin::InterpLin() : ScalarVectorFunction("interp.lin", 3) {} double InterpLin::scalarEval(vector const &args, vector const &lengths) const { double const *x = args[1]; double const *y = args[2]; double xnew = args[0][0]; unsigned int N = lengths[1]; if (xnew < x[0]) return y[0]; else if (xnew >= x[N-1]) return y[N-1]; else { unsigned int i = 0; for (; i < N-1; ++i) { if (xnew >= x[i] && xnew < x[i+1]) { break; } } if (i == N-1) { /* This shouldn't happen, but we must guard against an attempt to access an illegal element of x or y */ return JAGS_NAN; } else { return y[i] + (xnew - x[i]) * (y[i+1] - y[i]) / (x[i+1] - x[i]); } } } bool InterpLin::checkParameterLength(vector const &lengths) const { return lengths[0] == 1 && lengths[1] != 0 && lengths[2] == lengths[1]; } bool InterpLin::checkParameterValue(vector const &args, vector const &lengths) const { unsigned int N = lengths[1]; for (unsigned int i = 1; i < N; ++i) { if (args[1][i] <= args[1][i-1]) return false; } return true; } }} JAGS-4.3.2/src/modules/bugs/functions/Round.cc0000664000175000017500000000073114224052514015774 00000000000000#include #include "Round.h" #include using std::vector; using std::floor; namespace jags { namespace bugs { Round::Round ():ScalarFunction ("round", 1) { } double Round::evaluate(vector const &args) const { /* The C99 round function does not exist in the current C++ standard */ return floor(*args[0] + 0.5); } bool Round::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/bugs/functions/Trunc.cc0000664000175000017500000000077714224052514016012 00000000000000 #include #include "Trunc.h" #include using std::vector; using std::floor; namespace jags { namespace bugs { Trunc::Trunc ():ScalarFunction ("trunc", 1) { } double Trunc::evaluate(vector const &args) const { /* The C99 trunc function does not exist in the current C++ standard. */ return args[0][0] >= 0 ? floor(args[0][0]) : -floor(-args[0][0]); } bool Trunc::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/bugs/functions/Equals.cc0000664000175000017500000000067614224052514016147 00000000000000#include #include "Equals.h" #include #include using std::vector; using std::fabs; namespace jags { namespace bugs { Equals::Equals () : ScalarFunction ("equals",2) { } double Equals::evaluate(vector const &args) const { return fabs(*args[0] - *args[1]) < 16 *DBL_EPSILON; } bool Equals::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/bugs/functions/Prod.cc0000664000175000017500000000111214224052514015603 00000000000000#include #include #include "Prod.h" using std::vector; namespace jags { namespace bugs { Prod::Prod () : ScalarVectorFunction("prod", 0) { } double Prod::scalarEval(vector const &args, vector const &lengths) const { double value = 1; for (unsigned int j = 0; j < args.size(); ++j) { for (unsigned int i = 0; i < lengths[j]; ++i) { value *= args[j][i]; } } return value; } bool Prod::isDiscreteValued(vector const &mask) const { return allTrue(mask); } }} JAGS-4.3.2/src/modules/bugs/functions/MatMult.cc0000664000175000017500000000331314224052514016267 00000000000000#include #include "MatMult.h" #include #include "lapack.h" using std::vector; namespace jags { namespace bugs { //FIXME: deparse? MatMult::MatMult() : ArrayFunction("%*%", 2) { } void MatMult::evaluate (double *value, vector const &args, vector > const &dims) const { int d1, d2, d3; if (dims[0].size() == 1) { d1 = 1; d2 = dims[0][0]; } else { d1 = dims[0][0]; d2 = dims[0][1]; } if (dims[1].size() == 1) { d3 = 1; } else { d3 = dims[1][1]; } double one = 1, zero = 0; F77_DGEMM ("N", "N", &d1, &d3, &d2, &one, args[0], &d1, args[1], &d2, &zero, value, &d1); } vector MatMult::dim (vector > const &dims, vector const &values) const { vector ans(2,1); if (dims[0].size() == 2) { ans[0] = dims[0][0]; } if (dims[1].size() == 2) { ans[1] = dims[1][1]; } return drop(ans); } bool MatMult::checkParameterDim (vector > const &dims) const { if (dims[0].size() > 2 || dims[1].size() > 2) { return false; } if (dims[0].size() == 1) { return dims[0][0] == dims[1][0]; } else { return dims[0][1] == dims[1][0]; } } bool MatMult::isScale(vector const &mask, vector const &fix) const { //Test for quadratic terms if (mask[0] && mask[1]) { return false; } if (fix.empty()) { return true; } else { return (mask[0] || fix[0]) && (mask[1] || fix[1]); } } bool MatMult::isDiscreteValued(vector const &mask) const { return mask[0] && mask[1]; } }} JAGS-4.3.2/src/modules/bugs/functions/Transpose.cc0000664000175000017500000000255014224052514016664 00000000000000#include #include #include "Transpose.h" using std::vector; namespace jags { namespace bugs { Transpose::Transpose() : ArrayFunction("t",1) { } void Transpose::evaluate (double *value, vector const &args, vector > const &dims) const { unsigned int nrow = dims[0][0]; unsigned int ncol = dims[0].size() == 2 ? dims[0][1] : 1; unsigned int length = nrow * ncol; for (unsigned int i = 0; i < length; ++i) { value[i] = args[0][(i / ncol) + (i % ncol) * nrow]; } } vector Transpose::dim (vector > const &dims, vector const &values) const { vector ans(2); ans[0] = dims[0].size() == 2 ? dims[0][1] : 1; ans[1] = dims[0][0]; return ans; } bool Transpose::checkParameterDim (vector > const &dims) const { return isScalar(dims[0]) || isVector(dims[0]) || isMatrix(dims[0]); } bool Transpose::isAdditive(vector const &mask, vector const &isfixed) const { return true; } bool Transpose::isScale(vector const &mask, vector const &isfixed) const { return true; } bool Transpose::isDiscreteValued(std::vector const &mask) const { return mask[0]; } }} JAGS-4.3.2/src/modules/bugs/functions/DSumFunc.cc0000664000175000017500000000255714224052514016401 00000000000000#include #include #include #include #include "DSumFunc.h" using std::vector; namespace jags { namespace bugs { DSumFunc::DSumFunc() : ArrayFunction("dsum", 0) { } void DSumFunc::evaluate(double *x, vector const &args, vector > const &dims) const { unsigned int length = product(dims[0]); for (unsigned int i = 0; i < length; ++i) { x[i] = 0; for (unsigned int j = 0; j < args.size(); ++j) { x[i] += args[j][i]; } } } bool DSumFunc::isDiscreteValued(vector const &mask) const { return allTrue(mask); } bool DSumFunc::checkParameterDim(vector > const &dims) const { if (dims.empty()) return false; if (isFlat(dims[0])) return false; for (unsigned int j = 1; j < dims.size(); ++j) { if (dims[j] != dims[0]) return false; } return true; } vector DSumFunc::dim(vector > const &dims, vector const &values) const { return dims[0]; } bool DSumFunc::isLinear(vector const &mask, vector const &fixed) const { return true; } bool DSumFunc::isScale(vector const &mask, vector const &fixed) const { return allTrue(mask); } }} JAGS-4.3.2/src/modules/bugs/functions/DIntervalFunc.cc0000664000175000017500000000147314224052514017415 00000000000000#include #include "DIntervalFunc.h" #include using std::vector; #define T(args) (*args[0]) #define CUTPOINTS(args) (args[1]) namespace jags { namespace bugs { DIntervalFunc::DIntervalFunc () : ScalarVectorFunction ("dinterval", 2) { } double DIntervalFunc::scalarEval(vector const &args, vector const &lengths) const { unsigned int ncut = lengths[1]; double t = T(args); for (unsigned int i = 0; i < ncut; ++i) { if (t <= CUTPOINTS(args)[i]) return i; } return ncut; } bool DIntervalFunc::checkParameterLength (vector const &args) const { return args[0] == 1 && args[1] >= 1; } bool DIntervalFunc::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/bugs/functions/DRoundFunc.cc0000664000175000017500000000060214224052371016712 00000000000000#include #include "DRoundFunc.h" #include using std::vector; #define T(args) (*args[0]) #define NDIGITS(args) (*args[1]) namespace jags { namespace bugs { DRoundFunc::DRoundFunc () : ScalarFunction ("dround", 2) { } double DRoundFunc::evaluate(vector const &args) const { return(fround(T(args), NDIGITS(args))); } }} JAGS-4.3.2/src/modules/bugs/functions/IfElse.cc0000664000175000017500000000273614224052514016063 00000000000000#include #include "IfElse.h" using std::vector; namespace jags { namespace bugs { IfElse::IfElse () : ScalarFunction("ifelse", 3) { } double IfElse::evaluate(vector const &args) const { return *args[0] ? *args[1] : *args[2]; } bool IfElse::isDiscreteValued(vector const &mask) const { return mask[1] && mask[2]; } bool IfElse::isScale(vector const &mask, vector const &fixed) const { //Don't even bother with the case where the predicate is a //scale function. False negatives are allowed and this is a //silly case if (mask[0]) return false; if (fixed.empty()) { //result is a scale function if both arguments are return mask[1] && mask[2]; } else { //..but is never a fixed scale function return false; } } bool IfElse::isLinear(vector const &mask, vector const &fixed) const { if (mask[0]) return false; if (fixed.empty()) { //result is a linear function if either argument is return mask[1] || mask[2]; } else { //..but is never a fixed scale function return false; } } bool IfElse::isAdditive(vector const &mask, vector const &fixed) const { if (mask[0]) return false; if (fixed.empty()) { //result is an addtive function if both arguments are return mask[1] && mask[2]; } else { //..but it is never fixed return false; } } }} JAGS-4.3.2/src/modules/bugs/functions/Order.cc0000664000175000017500000000210414224052514015754 00000000000000#include #include #include "Order.h" #include using std::vector; using std::stable_sort; static bool lt_doubleptr (double const *arg1, double const *arg2) { return *arg1 < *arg2; } namespace jags { namespace bugs { Order::Order () : VectorFunction ("order", 1) { } void Order::evaluate(double *value, vector const &args, vector const &lengths) const { int N = lengths[0]; //Create a vector of pointers to the elements of arg and sort it vector argptrs(N); for (int i = 0; i < N; ++i) { argptrs[i] = args[0] + i; } stable_sort(argptrs.begin(), argptrs.end(), lt_doubleptr); //Orders can be inferred from the sorted vector of pointers for (int i = 0; i < N; ++i) { value[i] = argptrs[i] - args[0] + 1; } } unsigned int Order::length (vector const &lengths, vector const &parvalues) const { return lengths[0]; } bool Order::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/bugs/functions/Combine.cc0000664000175000017500000000362314224052514016264 00000000000000#include #include "Combine.h" #include #include #include #include using std::vector; using std::copy; using std::accumulate; namespace jags { namespace bugs { Combine::Combine () : VectorFunction ("c", 0) { } void Combine::evaluate (double *value, vector const &args, vector const &lengths) const { for (unsigned int i = 0; i < args.size(); ++i) { value = copy(args[i], args[i] + lengths[i], value); } } unsigned int Combine::length (vector const &lens, vector const &vals) const { return accumulate(lens.begin(), lens.end(), 0U); } bool Combine::isDiscreteValued(vector const &mask) const { return allTrue(mask); } bool Combine::isAdditive(vector const &mask, vector const &fixed) const { //The Combine function behaves like an aggregate node //and so has the same rules for preserving additive functions //i.e. only one argument may be additive. bool found = false; for (unsigned int i = 0; i < mask.size(); ++i) { if (mask[i]) { if (found) return false; else found = true; } if (!fixed.empty() && !fixed[i]) { return false; } } return found; } bool Combine::isScale(vector const &mask, vector const &fixed) const { //The Combine function behaves like an aggregate node //and so has the same rules for preserving scale functions return allTrue(mask); } bool Combine::isLinear(vector const &mask, vector const &fixed) const { //The Combine function behaves like an aggregate node //and so has the same rules for preserving linear functions return true; } bool Combine::checkParameterLength(vector const &args) const { return true; } } } JAGS-4.3.2/src/modules/bugs/functions/Rep.cc0000664000175000017500000000467114224052514015442 00000000000000#include #include "Rep.h" #include #include using std::vector; using std::string; using std::fill; using std::copy; using std::accumulate; namespace jags { namespace bugs { Rep::Rep() : VectorFunction("rep", 2) { } void Rep::evaluate(double *value, vector const &args, vector const &lengths) const { double const *x = args[0]; //Vector to be replicated double const *times = args[1]; //Number of times to replicate unsigned int len_x = lengths[0]; //Length of x vector unsigned int len_times = lengths[1]; //Length of times vector if (len_times == 1) { //Replicate whole vector unsigned int ntimes = static_cast(times[0]); for (unsigned int j = 0; j < ntimes; ++j) { value = copy(x, x + len_x, value); } } else { //Replicate vector element-wise for (unsigned int i = 0; i < len_x; ++i) { unsigned int ntimes = static_cast(times[i]); fill(value, value + ntimes, x[i]); value += ntimes; } } } unsigned int Rep::length(vector const &lengths, vector const &args) const { double const *times = args[1]; unsigned int len_times = lengths[1]; unsigned int len_x = lengths[0]; double y = 0; if (len_x == 0) { y = 0; } else if (len_times == 1) { y = len_x * times[0]; } else if (len_x > 0){ y = accumulate(times, times + len_times, 0.0); } return static_cast(y); } bool Rep::checkParameterLength(vector const &len) const { return (len[0] == 0) || (len[1] == 1) || (len[1] == len[0]); } bool Rep::isDiscreteValued(vector const &mask) const { //Output is discrete-valued if the first argument is discrete return mask[0]; } bool Rep::checkParameterDiscrete(vector const &mask) const { //Times vector must be discrete return mask[1]; } bool Rep::checkParameterFixed(vector const &mask) const { //Times vector must be fixed return mask[1]; } bool Rep::checkParameterValue(vector const &args, vector const &lens) const { //Times vector must be non-negative for (unsigned int i = 0; i < lens[1]; ++i) { if (args[1][i] < 0) return false; } return true; } } /* namespace bugs */ } /* namespace jags */ JAGS-4.3.2/src/modules/bugs/functions/testbugsfun.cc0000664000175000017500000012325014224052514017260 00000000000000#include "testbugsfun.h" #include "Abs.h" #include "ArcCos.h" #include "ArcCosh.h" #include "ArcSin.h" #include "ArcSinh.h" #include "ArcTan.h" #include "ArcTanh.h" #include "CLogLog.h" #include "Combine.h" #include "Cos.h" #include "Cosh.h" #include "DIntervalFunc.h" #include "DRoundFunc.h" #include "DSumFunc.h" #include "Exp.h" #include "ICLogLog.h" #include "IfElse.h" #include "ILogit.h" #include "InProd.h" #include "InterpLin.h" #include "Inverse.h" #include "LogDet.h" #include "LogFact.h" #include "LogGam.h" #include "Log.h" #include "Logit.h" #include "MatMult.h" #include "Max.h" #include "Mean.h" #include "Min.h" #include "Order.h" #include "Phi.h" #include "Probit.h" #include "Prod.h" #include "Rank.h" #include "Rep.h" #include "Round.h" #include "SD.h" #include "Sin.h" #include "Sinh.h" #include "Sort.h" #include "Sqrt.h" #include "Step.h" #include "Sum.h" #include "Tan.h" #include "Tanh.h" #include "Transpose.h" #include "Trunc.h" #include #include #include #include #include using jags::checkInteger; using jags::LinkFunction; using jags::ScalarFunction; using jags::VectorFunction; using jags::Function; using std::vector; using std::string; using std::equal; using std::copy; #include #include void BugsFunTest::setUp() { //Trigonometric functions and their inverses _sin = new jags::bugs::Sin; _cos = new jags::bugs::Cos; _tan = new jags::bugs::Tan; _arccos = new jags::bugs::ArcCos; _arcsin = new jags::bugs::ArcSin; _arctan = new jags::bugs::ArcTan; //Hyperbolic functions and their inverses _sinh = new jags::bugs::Sinh; _cosh = new jags::bugs::Cosh; _tanh = new jags::bugs::Tanh; _arcsinh = new jags::bugs::ArcSinh; _arccosh = new jags::bugs::ArcCosh; _arctanh = new jags::bugs::ArcTanh; //Link functions and their inverses _cloglog = new jags::bugs::CLogLog; _log = new jags::bugs::Log; _logit = new jags::bugs::Logit; _probit = new jags::bugs::Probit; _icloglog = new jags::bugs::ICLogLog; _exp = new jags::bugs::Exp; _ilogit = new jags::bugs::ILogit; _phi = new jags::bugs::Phi; //Scalar summaries of vectors _max = new jags::bugs::Max; _mean = new jags::bugs::Mean; _min = new jags::bugs::Min; _sum = new jags::bugs::Sum; _sd = new jags::bugs::SD; _prod = new jags::bugs::Prod; //Mathematical functions _logfact = new jags::bugs::LogFact; _loggam = new jags::bugs::LogGam; _sqrt = new jags::bugs::Sqrt; //Lossy scalar functions _round = new jags::bugs::Round; _step = new jags::bugs::Step; _trunc = new jags::bugs::Trunc; _abs = new jags::bugs::Abs; //Observable functions _dinterval = new jags::bugs::DIntervalFunc; _dround = new jags::bugs::DRoundFunc; _dsum = new jags::bugs::DSumFunc; //Sorting functions _order = new jags::bugs::Order; _rank = new jags::bugs::Rank; _sort = new jags::bugs::Sort; //Matrix functions _inverse = new jags::bugs::Inverse; _logdet = new jags::bugs::LogDet; _matmult = new jags::bugs::MatMult; _transpose = new jags::bugs::Transpose; _inprod = new jags::bugs::InProd; //Odds and sods _ifelse = new jags::bugs::IfElse; _interplin = new jags::bugs::InterpLin; _combine = new jags::bugs::Combine; _rep = new jags::bugs::Rep; } void BugsFunTest::tearDown() { //Trigonometric functions and their inverses delete _sin; delete _cos; delete _tan; delete _arccos; delete _arcsin; delete _arctan; //Hyperbolic functions and their inverses delete _sinh; delete _cosh; delete _tanh; delete _arcsinh; delete _arccosh; delete _arctanh; //Link functions and their inverses delete _cloglog; delete _log; delete _logit; delete _probit; delete _icloglog; delete _exp; delete _ilogit; delete _phi; //Scalar summaries of vectors delete _max; delete _mean; delete _min; delete _sum; delete _sd; delete _prod; //Mathematical functions delete _logfact; delete _loggam; delete _sqrt; //Lossy scalar functions delete _round; delete _step; delete _trunc; delete _abs; //Observable functions delete _dinterval; delete _dround; delete _dsum; //Sorting functions delete _order; delete _rank; delete _sort; //Matrix functions delete _inverse; delete _logdet; delete _matmult; delete _transpose; delete _inprod; //Odds and sods delete _ifelse; delete _interplin; delete _combine; delete _rep; } void BugsFunTest::npar() { //Trigonometric functions and their inverses CPPUNIT_ASSERT_EQUAL(_sin->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_cos->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_tan->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_arccos->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_arcsin->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_arctan->npar(), 1U); //Hyperbolic functions and their inverses CPPUNIT_ASSERT_EQUAL(_sinh->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_cosh->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_tanh->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_arcsinh->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_arccosh->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_arctanh->npar(), 1U); //Link functions and their inverses CPPUNIT_ASSERT_EQUAL(_cloglog->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_log->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_logit->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_probit->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_icloglog->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_exp->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_ilogit->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_phi->npar(), 1U); //Scalar summaries of vectors CPPUNIT_ASSERT_EQUAL(_max->npar(), 0U); CPPUNIT_ASSERT_EQUAL(_min->npar(), 0U); CPPUNIT_ASSERT_EQUAL(_sum->npar(), 0U); CPPUNIT_ASSERT_EQUAL(_prod->npar(), 0U); CPPUNIT_ASSERT_EQUAL(_sd->npar(), 1U); //Mathematical functions CPPUNIT_ASSERT_EQUAL(_logfact->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_loggam->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_sqrt->npar(), 1U); //Lossy scalar functions CPPUNIT_ASSERT_EQUAL(_round->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_step->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_trunc->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_abs->npar(), 1U); //Observable functions CPPUNIT_ASSERT_EQUAL(_dinterval->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dround->npar(), 2U); CPPUNIT_ASSERT(checkNPar(_dsum, 1)); //Sorting functions CPPUNIT_ASSERT_EQUAL(_order->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_rank->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_sort->npar(), 1U); //Matrix functions CPPUNIT_ASSERT_EQUAL(_inverse->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_logdet->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_matmult->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_transpose->npar(), 1U); CPPUNIT_ASSERT_EQUAL(_inprod->npar(), 2U); //Odds and sods CPPUNIT_ASSERT_EQUAL(_ifelse->npar(), 3U); CPPUNIT_ASSERT_EQUAL(_interplin->npar(), 3U); CPPUNIT_ASSERT(checkNPar(_combine, 1)); CPPUNIT_ASSERT(checkNPar(_combine, 2)); CPPUNIT_ASSERT(checkNPar(_combine, 3)); CPPUNIT_ASSERT_EQUAL(_rep->npar(), 2U); } void BugsFunTest::name() { //Trigonometric functions CPPUNIT_ASSERT_EQUAL(string("sin"), _sin->name()); CPPUNIT_ASSERT_EQUAL(string("cos"), _cos->name()); CPPUNIT_ASSERT_EQUAL(string("tan"), _tan->name()); CPPUNIT_ASSERT_EQUAL(string("arcsin"), _arcsin->name()); CPPUNIT_ASSERT_EQUAL(string("arccos"), _arccos->name()); CPPUNIT_ASSERT_EQUAL(string("arctan"), _arctan->name()); //Hyperbolic functions CPPUNIT_ASSERT_EQUAL(string("sinh"), _sinh->name()); CPPUNIT_ASSERT_EQUAL(string("cosh"), _cosh->name()); CPPUNIT_ASSERT_EQUAL(string("tanh"), _tanh->name()); CPPUNIT_ASSERT_EQUAL(string("arcsinh"), _arcsinh->name()); CPPUNIT_ASSERT_EQUAL(string("arccosh"), _arccosh->name()); CPPUNIT_ASSERT_EQUAL(string("arctanh"), _arctanh->name()); //Link functions CPPUNIT_ASSERT_EQUAL(string("cloglog"), _cloglog->name()); CPPUNIT_ASSERT_EQUAL(string("log"), _log->name()); CPPUNIT_ASSERT_EQUAL(string("logit"), _logit->name()); CPPUNIT_ASSERT_EQUAL(string("probit"), _probit->name()); CPPUNIT_ASSERT_EQUAL(string("icloglog"), _icloglog->name()); CPPUNIT_ASSERT_EQUAL(string("exp"), _exp->name()); CPPUNIT_ASSERT_EQUAL(string("ilogit"), _ilogit->name()); CPPUNIT_ASSERT_EQUAL(string("phi"), _phi->name()); //Scalar summaries of vectors CPPUNIT_ASSERT_EQUAL(string("max"), _max->name()); CPPUNIT_ASSERT_EQUAL(string("mean"), _mean->name()); CPPUNIT_ASSERT_EQUAL(string("min"), _min->name()); CPPUNIT_ASSERT_EQUAL(string("sum"), _sum->name()); CPPUNIT_ASSERT_EQUAL(string("sd"), _sd->name()); CPPUNIT_ASSERT_EQUAL(string("prod"), _prod->name()); //Mathematical functions CPPUNIT_ASSERT_EQUAL(string("logfact"), _logfact->name()); CPPUNIT_ASSERT_EQUAL(string("loggam"), _loggam->name()); CPPUNIT_ASSERT_EQUAL(string("sqrt"), _sqrt->name()); //Lossy scalar functions CPPUNIT_ASSERT_EQUAL(string("round"), _round->name()); CPPUNIT_ASSERT_EQUAL(string("step"), _step->name()); CPPUNIT_ASSERT_EQUAL(string("trunc"), _trunc->name()); CPPUNIT_ASSERT_EQUAL(string("abs"), _abs->name()); //Observable functions CPPUNIT_ASSERT_EQUAL(string("dinterval"), _dinterval->name()); CPPUNIT_ASSERT_EQUAL(string("dround"), _dround->name()); CPPUNIT_ASSERT_EQUAL(string("dsum"), _dsum->name()); CPPUNIT_ASSERT_EQUAL(string("order"), _order->name()); CPPUNIT_ASSERT_EQUAL(string("rank"), _rank->name()); CPPUNIT_ASSERT_EQUAL(string("sort"), _sort->name()); //Matrix functions CPPUNIT_ASSERT_EQUAL(string("inverse"), _inverse->name()); CPPUNIT_ASSERT_EQUAL(string("logdet"), _logdet->name()); CPPUNIT_ASSERT_EQUAL(string("%*%"), _matmult->name()); CPPUNIT_ASSERT_EQUAL(string("t"), _transpose->name()); //odds and ends CPPUNIT_ASSERT_EQUAL(string("ifelse"), _ifelse->name()); CPPUNIT_ASSERT_EQUAL(string("inprod"), _inprod->name()); CPPUNIT_ASSERT_EQUAL(string("interp.lin"), _interplin->name()); CPPUNIT_ASSERT_EQUAL(string("c"), _combine->name()); CPPUNIT_ASSERT_EQUAL(string("rep"), _rep->name()); } void BugsFunTest::alias() { //Trigonometric functions CPPUNIT_ASSERT_EQUAL(string(""), _sin->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _cos->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _tan->alias()); CPPUNIT_ASSERT_EQUAL(string("asin"), _arcsin->alias()); CPPUNIT_ASSERT_EQUAL(string("acos"), _arccos->alias()); CPPUNIT_ASSERT_EQUAL(string("atan"), _arctan->alias()); //Hyperbolic functions CPPUNIT_ASSERT_EQUAL(string(""), _sinh->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _cosh->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _tanh->alias()); CPPUNIT_ASSERT_EQUAL(string("asinh"), _arcsinh->alias()); CPPUNIT_ASSERT_EQUAL(string("acosh"), _arccosh->alias()); CPPUNIT_ASSERT_EQUAL(string("atanh"), _arctanh->alias()); //Link functions CPPUNIT_ASSERT_EQUAL(string(""), _cloglog->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _log->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _logit->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _probit->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _icloglog->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _exp->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _ilogit->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _phi->alias()); //Scalar summaries of vectors CPPUNIT_ASSERT_EQUAL(string(""), _max->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _mean->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _min->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _sum->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _sd->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _prod->alias()); //Mathematical functions CPPUNIT_ASSERT_EQUAL(string(""), _logfact->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _loggam->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _sqrt->alias()); //Lossy scalar functions CPPUNIT_ASSERT_EQUAL(string(""), _round->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _step->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _trunc->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _abs->alias()); //Observable functions CPPUNIT_ASSERT_EQUAL(string(""), _dinterval->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dround->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dsum->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _order->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _rank->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _sort->alias()); //Matrix functions CPPUNIT_ASSERT_EQUAL(string(""), _inverse->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _logdet->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _matmult->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _transpose->alias()); //odds and ends CPPUNIT_ASSERT_EQUAL(string(""), _ifelse->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _inprod->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _interplin->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _combine->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _rep->alias()); } void BugsFunTest::trig(double const v) { double sinv = eval(_sin, v); double cosv = eval(_cos, v); double tanv = eval(_tan, v); CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, sinv*sinv + cosv*cosv, tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(tanv, sinv/cosv, tol); //Test consistency of inverse functions by inverting twice CPPUNIT_ASSERT_DOUBLES_EQUAL(sinv, eval(_sin, eval(_arcsin, sinv)), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(cosv, eval(_cos, eval(_arccos, cosv)), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(tanv, eval(_tan, eval(_arctan, tanv)), tol); } void BugsFunTest::trig() { //Check reference values CPPUNIT_ASSERT_EQUAL(0.0, eval(_sin, 0)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_cos, 0)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_tan, 0)); CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, eval(_sin, M_PI_2), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, eval(_cos, M_PI_2), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, eval(_sin, M_PI), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.0, eval(_cos, M_PI), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, eval(_tan, M_PI), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.0, eval(_sin, 3 * M_PI_2), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, eval(_cos, 3 * M_PI_2), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, eval(_sin, M_2PI), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, eval(_cos, M_2PI), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, eval(_tan, M_2PI), tol); //Check limits of inverse functions checkLimits(_arcsin, -1, 1); checkLimits(_arccos, -1, 1); CPPUNIT_ASSERT_DOUBLES_EQUAL(-M_PI_2, eval(_arcsin, -1), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL( M_PI_2, eval(_arcsin, 1), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(M_PI, eval(_arccos, -1), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0, eval(_arccos, 1), tol); //Test consistency of sin, cos, tan for a range of values for (double v = -10; v < 10; v = v + 0.1) { trig(v); } } void BugsFunTest::hyper(const double v) { double sinhv = eval(_sinh, v); double coshv = eval(_cosh, v); double tanhv = eval(_tanh, v); CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, coshv*coshv - sinhv*sinhv, tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(tanhv, sinhv/coshv, tol); //Test consistency of inverse functions CPPUNIT_ASSERT_DOUBLES_EQUAL(v, eval(_arcsinh, sinhv), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(fabs(v), eval(_arccosh, coshv), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(v, eval(_arctanh, tanhv), tol); } void BugsFunTest::hyper() { //Check reference values CPPUNIT_ASSERT_EQUAL(0.0, eval(_sinh, 0)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_cosh, 0)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_tanh, 0)); //Check limits of inverse functions checkLimits(_arccosh, 1, JAGS_POSINF); checkLimits(_arctanh, -1, 1); //Check consistency across a range of values for (double v = -5; v < 5; v = v + 0.1) { hyper(v); } } void BugsFunTest::link(ScalarFunction const *f, LinkFunction const *l, double lower, double upper, int N) { //Check that names of f and l match CPPUNIT_ASSERT_EQUAL(f->name(), l->linkName()); //f only takes one argument (no need to check l) CPPUNIT_ASSERT_EQUAL(f->npar(), 1U); //Test link function over a range of values double delta = (upper - lower)/(N - 1); double yold = l->inverseLink(lower); for (int i = 0; i < N; ++i) { const double x = lower + i * delta; const double y = l->inverseLink(x); //Inverse link function is strictlying increasing CPPUNIT_ASSERT(l->grad(x) > 0); if (i > 0) { CPPUNIT_ASSERT(y > yold); } yold = y; //Inverting the link function puts us back where we were. CPPUNIT_ASSERT_DOUBLES_EQUAL(x, eval(f, y), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(x, l->link(y), tol); } } void BugsFunTest::link() { //Check reference values for link functions CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, _exp->inverseLink(0), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5, _ilogit->inverseLink(0), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.5, _phi->inverseLink(0), tol); //Check range of link functions checkLimits(_log, 0, JAGS_POSINF); checkLimits(_logit, 0, 1); checkLimits(_probit, 0, 1); checkLimits(_cloglog, 0, 1); //Check that the limits of the range map to -Inf, +Inf CPPUNIT_ASSERT_EQUAL(JAGS_NEGINF, eval(_log, 0)); CPPUNIT_ASSERT_EQUAL(JAGS_NEGINF, eval(_logit, 0)); CPPUNIT_ASSERT_EQUAL(JAGS_NEGINF, eval(_probit, 0)); CPPUNIT_ASSERT_EQUAL(JAGS_NEGINF, eval(_cloglog, 0)); CPPUNIT_ASSERT_EQUAL(JAGS_POSINF, eval(_logit, 1)); CPPUNIT_ASSERT_EQUAL(JAGS_POSINF, eval(_probit, 1)); CPPUNIT_ASSERT_EQUAL(JAGS_POSINF, eval(_cloglog, 1)); //Complementary log log link is only invertible up to around 3 link(_cloglog, _icloglog, -5.0, 3.0, 13); //For the rest, we test the range [-5,5] link(_log, _exp, -5.0, 5.0, 13); link(_logit, _ilogit, -5.0, 5.0, 13); link(_probit, _phi, -5.0, 5.0, 13); } void BugsFunTest::summary(vector const &v) { //Test scalar summaries of vector values; unsigned int N = v.size(); //Calculate summaries double vmax = eval(_max, v); double vmin = eval(_min, v); double vmean = eval(_mean, v); double vsum = eval(_sum, v); //Check consistency of min, max, mean, sum CPPUNIT_ASSERT(vmax >= vmean); CPPUNIT_ASSERT(vmean >= vmin); CPPUNIT_ASSERT_DOUBLES_EQUAL(vsum, vmean * N, tol); //Negate argument and recalculate vector negv(N); for (unsigned int i = 0; i < N; ++i) { negv[i] = -v[i]; } double negvmax = eval(_max, negv); double negvmin = eval(_min, negv); double negvmean = eval(_mean, negv); double negvsum = eval(_sum, negv); //Check consistency of results for positive and negative args CPPUNIT_ASSERT_EQUAL(negvmax, -vmin); CPPUNIT_ASSERT_EQUAL(negvmin, -vmax); CPPUNIT_ASSERT_EQUAL(negvmean, -vmean); CPPUNIT_ASSERT_EQUAL(negvsum, -vsum); //Check consistency of sd, sum, mean if (N > 1) { double vsd = eval(_sd, v); vector v2(N); for (unsigned int i = 0; i < N; ++i) v2[i] = v[i]*v[i]; double v2sum = eval(_sum, v2); double sd = sqrt((v2sum - vsum*vmean)/(N-1)); CPPUNIT_ASSERT_DOUBLES_EQUAL(sd, vsd, tol); } //Check consistency of prod and sum on log scale vector vexp(N); for (unsigned int i = 0; i < N; ++i) { vexp[i] = exp(v[i]); } CPPUNIT_ASSERT_DOUBLES_EQUAL(vsum, log(eval(_prod, vexp)), tol); } void BugsFunTest::summary(vector const &v1, vector const &v2) { //Test variadic summary functions taking two arguments; unsigned int N1 = v1.size(); unsigned int N2 = v2.size(); //Calculate summaries double vmax = eval(_max, v1, v2); double vmin = eval(_min, v1, v2); double vsum = eval(_sum, v1, v2); //Check consistency of min, max CPPUNIT_ASSERT(vmax >= vmin); //Check consistency of prod and sum on log scale vector v1exp(N1); for (unsigned int i = 0; i < N1; ++i) { v1exp[i] = exp(v1[i]); } vector v2exp(N2); for (unsigned int i = 0; i < N2; ++i) { v2exp[i] = exp(v2[i]); } CPPUNIT_ASSERT_DOUBLES_EQUAL(vsum, log(eval(_prod, v1exp, v2exp)), tol); } void BugsFunTest::summary() { double v0[1] = {0}; double v1[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; double v2[5] = {1, 3, 5, 9, 11}; double v3[2] = {-M_PI, M_PI}; double v4[6] = {-1, 1, 2, 2, -3, -2.5}; //All summary functions should fail when given an empty vector vector x0(0); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_max, x0)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_min, x0)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_mean, x0)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_sd, x0)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_sum, x0)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_prod, x0)); //Standard deviation requires at least two elements CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_sd, v0)); //Solaris Studio 12.3 requires some additional hinting for templates //otherwise could have summary(v0) etc. summary<1>(v0); summary<9>(v1); summary<5>(v2); summary<2>(v3); summary<6>(v4); summary<9,9>(v1, v1); summary<9,5>(v1, v2); summary<9,2>(v1, v3); summary<9,6>(v1, v4); summary<5,5>(v2, v2); summary<5,2>(v2, v3); summary<5,6>(v2, v4); summary<2,2>(v3, v3); summary<2,6>(v3, v4); summary<6,6>(v4, v4); } void BugsFunTest::math() { //Check that bad arguments are caught CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_logfact, -1)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_logfact, -1)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_loggam, -1)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_sqrt, -1)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_loggam, 0)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_logfact, 0)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_sqrt, 0)); CPPUNIT_ASSERT_DOUBLES_EQUAL(log(M_PI)/2, eval(_loggam, 0.5), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, eval(_logfact, 1), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, eval(_loggam, 1), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, eval(_sqrt, 1), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, eval(_loggam, 2), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(log(2.0), eval(_logfact, 2), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(log(2.0), eval(_loggam, 3), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(log(6.0), eval(_logfact, 3), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(log(6.0), eval(_loggam, 4), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(log(24.0), eval(_logfact, 4), tol); CPPUNIT_ASSERT_DOUBLES_EQUAL(2.0, eval(_sqrt, 4), tol); } void BugsFunTest::lossy() { //round moves towards the nearest integer CPPUNIT_ASSERT_EQUAL(0.0, eval(_round, 0.5 - DBL_EPSILON)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_round, 0.5 + DBL_EPSILON)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_round, 1.1)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_round, -0.4)); CPPUNIT_ASSERT_EQUAL(-1.0, eval(_round, -0.9)); //step moves from 0 to 1 at 0 CPPUNIT_ASSERT_EQUAL(0.0, eval(_step, -DBL_EPSILON)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_step, 0)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_step, DBL_EPSILON)); //trunc moves towards the nearest integer that is smaller in //absolute value CPPUNIT_ASSERT_EQUAL(0.0, eval(_trunc, 0)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_trunc, 0.5)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_trunc, 1 - DBL_EPSILON)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_trunc, 1)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_trunc, 1 + DBL_EPSILON)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_trunc, -0.9)); CPPUNIT_ASSERT_EQUAL(-1.0, eval(_trunc, -1.9999)); //abs makes negative numbers positive, //leaves non-negative numbers unchanged const double x = M_PI; CPPUNIT_ASSERT_EQUAL(x, eval(_abs, -x)); CPPUNIT_ASSERT_EQUAL(x, eval(_abs, x)); CPPUNIT_ASSERT_EQUAL(0.0, eval(_abs, 0.0)); } /* void BUGSFunTest::observable() { const double c1[1] = {1}; const double c2[2] = {-5.4, 2.3}; const double badc1[3] = {1.7, 2.7, 2.6}; const double badc2[2] = {-1, -1}; vector cut1 = mkVec(c1, 1); vector cut2 = mkVec(c2, 2); vector cutbad1 = mkVec(badc1, 3); vector cutbad1 = mkVec(badc2, 2); CPPUNIT_ASSERT_EQUAL(0, eval(_interval, -1, 1)); CPPUNIT_ASSERT_EQUAL(0, eval(_interval, -0.1, 1); CPPUNIT_ASSERT_EQUAL(1, eval(_interval, vector(1, 0.1), cut1)); CPPUNIT_ASSERT_EQUAL(1, eval(_interval, vector(1, -1), cut1)); CPPUNIT_ASSERT_EQUAL(0, eval(_interval, vector(1, -1), cut1)); CPPUNIT_ASSERT_EQUAL(0, eval(_interval, vector(1, -0.1), cut1)); CPPUNIT_ASSERT_EQUAL(1, eval(_interval, vector(1, 0.1), cut1)); CPPUNIT_ASSERT_EQUAL(1, eval(_interval, vector(1, -1), cut1)); //Observable functions _dinterval = new jags::bugs::DIntervalFunc; _dround = new jags::bugs::DRoundFunc; _dsum = new jags::bugs::DSumFunc; } */ void BugsFunTest::slap() { //Functions that are never Scale, Linear, Additive, or Power functions CPPUNIT_ASSERT(neverclosed(_sin, 1)); CPPUNIT_ASSERT(neverclosed(_cos, 1)); CPPUNIT_ASSERT(neverclosed(_tan, 1)); CPPUNIT_ASSERT(neverclosed(_arccos, 1)); CPPUNIT_ASSERT(neverclosed(_arcsin, 1)); CPPUNIT_ASSERT(neverclosed(_arctan, 1)); CPPUNIT_ASSERT(neverclosed(_sinh, 1)); CPPUNIT_ASSERT(neverclosed(_cosh, 1)); CPPUNIT_ASSERT(neverclosed(_tanh, 1)); CPPUNIT_ASSERT(neverclosed(_arccosh, 1)); CPPUNIT_ASSERT(neverclosed(_arcsinh, 1)); CPPUNIT_ASSERT(neverclosed(_arctanh, 1)); CPPUNIT_ASSERT(neverclosed(_cloglog, 1)); CPPUNIT_ASSERT(neverclosed(_log, 1)); CPPUNIT_ASSERT(neverclosed(_logit, 1)); CPPUNIT_ASSERT(neverclosed(_probit, 1)); CPPUNIT_ASSERT(neverclosed(_icloglog, 1)); CPPUNIT_ASSERT(neverclosed(_exp, 1)); CPPUNIT_ASSERT(neverclosed(_ilogit, 1)); CPPUNIT_ASSERT(neverclosed(_phi, 1)); CPPUNIT_ASSERT(neverclosed(_max, 1)); CPPUNIT_ASSERT(neverclosed(_min, 1)); CPPUNIT_ASSERT(neverclosed(_sd, 1)); CPPUNIT_ASSERT(neverclosed(_logfact, 1)); CPPUNIT_ASSERT(neverclosed(_loggam, 1)); CPPUNIT_ASSERT(neverclosed(_round, 1)); CPPUNIT_ASSERT(neverclosed(_step, 1)); CPPUNIT_ASSERT(neverclosed(_trunc, 1)); CPPUNIT_ASSERT(neverclosed(_abs, 1)); CPPUNIT_ASSERT(neverclosed(_dinterval, 2)); CPPUNIT_ASSERT(neverclosed(_dround, 2)); CPPUNIT_ASSERT(neverclosed(_order, 1)); CPPUNIT_ASSERT(neverclosed(_rank, 1)); CPPUNIT_ASSERT(neverclosed(_sort, 1)); CPPUNIT_ASSERT(neverclosed(_inverse, 1)); CPPUNIT_ASSERT(neverclosed(_logdet, 1)); CPPUNIT_ASSERT(neverclosed(_interplin, 3)); CPPUNIT_ASSERT(neverclosed(_rep, 2)); } void BugsFunTest::additive() { CPPUNIT_ASSERT(neveradditive(_mean, 1)); CPPUNIT_ASSERT(_sum->isAdditive(T, vector())); CPPUNIT_ASSERT(neveradditive(_prod, 2)); CPPUNIT_ASSERT(neveradditive(_sqrt, 1)); CPPUNIT_ASSERT(_transpose->isAdditive(T, vector())); //CPPUNIT_ASSERT(_dsum->isLinear(TF, vector())); //CPPUNIT_ASSERT(_dsum->isLinear(FT, vector())); //CPPUNIT_ASSERT(_dsum->isLinear(TT, vector())); CPPUNIT_ASSERT(neveradditive(_matmult, 2)); CPPUNIT_ASSERT(neveradditive(_inprod, 2)); //Ifelse is only additive if //a) The first argument is not additive //b) Both the second and third arguments are true CPPUNIT_ASSERT(!_ifelse->isAdditive(FFF, vector())); CPPUNIT_ASSERT(!_ifelse->isAdditive(FFT, vector())); CPPUNIT_ASSERT(!_ifelse->isAdditive(FTF, vector())); CPPUNIT_ASSERT(_ifelse->isAdditive(FTT, vector())); CPPUNIT_ASSERT(!_ifelse->isAdditive(TFF, vector())); CPPUNIT_ASSERT(!_ifelse->isAdditive(TFT, vector())); CPPUNIT_ASSERT(!_ifelse->isAdditive(TTF, vector())); CPPUNIT_ASSERT(!_ifelse->isAdditive(TTT, vector())); CPPUNIT_ASSERT(!_ifelse->isAdditive(FTT, FFF)); CPPUNIT_ASSERT(!_ifelse->isAdditive(FTT, FFT)); CPPUNIT_ASSERT(!_ifelse->isAdditive(FTT, FTF)); CPPUNIT_ASSERT(!_ifelse->isAdditive(FTT, FTT)); CPPUNIT_ASSERT(!_ifelse->isAdditive(FTT, TFF)); CPPUNIT_ASSERT(!_ifelse->isAdditive(FTT, TFT)); CPPUNIT_ASSERT(!_ifelse->isAdditive(FTT, TTF)); CPPUNIT_ASSERT(!_ifelse->isAdditive(FTT, TTT)); //Combine is only additive if one argument is additive CPPUNIT_ASSERT(_combine->isAdditive(FFT, vector())); CPPUNIT_ASSERT(_combine->isAdditive(FTF, vector())); CPPUNIT_ASSERT(!_combine->isAdditive(FTT, vector())); CPPUNIT_ASSERT(_combine->isAdditive(TFF, vector())); CPPUNIT_ASSERT(!_combine->isAdditive(TFT, vector())); CPPUNIT_ASSERT(!_combine->isAdditive(TTF, vector())); CPPUNIT_ASSERT(!_combine->isAdditive(TTT, vector())); } void BugsFunTest::linear() { CPPUNIT_ASSERT(_mean->isLinear(T, vector())); CPPUNIT_ASSERT(_sum->isLinear(T, vector())); CPPUNIT_ASSERT(neverlinear(_prod, 1)); CPPUNIT_ASSERT(neverlinear(_sqrt, 1)); CPPUNIT_ASSERT(_transpose->isLinear(T, vector())); CPPUNIT_ASSERT(_dsum->isLinear(TF, vector())); CPPUNIT_ASSERT(_dsum->isLinear(FT, vector())); CPPUNIT_ASSERT(_dsum->isLinear(TT, vector())); CPPUNIT_ASSERT(_matmult->isLinear(TF, vector())); CPPUNIT_ASSERT(_matmult->isLinear(FT, vector())); CPPUNIT_ASSERT(!_matmult->isLinear(TT, vector())); CPPUNIT_ASSERT(_inprod->isLinear(TF, vector())); CPPUNIT_ASSERT(_inprod->isLinear(FT, vector())); CPPUNIT_ASSERT(!_inprod->isLinear(TT, vector())); CPPUNIT_ASSERT(_ifelse->isLinear(FTT, vector())); CPPUNIT_ASSERT(_ifelse->isLinear(FTF, vector())); CPPUNIT_ASSERT(_ifelse->isLinear(FFT, vector())); CPPUNIT_ASSERT(!_ifelse->isLinear(TFF, vector())); CPPUNIT_ASSERT(!_ifelse->isLinear(TFT, vector())); CPPUNIT_ASSERT(!_ifelse->isLinear(TTF, vector())); CPPUNIT_ASSERT(!_ifelse->isLinear(TTT, vector())); CPPUNIT_ASSERT(!_ifelse->isLinear(FTF, FFT)); CPPUNIT_ASSERT(!_ifelse->isLinear(FTF, TFF)); CPPUNIT_ASSERT(!_ifelse->isLinear(FTF, TFT)); CPPUNIT_ASSERT(!_ifelse->isLinear(FFT, FTF)); CPPUNIT_ASSERT(!_ifelse->isLinear(FFT, TFF)); CPPUNIT_ASSERT(!_ifelse->isLinear(FFT, TTF)); CPPUNIT_ASSERT(_combine->isLinear(FFT, vector())); CPPUNIT_ASSERT(_combine->isLinear(FTF, vector())); CPPUNIT_ASSERT(_combine->isLinear(FTT, vector())); CPPUNIT_ASSERT(_combine->isLinear(TFF, vector())); CPPUNIT_ASSERT(_combine->isLinear(TFT, vector())); CPPUNIT_ASSERT(_combine->isLinear(TTF, vector())); CPPUNIT_ASSERT(_combine->isLinear(TTT, vector())); } void BugsFunTest::scale() { CPPUNIT_ASSERT(_mean->isScale(T, vector())); CPPUNIT_ASSERT(_sum->isScale(T, vector())); CPPUNIT_ASSERT(neverscale(_prod, 1)); CPPUNIT_ASSERT(neverscale(_sqrt, 1)); CPPUNIT_ASSERT(_transpose->isScale(T, vector())); CPPUNIT_ASSERT(!_dsum->isScale(TF, vector())); CPPUNIT_ASSERT(!_dsum->isScale(FT, vector())); CPPUNIT_ASSERT(_dsum->isScale(TT, vector())); CPPUNIT_ASSERT(_matmult->isScale(TF, vector())); CPPUNIT_ASSERT(_matmult->isScale(FT, vector())); CPPUNIT_ASSERT(!_matmult->isScale(TT, vector())); CPPUNIT_ASSERT(_inprod->isScale(TF, vector())); CPPUNIT_ASSERT(_inprod->isScale(FT, vector())); CPPUNIT_ASSERT(!_inprod->isScale(TT, vector())); CPPUNIT_ASSERT(_ifelse->isScale(FTT, vector())); CPPUNIT_ASSERT(!_ifelse->isScale(FTF, vector())); CPPUNIT_ASSERT(!_ifelse->isScale(FFT, vector())); CPPUNIT_ASSERT(_combine->isScale(TTT, vector())); CPPUNIT_ASSERT(!_combine->isScale(TTF, vector())); CPPUNIT_ASSERT(!_combine->isScale(TFT, vector())); CPPUNIT_ASSERT(!_combine->isScale(FTT, vector())); } void BugsFunTest::power() { CPPUNIT_ASSERT(neverpow(_mean, 1)); CPPUNIT_ASSERT(neverpow(_sum, 1)); CPPUNIT_ASSERT(neverpow(_prod, 1)); CPPUNIT_ASSERT(_sqrt->isPower(vector(1,true), vector())); CPPUNIT_ASSERT(neverpow(_transpose, 1)); CPPUNIT_ASSERT(neverpow(_dsum, 3)); CPPUNIT_ASSERT(neverpow(_inprod, 2)); } void BugsFunTest::sort() { double x[8] = {-1.7, 3, 18, 2, -25, 8, 7, 0.5}; vector xord = veval(_order, x); vector xrank = veval(_rank, x); vector xsort = veval(_sort, x); for (unsigned int i = 0; i < 8; ++i) { unsigned int j = static_cast(xord[i] - 1); unsigned int k = static_cast(xrank[i] - 1); CPPUNIT_ASSERT_EQUAL(static_cast(i), xord[k] - 1); CPPUNIT_ASSERT_EQUAL(static_cast(i), xrank[j] - 1); CPPUNIT_ASSERT_EQUAL(x[j], xsort[i]); CPPUNIT_ASSERT_EQUAL(x[i], xsort[k]); } vector x0(0); CPPUNIT_ASSERT_ASSERTION_FAIL(veval(_order, x0)); CPPUNIT_ASSERT_ASSERTION_FAIL(veval(_rank, x0)); CPPUNIT_ASSERT_ASSERTION_FAIL(veval(_sort, x0)); //CPPUNIT_FAIL("sort"); } void BugsFunTest::matrix() { //Just basic checks on the identity matrix for (unsigned int n = 1; n < 6; ++n) { vector A(n*n, 0); for (unsigned int i = 0; i < n; ++i) { A[i + n*i] = 1; } vector argA(1, &A[0]); vector dA(n, n); vector > dimA(1, dA); vector invA(n*n); _inverse->checkParameterDim(dimA); _inverse->evaluate(&invA[0], argA, dimA); for (unsigned int i = 0; i < n; ++i) { CPPUNIT_ASSERT_DOUBLES_EQUAL(A[i], invA[i], tol); } double logdetA; _logdet->checkParameterDim(dimA); _logdet->evaluate(&logdetA, argA, dimA); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, logdetA, tol); vector argA2(2, &A[0]); vector > dimA2(2, dA); vector Asquared(n*n); _matmult->checkParameterDim(dimA2); _matmult->evaluate(&Asquared[0], argA2, dimA2); for (unsigned int i = 0; i < n; ++i) { CPPUNIT_ASSERT_DOUBLES_EQUAL(A[i], Asquared[i], tol); } vector tA(n*n); _transpose->checkParameterDim(dimA); _transpose->evaluate(&tA[0], argA, dimA); for (unsigned int i = 0; i < n; ++i) { CPPUNIT_ASSERT_DOUBLES_EQUAL(A[i], tA[i], tol); } } } void BugsFunTest::inprod() { double x3[3] = {7, 8, 9}; double y3[3] = {1, 2, -3}; CPPUNIT_ASSERT_DOUBLES_EQUAL(-4, eval(_inprod, x3, y3), tol); double x4[4] = {-1, 0, 2.7, 3}; double y4[4] = {1, -1, 1, -1}; CPPUNIT_ASSERT_DOUBLES_EQUAL(-1.3, eval(_inprod, x4, y4), tol); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_inprod, x3, y4)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_inprod, x4, y3)); } void BugsFunTest::interplin() { double x[6] = {-10, -0.5, 0, 1.2, 3.8, 77}; double y[6] = {-2, 3, -6.5, 8, 2.14, 7}; //Exact agreement at break points for (unsigned int i = 0; i < 6; ++i) { double ans = eval(_interplin, x[i], x, y); CPPUNIT_ASSERT_EQUAL(y[i], ans); } //Interpolation between break points unsigned int N = 100; for (unsigned int i = 0; i < 5; ++i) { for (unsigned int j = 0; j <= N; ++j) { double c = ((N - j) * x[i] + j * x[i + 1])/ N; double ans = eval(_interplin, c, x, y); double w = ((N - j) * y[i] + j * y[i + 1])/ N; CPPUNIT_ASSERT_DOUBLES_EQUAL(w, ans, tol); } } //Extrapolation beyond break points CPPUNIT_ASSERT_EQUAL(y[5], eval(_interplin, JAGS_POSINF, x, y)); CPPUNIT_ASSERT_EQUAL(y[0], eval(_interplin, JAGS_NEGINF, x, y)); } void BugsFunTest::ifelse() { CPPUNIT_ASSERT_EQUAL(2.0, eval(_ifelse, 0, 1, 2)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_ifelse, 1, 1, 2)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_ifelse, -1, 1, 2)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_ifelse, DBL_EPSILON, 1, 2)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_ifelse, JAGS_POSINF, 1, 2)); CPPUNIT_ASSERT_EQUAL(1.0, eval(_ifelse, JAGS_NEGINF, 1, 2)); } void BugsFunTest::discrete() { //Trigonometric functions and their inverses CPPUNIT_ASSERT(isdiscrete(_sin, 1, never)); CPPUNIT_ASSERT(isdiscrete(_cos, 1, never)); CPPUNIT_ASSERT(isdiscrete(_tan, 1, never)); CPPUNIT_ASSERT(isdiscrete(_arccos, 1, never)); CPPUNIT_ASSERT(isdiscrete(_arcsin, 1, never)); CPPUNIT_ASSERT(isdiscrete(_arctan, 1, never)); //Hyperbolic functions and their inverses CPPUNIT_ASSERT(isdiscrete(_sinh, 1, never)); CPPUNIT_ASSERT(isdiscrete(_cosh, 1, never)); CPPUNIT_ASSERT(isdiscrete(_tanh, 1, never)); CPPUNIT_ASSERT(isdiscrete(_arcsinh, 1, never)); CPPUNIT_ASSERT(isdiscrete(_arccosh, 1, never)); CPPUNIT_ASSERT(isdiscrete(_arctanh, 1, never)); //Link functions and their inverses CPPUNIT_ASSERT(isdiscrete(_cloglog, 1, never)); CPPUNIT_ASSERT(isdiscrete(_log, 1, never)); CPPUNIT_ASSERT(isdiscrete(_logit, 1, never)); CPPUNIT_ASSERT(isdiscrete(_probit, 1, never)); CPPUNIT_ASSERT(isdiscrete(_icloglog, 1, never)); CPPUNIT_ASSERT(isdiscrete(_exp, 1, never)); CPPUNIT_ASSERT(isdiscrete(_ilogit, 1, never)); CPPUNIT_ASSERT(isdiscrete(_phi, 1, never)); //Scalar summaries of vectors CPPUNIT_ASSERT(isdiscrete(_max, 1, all)); CPPUNIT_ASSERT(isdiscrete(_mean, 1, never)); CPPUNIT_ASSERT(isdiscrete(_min, 1, all)); CPPUNIT_ASSERT(isdiscrete(_sum, 1, all)); CPPUNIT_ASSERT(isdiscrete(_sd, 1, never)); CPPUNIT_ASSERT(isdiscrete(_prod, 1, all)); //Mathematical functions CPPUNIT_ASSERT(isdiscrete(_logfact, 1, never)); CPPUNIT_ASSERT(isdiscrete(_loggam, 1, never)); CPPUNIT_ASSERT(isdiscrete(_sqrt, 1, never)); //Lossy scalar functions CPPUNIT_ASSERT(isdiscrete(_round, 1, always)); CPPUNIT_ASSERT(isdiscrete(_step, 1, always)); CPPUNIT_ASSERT(isdiscrete(_trunc, 1, always)); CPPUNIT_ASSERT(isdiscrete(_abs, 1, all)); //Observable functions CPPUNIT_ASSERT(isdiscrete(_dinterval, 2, always)); CPPUNIT_ASSERT(isdiscrete(_dround, 2, never)); CPPUNIT_ASSERT(isdiscrete(_dsum, 1, all)); //Sorting functions CPPUNIT_ASSERT(isdiscrete(_order, 1, always)); CPPUNIT_ASSERT(isdiscrete(_rank, 1, always)); CPPUNIT_ASSERT(isdiscrete(_sort, 1, all)); //Matrix functions CPPUNIT_ASSERT(isdiscrete(_inverse, 1, never)); CPPUNIT_ASSERT(isdiscrete(_logdet, 1, never)); CPPUNIT_ASSERT(isdiscrete(_matmult, 2, all)); CPPUNIT_ASSERT(isdiscrete(_transpose, 1, all)); CPPUNIT_ASSERT(isdiscrete(_inprod, 2, all)); //Odds and sods CPPUNIT_ASSERT(_ifelse->isDiscreteValued(FTT)); CPPUNIT_ASSERT(_ifelse->isDiscreteValued(TTT)); CPPUNIT_ASSERT(!_ifelse->isDiscreteValued(TTF)); CPPUNIT_ASSERT(!_ifelse->isDiscreteValued(TFT)); CPPUNIT_ASSERT(!_ifelse->isDiscreteValued(TFF)); CPPUNIT_ASSERT(isdiscrete(_interplin, 3, never)); CPPUNIT_ASSERT(_rep->isDiscreteValued(TT)); CPPUNIT_ASSERT(_rep->isDiscreteValued(TF)); CPPUNIT_ASSERT(!_rep->isDiscreteValued(FT)); CPPUNIT_ASSERT(!_rep->isDiscreteValued(FF)); } void BugsFunTest::combine() { vector x0(0); double x1[1] = {-1}; double x3[3] = {7, 8, 9}; double x6[6] = {-10, -0.5, 0, 1.2, 3.8, 77}; //c(x6) == x6 vector out1 = veval(_combine, x6); CPPUNIT_ASSERT_EQUAL(static_cast(6), out1.size()); CPPUNIT_ASSERT(equal(out1.begin(), out1.end(), x6)); //c(x0) has size 0 vector out2 = veval(_combine, x0); CPPUNIT_ASSERT_EQUAL(static_cast(0), out2.size()); //c(x1, x3, x0, x3) == c(-1, 7, 8, 9, 7, 8, 9) double y3[7] = {-1, 7, 8, 9, 7, 8, 9}; vector out3 = veval(_combine, x1, x3, x0, x3); CPPUNIT_ASSERT_EQUAL(static_cast(7), out3.size()); CPPUNIT_ASSERT(equal(out3.begin(), out3.end(), y3)); } void BugsFunTest::rep() { double x3[3] = {7, 8, 9}; double x6[6] = {-10, -0.5, 0, 1.2, 3.8, 77}; double l3[3] = {1,2,3}; double l6[6] = {1,1,0,0,0,2}; // rep(0, 3) == c(0, 0, 0) double y1[3] = {0, 0, 0}; vector out1 = veval(_rep, 0, 3); CPPUNIT_ASSERT_EQUAL(static_cast(3), out1.size()); CPPUNIT_ASSERT(equal(out1.begin(), out1.end(), y1)); // rep(x3, 4) == c(7, 8, 9, 7, 8, 9, 7, 8, 9, 7, 8, 9) double y2[12] = {7, 8, 9, 7, 8, 9, 7, 8, 9, 7, 8, 9}; vector out2 = veval(_rep, x3, 4); CPPUNIT_ASSERT_EQUAL(static_cast(12), out2.size()); CPPUNIT_ASSERT(equal(out2.begin(), out2.end(), y2)); // rep(x3, l3) == c(7, 8, 8, 9, 9, 9) double y3[6] = {7, 8, 8, 9, 9, 9}; vector out3 = veval(_rep, x3, l3); CPPUNIT_ASSERT_EQUAL(static_cast(6), out3.size()); CPPUNIT_ASSERT(equal(out3.begin(), out3.end(), y3)); // rep(x6, l6) == c(-10, -0.5, 77, 77) double y4[4] = {-10, -0.5, 77, 77}; vector out4 = veval(_rep, x6, l6); CPPUNIT_ASSERT_EQUAL(static_cast(4), out4.size()); CPPUNIT_ASSERT(equal(out4.begin(), out4.end(), y4)); // rep(x3, 0) == numeric(0) vector out5 = veval(_rep, x3, 0); CPPUNIT_ASSERT_EQUAL(static_cast(0), out5.size()); // rep(numeric(0), numeric(0)) == numeric(0) vector x0(0), l0(0); vector out6 = veval(_rep, x0, l0); CPPUNIT_ASSERT_EQUAL(static_cast(0), out6.size()); // rep(numeric(0), 7) == numeric(0) vector out7 = veval(_rep, x0, 7); CPPUNIT_ASSERT_EQUAL(static_cast(0), out7.size()); // rep(numeric(0), l3) == numeric(0) vector out8 = veval(_rep, x0, l3); CPPUNIT_ASSERT_EQUAL(static_cast(0), out8.size()); //Check that argument length mismatches are caught CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_rep, x3, l0)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_rep, x3, l6)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_rep, x6, l0)); CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_rep, x6, l3)); //Forbid negative values in second argument CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_rep, x3, -1)); double badl3[3] = {1,2,-2}; CPPUNIT_ASSERT_ASSERTION_FAIL(eval(_rep, x3, badl3)); //CPPUNIT_FAIL("rep"); } JAGS-4.3.2/src/modules/bugs/functions/testbugsfun.h0000664000175000017500000000775714224052514017137 00000000000000#ifndef BUGS_FUN_TEST_H #define BUGS_FUN_TEST_H namespace jags { class ScalarFunction; class VectorFunction; class ArrayFunction; class LinkFunction; } #include #include #include class BugsFunTest : public CppUnit::TestFixture, public JAGSFixture { CPPUNIT_TEST_SUITE( BugsFunTest ); CPPUNIT_TEST( npar ); CPPUNIT_TEST( name ); CPPUNIT_TEST( alias ); CPPUNIT_TEST( trig ); CPPUNIT_TEST( hyper ); CPPUNIT_TEST( link ); CPPUNIT_TEST( summary ); CPPUNIT_TEST( math ); CPPUNIT_TEST( lossy ); CPPUNIT_TEST( slap ); CPPUNIT_TEST( additive ); CPPUNIT_TEST( linear ); CPPUNIT_TEST( scale ); CPPUNIT_TEST( sort ); CPPUNIT_TEST( matrix ); CPPUNIT_TEST( inprod ); CPPUNIT_TEST( ifelse ); CPPUNIT_TEST( interplin ); CPPUNIT_TEST( discrete ); CPPUNIT_TEST( combine ); CPPUNIT_TEST( rep ); CPPUNIT_TEST_SUITE_END(); jags::ScalarFunction *_abs; jags::ScalarFunction *_arccos; jags::ScalarFunction *_arccosh; jags::ScalarFunction *_arcsin; jags::ScalarFunction *_arcsinh; jags::ScalarFunction *_arctan; jags::ScalarFunction *_arctanh; jags::ScalarFunction *_cloglog; jags::VectorFunction *_combine; jags::ScalarFunction *_cos; jags::ScalarFunction *_cosh; jags::VectorFunction *_dinterval; jags::ScalarFunction *_dround; jags::ArrayFunction *_dsum; jags::LinkFunction *_exp; jags::LinkFunction *_icloglog; jags::ScalarFunction *_ifelse; jags::LinkFunction *_ilogit; jags::VectorFunction *_inprod; jags::VectorFunction *_interplin; jags::ArrayFunction *_inverse; jags::ArrayFunction *_logdet; jags::ScalarFunction *_logfact; jags::ScalarFunction *_loggam; jags::ScalarFunction *_log; jags::ScalarFunction *_logit; jags::ArrayFunction *_matmult; jags::VectorFunction *_max; jags::VectorFunction *_mean; jags::VectorFunction *_min; jags::VectorFunction *_order; jags::LinkFunction *_phi; jags::ScalarFunction *_probit; jags::VectorFunction *_prod; jags::VectorFunction *_rank; jags::VectorFunction *_rep; jags::ScalarFunction *_round; jags::VectorFunction *_sd; jags::ScalarFunction *_sin; jags::ScalarFunction *_sinh; jags::VectorFunction *_sort; jags::ScalarFunction *_sqrt; jags::ScalarFunction *_step; jags::VectorFunction *_sum; jags::ScalarFunction *_tan; jags::ScalarFunction *_tanh; jags::ArrayFunction *_transpose; jags::ScalarFunction *_trunc; jags::ScalarFunction *_yytrunc; void link(jags::ScalarFunction const *f, jags::LinkFunction const *link, double lower, double upper, int N); /* void summary(double const *v, unsigned int N); void summary(double const *v1, unsigned int N1, double const *v2, unsigned int N2); */ void summary(std::vector const &v); void summary(std::vector const &v1, std::vector const &v2); /* template void summary(double const (&x)[N]) { summary(x, N); } template void summary(double const (&x)[N1], double const (&y)[N2]) { summary(x, N1, y, N2); } */ template void summary(double const (&x)[N]) { summary(mkVec(x)); } template void summary(double const (&x)[N1], double const (&y)[N2]) { summary(mkVec(x), mkVec(y)); } void trig(double v); void hyper(double v); public: void setUp(); void tearDown(); void npar(); void name(); void alias(); void link(); void summary(); void trig(); void hyper(); void math(); void lossy(); void slap(); void additive(); void linear(); void scale(); void sort(); void power(); void matrix(); void inprod(); void ifelse(); void discrete(); void interplin(); void combine(); void rep(); }; #endif // BUGS_FUN_TEST_H JAGS-4.3.2/src/modules/bugs/samplers/0000755000175000017500000000000014400711325014267 500000000000000JAGS-4.3.2/src/modules/bugs/samplers/Makefile.am0000664000175000017500000000222314224052371016247 00000000000000# SUBDIRS = cj noinst_LTLIBRARIES = libbugssampler.la libbugssampler_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/bugs/distributions \ -I$(top_srcdir)/src/modules/bugs/matrix libbugssampler_la_SOURCES = Censored.cc CensoredFactory.cc \ ConjugateGamma.cc ConjugateWishart.cc ConjugateBeta.cc \ ConjugateMNormal.cc ConjugateDirichlet.cc ConjugateNormal.cc \ DSumFactory.cc ConjugateFactory.cc RWDSum.cc RealDSum.cc \ DiscreteDSum.cc MNormal.cc MNormalFactory.cc ConjugateMethod.cc \ Dirichlet.cc DirichletFactory.cc TruncatedGamma.cc DMultiDSum.cc \ ShiftedCount.cc ShiftedMultinomial.cc SumMethod.cc SumFactory.cc \ RW1.cc RW1Factory.cc BinomSlicer.cc BinomSliceFactory.cc noinst_HEADERS = Censored.h CensoredFactory.h ConjugateFactory.h \ ConjugateNormal.h ConjugateBeta.h ConjugateGamma.h DSumFactory.h \ ConjugateDirichlet.h ConjugateMNormal.h ConjugateWishart.h RWDSum.h \ RealDSum.h DiscreteDSum.h MNormal.h MNormalFactory.h \ ConjugateMethod.h Dirichlet.h DirichletFactory.h TruncatedGamma.h \ DMultiDSum.h ShiftedCount.h ShiftedMultinomial.h SumMethod.h \ SumFactory.h RW1.h RW1Factory.h BinomSlicer.h BinomSliceFactory.h JAGS-4.3.2/src/modules/bugs/samplers/Censored.h0000664000175000017500000000075514224052514016135 00000000000000#ifndef CENSORED_H_ #define CENSORED_H_ #include "ConjugateMethod.h" namespace jags { class Graph; namespace bugs { /** * Update Method for censored real-valued distributions. */ class Censored : public ConjugateMethod { StochasticNode *_snode; public: Censored(SingletonGraphView const *gv); static bool canSample(StochasticNode *snode, Graph const &graph); void update(unsigned int chain, RNG * rng) const; }; } } #endif /* CENSORED_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/CensoredFactory.h0000664000175000017500000000073514224052514017463 00000000000000#ifndef CENSORED_FACTORY_H_ #define CENSORED_FACTORY_H_ #include namespace jags { class Graph; namespace bugs { /** * @short Factory object for censored samplers */ class CensoredFactory : public SingletonFactory { public: bool canSample(StochasticNode *, Graph const &) const; Sampler *makeSampler(StochasticNode *, Graph const &) const; std::string name() const; }; } } #endif /* CENSORED_FACTORY_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/ConjugateFactory.h0000664000175000017500000000150614224052514017635 00000000000000#ifndef CONJUGATE_FACTORY_H_ #define CONJUGATE_FACTORY_H_ #include namespace jags { class Graph; namespace bugs { /** * @short Factory object for conjugate samplers */ class ConjugateFactory : public SingletonFactory { public: /** * Provides a simple interface to the canSample member functions of * the various conjugate samplers. The distribution of snode is found * and, if it has an associated conjugate sampler, the appropriate * canSample member function is dispatched */ bool canSample(StochasticNode *snode, Graph const &graph) const; /** * Creates a ConjugateSampler for a stochastic node. */ Sampler *makeSampler(StochasticNode *snode, Graph const &graph) const; std::string name() const; }; }} #endif /* CONJUGATE_FACTORY_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/ConjugateNormal.h0000664000175000017500000000147014224052514017456 00000000000000#ifndef CONJUGATE_NORMAL_H_ #define CONJUGATE_NORMAL_H_ #include "ConjugateMethod.h" namespace jags { class Graph; namespace bugs { /** * Conjugate sampler for the normal distribution. * A conjugate sampler can be created for a stochastic node "snode" * if it has a normal distribution, all of its marginal stochastic * children are normal, they depend only on snode through the mean * (and not the precision) and the mean is a linear function of * snode. */ class ConjugateNormal : public ConjugateMethod { double *_betas; unsigned long _length_betas; public: ConjugateNormal(SingletonGraphView const *gv); ~ConjugateNormal(); void update(unsigned int chain, RNG *rng) const; static bool canSample(StochasticNode *snode, Graph const &graph); }; }} #endif /* CONJUGATE_NORMAL_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/ConjugateBeta.h0000664000175000017500000000142514224052514017101 00000000000000#ifndef CONJUGATE_BETA_H_ #define CONJUGATE_BETA_H_ #include "ConjugateMethod.h" namespace jags { class Graph; namespace bugs { /** * @short Conjugate sampler for the beta distribution * * A conjugate beta sampler can be created for a Stochastic node * "snode" if its children within the graph are all stochastic nodes * with either a binomial or a Bernoulli distribution with snode as * the probability parameter. In the case of binomial children, the * sample size parameter must not depend on snode. */ class ConjugateBeta : public ConjugateMethod { public: ConjugateBeta(SingletonGraphView const *gv); void update(unsigned int chain, RNG *rng) const; static bool canSample(StochasticNode *snode, Graph const &graph); }; }} #endif /* CONJUGATE_BETA_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/ConjugateGamma.h0000664000175000017500000000070614224052514017251 00000000000000#ifndef CONJUGATE_GAMMA_H_ #define CONJUGATE_GAMMA_H_ #include "ConjugateMethod.h" namespace jags { class Graph; namespace bugs { class ConjugateGamma : public ConjugateMethod { double *_coef; public: ConjugateGamma(SingletonGraphView const *gv); ~ConjugateGamma(); static bool canSample(StochasticNode *snode, Graph const &graph); void update(unsigned int chain, RNG *rng) const; }; }} #endif /* CONJUGATE_GAMMA_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/DSumFactory.h0000664000175000017500000000100614224052514016561 00000000000000#ifndef DSUM_FACTORY_H_ #define DSUM_FACTORY_H_ #include namespace jags { namespace bugs { /** * @short Factory object for discrete sum samplers */ class DSumFactory : public SamplerFactory { public: std::vector makeSamplers(std::list const &nodes, Graph const &graph) const; Sampler * makeSampler(std::list const &nodes, Graph const &graph) const; std::string name() const; }; }} #endif /* DSUM_FACTORY_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/ConjugateDirichlet.h0000664000175000017500000000226514224052514020140 00000000000000#ifndef CONJUGATE_DIRICHLET_H_ #define CONJUGATE_DIRICHLET_H_ #include "ConjugateMethod.h" namespace jags { class Graph; namespace bugs { /** * @short Conjugate sampler for Dirichlet distribution. * * A conjugate sampler may be created for the stochastic node "snode" * if it has a Dirichlet distribution and its marginal stochastic * children have either a categorical distribution (dcat) or a * multinomial distribution (dmult) with snode as the probability * vector. In the case of a multinomial distribution, the sample size * must not depend on snode. The immediate deterministic children * must be either aggregate nodes or mixture nodes. */ class ConjugateDirichlet : public ConjugateMethod { bool _mix; const std::vector _tree; std::vector > _offsets; std::vector _leaves; bool isActiveLeaf(int index, unsigned int chain) const; bool isActiveTree(int index, unsigned int chain) const; public: ConjugateDirichlet(SingletonGraphView const *gv); void update(unsigned int chain, RNG *rng) const; static bool canSample(StochasticNode *snode, Graph const &graph); }; }} #endif /* CONJUGATE_DIRICHLET_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/ConjugateMNormal.h0000664000175000017500000000203014224052514017564 00000000000000#ifndef CONJUGATE_M_NORMAL_H_ #define CONJUGATE_M_NORMAL_H_ #include "ConjugateMethod.h" namespace jags { class Graph; namespace bugs { /** * Conjugate sampler for multivariate normal distribution * * ConjugateMNormal is currently rather limited in scope. It can * sample a multivariate normal node "snode" if all the stochastic * children of snode in the graph are themselves multivariate normal, * with mean snode, and where the precision matrix does not depend on * snode. * * This can (and should) be extended to allow marginal stochastic * children that are normally distribution and where the mean of the * children is a linear function of (some element of) snode. */ class ConjugateMNormal : public ConjugateMethod { double *_betas; const unsigned int _length_betas; public: ConjugateMNormal(SingletonGraphView const *gv); ~ConjugateMNormal(); void update(unsigned int chain, RNG *rng) const; static bool canSample(StochasticNode *snode, Graph const &graph); }; }} #endif /* CONJUGATE_M_NORMAL_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/ConjugateWishart.h0000664000175000017500000000132714224052514017650 00000000000000#ifndef CONJUGATE_WISHART_H_ #define CONJUGATE_WISHART_H_ #include "ConjugateMethod.h" namespace jags { class Graph; namespace bugs { /** * Conjugate method for the Wishart distribution * * A Conjugate Wishart method for stochastic node "snode" can be * created if snode has a Wishart distribution and its stochastic * children are multivariate normal with precision matrix snode. The * mean of the children may not depend on snode. */ class ConjugateWishart : public ConjugateMethod { public: ConjugateWishart(SingletonGraphView const *gv); void update(unsigned int chain, RNG *rng) const; static bool canSample(StochasticNode *snode, Graph const &graph); }; }} #endif /* CONJUGATE_WISHART_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/RWDSum.h0000664000175000017500000000453514224052515015515 00000000000000#ifndef RW_DSUM_H_ #define RW_DSUM_H_ #include #include class Graph; class GraphView; namespace jags { namespace bugs { /** * @short Random Walk Metropolis-Hastings for parents of DSum nodes */ class RWDSum : public Metropolis { GraphView const *_gv; unsigned int _chain; StepAdapter _step_adapter; double _pmean; unsigned int _niter; protected: StochasticNode const *_dsnode; public: /** * Constructor. * * @param step Initial step size for the random walk updates. */ RWDSum(GraphView const *gv, unsigned int chain, double step); /** * Updates the current value by adding a random increment. */ void update(RNG *rng); /** * Modifies the step size to achieve the target acceptance * probability using a noisy gradient algorithm * * @param prob acceptance probability at current update */ void rescale(double prob); /** * The RWDSum method keeps a running mean of the acceptance * probabilities, which is updated every time the rescale function * is called. The checkAdaptation function returns true if the logit * of the running mean is within 0.50 of the target. */ bool checkAdaptation() const; /** * Does a random walk step. Note that this function does not * modify the value of the RWDSum object. * * @param value Value vector. It represents an nrow by ncol matrix * of values stored in column order. * @param nrow Number of rows of the value matrix * @param ncol Number of columns of the value matrix * @param s Step size * @param rng Random number generator */ virtual void step(std::vector &value, unsigned int nrow, unsigned int ncol, double s, RNG *rng) const = 0; /** * Tests whether nodes can be sampled * * @param nodes Vector of stochastic nodes to be sampled * @param graph Graph within which sampling takes place * @param discrete Flag indicating whether the nodes are discrete-valued * or not */ static bool canSample(std::vector const &nodes, Graph const &graph, bool discrete, bool multinom); void setValue(std::vector const &value); void getValue(std::vector &value) const; }; }} #endif /* RW_DSUM_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/RealDSum.h0000664000175000017500000000070214224052514016037 00000000000000#ifndef REAL_DSUM_H_ #define REAL_DSUM_H_ #include "RWDSum.h" #include class StochasticNode; class GraphView; namespace jags { namespace bugs { /** * @short Sample parents of dsum nodes */ class RealDSum : public RWDSum { public: RealDSum(GraphView const *gv, unsigned int chain); void step(std::vector &value, unsigned int nrow, unsigned int ncol, double s, RNG *rng) const; }; }} #endif /* REAL_DSUM_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/DiscreteDSum.h0000664000175000017500000000066114224052514016722 00000000000000#ifndef DISCRETE_DSUM_H_ #define DISCRETE_DSUM_H_ #include "RWDSum.h" class StochasticNode; namespace jags { namespace bugs { /** * @short Sample parents of dsum nodes */ class DiscreteDSum : public RWDSum { public: DiscreteDSum(GraphView const *gv, unsigned int chain); void step(std::vector &value, unsigned int nrow, unsigned int ncol, double s, RNG *rng) const; }; }} #endif /* DISCRETE_DSUM_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/MNormal.h0000664000175000017500000000145214224052515015734 00000000000000#ifndef MNORM_METROPOLIS_H_ #define MNORM_METROPOLIS_H_ #include namespace jags { class SingletonGraphView; namespace bugs { class MNormMetropolis : public Metropolis { SingletonGraphView const *_gv; unsigned int _chain; double *_mean; double *_var; double *_prec; unsigned int _n; unsigned int _n_isotonic; double _sump, _meanp; double _lstep; unsigned int _nstep; unsigned int _p_over_target; public: MNormMetropolis(SingletonGraphView const *gv, unsigned int chain); ~MNormMetropolis(); void rescale(double p); void update(RNG *rng); bool checkAdaptation() const; void getValue(std::vector &value) const; void setValue(std::vector const &value); }; }} #endif /* MNORM_METROPOLIS_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/MNormalFactory.h0000664000175000017500000000075014224052514017263 00000000000000#ifndef MNORMAL_FACTORY_H_ #define MNORMAL_FACTORY_H_ #include "MNormal.h" #include namespace jags { namespace bugs { /** * @short Factory object for multivariate normal samplers */ class MNormalFactory : public SingletonFactory { public: bool canSample(StochasticNode *snode, Graph const &graph) const; Sampler *makeSampler(StochasticNode *snode, Graph const &graph) const; std::string name() const; }; }} #endif /* MNORMAL_FACTORY_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/ConjugateMethod.h0000664000175000017500000000165614224052371017455 00000000000000#ifndef CONJUGATE_METHOD_H_ #define CONJUGATE_METHOD_H_ #include #include namespace jags { class SingletonGraphView; class StochasticNode; struct RNG; namespace bugs { enum ConjugateDist { BERN, BETA, BIN, CAT, CHISQ, DEXP, DIRCH, EXP, GAMMA, LNORM, LOGIS, MNORM, MULTI, NEGBIN, NORM, PAR, POIS, T, UNIF, WEIB, WISH, OTHERDIST }; /** * Convenience function that converts the name of a distribution into * a member of the ConjugateDist enumeration. OTHERDIST is returned * if the name cannot be found in the internal table. */ ConjugateDist getDist(StochasticNode const *snode); class ConjugateMethod : public ImmutableSampleMethod { protected: const ConjugateDist _target_dist; const std::vector _child_dist; SingletonGraphView const * const _gv; public: ConjugateMethod(SingletonGraphView const *gv); }; }} #endif /* CONJUGATE_METHOD_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/Dirichlet.h0000664000175000017500000000117614224052514016300 00000000000000#ifndef DIRICHLET_METROPOLIS_H_ #define DIRICHLET_METROPOLIS_H_ #include namespace jags { class GraphView; namespace bugs { class DirchMetropolis : public RWMetropolis { GraphView const *_gv; unsigned int _chain; double _s; public: DirchMetropolis(GraphView const *gv, unsigned int chain); void getValue(std::vector &x) const; void setValue(std::vector const &x); void step(std::vector &x, double size, RNG *rng) const; double logJacobian(std::vector const &x) const; double logDensity() const; }; }} #endif /* DIRICHLET_METROPOLIS_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/DirichletFactory.h0000664000175000017500000000076214224052515017631 00000000000000#ifndef DIRICHLET_FACTORY_H_ #define DIRICHLET_FACTORY_H_ #include "Dirichlet.h" #include namespace jags { namespace bugs { /** * @short Factory object for multivariate normal samplers */ class DirichletFactory : public SingletonFactory { public: bool canSample(StochasticNode *snode, Graph const &graph) const; Sampler *makeSampler(StochasticNode *snode, Graph const &graph) const; std::string name() const; }; }} #endif /* DIRICHLET_FACTORY_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/TruncatedGamma.h0000664000175000017500000000071314224052515017262 00000000000000#ifndef TRUNCATED_GAMMA_H_ #define TRUNCATED_GAMMA_H_ #include "ConjugateMethod.h" namespace jags { class Graph; namespace bugs { class TruncatedGamma : public ConjugateMethod { const double _exponent; public: TruncatedGamma(SingletonGraphView const *gv); ~TruncatedGamma(); static bool canSample(StochasticNode *snode, Graph const &graph); void update(unsigned int chain, RNG *rng) const; }; }} #endif /* TRUNCATED_GAMMA_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/DMultiDSum.h0000664000175000017500000000064714224052514016362 00000000000000#ifndef DMULTI_DSUM_H_ #define DMULTI_DSUM_H_ #include "RWDSum.h" class StochasticNode; namespace jags { namespace bugs { /** * @short Sample parents of dsum nodes */ class DMultiDSum : public RWDSum { public: DMultiDSum(GraphView const *gv, unsigned int chain); void step(std::vector &value, unsigned int nrow, unsigned int ncol, double s, RNG *rng) const; }; }} #endif /* DMULTI_DSUM_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/ShiftedCount.h0000664000175000017500000000062114224052515016763 00000000000000#ifndef SHIFTED_COUNT_H_ #define SHIFTED_COUNT_H_ #include "ConjugateMethod.h" namespace jags { class Graph; namespace bugs { class ShiftedCount : public ConjugateMethod { public: ShiftedCount(SingletonGraphView const *gv); static bool canSample(StochasticNode *snode, Graph const &graph); void update(unsigned int chain, RNG *rng) const; }; }} #endif /* SHIFTED_COUNT_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/ShiftedMultinomial.h0000664000175000017500000000071114224052514020164 00000000000000#ifndef SHIFTED_MULTINOMIAL_H_ #define SHIFTED_MULTINOMIAL_H_ #include "ConjugateMethod.h" namespace jags { class Graph; namespace bugs { class ShiftedMultinomial : public ConjugateMethod { std::vector _index; public: ShiftedMultinomial(SingletonGraphView const *gv); static bool canSample(StochasticNode *snode, Graph const &graph); void update(unsigned int chain, RNG *rng) const; }; }} #endif /* SHIFTED_MULTINOMIAL_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/SumMethod.h0000664000175000017500000000243214224052514016272 00000000000000#ifndef SUM_METHOD_H_ #define SUM_METHOD_H_ #include #include namespace jags { class StochasticNode; class DeterministicNode; class GraphView; namespace bugs { /** * @short Sampler for stochastic parents of sum nodes */ class SumMethod : public MutableSampleMethod { GraphView const *_gv; unsigned int _chain; double _sum; bool _discrete; std::vector _x; unsigned int _i, _j; StochasticNode *_sumchild; bool _fast; double _sumdiff; unsigned int _iter; double _width; int _max; bool _adapt; public: SumMethod(GraphView const *gv, unsigned int chain); ~SumMethod(); void update(RNG *); void setValue(double x); double value() const; void getLimits(double *lower, double *upper) const; std::string name() const; double logDensity() const; void updateStep(RNG *rng); bool isAdaptive() const; void adaptOff(); bool checkAdaptation() const; static StochasticNode * isCandidate(StochasticNode *snode, Graph const &graph); static bool canSample(std::vector const &nodes, Graph const &graph); }; } //namespace bugs } //namespace jags #endif /* SUM_METHOD_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/SumFactory.h0000664000175000017500000000066214224052515016465 00000000000000#ifndef SUM_FACTORY_H_ #define SUM_FACTORY_H_ #include namespace jags { namespace bugs { /** * @short Factory object for discrete sum samplers */ class SumFactory : public SamplerFactory { public: std::vector makeSamplers(std::list const &nodes, Graph const &graph) const; std::string name() const; }; } } #endif /* SUM_FACTORY_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/RW1.h0000664000175000017500000000126414224052515015001 00000000000000#ifndef RW1_METROPOLIS_H_ #define RW1_METROPOLIS_H_ #include #include namespace jags { class SingletonGraphView; namespace bugs { class RW1 : public Metropolis { SingletonGraphView const *_gv; unsigned int _chain; StepAdapter _step_adapter; double _pmean; unsigned int _niter; public: RW1(SingletonGraphView const *gv, unsigned int chain); ~RW1(); void rescale(double p); void update(RNG *rng); bool checkAdaptation() const; void getValue(std::vector &value) const; void setValue(std::vector const &value); }; } } #endif /* RW1_METROPOLIS_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/RW1Factory.h0000664000175000017500000000071514224052514016330 00000000000000#ifndef RW1_FACTORY_H_ #define RW1_FACTORY_H_ #include "RW1.h" #include namespace jags { namespace bugs { /** * @short Factory object for RW1 sampler */ class RW1Factory : public SingletonFactory { public: bool canSample(StochasticNode *snode, Graph const &graph) const; Sampler *makeSampler(StochasticNode *, Graph const &) const; std::string name() const; }; } } #endif /* RW1_FACTORY_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/BinomSlicer.h0000664000175000017500000000203614224052514016573 00000000000000#ifndef BINOM_SLICER_H_ #define BINOM_SLICER_H_ #include namespace jags { class StochasticNode; class SingletonGraphView; class Graph; namespace bugs { /** * Slice sampler for real-valued distributions */ class BinomSlicer : public Slicer { SingletonGraphView const *_gv; unsigned int _chain; public: /** * Constructor for Slice Sampler * @param gv GraphView containing node to sample * @param chain Index number of chain to sample (starting from zero) * @param width Initial width of slice * @param maxwidth Maximal width of slice as a multiple of the width * parameter * @param nburn Length of burnin */ BinomSlicer(SingletonGraphView const *gv, unsigned int chain, double width = 1, long maxwidth = 10); double value() const; void setValue(double value); void getLimits(double *lower, double *upper) const; void update(RNG *rng); static bool canSample(StochasticNode *node, Graph const &graph); double logDensity() const; }; }} #endif /* BINOM_SLICER_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/BinomSliceFactory.h0000664000175000017500000000103114224052514017733 00000000000000#ifndef BINOM_SLICE_FACTORY_H_ #define BINOM_SLICE_FACTORY_H_ #include class StochasticNode; class Graph; namespace jags { namespace bugs { /** * @short Factory object for binomial slice samplers */ class BinomSliceFactory : public SingletonFactory { public: bool canSample(StochasticNode *snode, Graph const &graph) const; Sampler *makeSampler(StochasticNode *snode, Graph const &graph) const; std::string name() const; }; } } #endif /* BINOM_SLICE_FACTORY_H_ */ JAGS-4.3.2/src/modules/bugs/samplers/Makefile.in0000644000175000017500000017243214400675236016277 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # SUBDIRS = cj VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/bugs/samplers ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbugssampler_la_LIBADD = am_libbugssampler_la_OBJECTS = libbugssampler_la-Censored.lo \ libbugssampler_la-CensoredFactory.lo \ libbugssampler_la-ConjugateGamma.lo \ libbugssampler_la-ConjugateWishart.lo \ libbugssampler_la-ConjugateBeta.lo \ libbugssampler_la-ConjugateMNormal.lo \ libbugssampler_la-ConjugateDirichlet.lo \ libbugssampler_la-ConjugateNormal.lo \ libbugssampler_la-DSumFactory.lo \ libbugssampler_la-ConjugateFactory.lo \ libbugssampler_la-RWDSum.lo libbugssampler_la-RealDSum.lo \ libbugssampler_la-DiscreteDSum.lo libbugssampler_la-MNormal.lo \ libbugssampler_la-MNormalFactory.lo \ libbugssampler_la-ConjugateMethod.lo \ libbugssampler_la-Dirichlet.lo \ libbugssampler_la-DirichletFactory.lo \ libbugssampler_la-TruncatedGamma.lo \ libbugssampler_la-DMultiDSum.lo \ libbugssampler_la-ShiftedCount.lo \ libbugssampler_la-ShiftedMultinomial.lo \ libbugssampler_la-SumMethod.lo libbugssampler_la-SumFactory.lo \ libbugssampler_la-RW1.lo libbugssampler_la-RW1Factory.lo \ libbugssampler_la-BinomSlicer.lo \ libbugssampler_la-BinomSliceFactory.lo libbugssampler_la_OBJECTS = $(am_libbugssampler_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = \ ./$(DEPDIR)/libbugssampler_la-BinomSliceFactory.Plo \ ./$(DEPDIR)/libbugssampler_la-BinomSlicer.Plo \ ./$(DEPDIR)/libbugssampler_la-Censored.Plo \ ./$(DEPDIR)/libbugssampler_la-CensoredFactory.Plo \ ./$(DEPDIR)/libbugssampler_la-ConjugateBeta.Plo \ ./$(DEPDIR)/libbugssampler_la-ConjugateDirichlet.Plo \ ./$(DEPDIR)/libbugssampler_la-ConjugateFactory.Plo \ ./$(DEPDIR)/libbugssampler_la-ConjugateGamma.Plo \ ./$(DEPDIR)/libbugssampler_la-ConjugateMNormal.Plo \ ./$(DEPDIR)/libbugssampler_la-ConjugateMethod.Plo \ ./$(DEPDIR)/libbugssampler_la-ConjugateNormal.Plo \ ./$(DEPDIR)/libbugssampler_la-ConjugateWishart.Plo \ ./$(DEPDIR)/libbugssampler_la-DMultiDSum.Plo \ ./$(DEPDIR)/libbugssampler_la-DSumFactory.Plo \ ./$(DEPDIR)/libbugssampler_la-Dirichlet.Plo \ ./$(DEPDIR)/libbugssampler_la-DirichletFactory.Plo \ ./$(DEPDIR)/libbugssampler_la-DiscreteDSum.Plo \ ./$(DEPDIR)/libbugssampler_la-MNormal.Plo \ ./$(DEPDIR)/libbugssampler_la-MNormalFactory.Plo \ ./$(DEPDIR)/libbugssampler_la-RW1.Plo \ ./$(DEPDIR)/libbugssampler_la-RW1Factory.Plo \ ./$(DEPDIR)/libbugssampler_la-RWDSum.Plo \ ./$(DEPDIR)/libbugssampler_la-RealDSum.Plo \ ./$(DEPDIR)/libbugssampler_la-ShiftedCount.Plo \ ./$(DEPDIR)/libbugssampler_la-ShiftedMultinomial.Plo \ ./$(DEPDIR)/libbugssampler_la-SumFactory.Plo \ ./$(DEPDIR)/libbugssampler_la-SumMethod.Plo \ ./$(DEPDIR)/libbugssampler_la-TruncatedGamma.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libbugssampler_la_SOURCES) DIST_SOURCES = $(libbugssampler_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libbugssampler.la libbugssampler_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/bugs/distributions \ -I$(top_srcdir)/src/modules/bugs/matrix libbugssampler_la_SOURCES = Censored.cc CensoredFactory.cc \ ConjugateGamma.cc ConjugateWishart.cc ConjugateBeta.cc \ ConjugateMNormal.cc ConjugateDirichlet.cc ConjugateNormal.cc \ DSumFactory.cc ConjugateFactory.cc RWDSum.cc RealDSum.cc \ DiscreteDSum.cc MNormal.cc MNormalFactory.cc ConjugateMethod.cc \ Dirichlet.cc DirichletFactory.cc TruncatedGamma.cc DMultiDSum.cc \ ShiftedCount.cc ShiftedMultinomial.cc SumMethod.cc SumFactory.cc \ RW1.cc RW1Factory.cc BinomSlicer.cc BinomSliceFactory.cc noinst_HEADERS = Censored.h CensoredFactory.h ConjugateFactory.h \ ConjugateNormal.h ConjugateBeta.h ConjugateGamma.h DSumFactory.h \ ConjugateDirichlet.h ConjugateMNormal.h ConjugateWishart.h RWDSum.h \ RealDSum.h DiscreteDSum.h MNormal.h MNormalFactory.h \ ConjugateMethod.h Dirichlet.h DirichletFactory.h TruncatedGamma.h \ DMultiDSum.h ShiftedCount.h ShiftedMultinomial.h SumMethod.h \ SumFactory.h RW1.h RW1Factory.h BinomSlicer.h BinomSliceFactory.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/bugs/samplers/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/bugs/samplers/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libbugssampler.la: $(libbugssampler_la_OBJECTS) $(libbugssampler_la_DEPENDENCIES) $(EXTRA_libbugssampler_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libbugssampler_la_OBJECTS) $(libbugssampler_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-BinomSliceFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-BinomSlicer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-Censored.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-CensoredFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-ConjugateBeta.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-ConjugateDirichlet.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-ConjugateFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-ConjugateGamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-ConjugateMNormal.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-ConjugateMethod.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-ConjugateNormal.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-ConjugateWishart.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-DMultiDSum.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-DSumFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-Dirichlet.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-DirichletFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-DiscreteDSum.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-MNormal.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-MNormalFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-RW1.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-RW1Factory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-RWDSum.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-RealDSum.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-ShiftedCount.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-ShiftedMultinomial.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-SumFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-SumMethod.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugssampler_la-TruncatedGamma.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libbugssampler_la-Censored.lo: Censored.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-Censored.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-Censored.Tpo -c -o libbugssampler_la-Censored.lo `test -f 'Censored.cc' || echo '$(srcdir)/'`Censored.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-Censored.Tpo $(DEPDIR)/libbugssampler_la-Censored.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Censored.cc' object='libbugssampler_la-Censored.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-Censored.lo `test -f 'Censored.cc' || echo '$(srcdir)/'`Censored.cc libbugssampler_la-CensoredFactory.lo: CensoredFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-CensoredFactory.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-CensoredFactory.Tpo -c -o libbugssampler_la-CensoredFactory.lo `test -f 'CensoredFactory.cc' || echo '$(srcdir)/'`CensoredFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-CensoredFactory.Tpo $(DEPDIR)/libbugssampler_la-CensoredFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CensoredFactory.cc' object='libbugssampler_la-CensoredFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-CensoredFactory.lo `test -f 'CensoredFactory.cc' || echo '$(srcdir)/'`CensoredFactory.cc libbugssampler_la-ConjugateGamma.lo: ConjugateGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-ConjugateGamma.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-ConjugateGamma.Tpo -c -o libbugssampler_la-ConjugateGamma.lo `test -f 'ConjugateGamma.cc' || echo '$(srcdir)/'`ConjugateGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-ConjugateGamma.Tpo $(DEPDIR)/libbugssampler_la-ConjugateGamma.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ConjugateGamma.cc' object='libbugssampler_la-ConjugateGamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-ConjugateGamma.lo `test -f 'ConjugateGamma.cc' || echo '$(srcdir)/'`ConjugateGamma.cc libbugssampler_la-ConjugateWishart.lo: ConjugateWishart.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-ConjugateWishart.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-ConjugateWishart.Tpo -c -o libbugssampler_la-ConjugateWishart.lo `test -f 'ConjugateWishart.cc' || echo '$(srcdir)/'`ConjugateWishart.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-ConjugateWishart.Tpo $(DEPDIR)/libbugssampler_la-ConjugateWishart.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ConjugateWishart.cc' object='libbugssampler_la-ConjugateWishart.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-ConjugateWishart.lo `test -f 'ConjugateWishart.cc' || echo '$(srcdir)/'`ConjugateWishart.cc libbugssampler_la-ConjugateBeta.lo: ConjugateBeta.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-ConjugateBeta.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-ConjugateBeta.Tpo -c -o libbugssampler_la-ConjugateBeta.lo `test -f 'ConjugateBeta.cc' || echo '$(srcdir)/'`ConjugateBeta.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-ConjugateBeta.Tpo $(DEPDIR)/libbugssampler_la-ConjugateBeta.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ConjugateBeta.cc' object='libbugssampler_la-ConjugateBeta.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-ConjugateBeta.lo `test -f 'ConjugateBeta.cc' || echo '$(srcdir)/'`ConjugateBeta.cc libbugssampler_la-ConjugateMNormal.lo: ConjugateMNormal.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-ConjugateMNormal.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-ConjugateMNormal.Tpo -c -o libbugssampler_la-ConjugateMNormal.lo `test -f 'ConjugateMNormal.cc' || echo '$(srcdir)/'`ConjugateMNormal.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-ConjugateMNormal.Tpo $(DEPDIR)/libbugssampler_la-ConjugateMNormal.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ConjugateMNormal.cc' object='libbugssampler_la-ConjugateMNormal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-ConjugateMNormal.lo `test -f 'ConjugateMNormal.cc' || echo '$(srcdir)/'`ConjugateMNormal.cc libbugssampler_la-ConjugateDirichlet.lo: ConjugateDirichlet.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-ConjugateDirichlet.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-ConjugateDirichlet.Tpo -c -o libbugssampler_la-ConjugateDirichlet.lo `test -f 'ConjugateDirichlet.cc' || echo '$(srcdir)/'`ConjugateDirichlet.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-ConjugateDirichlet.Tpo $(DEPDIR)/libbugssampler_la-ConjugateDirichlet.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ConjugateDirichlet.cc' object='libbugssampler_la-ConjugateDirichlet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-ConjugateDirichlet.lo `test -f 'ConjugateDirichlet.cc' || echo '$(srcdir)/'`ConjugateDirichlet.cc libbugssampler_la-ConjugateNormal.lo: ConjugateNormal.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-ConjugateNormal.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-ConjugateNormal.Tpo -c -o libbugssampler_la-ConjugateNormal.lo `test -f 'ConjugateNormal.cc' || echo '$(srcdir)/'`ConjugateNormal.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-ConjugateNormal.Tpo $(DEPDIR)/libbugssampler_la-ConjugateNormal.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ConjugateNormal.cc' object='libbugssampler_la-ConjugateNormal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-ConjugateNormal.lo `test -f 'ConjugateNormal.cc' || echo '$(srcdir)/'`ConjugateNormal.cc libbugssampler_la-DSumFactory.lo: DSumFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-DSumFactory.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-DSumFactory.Tpo -c -o libbugssampler_la-DSumFactory.lo `test -f 'DSumFactory.cc' || echo '$(srcdir)/'`DSumFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-DSumFactory.Tpo $(DEPDIR)/libbugssampler_la-DSumFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DSumFactory.cc' object='libbugssampler_la-DSumFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-DSumFactory.lo `test -f 'DSumFactory.cc' || echo '$(srcdir)/'`DSumFactory.cc libbugssampler_la-ConjugateFactory.lo: ConjugateFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-ConjugateFactory.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-ConjugateFactory.Tpo -c -o libbugssampler_la-ConjugateFactory.lo `test -f 'ConjugateFactory.cc' || echo '$(srcdir)/'`ConjugateFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-ConjugateFactory.Tpo $(DEPDIR)/libbugssampler_la-ConjugateFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ConjugateFactory.cc' object='libbugssampler_la-ConjugateFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-ConjugateFactory.lo `test -f 'ConjugateFactory.cc' || echo '$(srcdir)/'`ConjugateFactory.cc libbugssampler_la-RWDSum.lo: RWDSum.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-RWDSum.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-RWDSum.Tpo -c -o libbugssampler_la-RWDSum.lo `test -f 'RWDSum.cc' || echo '$(srcdir)/'`RWDSum.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-RWDSum.Tpo $(DEPDIR)/libbugssampler_la-RWDSum.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RWDSum.cc' object='libbugssampler_la-RWDSum.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-RWDSum.lo `test -f 'RWDSum.cc' || echo '$(srcdir)/'`RWDSum.cc libbugssampler_la-RealDSum.lo: RealDSum.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-RealDSum.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-RealDSum.Tpo -c -o libbugssampler_la-RealDSum.lo `test -f 'RealDSum.cc' || echo '$(srcdir)/'`RealDSum.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-RealDSum.Tpo $(DEPDIR)/libbugssampler_la-RealDSum.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RealDSum.cc' object='libbugssampler_la-RealDSum.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-RealDSum.lo `test -f 'RealDSum.cc' || echo '$(srcdir)/'`RealDSum.cc libbugssampler_la-DiscreteDSum.lo: DiscreteDSum.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-DiscreteDSum.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-DiscreteDSum.Tpo -c -o libbugssampler_la-DiscreteDSum.lo `test -f 'DiscreteDSum.cc' || echo '$(srcdir)/'`DiscreteDSum.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-DiscreteDSum.Tpo $(DEPDIR)/libbugssampler_la-DiscreteDSum.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DiscreteDSum.cc' object='libbugssampler_la-DiscreteDSum.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-DiscreteDSum.lo `test -f 'DiscreteDSum.cc' || echo '$(srcdir)/'`DiscreteDSum.cc libbugssampler_la-MNormal.lo: MNormal.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-MNormal.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-MNormal.Tpo -c -o libbugssampler_la-MNormal.lo `test -f 'MNormal.cc' || echo '$(srcdir)/'`MNormal.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-MNormal.Tpo $(DEPDIR)/libbugssampler_la-MNormal.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MNormal.cc' object='libbugssampler_la-MNormal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-MNormal.lo `test -f 'MNormal.cc' || echo '$(srcdir)/'`MNormal.cc libbugssampler_la-MNormalFactory.lo: MNormalFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-MNormalFactory.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-MNormalFactory.Tpo -c -o libbugssampler_la-MNormalFactory.lo `test -f 'MNormalFactory.cc' || echo '$(srcdir)/'`MNormalFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-MNormalFactory.Tpo $(DEPDIR)/libbugssampler_la-MNormalFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MNormalFactory.cc' object='libbugssampler_la-MNormalFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-MNormalFactory.lo `test -f 'MNormalFactory.cc' || echo '$(srcdir)/'`MNormalFactory.cc libbugssampler_la-ConjugateMethod.lo: ConjugateMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-ConjugateMethod.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-ConjugateMethod.Tpo -c -o libbugssampler_la-ConjugateMethod.lo `test -f 'ConjugateMethod.cc' || echo '$(srcdir)/'`ConjugateMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-ConjugateMethod.Tpo $(DEPDIR)/libbugssampler_la-ConjugateMethod.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ConjugateMethod.cc' object='libbugssampler_la-ConjugateMethod.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-ConjugateMethod.lo `test -f 'ConjugateMethod.cc' || echo '$(srcdir)/'`ConjugateMethod.cc libbugssampler_la-Dirichlet.lo: Dirichlet.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-Dirichlet.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-Dirichlet.Tpo -c -o libbugssampler_la-Dirichlet.lo `test -f 'Dirichlet.cc' || echo '$(srcdir)/'`Dirichlet.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-Dirichlet.Tpo $(DEPDIR)/libbugssampler_la-Dirichlet.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Dirichlet.cc' object='libbugssampler_la-Dirichlet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-Dirichlet.lo `test -f 'Dirichlet.cc' || echo '$(srcdir)/'`Dirichlet.cc libbugssampler_la-DirichletFactory.lo: DirichletFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-DirichletFactory.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-DirichletFactory.Tpo -c -o libbugssampler_la-DirichletFactory.lo `test -f 'DirichletFactory.cc' || echo '$(srcdir)/'`DirichletFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-DirichletFactory.Tpo $(DEPDIR)/libbugssampler_la-DirichletFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DirichletFactory.cc' object='libbugssampler_la-DirichletFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-DirichletFactory.lo `test -f 'DirichletFactory.cc' || echo '$(srcdir)/'`DirichletFactory.cc libbugssampler_la-TruncatedGamma.lo: TruncatedGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-TruncatedGamma.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-TruncatedGamma.Tpo -c -o libbugssampler_la-TruncatedGamma.lo `test -f 'TruncatedGamma.cc' || echo '$(srcdir)/'`TruncatedGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-TruncatedGamma.Tpo $(DEPDIR)/libbugssampler_la-TruncatedGamma.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='TruncatedGamma.cc' object='libbugssampler_la-TruncatedGamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-TruncatedGamma.lo `test -f 'TruncatedGamma.cc' || echo '$(srcdir)/'`TruncatedGamma.cc libbugssampler_la-DMultiDSum.lo: DMultiDSum.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-DMultiDSum.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-DMultiDSum.Tpo -c -o libbugssampler_la-DMultiDSum.lo `test -f 'DMultiDSum.cc' || echo '$(srcdir)/'`DMultiDSum.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-DMultiDSum.Tpo $(DEPDIR)/libbugssampler_la-DMultiDSum.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DMultiDSum.cc' object='libbugssampler_la-DMultiDSum.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-DMultiDSum.lo `test -f 'DMultiDSum.cc' || echo '$(srcdir)/'`DMultiDSum.cc libbugssampler_la-ShiftedCount.lo: ShiftedCount.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-ShiftedCount.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-ShiftedCount.Tpo -c -o libbugssampler_la-ShiftedCount.lo `test -f 'ShiftedCount.cc' || echo '$(srcdir)/'`ShiftedCount.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-ShiftedCount.Tpo $(DEPDIR)/libbugssampler_la-ShiftedCount.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ShiftedCount.cc' object='libbugssampler_la-ShiftedCount.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-ShiftedCount.lo `test -f 'ShiftedCount.cc' || echo '$(srcdir)/'`ShiftedCount.cc libbugssampler_la-ShiftedMultinomial.lo: ShiftedMultinomial.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-ShiftedMultinomial.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-ShiftedMultinomial.Tpo -c -o libbugssampler_la-ShiftedMultinomial.lo `test -f 'ShiftedMultinomial.cc' || echo '$(srcdir)/'`ShiftedMultinomial.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-ShiftedMultinomial.Tpo $(DEPDIR)/libbugssampler_la-ShiftedMultinomial.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ShiftedMultinomial.cc' object='libbugssampler_la-ShiftedMultinomial.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-ShiftedMultinomial.lo `test -f 'ShiftedMultinomial.cc' || echo '$(srcdir)/'`ShiftedMultinomial.cc libbugssampler_la-SumMethod.lo: SumMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-SumMethod.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-SumMethod.Tpo -c -o libbugssampler_la-SumMethod.lo `test -f 'SumMethod.cc' || echo '$(srcdir)/'`SumMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-SumMethod.Tpo $(DEPDIR)/libbugssampler_la-SumMethod.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SumMethod.cc' object='libbugssampler_la-SumMethod.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-SumMethod.lo `test -f 'SumMethod.cc' || echo '$(srcdir)/'`SumMethod.cc libbugssampler_la-SumFactory.lo: SumFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-SumFactory.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-SumFactory.Tpo -c -o libbugssampler_la-SumFactory.lo `test -f 'SumFactory.cc' || echo '$(srcdir)/'`SumFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-SumFactory.Tpo $(DEPDIR)/libbugssampler_la-SumFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SumFactory.cc' object='libbugssampler_la-SumFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-SumFactory.lo `test -f 'SumFactory.cc' || echo '$(srcdir)/'`SumFactory.cc libbugssampler_la-RW1.lo: RW1.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-RW1.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-RW1.Tpo -c -o libbugssampler_la-RW1.lo `test -f 'RW1.cc' || echo '$(srcdir)/'`RW1.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-RW1.Tpo $(DEPDIR)/libbugssampler_la-RW1.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RW1.cc' object='libbugssampler_la-RW1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-RW1.lo `test -f 'RW1.cc' || echo '$(srcdir)/'`RW1.cc libbugssampler_la-RW1Factory.lo: RW1Factory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-RW1Factory.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-RW1Factory.Tpo -c -o libbugssampler_la-RW1Factory.lo `test -f 'RW1Factory.cc' || echo '$(srcdir)/'`RW1Factory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-RW1Factory.Tpo $(DEPDIR)/libbugssampler_la-RW1Factory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RW1Factory.cc' object='libbugssampler_la-RW1Factory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-RW1Factory.lo `test -f 'RW1Factory.cc' || echo '$(srcdir)/'`RW1Factory.cc libbugssampler_la-BinomSlicer.lo: BinomSlicer.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-BinomSlicer.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-BinomSlicer.Tpo -c -o libbugssampler_la-BinomSlicer.lo `test -f 'BinomSlicer.cc' || echo '$(srcdir)/'`BinomSlicer.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-BinomSlicer.Tpo $(DEPDIR)/libbugssampler_la-BinomSlicer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='BinomSlicer.cc' object='libbugssampler_la-BinomSlicer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-BinomSlicer.lo `test -f 'BinomSlicer.cc' || echo '$(srcdir)/'`BinomSlicer.cc libbugssampler_la-BinomSliceFactory.lo: BinomSliceFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugssampler_la-BinomSliceFactory.lo -MD -MP -MF $(DEPDIR)/libbugssampler_la-BinomSliceFactory.Tpo -c -o libbugssampler_la-BinomSliceFactory.lo `test -f 'BinomSliceFactory.cc' || echo '$(srcdir)/'`BinomSliceFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugssampler_la-BinomSliceFactory.Tpo $(DEPDIR)/libbugssampler_la-BinomSliceFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='BinomSliceFactory.cc' object='libbugssampler_la-BinomSliceFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugssampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugssampler_la-BinomSliceFactory.lo `test -f 'BinomSliceFactory.cc' || echo '$(srcdir)/'`BinomSliceFactory.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libbugssampler_la-BinomSliceFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-BinomSlicer.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-Censored.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-CensoredFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateBeta.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateDirichlet.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateGamma.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateMNormal.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateMethod.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateNormal.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateWishart.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-DMultiDSum.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-DSumFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-Dirichlet.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-DirichletFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-DiscreteDSum.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-MNormal.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-MNormalFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-RW1.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-RW1Factory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-RWDSum.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-RealDSum.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ShiftedCount.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ShiftedMultinomial.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-SumFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-SumMethod.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-TruncatedGamma.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libbugssampler_la-BinomSliceFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-BinomSlicer.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-Censored.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-CensoredFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateBeta.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateDirichlet.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateGamma.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateMNormal.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateMethod.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateNormal.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ConjugateWishart.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-DMultiDSum.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-DSumFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-Dirichlet.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-DirichletFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-DiscreteDSum.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-MNormal.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-MNormalFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-RW1.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-RW1Factory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-RWDSum.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-RealDSum.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ShiftedCount.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-ShiftedMultinomial.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-SumFactory.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-SumMethod.Plo -rm -f ./$(DEPDIR)/libbugssampler_la-TruncatedGamma.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/bugs/samplers/Censored.cc0000664000175000017500000000507714224052514016275 00000000000000#include #include "Censored.h" #include "DInterval.h" #include #include #include #include #include #include #include using std::vector; using std::string; namespace jags { namespace bugs { static int indicator(SingletonGraphView const *gv, unsigned int ch) { return static_cast(gv->stochasticChildren()[0]->value(ch)[0]); } static Node const *breaks(SingletonGraphView const *gv) { return gv->stochasticChildren()[0]->parents()[1]; } Censored::Censored(SingletonGraphView const *gv) : ConjugateMethod(gv), _snode(dynamic_cast(gv->node())) { int nbreaks = breaks(gv)->length(); for (unsigned int ch = 0; ch < _snode->nchain(); ++ch) { int y = indicator(gv, ch); if (y < 0 || y > nbreaks) { throwNodeError(_snode, "Bad interval-censored node"); } } } bool Censored::canSample(StochasticNode *snode, Graph const &graph) { // The sampler works on scalar real-valued distributions with a // single child: an observed stochastic node with a "dinterval" // distribution. if (snode->isDiscreteValued() || snode->length() != 1) return false; // The sampler relies on the fact that boundable distributions can // draw truncated random samples. However, the node itself must not // be bounded as we don't want the additional complication of combining // a priori and a posteriori bounds on the distribution. if (!snode->distribution()->canBound()) return false; if (isBounded(snode)) return false; //Check that we have a single stochastic child, which is a direct //child of the sampled node which has distribution "dinterval" SingletonGraphView gv(snode, graph); vector const &schild = gv.stochasticChildren(); vector const &dchild = gv.deterministicChildren(); if(schild.size() != 1) return false; //Too many children if(!dchild.empty()) return false; //Not direct child if (schild[0]->distribution()->name() != "dinterval") return false; if (schild[0]->parents()[1] == snode) return false; //Breaks depend on snode return true; } void Censored::update(unsigned int chain, RNG * rng) const { int y = indicator(_gv, chain); double const *b = breaks(_gv)->value(chain); int ymax = breaks(_gv)->length(); double const *lower = (y == 0) ? 0 : b + y - 1; double const *upper = (y == ymax) ? 0 : b + y; _snode->truncatedSample(rng, chain, lower, upper); } }} JAGS-4.3.2/src/modules/bugs/samplers/CensoredFactory.cc0000664000175000017500000000134414224052371017617 00000000000000#include #include "CensoredFactory.h" #include "Censored.h" #include #include using std::string; namespace jags { namespace bugs { bool CensoredFactory::canSample(StochasticNode * snode, Graph const &graph) const { return Censored::canSample(snode, graph); } Sampler *CensoredFactory::makeSampler(StochasticNode *snode, Graph const &graph) const { SingletonGraphView *gv = new SingletonGraphView(snode, graph); ImmutableSampleMethod* method = new Censored(gv); return new ImmutableSampler(gv, method, "bugs::Censored"); } string CensoredFactory::name() const { return "bugs::Censored"; } } } JAGS-4.3.2/src/modules/bugs/samplers/ConjugateGamma.cc0000664000175000017500000001321514224052514017406 00000000000000#include #include "ConjugateGamma.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::sqrt; using std::max; using std::sort; using std::string; namespace jags { namespace bugs { static double getScale(StochasticNode const *snode, ConjugateDist d, unsigned int chain) { //Get scale parameter of snode switch(d) { case GAMMA: case NORM: case DEXP: case WEIB: case LNORM: return *snode->parents()[1]->value(chain); break; case EXP: case POIS: return *snode->parents()[0]->value(chain); break; default: throwNodeError(snode, "Can't get scale parameter: invalid distribution"); return 0; //-Wall } } static void calCoef(double *coef, SingletonGraphView const *gv, vector const &child_dist, unsigned int chain) { const double xold = gv->node()->value(chain)[0]; vector const &stoch_children = gv->stochasticChildren(); unsigned long nchildren = stoch_children.size(); for (unsigned int i = 0; i < nchildren; ++i) { coef[i] = -getScale(stoch_children[i], child_dist[i], chain); } double val = xold + 1; gv->setValue(&val, 1, chain); for (unsigned int i = 0; i < nchildren; ++i) { coef[i] += getScale(stoch_children[i], child_dist[i], chain); } gv->setValue(&xold, 1, chain); } ConjugateGamma::ConjugateGamma(SingletonGraphView const *gv) : ConjugateMethod(gv), _coef(0) { if(!gv->deterministicChildren().empty() && checkScale(gv, true)) { //One-off calculation of fixed scale transformation _coef = new double[gv->stochasticChildren().size()]; calCoef(_coef, gv, _child_dist, 0); } } ConjugateGamma::~ConjugateGamma() { delete [] _coef; } bool ConjugateGamma::canSample(StochasticNode *snode, Graph const &graph) { switch (getDist(snode)) { case GAMMA: case EXP: case CHISQ: //The exponential and chisquare distributions are both special //cases of the gamma distribution and are handled by the conjugate //gamma method. break; default: return false; } SingletonGraphView gv(snode, graph); // Check stochastic children vector const &stoch_nodes = gv.stochasticChildren(); for (unsigned int i = 0; i < stoch_nodes.size(); ++i) { if (isBounded(stoch_nodes[i])) { return false; //Bounded } switch(getDist(stoch_nodes[i])) { case EXP: case POIS: break; case GAMMA: case NORM: case DEXP: case WEIB: case LNORM: if (gv.isDependent(stoch_nodes[i]->parents()[0])) { return false; //non-scale parameter depends on snode } break; default: return false; } } // Check deterministic descendants are scale transformations if (!checkScale(&gv, false)) { return false; } return true; //We made it! } void ConjugateGamma::update(unsigned int chain, RNG *rng) const { vector const &stoch_children = _gv->stochasticChildren(); unsigned int nchildren = stoch_children.size(); //Need to initialize these for -Wall double r=0; // shape double mu=0; // 1/scale //Prior vector const ¶m = _gv->node()->parents(); switch(_target_dist) { case GAMMA: r = *param[0]->value(chain); mu = *param[1]->value(chain); break; case EXP: r = 1; mu = *param[0]->value(chain); break; case CHISQ: r = *param[0]->value(chain)/2; mu = 0.5; //FIXME: This was wrong in 3.x.y. Needs testing break; default: throwLogicError("invalid distribution in ConjugateGamma method"); } // likelihood double *coef = 0; bool empty = _gv->deterministicChildren().empty(); bool temp_coef = false; if (!empty && _coef == 0) { temp_coef = true; coef = new double[nchildren]; calCoef(coef, _gv, _child_dist, chain); } else { coef = _coef; } for (unsigned int i = 0; i < nchildren; ++i) { double coef_i = empty ? 1 : coef[i]; if (coef_i > 0) { StochasticNode const *schild = stoch_children[i]; vector const &cparam = schild->parents(); double Y = *schild->value(chain); double m = *cparam[0]->value(chain); //location parameter switch(_child_dist[i]) { case GAMMA: r += m; mu += coef_i * Y ; break; case EXP: r += 1; mu += coef_i * Y; break; case NORM: r += 0.5; mu += coef_i * (Y - m) * (Y - m) / 2; break; case POIS: r += Y; mu += coef_i; break; case DEXP: r += 1; mu += coef_i * fabs(Y - m); break; case WEIB: r += 1; mu += coef_i * pow(Y, m); break; case LNORM: r+= 0.5; mu += coef_i * (log(Y) - m) * (log(Y) - m) / 2; break; default: throwLogicError("Invalid distribution in Conjugate Gamma method"); } } } if (temp_coef) { delete [] coef; } // Sample from the posterior double xnew; if (isBounded(_gv->node())) { // Use inversion to get random sample double lower = 0; Node const *lb = _gv->node()->lowerBound(); if (lb) { lower = max(lower, *lb->value(chain)); } Node const *ub = _gv->node()->upperBound(); double plower = lb ? pgamma(lower, r, 1/mu, 1, 0) : 0; double pupper = ub ? pgamma(*ub->value(chain), r, 1/mu, 1, 0) : 1; double p = runif(plower, pupper, rng); xnew = qgamma(p, r, 1/mu, 1, 0); } else { xnew = rgamma(r, 1/mu, rng); } _gv->setValue(&xnew, 1, chain); } }} JAGS-4.3.2/src/modules/bugs/samplers/ConjugateWishart.cc0000664000175000017500000000717114224052514020011 00000000000000#include #include "ConjugateWishart.h" #include "DWish.h" #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::sqrt; using std::string; using std::copy; namespace jags { namespace bugs { static inline double getPrecision0(StochasticNode const *snode, unsigned int chain) { //Returns the first element of the precision matrix for a node //with a multivariate normal distribution. return snode->parents()[1]->value(chain)[0]; } bool ConjugateWishart::canSample(StochasticNode *snode, Graph const &graph) { if (getDist(snode) != WISH) return false; if (isBounded(snode)) return false; SingletonGraphView gv(snode, graph); vector const &schild = gv.stochasticChildren(); // Check stochastic children for (unsigned int i = 0; i < schild.size(); ++i) { if (isBounded(schild[i])) { return false; //Bounded } switch(getDist(schild[i])) { case MNORM: if (gv.isDependent(schild[i]->parents()[0])) { return false; //mean parameter depends on snode } break; default: return false; } } vector const &dchild = gv.deterministicChildren(); if (!dchild.empty()) { // Deterministic children must be scale functions if (!checkScale(&gv, false)) { return false; } // Only mixture nodes are allowed. If we allowed arbitrary // functions, the complexity would be O(nrow^4). for (unsigned int i = 0; i < dchild.size(); ++i) { if (!isMixture(dchild[i])) return false; } } return true; } ConjugateWishart::ConjugateWishart(SingletonGraphView const *gv) : ConjugateMethod(gv) {} void ConjugateWishart::update(unsigned int chain, RNG *rng) const { vector const &stoch_children = _gv->stochasticChildren(); unsigned int nchildren = stoch_children.size(); vector const ¶m = _gv->node()->parents(); double df = *param[1]->value(chain); double const *Rprior = param[0]->value(chain); int nrow = param[0]->dim()[0]; int N = nrow * nrow; vector R(N); copy(Rprior, Rprior + N, R.begin()); //Logical mask to determine which stochastic children are active. vector active(nchildren, true); if (!_gv->deterministicChildren().empty()) { //Mixure model //Save first element of precision matrix for each child vector precision0(nchildren); for (unsigned int i = 0; i < nchildren; ++i) { precision0[i] = getPrecision0(stoch_children[i], chain); } //Double the current value double const *x = _gv->node()->value(chain); vector x2(N); for (int j = 0; j < N; ++j) { x2[j] = 2 * x[j]; } _gv->setValue(x2, chain); //See if precision matrix has changed for (unsigned int i = 0; i < nchildren; ++i) { if (getPrecision0(stoch_children[i], chain) == precision0[i]) { active[i] = false; //not active } } } for (unsigned int i = 0; i < nchildren; ++i) { if (active[i]) { StochasticNode const *schild = stoch_children[i]; double const *Y = schild->value(chain); double const *mu = schild->parents()[0]->value(chain); for (int j = 0; j < nrow; j++) { for (int k = 0; k < nrow; k++) { R[j*nrow + k] += (Y[j] - mu[j]) * (Y[k] - mu[k]); } } df += 1; } } vector xnew(N); DWish::randomSample(&xnew[0], N, &R[0], df, nrow, rng); _gv->setValue(xnew, chain); } }} JAGS-4.3.2/src/modules/bugs/samplers/ConjugateBeta.cc0000664000175000017500000001063114224052514017236 00000000000000#include #include "ConjugateBeta.h" #include #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::sqrt; using std::max; using std::min; using std::string; namespace jags { namespace bugs { bool ConjugateBeta::canSample(StochasticNode *snode, Graph const &graph) { switch(getDist(snode)) { case BETA: break; case UNIF: // dunif(0,1) is equivalent to dbeta(1,1) if(!(*snode->parents()[0]->value(0) == 0 && *snode->parents()[1]->value(0) == 1 && snode->parents()[0]->isFixed() && snode->parents()[1]->isFixed())) return false; break; default: return false; } SingletonGraphView gv(snode, graph); vector const &dchild = gv.deterministicChildren(); vector const &schild = gv.stochasticChildren(); // Check deterministic descendants // Only Mixture nodes are allowed for (unsigned int j = 0; j < dchild.size(); ++j) { if (!isMixture(dchild[j])) { return false; } } if (!checkScale(&gv, false)) { return false; } // Check stochastic children for (unsigned int i = 0; i < schild.size(); ++i) { if (isBounded(schild[i])) { return false; //Bounded } switch(getDist(schild[i])) { case BIN: case NEGBIN: if (gv.isDependent(schild[i]->parents()[1])) { return false; //n depends on snode } break; case BERN: break; default: return false; } } return true; //We made it! } ConjugateBeta::ConjugateBeta(SingletonGraphView const *gv) : ConjugateMethod(gv) { } void ConjugateBeta::update(unsigned int chain, RNG *rng) const { vector const &stoch_children = _gv->stochasticChildren(); StochasticNode const *snode = _gv->node(); double a=0, b=0; //-Wall switch (_target_dist) { case BETA: a = *snode->parents()[0]->value(chain); b = *snode->parents()[1]->value(chain); break; case UNIF: a = 1; b = 1; break; default: throwLogicError("Invalid distribution in ConjugateBeta sampler"); } unsigned int Nchild = stoch_children.size(); /* For mixture models, we count only stochastic children that depend on snode */ double *C = 0; bool is_mix = !_gv->deterministicChildren().empty(); if (is_mix) { C = new double[Nchild]; for (unsigned int i = 0; i < Nchild; ++i) { C[i] = *stoch_children[i]->parents()[0]->value(chain); } // Perturb current value, keeping in the legal range [0,1] double x = *snode->value(chain); x = x > 0.5 ? x - 0.4 : x + 0.4; _gv->setValue(&x, 1, chain); // C[i] == 1 if parameter of child i has changed (so depends on snode) // C[i] == 0 otherwise for (unsigned int i = 0; i < Nchild; ++i) { C[i] = (*stoch_children[i]->parents()[0]->value(chain) != C[i]); } } for (unsigned int i = 0; i < stoch_children.size(); ++i) { if (!(is_mix && C[i] == 0)) { double y = *stoch_children[i]->value(chain); double n; switch(_child_dist[i]) { case BIN: n = *stoch_children[i]->parents()[1]->value(chain); a += y; b += n - y; break; case NEGBIN: n = *stoch_children[i]->parents()[1]->value(chain); a += n; b += y; break; case BERN: a += y; b += 1 - y; break; default: throwLogicError("Invalid distribution in Conjugate Beta sampler"); } } } // Draw the sample double xnew = rbeta(a, b, rng); if (isBounded(snode)) { double lower = 0; Node const *lb = snode->lowerBound(); if (lb) { lower = max(lower, *lb->value(chain)); } double upper = 1; Node const *ub = snode->upperBound(); if (ub) { upper = min(upper, *ub->value(chain)); } /* Try 4 more attempts to get random sample within the bounds */ for (int i = 0; i < 4; i++) { if (xnew >= lower && xnew <= upper) { _gv->setValue(&xnew, 1, chain); if (is_mix) delete [] C; return; } xnew = rbeta(a, b, rng); } /* Failure! Use inversion */ double plower = lb ? pbeta(lower, a, b, 1, 0) : 0; double pupper = ub ? pbeta(upper, a, b, 1, 0) : 1; double p = runif(plower, pupper, rng); xnew = qbeta(p, a, b, 1, 0); } _gv->setValue(&xnew, 1, chain); if (is_mix) { delete [] C; } } }} JAGS-4.3.2/src/modules/bugs/samplers/ConjugateMNormal.cc0000664000175000017500000002021614224052514017730 00000000000000#include #include #include #include #include #include #include #include #include #include #include "lapack.h" #include #include #include #include #include "ConjugateMNormal.h" #include "DMNorm.h" #include using std::string; using std::vector; using std::set; using std::sqrt; using std::string; namespace jags { namespace bugs { static void calBeta(double *betas, SingletonGraphView const *gv, unsigned int chain) { StochasticNode *snode = gv->node(); double const *xold = snode->value(chain); unsigned int nrow = snode->length(); double *xnew = new double[nrow]; for (unsigned int i = 0; i < nrow; ++i) { xnew[i] = xold[i]; } vector const &stoch_children = gv->stochasticChildren(); unsigned long nchildren = stoch_children.size(); double *beta_j = betas; for (unsigned int j = 0; j < nchildren; ++j) { StochasticNode const *schild = stoch_children[j]; double const *mu = schild->parents()[0]->value(chain); unsigned int nrow_child = schild->length(); for (unsigned int k = 0; k < nrow_child; ++k) { for (unsigned int i = 0; i < nrow; ++i) { beta_j[nrow * k + i] = -mu[k]; } } beta_j += nrow_child * nrow; } for (unsigned int i = 0; i < nrow; ++i) { xnew[i] += 1; gv->setValue(xnew, nrow, chain); beta_j = betas; for (unsigned int j = 0; j < nchildren; ++j) { StochasticNode const *schild = stoch_children[j]; double const *mu = schild->parents()[0]->value(chain); unsigned int nrow_child = schild->length(); for (unsigned int k = 0; k < nrow_child; ++k) { beta_j[nrow * k + i] += mu[k]; } beta_j += nrow_child * nrow; } xnew[i] -= 1; } gv->setValue(xnew, nrow, chain); delete [] xnew; } static unsigned int sumChildrenLength(SingletonGraphView const *gv) { vector const &children = gv->stochasticChildren(); unsigned int N = 0; for (unsigned int i = 0; i < children.size(); ++i) { N += children[i]->length(); } return N; } ConjugateMNormal::ConjugateMNormal(SingletonGraphView const *gv) : ConjugateMethod(gv), _betas(0), _length_betas(sumChildrenLength(gv) * gv->length()) { if(!gv->deterministicChildren().empty() && checkLinear(gv, true)) { _betas = new double[_length_betas]; calBeta(_betas, gv, 0); } } ConjugateMNormal::~ConjugateMNormal() { delete [] _betas; } bool ConjugateMNormal::canSample(StochasticNode *snode, Graph const &graph) { if (getDist(snode) != MNORM) return false; if (isBounded(snode)) return false; SingletonGraphView gv(snode, graph); vector const &schild = gv.stochasticChildren(); // Check stochastic children for (unsigned int i = 0; i < schild.size(); ++i) { if (getDist(schild[i]) != MNORM && getDist(schild[i]) != NORM) { return false; //Not normal or multivariate normal } if (isBounded(schild[i])) { return false; } if (gv.isDependent(schild[i]->parents()[1])) { return false; //Precision depends on snode } } // Check linearity of deterministic descendants if (!checkLinear(&gv, false)) return false; return true; //We made it! } void ConjugateMNormal::update(unsigned int chain, RNG *rng) const { vector const &stoch_children = _gv->stochasticChildren(); unsigned int nchildren = stoch_children.size(); StochasticNode *snode = _gv->node(); double const *xold = snode->value(chain); double const *priormean = snode->parents()[0]->value(chain); double const *priorprec = snode->parents()[1]->value(chain); int nrow = snode->length(); /* The log of the full conditional density takes the form -1/2(t(x) %*% A %*% x - 2 * b %*% x) For computational convenience, we reset the origin to xold, the current value of the node. */ int N = nrow * nrow; double *b = new double[nrow]; double *A = new double[N]; for (int i = 0; i < nrow; ++i) { b[i] = 0; for (int i2 = 0; i2 < nrow; ++i2) { b[i] += priorprec[i * nrow + i2] * (priormean[i2] - xold[i2]); } } for (int i = 0; i < N; ++i) { A[i] = priorprec[i]; } /* FORTRAN routines are all call-by-reference, so we need to create * these constants */ double zero = 0; double d1 = 1; int i1 = 1; if (_gv->deterministicChildren().empty()) { // This can only happen if the stochastic children are all // multivariate normal with the same number of rows and // columns. We know alpha = 0, beta = I. double *delta = new double[nrow]; for (unsigned int j = 0; j < nchildren; ++j) { double const *Y = stoch_children[j]->value(chain); double const *tau = stoch_children[j]->parents()[1]->value(chain); double alpha = 1; F77_DAXPY (&N, &alpha, tau, &i1, A, &i1); for (int i = 0; i < nrow; ++i) { delta[i] = Y[i] - xold[i]; } F77_DGEMV ("N", &nrow, &nrow, &alpha, tau, &nrow, delta, &i1, &d1, b, &i1); } delete [] delta; } else { bool temp_beta = (_betas == 0); double *betas = 0; if (temp_beta) { betas = new double[_length_betas]; calBeta(betas, _gv, chain); } else { betas = _betas; } //Calculate largest possible size of working matrix C unsigned int max_nrow_child = 0; for (unsigned int j = 0; j < nchildren; ++j) { unsigned int nrow_j = stoch_children[j]->length(); if (nrow_j > max_nrow_child) max_nrow_child = nrow_j; } double *C = new double[nrow * max_nrow_child]; double *delta = new double[max_nrow_child]; /* Now add the contribution of each term to A, b b += N_j * beta_j %*% tau_j (Y_j - mu_j) A += N_j * beta_j %*% tau_j %*% t(beta_j) where - N_j is the frequency weight of child j - beta_j is a matrix of linear coefficients - tau_j is the variance-covariance matrix of child j - mu_j is the mean of child j - Y_j is the value of child j We make use of BLAS routines for efficiency. */ double const *beta_j = betas; for (unsigned int j = 0; j < nchildren; ++j) { StochasticNode const *schild = stoch_children[j]; double const *Y = schild->value(chain); double const *mu = schild->parents()[0]->value(chain); double const *tau = schild->parents()[1]->value(chain); int nrow_child = schild->length(); if (nrow_child == 1) { double alpha = tau[0]; F77_DSYR("L", &nrow, &alpha, beta_j, &i1, A, &nrow); alpha *= (Y[0] - mu[0]); F77_DAXPY(&nrow, &alpha, beta_j, &i1, b, &i1); } else { double alpha = 1; F77_DSYMM("R", "L", &nrow, &nrow_child, &alpha, tau, &nrow_child, beta_j, &nrow, &zero, C, &nrow); for (int i = 0; i < nrow_child; ++i) { delta[i] = Y[i] - mu[i]; } F77_DGEMV("N", &nrow, &nrow_child, &d1, C, &nrow, delta, &i1, &d1, b, &i1); F77_DGEMM("N","T", &nrow, &nrow, &nrow_child, &d1, C, &nrow, beta_j, &nrow, &d1, A, &nrow); } beta_j += nrow_child * nrow; } delete [] C; delete [] delta; if (temp_beta) { delete [] betas; } } /* Solve the equation A %*% x = b to get the posterior mean. We have to take a copy of A as it is overwritten during the call to DPOSV. The result is stored in b */ double * Acopy = new double[N]; for (int i = 0; i < N; ++i) { Acopy[i] = A[i]; } int one = 1; int info; F77_DPOSV ("L", &nrow, &one, Acopy, &nrow, b, &nrow, &info); if (info != 0) { delete [] Acopy; delete [] A; delete [] b; throwNodeError(snode, "unable to solve linear equations in ConjugateMNormal"); } //Shift origin back to original scale for (int i = 0; i < nrow; ++i) { b[i] += xold[i]; } double *xnew = new double[nrow]; //NB. This uses the lower triangle of A DMNorm::randomsample(xnew, b, A, true, nrow, rng); _gv->setValue(xnew, nrow, chain); delete [] A; delete [] Acopy; delete [] b; delete [] xnew; } }} JAGS-4.3.2/src/modules/bugs/samplers/ConjugateDirichlet.cc0000664000175000017500000003305314224052514020275 00000000000000#include #include "ConjugateDirichlet.h" #include #include #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::string; using std::copy; using std::map; using std::pair; using std::list; namespace jags { Node const *findUniqueParent(Node const *node, set const &nodeset) { /* Utility function called by checkAggNode and checkMixNode. If node has a single parent in nodeset, then a pointer to the parent is returned. If there are multiple parents in nodeset then a NULL pointer is returned. If no parents are in nodeset, a logic error is thrown. */ vector const &par = node->parents(); Node const *param = 0; for (unsigned int i = 0; i < par.size(); ++i) { if (nodeset.count(par[i])) { if (param) { if (param != par[i]) return 0; } else { param = par[i]; } } } if (param == 0) { throwLogicError("Error in ConjugateDirichlet::canSample"); } return param; } bool checkAggNode(AggNode const *anode, set const &nodeset) { /* Utility function called by ConjugateDirichlet::canSample The aggregate node (anode) must have only one parent in nodeset. This parent must be embedded entirely within anode (i.e. we cannot take a subset of it) and the order of the elements cannot be permuted. */ Node const *param = findUniqueParent(anode, nodeset); if (param == 0) return false; //Check that parent is entirely contained in anode with //offsets in ascending order vector const &par = anode->parents(); vector const &off = anode->offsets(); unsigned int j = 0; for (unsigned int i = 0; i < par.size(); ++i) { if (par[i] == param && off[i] != j++) return false; } if (j != param->length()) return false; return true; } bool checkMixNode(MixtureNode const *mnode, set const &nodeset) { /* Utility function called by ConjugateDirichlet::canSample None of the indices may depend on nodeset. Among the other parents, only 1 may be in nodeset (although it may appear several times) */ vector const &par = mnode->parents(); //Check indices unsigned int nindex = mnode->index_size(); for (unsigned int i = 0; i < nindex; ++i) { if (nodeset.count(par[i])) return false; } //Check for unique parent return findUniqueParent(mnode, nodeset) != 0; } bool isMix(SingletonGraphView const *gv) { /* Utility function called by constructor. It returns true if any of the deterministic descendants are mixture nodes. When there are no mixture nodes, the update calculations can be simplified. This static function is called by the constructor and the result is stored in the variable _mix. */ vector const &dchild = gv->deterministicChildren(); for (unsigned int i = 0; i < dchild.size(); ++i) { if (isMixture(dchild[i])) return true; } return false; } vector makeTree(SingletonGraphView const *gv) { /* If canSample is true then the nodes in the GraphView gv form a tree with the sampled node as its root. This function creates an integer vector "tree" denoting the parents of the deterministic descendants: "tree[i] = j" for 0 < j < i means that the unique parent of deterministic node "i" in the GraphView is deterministic node "j". If the unique parent is the sampled node then we denote this by "tree[i] = -1". This static function is called by the constructor, and the result is stored in the variable _tree; */ vector const &dchild = gv->deterministicChildren(); StochasticNode *snode = gv->node(); vector tree(dchild.size(), -1); set nodeset; nodeset.insert(snode); for (unsigned int j = 0; j < dchild.size(); ++j) { Node const *parent = findUniqueParent(dchild[j], nodeset); if (parent == 0) { throwLogicError("Invalid tree in ConjugateDirichlet"); } if (parent != snode) { for (unsigned int k = 0; k < j; ++k) { if (parent == dchild[k]) { tree[j] = k; break; } } if (tree[j] == -1) { throwLogicError("Invalid tree in ConjugateDirichlet"); } } nodeset.insert(dchild[j]); } return tree; } vector > makeOffsets(SingletonGraphView const *gv, vector const &tree) { vector const &dchild = gv->deterministicChildren(); vector > offsets(dchild.size()); StochasticNode const *snode = gv->node(); for (unsigned int i = 0; i < dchild.size(); ++i) { int j = tree[i]; //index of parent in dchild if (isMixture(dchild[i])) { if (j != -1) offsets[i] = offsets[j]; } else if (AggNode const *a = dynamic_cast(dchild[i])) { vector const &par_i = a->parents(); vector const &off_i = a->offsets(); Node const *target = (j == -1) ? static_cast(snode) : static_cast(dchild[j]); if (j == -1 || offsets[j].empty()) { for (unsigned int k = 0; k < par_i.size(); ++k) { if (par_i[k] == target) { offsets[i].push_back(k); } } } else { unsigned int p = 0; for (unsigned int k = 0; k < par_i.size(); ++k) { if (par_i[k] == target && off_i[k] == offsets[j][p]) { offsets[i].push_back(k); p++; } } } if (offsets[i].size() != snode->length()) { throwLogicError("Offset error in ConjugateDirichlet"); } } else { throwLogicError("Invalid child in ConjugateDirichlet"); } } return offsets; } namespace bugs { bool ConjugateDirichlet::canSample(StochasticNode *snode, Graph const &graph) { /* The ConjugateDirichlet sampler aims to be as general as possible, while minimizing the calculations that have to be done at each iteration. The stochastic children may be multinomial or categorical, and the deterministic children may include mixture nodes and aggregate nodes. However there are some restrictions that are implemented in the checkAggNode and checkMixNode functions. 1) The deterministic descendents must form a tree, so that there is only one pathway from the sample node (snode) to each stochastic child. 2) Aggregate nodes can only be used to embed snode (or one of its determistic descendants) in a larger node, not to take a subset. 3) When a node X is embedded in an aggregate node Y, the order of the elements of X cannot be permuted in Y. These restrictions ensure that the _off values used by the update method are the same across chains and across iterations, and can therefore be calculated once in the constructor. Fascinating fact: Neither dmulti nor dcat requires a normalized probability argument. This allows us to embed snode inside a larger aggregate node without worrying about what the other values are. For example: Y ~ dcat(p) p[1:3] ~ ddirch(alpha) p[4:5] <- W We can completely ignore the values of W (p[4] and p[5]). Normally these will be zero but we don't require it. */ if (getDist(snode) != DIRCH) return false; if (isBounded(snode)) return false; SingletonGraphView gv(snode, graph); vector const &dchild = gv.deterministicChildren(); vector const &schild = gv.stochasticChildren(); // Check stochastic children for (unsigned int i = 0; i < schild.size(); ++i) { vector const ¶m = schild[i]->parents(); if (isBounded(schild[i])) { return false; //Truncated } switch(getDist(schild[i])) { case CAT: break; case MULTI: if (gv.isDependent(param[1])) return false; break; default: return false; } } // Check deterministic descendants set nodeset; nodeset.insert(snode); for (unsigned int j = 0; j < dchild.size(); ++j) { if (MixtureNode const *m = dynamic_cast(dchild[j])) { if (!checkMixNode(m, nodeset)) return false; } else if (AggNode const *a = dynamic_cast(dchild[j])) { if (!checkAggNode(a, nodeset)) return false; } else { return false; } nodeset.insert(dchild[j]); } return true; } ConjugateDirichlet::ConjugateDirichlet(SingletonGraphView const *gv) : ConjugateMethod(gv), _mix(isMix(gv)), _tree(makeTree(gv)), _offsets(gv->stochasticChildren().size()), _leaves(gv->stochasticChildren().size(), -1) { vector > offsets = makeOffsets(gv, _tree); //Create a map from stochastic children onto their indices vector const &schild = gv->stochasticChildren(); map smap; for (unsigned int s = 0; s < schild.size(); ++s) { smap.insert(pair(schild[s], s)); } vector const &dchild = gv->deterministicChildren(); for (unsigned int d = 0; d < dchild.size(); ++d) { list const *dc = dchild[d]->stochasticChildren(); for (list::const_iterator q = dc->begin(); q != dc->end(); ++q) { map::iterator r = smap.find(*q); if (r != smap.end()) { _leaves[r->second] = d; _offsets[r->second] = offsets[d]; smap.erase(r); } } } } bool ConjugateDirichlet::isActiveLeaf(int i, unsigned int chain) const { if (!_mix) return true; return isActiveTree(_leaves[i], chain); } bool ConjugateDirichlet::isActiveTree(int i, unsigned int chain) const { /* Returns true if there is an active path from the sampled node to the deterministic node with index "i". A path is not active if it is blocked by a mixture node that is set to another mixture component. */ if (i == -1) { return true; //We have reached the sampled node } vector const &dchild = _gv->deterministicChildren(); if (MixtureNode const *m = asMixture(dchild[i])) { if (_tree[i] == -1) { if (m->activeParent(chain) != _gv->node()) return false; } else { if (m->activeParent(chain) != dchild[_tree[i]]) return false; } } return isActiveTree(_tree[i], chain); } void ConjugateDirichlet::update(unsigned int chain, RNG *rng) const { StochasticNode *snode = _gv->node(); unsigned int size = snode->length(); double *alpha = new double[size]; double *xnew = new double[size]; double const *prior = snode->parents()[0]->value(chain); for (unsigned long i = 0; i < size; ++i) { alpha[i] = prior[i]; } vector const &schild = _gv->stochasticChildren(); for (unsigned int i = 0; i < schild.size(); ++i) { unsigned int index = 0; double const *N = 0; if (isActiveLeaf(i, chain)) { switch(_child_dist[i]) { case MULTI: N = schild[i]->value(chain); if (_offsets[i].empty()) { for (unsigned int j = 0; j < size; ++j) { alpha[j] += N[j]; } } else { for (unsigned int j = 0; j < size; ++j) { alpha[j] += N[_offsets[i][j]]; } } break; case CAT: index = static_cast(*schild[i]->value(chain)) - 1; if (_offsets[i].empty()) { alpha[index] += 1; } else { for (unsigned int j = 0; j < size; ++j) { if (index == _offsets[i][j]) { alpha[j] += 1; break; } } } break; default: throwLogicError("Invalid distribution in ConjugateDirichlet"); } } } /* Check structural zeros */ for (unsigned int i = 0; i < size; ++i) { if (prior[i] == 0 && alpha[i] != 0) { throwNodeError(snode, "Invalid likelihood for Dirichlet distribution with structural zeros"); } } /* Draw Dirichlet sample by drawing independent gamma random variates and then normalizing */ double xsum = 0.0; for (unsigned long i = 0; i < size; ++i) { if (alpha[i] > 0) { xnew[i] = rgamma(alpha[i], 1, rng); xsum += xnew[i]; } else { xnew[i] = 0; } } for (unsigned long i = 0; i < size; ++i) { xnew[i] /= xsum; } if (_mix) { //Override default updating of deterministic nodes in gv snode->setValue(xnew, size, chain); vector const &dchild = _gv->deterministicChildren(); vector modified(dchild.size(), false); for (unsigned int d = 0; d < dchild.size(); ++d) { if (_tree[d] == -1) { MixtureNode *m = dynamic_cast(dchild[d]); if (m == 0 || m->activeParent(chain) == snode) { dchild[d]->deterministicSample(chain); modified[d] = true; } } else if (modified[_tree[d]]) { MixtureNode *m = dynamic_cast(dchild[d]); if (m == 0 || m->activeParent(chain) == dchild[_tree[d]]) { dchild[d]->deterministicSample(chain); modified[d] = true; } } } } else { _gv->setValue(xnew, size, chain); } delete [] xnew; delete [] alpha; } } //namespace jags } //namespace bugs JAGS-4.3.2/src/modules/bugs/samplers/ConjugateNormal.cc0000664000175000017500000001474314224052514017623 00000000000000#include #include #include #include #include #include #include #include #include #include #include #include #include #include "ConjugateNormal.h" #include using std::vector; using std::set; using std::sqrt; namespace jags { namespace bugs { static void calBeta(double *beta, SingletonGraphView const *gv, unsigned int chain) { StochasticNode *snode = gv->node(); const double xold = *snode->value(chain); vector const &stoch_children = gv->stochasticChildren(); double xnew = xold + 1; gv->setValue(&xnew, 1, chain); double *bp = beta; for (unsigned int i = 0; i < stoch_children.size(); ++i) { StochasticNode const *child = stoch_children[i]; unsigned int nrow = child->length(); double const *mu = child->parents()[0]->value(chain); for (unsigned int j = 0; j < nrow; ++j) { bp[j] = mu[j]; } bp += nrow; } gv->setValue(&xold, 1, chain); bp = beta; for (unsigned int i = 0; i < stoch_children.size(); ++i) { StochasticNode const *child = stoch_children[i]; unsigned int nrow = child->length(); double const *mu = child->parents()[0]->value(chain); for (unsigned int j = 0; j < nrow; ++j) { bp[j] -= mu[j]; } bp += nrow; } } ConjugateNormal::ConjugateNormal(SingletonGraphView const *gv) : ConjugateMethod(gv), _betas(0), _length_betas(0) { if (!gv->deterministicChildren().empty()) { //Need to allocate vector of coefficients vector const &children = gv->stochasticChildren(); for (unsigned int i = 0; i < children.size(); ++i) { _length_betas += children[i]->length(); } if (checkLinear(gv, true)) { //One-time calculation of fixed coefficients _betas = new double[_length_betas]; calBeta(_betas, gv, 0); } } } ConjugateNormal::~ConjugateNormal() { delete [] _betas; } bool ConjugateNormal::canSample(StochasticNode *snode, Graph const &graph) { /* 1) Stochastic children of sampled node must be normal, must not be truncated, and must depend on snode only via the mean parameter 2) The mean parameter must be a linear function of snode. */ switch(getDist(snode)) { case NORM: case EXP: break; default: return false; } SingletonGraphView gv(snode, graph); vector const &schild = gv.stochasticChildren(); // Check stochastic children for (unsigned int i = 0; i < schild.size(); ++i) { switch (getDist(schild[i])) { case NORM: case MNORM: break; default: return false; //Not normal } if (isBounded(schild[i])) { return false; //Truncated distribution } if (gv.isDependent(schild[i]->parents()[1])) { return false; //Precision depends on snode } } // Check linearity of deterministic descendants return checkLinear(&gv, false); } void ConjugateNormal::update(unsigned int chain, RNG *rng) const { vector const &stoch_children = _gv->stochasticChildren(); unsigned int nchildren = stoch_children.size(); StochasticNode *snode = _gv->node(); /* For convenience in the following computations, we shift the origin to xold, the previous value of the node */ const double xold = *snode->value(chain); double A=0, B=0; //-Wall if (_target_dist == NORM) { const double priormean = *snode->parents()[0]->value(chain) - xold; const double priorprec = *snode->parents()[1]->value(chain); A = priormean * priorprec; //Weighted sum of means B = priorprec; //Sum of weights } else if (_target_dist == EXP) { A = -snode->parents()[0]->value(chain)[0]; B = 0; } else { throwLogicError("Invalid distribution in conjugate normal method"); } if (_gv->deterministicChildren().empty()) { // This can only happen if the stochastic children are all // univariate normal. We know alpha = 0, beta = 1. for (unsigned int i = 0; i < nchildren; ++i) { double Y = *stoch_children[i]->value(chain); double tau = *stoch_children[i]->parents()[1]->value(chain); A += (Y - xold) * tau; B += tau; } } else { double *beta; bool temp_beta = (_betas == 0); if (temp_beta) { beta = new double[_length_betas]; calBeta(beta, _gv, chain); } else { beta = _betas; } double const *bp = beta; for (unsigned long i = 0; i < nchildren; ++i) { StochasticNode const *child = stoch_children[i]; double const *Y = child->value(chain); double const *tau = child->parents()[1]->value(chain); double const *alpha = child->parents()[0]->value(chain); unsigned int nrow = child->length(); for (unsigned int k = 0; k < nrow; ++k) { double tau_beta_k = 0; for (unsigned int k2 = 0; k2 < nrow; ++k2) { tau_beta_k += tau[k * nrow + k2] * bp[k2]; } A += (Y[k] - alpha[k]) * tau_beta_k; B += bp[k] * tau_beta_k; } bp += nrow; } if (temp_beta) { delete [] beta; } } // Draw the sample double postmean = xold + A/B; double postsd = sqrt(1/B); double xnew; Node const *lb = snode->lowerBound(); Node const *ub = snode->upperBound(); switch(_target_dist) { case NORM: if (lb && ub) { xnew = inormal(*lb->value(chain), *ub->value(chain), rng, postmean, postsd); } else if (lb) { xnew = lnormal(*lb->value(chain), rng, postmean, postsd); } else if (ub) { xnew = rnormal(*ub->value(chain), rng, postmean, postsd); } else { xnew = rnorm(postmean, postsd, rng); } break; case EXP: if (B > 0) { double lower = lb ? fmax2(0, *lb->value(chain)) : 0; if (ub) { xnew = inormal(lower, *ub->value(chain), rng, postmean, postsd); } else { xnew = lnormal(0, rng, postmean, postsd); } } else { // Sample from prior // FIXME: This should be easier - try adding forwardSample // method to GraphView double rate = 1/snode->parents()[0]->value(chain)[0]; if (lb || ub) { double lower = lb ? *lb->value(chain) : 0; double pupper = fmin2(exp(-lower * rate), 1); double plower = ub ? exp(-ub->value(chain)[0] * rate) : 0; double p = runif(plower, pupper, rng); xnew = -log(p)/rate; } else { xnew = rexp(rate, rng); } } break; default: throwLogicError("Invalid distribution in conjugate normal method"); } _gv->setValue(&xnew, 1, chain); } }} JAGS-4.3.2/src/modules/bugs/samplers/DSumFactory.cc0000664000175000017500000000552114224052514016725 00000000000000#include #include #include #include #include #include #include #include "DSumFactory.h" #include "RealDSum.h" #include "DiscreteDSum.h" #include "DMultiDSum.h" #include using std::list; using std::vector; using std::string; namespace jags { namespace bugs { static StochasticNode const *getDSumChild(StochasticNode *node) { list::const_iterator p; for (p = node->stochasticChildren()->begin(); p != node->stochasticChildren()->end(); ++p) { //Skip unobserved nodes if (isObserved(*p) && (*p)->distribution()->name() == "dsum") return *p; } return 0; } Sampler * DSumFactory::makeSampler(list const &nodes, Graph const &graph) const { //Find DSum node StochasticNode const *dsum_node = 0; for (list::const_iterator p = nodes.begin(); p != nodes.end(); ++p) { dsum_node = getDSumChild(*p); if (dsum_node) break; } if (!dsum_node) return 0; //See if we can sample the parents. This can only be done if they //are unobserved stochastic nodes in the sample set vector parameters; vector const &parents = dsum_node->parents(); vector::const_iterator pp; for (pp = parents.begin(); pp != parents.end(); ++pp) { list::const_iterator q = find(nodes.begin(), nodes.end(), *pp); if (q != nodes.end()) { parameters.push_back(*q); } else { return 0; } } bool discrete; bool multinom = false; string name; if (RWDSum::canSample(parameters, graph, false, false)) { discrete = false; name = "bugs::RealDSum"; } else if (RWDSum::canSample(parameters, graph, true, false)) { discrete = true; name = "bugs::DiscreteDSum"; } else if (RWDSum::canSample(parameters, graph, true, true)) { discrete = true; multinom = true; name = "bugs::DMultiDSum"; } else { return 0; } GraphView *gv = new GraphView(parameters, graph, true); unsigned int nchain = parameters[0]->nchain(); vector methods(nchain, 0); for (unsigned int ch = 0; ch < nchain; ++ch) { if (discrete) { if (multinom) methods[ch] = new DMultiDSum(gv, ch); else methods[ch] = new DiscreteDSum(gv, ch); } else { methods[ch] = new RealDSum(gv, ch); } } return new MutableSampler(gv, methods, name); } string DSumFactory::name() const { return "bugs::DSum"; } vector DSumFactory::makeSamplers(list const &nodes, Graph const &graph) const { Sampler *s = makeSampler(nodes, graph); if (s) return vector(1, s); else return vector(); } }} JAGS-4.3.2/src/modules/bugs/samplers/ConjugateFactory.cc0000664000175000017500000000707314224052514020000 00000000000000#include #include "ConjugateFactory.h" #include "ConjugateNormal.h" #include "ConjugateGamma.h" #include "ConjugateBeta.h" #include "ConjugateDirichlet.h" #include "ConjugateMNormal.h" #include "ConjugateWishart.h" //#include "TruncatedGamma.h" #include "ShiftedCount.h" #include "ShiftedMultinomial.h" #include #include #include #include #include #include using std::string; namespace jags { namespace bugs { bool ConjugateFactory::canSample(StochasticNode * snode, Graph const &graph) const { bool ans = false; switch(getDist(snode)) { case NORM: ans = ConjugateNormal::canSample(snode, graph); break; case GAMMA: case CHISQ: ans = ConjugateGamma::canSample(snode, graph); break; case EXP: ans = ConjugateGamma::canSample(snode, graph) || ConjugateNormal::canSample(snode, graph); break; case BETA: ans = ConjugateBeta::canSample(snode, graph); break; case DIRCH: ans = ConjugateDirichlet::canSample(snode, graph); break; case MNORM: ans = ConjugateMNormal::canSample(snode, graph); break; case WISH: ans = ConjugateWishart::canSample(snode, graph); break; case UNIF: /* ans = TruncatedGamma::canSample(snode, graph) || ConjugateBeta::canSample(snode, graph); */ ans = ConjugateBeta::canSample(snode, graph); break; case POIS: case BIN: case NEGBIN: ans = ShiftedCount::canSample(snode, graph); break; case MULTI: ans = ShiftedMultinomial::canSample(snode, graph); break; default: break; } return ans; } Sampler *ConjugateFactory::makeSampler(StochasticNode *snode, Graph const &graph) const { SingletonGraphView *gv = new SingletonGraphView(snode, graph); ConjugateMethod* method = 0; string name; switch (getDist(snode)) { case NORM: method = new ConjugateNormal(gv); name = "bugs::ConjugateNormal"; break; case GAMMA: case CHISQ: method = new ConjugateGamma(gv); name = "bugs::ConjugateGamma"; break; case EXP: if (ConjugateGamma::canSample(snode, graph)) { method = new ConjugateGamma(gv); name = "bugs::ConjugateGamma"; } else if (ConjugateNormal::canSample(snode, graph)) { method = new ConjugateNormal(gv); name = "bugs::ConjugateNormal"; } else { throwLogicError("Cannot find conjugate sampler for exponential"); } break; case BETA: method = new ConjugateBeta(gv); name = "bugs::ConjugateBeta"; break; case DIRCH: method = new ConjugateDirichlet(gv); name = "bugs::ConjugateDirichlet"; break; case MNORM: method = new ConjugateMNormal(gv); name = "bugs::ConjugateMNormal"; break; case WISH: method = new ConjugateWishart(gv); name = "bugs::ConjugateWishart"; break; case UNIF: /* if (TruncatedGamma::canSample(snode, graph)) { method = new TruncatedGamma(gv); name = "TruncatedGamma"; } else */ if (ConjugateBeta::canSample(snode, graph)) { method = new ConjugateBeta(gv); name = "bugs::ConjugateBeta"; } else { throwLogicError("Cannot find conjugate sampler for uniform"); } break; case POIS: case BIN: case NEGBIN: method = new ShiftedCount(gv); name = "bugs::ShiftedCount"; break; case MULTI: method = new ShiftedMultinomial(gv); name = "bugs::ShiftedMultiNomial"; break; default: throwLogicError("Unable to create conjugate sampler"); } return new ImmutableSampler(gv, method, name); } string ConjugateFactory::name() const { return "bugs::Conjugate"; } }} JAGS-4.3.2/src/modules/bugs/samplers/RWDSum.cc0000664000175000017500000001310014224052515015637 00000000000000#include #include #include #include #include #include #include #include "RWDSum.h" #include #include using std::vector; using std::log; using std::exp; using std::fabs; using std::set; //Target acceptance probability for Metropolis-Hastings algorithm #define PROB 0.5 namespace jags { namespace bugs { /* * Returns the stochastic child with a DSum distribution, if it * exists, otherwise a null pointer. If there is more than one DSum * child, a null pointer is also returned */ static StochasticNode const *getDSumNode(GraphView const *gv) { StochasticNode const *dsnode = 0; for (unsigned int i = 0; i < gv->stochasticChildren().size(); ++i) { if (gv->stochasticChildren()[i]->distribution()->name() == "dsum") { if (dsnode == 0) { dsnode = gv->stochasticChildren()[i]; } else { //There should be a single dsum child return 0; } } } return dsnode; } static vector nodeValues(GraphView const *gv, unsigned int chain) { vector ans(gv->length()); gv->getValue(ans, chain); StochasticNode const *dchild = getDSumNode(gv); if (!dchild) { throwLogicError("DSum Child not found in RWDSum method"); } //Check discreteness bool discrete = dchild->isDiscreteValued(); for (unsigned int i = 0; i < gv->nodes().size(); ++i) { if (gv->nodes()[i]->isDiscreteValued() != discrete) { throwLogicError("Discrete value inconsistency in RWDSum method"); } } //Enforce discreteness of value vector, if necessary if (discrete) { for (unsigned int i = 0; i < ans.size(); ++i) { ans[i] = static_cast(ans[i]); } } //Ensure that values of sampled nodes are consistent with dsum child unsigned int nrow = dchild->length(); unsigned int ncol = gv->nodes().size(); if (ans.size() != nrow * ncol) { throwLogicError("Inconsistent lengths in RWDSum method"); } for (unsigned int r = 0; r < nrow; ++r) { double delta = dchild->value(chain)[r]; for (unsigned int c = 0; c < ncol; ++c) { delta -= ans[c * nrow + r]; } if (delta != 0) { if (discrete) { int idelta = static_cast(delta); if (delta != idelta) { throwLogicError("Unable to satisfy dsum constraint"); } int eps = idelta / ncol; int resid = idelta % ncol; for (unsigned int c = 0; c < ncol; ++c) { ans[c * nrow + r] += eps; } ans[r] += resid; } else { double eps = delta / ncol; for (unsigned int c = 0; c < ncol; ++c) { ans[c * nrow + r] += eps; } } } } gv->setValue(ans, chain); return(ans); } RWDSum::RWDSum(GraphView const *gv, unsigned int chain, double step) : Metropolis(nodeValues(gv, chain)), _gv(gv), _chain(chain), _step_adapter(step, PROB), _pmean(0), _niter(2), _dsnode(getDSumNode(gv)) { if (!_dsnode) { throwLogicError("No DSum node found in RWDSum method"); } gv->checkFinite(chain); //Check validity of initial values } void RWDSum::rescale(double p) { _step_adapter.rescale(p); // We keep a weighted mean estimate of the mean acceptance probability // with the weights in favour of more recent iterations _pmean += 2 * (p - _pmean) / _niter; _niter++; } void RWDSum::update(RNG *rng) { vector value(length()); unsigned int nrow = _dsnode->length(); unsigned int ncol = _gv->nodes().size(); unsigned int nrep = nrow * (ncol - 1); for (unsigned int j = 0; j < nrep; ++j) { double log_p = -_gv->logFullConditional(_chain); getValue(value); step(value, nrow, ncol, _step_adapter.stepSize(), rng); setValue(value); log_p += _gv->logFullConditional(_chain); accept(rng, exp(log_p)); } } bool RWDSum::checkAdaptation() const { if (_pmean == 0 || _pmean == 1) { return false; } if (fabs(_step_adapter.logitDeviation(_pmean)) > 0.5) { return false; } return true; } bool RWDSum::canSample(vector const &nodes, Graph const &graph, bool discrete, bool multinom) { if (nodes.size() < 2) return false; for (unsigned int i = 0; i < nodes.size(); ++i) { // Nodes must be of full rank if (multinom) { if (!discrete) return false; if (nodes[i]->distribution()->name() != "dmulti") return false; } else { if (nodes[i]->df() != nodes[i]->length()) return false; } // Check discreteness if (nodes[i]->isDiscreteValued() != discrete) return false; } GraphView gv(nodes, graph, true); set nodeset; for (unsigned int i = 0; i < nodes.size(); ++i) { nodeset.insert(nodes[i]); } StochasticNode const *dschild = getDSumNode(&gv); if (!dschild) { return false; } else { //It must be an observed direct descendent of sampled nodes //and have no other parents if (!isObserved(dschild)) return false; if (dschild->parents().size() != nodes.size()) return false; for (unsigned int j = 0; j < dschild->parents().size(); ++j) { if (nodeset.count(dschild->parents()[j]) == 0) { return false; } } } if (discrete) { //Check discreteness of child node if (!dschild->isDiscreteValued()) return false; //Check that value is really integer double val = dschild->value(0)[0]; if (val != static_cast(val)) { return false; } } // And so, their work was done... return true; } void RWDSum::setValue(vector const &value) { _gv->setValue(value, _chain); } void RWDSum::getValue(vector &value) const { _gv->getValue(value, _chain); } }} JAGS-4.3.2/src/modules/bugs/samplers/RealDSum.cc0000664000175000017500000000202514224052514016175 00000000000000#include #include #include #include #include #include #include "RealDSum.h" //Initial step size #define STEP 0.1 using std::vector; using std::string; namespace jags { namespace bugs { //Pick a random integer between 0 and n - 1 static int pick(int n, RNG *rng) { double u = rng->uniform() * n; int i = 1; while (i < u) ++i; return i - 1; } RealDSum::RealDSum(GraphView const *gv, unsigned int chain) : RWDSum(gv, chain, STEP) { } void RealDSum::step(vector &value, unsigned int nrow, unsigned int ncol, double s, RNG *rng) const { //Randomly pick a row int r = pick(nrow, rng); //Randomly draw two columns int c1 = pick(ncol, rng); int c2 = pick(ncol - 1, rng); if (c2 >= c1) ++c2; //Modify the chosen components while keeping the sum constant double eps = rng->normal() * s; value[c1 * nrow + r] += eps; value[c2 * nrow + r] -= eps; } }} JAGS-4.3.2/src/modules/bugs/samplers/DiscreteDSum.cc0000664000175000017500000000216714224052514017063 00000000000000#include #include #include #include #include #include #include "DiscreteDSum.h" #include using std::vector; using std::fabs; using std::string; //Initial step size #define STEP 1 namespace jags { namespace bugs { //Pick a random integer between 0 and n - 1 static int pick(int n, RNG *rng) { double u = rng->uniform() * n; int i = 1; while (i < u) ++i; return i - 1; } DiscreteDSum::DiscreteDSum(GraphView const *gv, unsigned int chain) : RWDSum(gv, chain, STEP) { } void DiscreteDSum::step(vector &value, unsigned int nrow, unsigned int ncol, double s, RNG *rng) const { //Randomly pick a row int r = pick(nrow, rng); //Randomly pick two columns int c1 = pick(ncol, rng); int c2 = pick(ncol - 1, rng); if (c2 >= c1) ++c2; //Modify the chosen elements while keeping the sum constant double eps = rng->exponential() * s; int inteps = static_cast(eps); value[c1 * nrow + r] += inteps; value[c2 * nrow + r] -= inteps; } }} JAGS-4.3.2/src/modules/bugs/samplers/MNormal.cc0000664000175000017500000001111214224052514016063 00000000000000#include #include "MNormal.h" #include #include #include #include #include #include #include #include #define N_REFRESH 100 using std::vector; using std::copy; using std::exp; using std::sqrt; using std::min; using std::string; namespace jags { namespace bugs { static vector initValue(SingletonGraphView const *gv, unsigned int chain) { double const *x = gv->node()->value(chain); unsigned int N = gv->node()->length(); vector ivalue(N); for (unsigned int i = 0; i < N; ++i) { ivalue[i] = x[i]; } return ivalue; } MNormMetropolis::MNormMetropolis(SingletonGraphView const *gv, unsigned int chain) : Metropolis(initValue(gv, chain)), _gv(gv), _chain(chain), _mean(0), _var(0), _prec(0), _n(0), _n_isotonic(0), _sump(0), _meanp(0), _lstep(0), _nstep(10), _p_over_target(true) { gv->checkFinite(chain); //Check validity of initial values unsigned int N = gv->length(); _mean = new double[N]; _var = new double[N * N]; _prec = new double[N * N]; // Give initial mean zero and identity variance matrix for (unsigned int i = 0; i < N; ++i) { _mean[i] = 0; for (unsigned int j = 0; j < N; ++j) { _prec[i + N * j] = _var[i + N * j] = (i == j) ? 1 : 0; } } } MNormMetropolis::~MNormMetropolis() { delete [] _mean; delete [] _var; delete [] _prec; } void MNormMetropolis::update(RNG *rng) { double logdensity = -_gv->logFullConditional(_chain); double step = exp(_lstep); double const *xold = _gv->node()->value(_chain); unsigned int N = _gv->length(); double *eps = new double[N]; DMNorm::randomsample(eps, 0, _var, false, N, rng); vector xnew(N); for (unsigned int i = 0; i < N; ++i) { xnew[i] = xold[i] + eps[i] * step; } delete [] eps; setValue(xnew); logdensity += _gv->logFullConditional(_chain); accept(rng, exp(logdensity)); } void MNormMetropolis::rescale(double p) { ++_n; p = min(p, 1.0); _sump += p; if (_n % N_REFRESH == 0) { //Calculate the running mean acceptance rate _meanp = _sump / N_REFRESH; _sump = 0; } if (_n_isotonic == 0) { //Adjust scale of proposal distribution to get optimal acceptance //rate using a noisy gradient algorithm _lstep += (p - 0.234) / _nstep; if ((p > 0.234) != _p_over_target) { _p_over_target = !_p_over_target; ++_nstep; } /* Isotonic random walk. Use the identity matrix (scaled by the _lstep parameter) as the precision of the proposal distribution until the acceptance rate lies in an interval around the optimum. */ if (_n % N_REFRESH == 0 && _meanp >= 0.15 && _meanp <= 0.35) { _n_isotonic = _n; _nstep = 100; //reset the step size as we adapt proposal } } else { //This give better adaptation in the orange tree example _lstep += (p - 0.234) / sqrt(static_cast(_nstep)); _nstep++; /* Adaptive random walk: The variance of the proposal distribution is adapted to the empirical variance of the posterior distribution. We use weighted moment estimators for the mean and variance so that more recent iterations get greter weight. This is important because the chain has not converged: the effect of an initial transient must be minimized. The weights are proportional to (_n - _n_isotonic) for the mean, and the iterative formula is exact. For the variance, the weights are proportional to _n, and the formula is asymptotically correct. For small values of (_n - _n_isotonic), the variance estimator is shrunk towards the prior (identity matrix) in order to ensure a smooth transition from the isotonic random walk. */ unsigned int N = _gv->length(); double const *x = _gv->node()->value(_chain); for (unsigned int i = 0; i < N; ++i) { _mean[i] += 2 * (x[i] - _mean[i]) / (_n - _n_isotonic + 1); } for (unsigned int i = 0; i < N; ++i) { for (unsigned int j = 0; j < N; ++j) { _var[i + N * j] += 2 * ((x[i] - _mean[i]) * (x[j] - _mean[j]) - _var[i + N * j]) / _n; } } } } bool MNormMetropolis::checkAdaptation() const { return (_n_isotonic > 0) && (_meanp >= 0.15) && (_meanp <= 0.35); } void MNormMetropolis::getValue(vector &value) const { double const *v = _gv->node()->value(_chain); copy(v, v + _gv->length(), value.begin()); } void MNormMetropolis::setValue(vector const &value) { _gv->setValue(value, _chain); } }} JAGS-4.3.2/src/modules/bugs/samplers/MNormalFactory.cc0000664000175000017500000000173214224052514017422 00000000000000#include #include "MNormal.h" #include "MNormalFactory.h" #include #include #include #include #include #include using std::vector; using std::string; namespace jags { namespace bugs { bool MNormalFactory::canSample(StochasticNode * snode, Graph const &graph) const { return snode->distribution()->name() == "dmnorm" && !isBounded(snode); } Sampler * MNormalFactory::makeSampler(StochasticNode *snode, Graph const &graph) const { unsigned int N = snode->nchain(); vector methods(N, 0); SingletonGraphView *gv = new SingletonGraphView(snode, graph); for (unsigned int ch = 0; ch < N; ++ch) { methods[ch] = new MNormMetropolis(gv, ch); } return new MutableSampler(gv, methods, "bugs::MNormalMetropolis"); } string MNormalFactory::name() const { return "bugs::MNormal"; } }} JAGS-4.3.2/src/modules/bugs/samplers/ConjugateMethod.cc0000664000175000017500000000326114224052371017605 00000000000000#include "ConjugateMethod.h" #include #include #include #include #include #include using std::vector; using std::map; using std::string; namespace jags { namespace bugs { ConjugateDist getDist(StochasticNode const *snode) { static map dist_table; if (dist_table.empty()) { dist_table["dbern"] = BERN; dist_table["dbeta"] = BETA; dist_table["dbin"] = BIN; dist_table["dcat"] = CAT; dist_table["dchisq"] = CHISQ; dist_table["ddexp"] = DEXP; dist_table["ddirch"] = DIRCH; dist_table["dexp"] = EXP; dist_table["dgamma"] = GAMMA; dist_table["dlnorm"] = LNORM; dist_table["dlogis"] = LOGIS; dist_table["dmnorm"] = MNORM; dist_table["dmulti"] = MULTI; dist_table["dnegbin"] = NEGBIN; dist_table["dnorm"] = NORM; dist_table["dpar"] = PAR; dist_table["dpois"] = POIS; dist_table["dt"] = T; dist_table["dunif"] = UNIF; dist_table["dweib"] = WEIB; dist_table["dwish"] = WISH; } string const &name = snode->distribution()->name(); map::iterator p(dist_table.find(name)); if (p == dist_table.end()) return OTHERDIST; else return p->second; } static vector getChildDist(SingletonGraphView const *gv) { vector ans; vector const &child = gv->stochasticChildren(); for (unsigned int i = 0; i < child.size(); ++i) { ans.push_back(getDist(child[i])); } return ans; } ConjugateMethod::ConjugateMethod(SingletonGraphView const *gv) : _target_dist(getDist(gv->node())), _child_dist(getChildDist(gv)), _gv(gv) { } }} JAGS-4.3.2/src/modules/bugs/samplers/Dirichlet.cc0000664000175000017500000000401614224052514016432 00000000000000 #include #include "Dirichlet.h" #include #include #include #include #include using std::copy; using std::exp; using std::log; using std::string; using std::vector; namespace jags { namespace bugs { static vector initValue(GraphView const *gv, unsigned int chain) { vector ivalue(gv->length()); gv->getValue(ivalue, chain); return ivalue; } DirchMetropolis::DirchMetropolis(GraphView const *gv, unsigned int chain) : RWMetropolis(initValue(gv, chain), 0.1), _gv(gv), _chain(chain), _s(1) { gv->checkFinite(chain); //Check validity of initial values } void DirchMetropolis::step(vector &value, double step, RNG *rng) const { //Random walk on a log scale. for (unsigned int i = 0; i < value.size(); ++i) { value[i] *= exp(step * rng->normal()); } } void DirchMetropolis::getValue(vector &value) const { _gv->getValue(value, _chain); for (unsigned int i = 0; i < value.size(); ++i) { value[i] *= _s; } } void DirchMetropolis::setValue(vector const &value) { double s = 0; for (unsigned int i = 0; i < value.size(); ++i) { s += value[i]; } //Make a scaled down copy of the value vector v = value; for (unsigned int i = 0; i < v.size(); ++i) { v[i] /= s; } _gv->setValue(v, _chain); _s = s; } double DirchMetropolis::logDensity() const { /* We need to add a penalty based on _s to stop the random walk going off to infinity. This penalty is based on a gamma distribution with shape n and rate n (mean = 1, var = 1/sqrt(n)) */ double n = _gv->length(); return _gv->logFullConditional(_chain) - (n + 1) * _s + n * log(_s); } double DirchMetropolis::logJacobian(vector const &value) const { //Compensate for random walk on log scale double lj = 0; for (unsigned int i = 0; i < value.size(); ++i) { if (value[i]) { lj += log(value[i]); } } return lj; } }} JAGS-4.3.2/src/modules/bugs/samplers/DirichletFactory.cc0000664000175000017500000000201514224052514017757 00000000000000#include #include "Dirichlet.h" #include "DirichletFactory.h" #include #include #include #include #include #include using std::vector; using std::string; namespace jags { namespace bugs { bool DirichletFactory::canSample(StochasticNode * snode, Graph const &graph) const { return snode->distribution()->name() == "ddirch"; } Sampler * DirichletFactory::makeSampler(StochasticNode *snode, Graph const &graph) const { unsigned int nchain = snode->nchain(); vector methods(nchain, 0); vector nodes(1, snode); SingletonGraphView *gv = new SingletonGraphView(snode, graph); for (unsigned int ch = 0; ch < nchain; ++ch) { methods[ch] = new DirchMetropolis(gv, ch); } return new MutableSampler(gv, methods, "bugs::DirichletMetropolis"); } string DirichletFactory::name() const { return "bugs::Dirichlet"; } }} JAGS-4.3.2/src/modules/bugs/samplers/TruncatedGamma.cc0000664000175000017500000001572614224052514017431 00000000000000#include #include "TruncatedGamma.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::sqrt; using std::max; using std::sort; using std::string; #define TG_EPS 0.1 /* The machinery of the TruncatedGamma method is very similar to the Conjugate gamma method, except that Poisson distributions are not permitted. */ namespace jags { namespace bugs { static Node const * getParent(StochasticNode const *snode) { //Choose appropriate parent for stochastic child switch(getDist(snode)) { case GAMMA: case NORM: case DEXP: case WEIB: case LNORM: return snode->parents()[1]; break; case EXP: case POIS: return snode->parents()[0]; break; default: throwLogicError("Invalid distribution in TruncatedGamma sampler"); return 0; //-Wall } } static double calExponent(SingletonGraphView const *gv, int i, unsigned int chain) { /* All stochastic children depend on the sampled node "x" via a parent that takes the value "a * x^c". This function calculates the value of the exponent c for the ith stochastic child */ if (gv->deterministicChildren().empty()) { return 1; } //Save original value const double xold = *gv->node()->value(chain); double x0 = xold; if (x0 <= 0) { x0 = 1; gv->setValue(&x0, 1, chain); } Node const *par = getParent(gv->stochasticChildren()[i]); double y0 = *par->value(chain); double x1 = 2 * x0; gv->setValue(&x1, 1, chain); double y1 = *par->value(chain); gv->setValue(&xold, 1, chain); //Restore original value if (y1 <= 0 || y0 <= 0) throwLogicError("Invalid scale function in TruncatedGamma sampler"); return (log(y1) - log(y0))/log(2.0); } TruncatedGamma::TruncatedGamma(SingletonGraphView const *gv) : ConjugateMethod(gv), _exponent(calExponent(gv, 0, 0)) { } TruncatedGamma::~TruncatedGamma() { } bool TruncatedGamma::canSample(StochasticNode *snode, Graph const &graph) { // Target node must have a uniform distribution with a fixed, // non-negative lower bound. if (getDist(snode) != UNIF) return false; if (!snode->parents()[0]->isFixed()) return false; if (snode->parents()[0]->value(0)[0] < 0) return false; SingletonGraphView gv(snode, graph); vector const &stoch_nodes = gv.stochasticChildren(); //Check that stochastic children are valid for (unsigned int i = 0; i < stoch_nodes.size(); ++i) { //Check that children are unbounded if (isBounded(stoch_nodes[i])) { return false; } //Check that are no unwanted paths to the stochastic children switch(getDist(stoch_nodes[i])) { case EXP: case POIS: break; case GAMMA: case NORM: case DEXP: case WEIB: case LNORM: if (gv.isDependent(stoch_nodes[i]->parents()[0])) { return false; //non-scale parameter depends on snode } break; default: return false; } } // Deterministic children must be fixed power functions if (!checkPower(&gv, true)) return false; // Calculate the coefficient of the power function double exp0 = calExponent(&gv, 0, 0); for (unsigned int i = 0; i < stoch_nodes.size(); ++i) { double expi = calExponent(&gv, i, 0); //Exclude exponents near 0 for numerical stability if (fabs(expi) < TG_EPS) return false; // Exponent must be the same for all stochastic children // We allow for some numerical error if (fabs(expi - exp0) > 1E-16) return false; } //A negative prior value of shape is required if we can guarantee //that it is positive a posteriori. double shape = 1/exp0; for (unsigned int i = 0; i < stoch_nodes.size(); ++i) { switch(getDist(stoch_nodes[i])) { case GAMMA: if (stoch_nodes[i]->parents()[0]->isFixed()) { shape += *stoch_nodes[0]->parents()[0]->value(0); } break; case POIS: if (stoch_nodes[i]->isFixed()) { shape += *stoch_nodes[i]->value(0); } break; case EXP: case DEXP: case WEIB: shape += 1; break; case NORM: case LNORM: shape += 0.5; break; default: return false; } } // We could allow any shape > 0, but we add a fudge factor to // guarantee stability return (shape >= TG_EPS); } void TruncatedGamma::update(unsigned int chain, RNG *rng) const { //If "x" is the value of the sampled node, the parameter "z = //x^_exponent" has a truncated gamma distribution. We work in //terms of "z" and then translate back to "x" //Prior parameters double r = 1/_exponent; // shape double mu = 0; // 1/scale //Save current value StochasticNode *snode = _gv->node(); const double xold = snode->value(chain)[0]; const double zold = pow(xold, _exponent); //Add likelihood contributions to shape and scale parameters vector const &schildren = _gv->stochasticChildren(); for (unsigned int i = 0; i < schildren.size(); ++i) { double Y = *schildren[i]->value(chain); double m = *schildren[i]->parents()[0]->value(chain); double c = *getParent(schildren[i])->value(chain) / zold; if (c > 0) { switch(_child_dist[i]) { case GAMMA: r += m; mu += c * Y ; break; case EXP: r += 1; mu += c * Y; break; case NORM: r += 0.5; mu += c * (Y - m) * (Y - m) / 2; break; case POIS: r += Y; mu += c; break; case DEXP: r += 1; mu += c * fabs(Y - m); break; case WEIB: r += 1; mu += c * pow(Y, m); break; case LNORM: r += 0.5; mu += c * (log(Y) - m) * (log(Y) - m) / 2; break; default: throwLogicError("Invalid distribution in TruncatedGamma"); } } } if (mu == 0) { throwNodeError(snode, "Degenerate posterior in TruncatedGamma sampler"); } //Find the boundaries on the scale of x double lx = snode->parents()[0]->value(chain)[0]; double ux = snode->parents()[1]->value(chain)[0]; if (xold < lx || xold > ux) { throwLogicError("Current value invalid in TruncatedGamma method"); } // Find boundaries on the scale of z double ly, uy; if (_exponent > 0) { ly = (lx > 0) ? exp(_exponent * log(lx)) : 0; uy = exp(_exponent * log(ux)); } else { // Boundaries are inverted ly = exp(_exponent * log(ux)); uy = (lx > 0) ? exp(_exponent * log(lx)) : JAGS_POSINF; } double plower = pgamma(ly, r, 1/mu, 1, 0); double pupper = pgamma(uy, r, 1/mu, 1, 0); // Sample from the posterior double ynew; if (pupper - plower > 0.5) { do { ynew = rgamma(r, 1/mu, rng); } while (ynew < ly || ynew > uy); } else { double p = runif(plower, pupper, rng); ynew = qgamma(p, r, 1/mu, 1, 0); } double xnew = exp(log(ynew)/_exponent); _gv->setValue(&xnew, 1, chain); } }} JAGS-4.3.2/src/modules/bugs/samplers/DMultiDSum.cc0000664000175000017500000000244314224052514016514 00000000000000#include #include #include #include #include #include #include "DMultiDSum.h" #include using std::vector; using std::fabs; using std::string; //Initial step size #define STEP 1 namespace jags { namespace bugs { DMultiDSum::DMultiDSum(GraphView const *gv, unsigned int chain) : RWDSum(gv, chain, STEP) { } //Pick a random integer between 0 and n - 1 static int pick(int n, RNG *rng) { double u = rng->uniform() * n; int i = 1; while (i < u) ++i; return i - 1; } void DMultiDSum::step(vector &value, unsigned int nrow, unsigned int ncol, double s, RNG *rng) const { //Randomly pick two rows int r1 = pick(nrow, rng); int r2 = pick(nrow - 1, rng); if (r2 >= r1) ++r2; //Randomly pick two columns int c1 = pick(ncol, rng); int c2 = pick(ncol - 1, rng); if (c2 >= c1) ++c2; double eps = rng->normal() * s; int inteps = static_cast(fabs(eps)) + 1; //Modify the chosen elements while keeping row and column sums //constant value[nrow * c1 + r1] += inteps; value[nrow * c1 + r2] -= inteps; value[nrow * c2 + r1] -= inteps; value[nrow * c2 + r2] += inteps; } }} JAGS-4.3.2/src/modules/bugs/samplers/ShiftedCount.cc0000664000175000017500000000441714224052515017130 00000000000000#include #include "ShiftedCount.h" #include #include #include #include using std::vector; using std::string; namespace jags { namespace bugs { ShiftedCount::ShiftedCount(SingletonGraphView const *gv) : ConjugateMethod(gv) { } bool ShiftedCount::canSample(StochasticNode *snode, Graph const &graph) { switch(getDist(snode)) { case POIS: case BIN: case NEGBIN: break; default: return false; } if (isBounded(snode)) return false; SingletonGraphView gv(snode, graph); // There should be no deterministic children if (!gv.deterministicChildren().empty()) return false; // Check stochastic children: Must have single child node ... vector const &child_nodes = gv.stochasticChildren(); if (child_nodes.size() != 1) return false; // ... with a Binomial(p, N) distribution such that N is the // sampled node and p does not depend on sampled node StochasticNode const *cnode = child_nodes.front(); if (getDist(cnode) != BIN) return false; if (isBounded(cnode)) return false; if (cnode->parents()[1] != snode) return false; if (cnode->parents()[0] == snode) return false; return true; } void ShiftedCount::update(unsigned int chain, RNG *rng) const { StochasticNode const* snode = _gv->node(); StochasticNode * cnode = _gv->stochasticChildren().front(); double y = *cnode->value(chain); //Child value // Prior rate (Poisson) or probability (Binomial) double lambda = *snode->parents()[0]->value(chain); // Binomial probability of child double pi = *cnode->parents()[0]->value(chain); double xnew = y; double N = 0; switch(_target_dist) { case POIS: lambda = (1 - pi) * lambda; xnew += rpois(lambda, rng); break; case BIN: N = *snode->parents()[1]->value(chain); lambda = (1 - pi) * lambda / ((1 - pi) * lambda + (1 - lambda)); xnew += rbinom(N - y, lambda, rng); break; case NEGBIN: N = *snode->parents()[1]->value(chain); lambda = (1 - pi) * lambda + pi; xnew += rnbinom(N - y, lambda, rng); break; default: throwLogicError("Invalid distribution in ShiftedCount"); } _gv->setValue(&xnew, 1, chain); } }} JAGS-4.3.2/src/modules/bugs/samplers/ShiftedMultinomial.cc0000664000175000017500000001156614224052514020334 00000000000000#include #include "ShiftedMultinomial.h" #include #include #include #include using std::vector; using std::string; using std::copy; /* Helper functions */ namespace jags { namespace bugs { static inline StochasticNode const *CHILD(SingletonGraphView const *gv, unsigned int i) { return gv->stochasticChildren()[i]; } static inline double SIZE(StochasticNode const *cnode, unsigned int chain) { return *cnode->parents()[1]->value(chain); } static inline double const *PROB(StochasticNode const *cnode, unsigned int chain) { return cnode->parents()[0]->value(chain); } /* If X ~ dmulti(p, N) and X has stochastic children Y[j] ~ dbin(pi[j], n[j]) for j = 1 .. J, then for each element i of X we must have either n[j] = X[i] for exactly one child j, or no child has a size parameter n[j] that depends on X. The makeIndex function checks this condition and returns a vector if indices such that: index[i] = j if X[i] == n[j] index[i] = -1 if no child corresponds to index i. If the conditions are not satisfied, an empty vector is returned, indicating an error. NB It is only safe to call this after the other checks in canSample. */ static vector makeIndex(SingletonGraphView const *gv, unsigned int chain) { unsigned int m = gv->length(); //Length of sampled node vector index(m, -1); unsigned int J = gv->stochasticChildren().size(); //Number of children // Store current value vector xold = vector(m); gv->getValue(xold, chain); vector xnew = vector(m, 0); gv->setValue(xnew, chain); for (unsigned int j = 0; j < J; ++j) { if (SIZE(CHILD(gv, j), chain) != 0) { gv->setValue(xold, chain); return vector(); } } for (unsigned int i = 0; i < m; ++i) { xnew[i] = 1; gv->setValue(xnew, chain); for (unsigned int j = 0; j < J; ++j) { bool found_index = false; double nj = SIZE(CHILD(gv,j), chain); if (nj > 1) { // Size parameter does not correspond exactly to X[i] gv->setValue(xold, chain); return vector(); } if (nj == 1) { if (found_index) { // More than one stochastic child depends on X[i] gv->setValue(xold, chain); return vector(); } else { index[i] = j; found_index = true; } } } xnew[i] = 0; } // Restore current value gv->setValue(xold, chain); return index; } ShiftedMultinomial::ShiftedMultinomial(SingletonGraphView const *gv) : ConjugateMethod(gv), _index(makeIndex(gv,0)) { } bool ShiftedMultinomial::canSample(StochasticNode *snode, Graph const &graph) { /* Sampled node must have an unbounded multinomial distribution */ if (getDist(snode) != MULTI) return false; if (isBounded(snode)) return false; SingletonGraphView gv(snode, graph); // Stochastic children must all be unbounded binomial vector const &stoch_children = gv.stochasticChildren(); for (unsigned int i = 0; i < stoch_children.size(); ++i) { if (getDist(stoch_children[i]) != BIN) return false; if (isBounded(stoch_children[i])) return false; if (gv.isDependent(stoch_children[i]->parents()[0])) return false; //probability parameter depends on snode } // Deterministic children must be fixed scale functions if (!checkLinear(&gv, true)) return false; // Check indices for chain 0. See notes for MakeIndex vector index = makeIndex(&gv, 0); if (index.empty()) { return false; } // Check that other chains are consistent with chain 0. // Possible overkill for (unsigned int ch = 1; ch < snode->nchain(); ++ch) { if (index != makeIndex(&gv, ch)) return false; } return true; } void ShiftedMultinomial::update(unsigned int chain, RNG *rng) const { StochasticNode *snode = _gv->node(); // Sampled node unsigned int m = snode->length(); // Length of sampled node double N = SIZE(snode, chain); double const *p = PROB(snode, chain); vector prob(m); copy(p, p + m, prob.begin()); vector xnew = vector(m, 0); vector y = vector(m, 0); for (unsigned int i = 0; i < m; ++i) { int j = _index[i]; if (j >= 0) { y[i] = *CHILD(_gv, j)->value(chain); N -= y[i]; double pi = *PROB(CHILD(_gv, j), chain); prob[i] *= (1 - pi); } } // Normalize probability double sump = 0; for (unsigned int i = 0; i < m; ++i) { sump += prob[i]; } // Sample multinomial as a series of binomials for (unsigned int i = 0; i < m - 1; i++) { if (N == 0) { xnew[i] = 0; } else { xnew[i] = rbinom(N, prob[i]/sump, rng); N -= xnew[i]; sump -= prob[i]; } } xnew[m - 1] = N; // Shift for (unsigned int i = 0; i < m; ++i) { xnew[i] += y[i]; } _gv->setValue(xnew, chain); } }} JAGS-4.3.2/src/modules/bugs/samplers/SumMethod.cc0000664000175000017500000002655114224052515016441 00000000000000#include #include #include #include #include #include #include #include #include #include "SumMethod.h" #include #include #include #include #include #include using std::vector; using std::accumulate; using std::min; using std::max; using std::ceil; using std::logic_error; using std::floor; using std::fabs; using std::list; using std::find; namespace jags { namespace bugs { template double sumValue(vector const &x, unsigned int ch) { double y = 0; for (typename vector::const_iterator p = x.begin(); p != x.end(); ++p) { double const *v = (*p)->value(ch); unsigned int n = (*p)->length(); y = accumulate(v, v+n, y); } return y; } /* //Test to see of two sets intersect template bool intersects(set const &st, set const &su) { typename set::const_iterator t = st.begin(); typename set::const_iterator u = su.begin(); while (t != st.end() && u != su.end()) { if (*t < *u) { if (t != st.end()) ++t; } else if (*t > *u) { if (u != su.end()) ++u; } else { return true; } } return false; } */ StochasticNode * SumMethod::isCandidate(StochasticNode *snode, Graph const &graph) { //We can only sample scalar nodes if (snode->length() != 1) return 0; SingletonGraphView gv(snode, graph); /* Check stochastic children */ vector const &schildren = gv.stochasticChildren(); StochasticNode *sumchild = 0; for (unsigned int i = 0; i < schildren.size(); ++i) { if (schildren[i]->distribution()->name() == "sum") { /* There should be only one sum node and it must be observed */ if (sumchild) return 0; if(!isObserved(schildren[i])) return 0; sumchild = schildren[i]; } } if (!sumchild) return 0; /* Deterministic descendants must be an additive function * of snode */ if (schildren.size() == 1) { if (!checkAdditive(&gv, false)) return 0; } else { /* We only care that sumnode is an additive function so construct a local graph that excludes other stochastic children for additivity check */ Graph lgraph; lgraph.insert(snode); lgraph.insert(sumchild); vector const &dchildren = gv.deterministicChildren(); for (unsigned int j = 0; j < dchildren.size(); ++j) { lgraph.insert(dchildren[j]); } SingletonGraphView lgv(snode, lgraph); if (!checkAdditive(&lgv, false)) return 0; } return sumchild; } bool SumMethod::canSample(vector const &snodes, Graph const &graph) { //Are individual nodes candidates? StochasticNode *sumchild = isCandidate(snodes[0], graph); if (sumchild == 0) return false; for (unsigned int i = 1; i < snodes.size(); ++i) { if (isCandidate(snodes[i], graph) != sumchild) return false; } //Check consistency of discreteness bool discrete = sumchild->isDiscreteValued(); for (unsigned int i = 1; i < snodes.size(); ++i) { if (snodes[i]->isDiscreteValued() != discrete) return false; } //Together are the nodes additive with a fixed intercept? GraphView gv(snodes, graph, true); /* Only deterministic nodes with a path to sumnode need to be additive. Constract a local graph that strips out the rest. */ Graph lgraph; //local graph vector const &dc = gv.deterministicChildren(); for (vector::const_reverse_iterator p = dc.rbegin(); p != dc.rend(); ++p) { list const *psc = (*p)->stochasticChildren(); if (find(psc->begin(), psc->end(), sumchild) != psc->end()) { lgraph.insert(*p); } else { list const *pdc = (*p)->deterministicChildren(); for(list::const_iterator q = pdc->begin(); q != pdc->end(); ++q) { if (lgraph.contains(*q)) { lgraph.insert(*p); break; } } } } lgraph.insert(sumchild); for (unsigned int i = 0; i < snodes.size(); ++i) { lgraph.insert(snodes[i]); } return checkAdditive(snodes, lgraph, true); } SumMethod::SumMethod(GraphView const *gv, unsigned int chain) : MutableSampleMethod(), _gv(gv), _chain(chain), _sum(gv->stochasticChildren()[0]->value(chain)[0]), _discrete(gv->stochasticChildren()[0]->isDiscreteValued()), _x(gv->length()), _i(0), _j(0), _sumchild(0), _fast(false), _sumdiff(0), _iter(0), _width(2), _max(10), _adapt(true) { if (gv->stochasticChildren().size() == 1) { _sumchild = gv->stochasticChildren().front(); _fast = true; } else { vector const &schildren = gv->stochasticChildren(); for (unsigned int i = 0; i < schildren.size(); ++i) { if (schildren[i]->distribution()->name() == "sum") { _sumchild = schildren[i]; break; } } } gv->getValue(_x, chain); if (_sumchild->logDensity(chain, PDF_LIKELIHOOD) != 0) { //If initial values are inconsistent with outcome we //try to adjust them // Calculate intercept (usually zero) double y = sumValue(_sumchild->parents(), chain); double sumx = sumValue(gv->nodes(), chain); double alpha = y - sumx; // Calculate target sum for sampled values double sumx_new = _sumchild->value(chain)[0] - alpha; // Rescale unsigned int N = _x.size(); vector xnew; if (_discrete) { xnew = vector(N, floor(sumx_new/N)); double delta = sumx_new - accumulate(xnew.begin(), xnew.end(), 0); xnew[N-1] += delta; } else { xnew = vector(N, sumx_new/N); } gv->setValue(xnew, chain); if (_sumchild->logDensity(chain, PDF_LIKELIHOOD) != 0) { throw logic_error("SumMethod failed to fix initial values"); } if (jags_finite(gv->logFullConditional(_chain))) { _x = xnew; //Preserve changes } else { throw NodeError(_sumchild, "SumMethod cannot fix the stochastic parents of this node to satisfy the sum constraint.\nYou must supply initial values for the parents"); } } //Check validity of initial values gv->checkFinite(chain); } SumMethod::~SumMethod() { } void SumMethod::updateStep(RNG *rng) { // Test current value double g0 = logDensity(); if (!jags_finite(g0)) { return; } // Generate auxiliary variable double z = g0 - rng->exponential(); //Discrete width double width = _discrete ? ceil(_width) : _width; // Generate random interval of width "_width" about current value double left = _discrete ? floor(rng->uniform() * (width + 1)) : rng->uniform() * width; double xold = value(); double L = xold - left; double R = L + width; double lower = JAGS_NEGINF, upper = JAGS_POSINF; getLimits(&lower, &upper); // Stepping out // Randomly set number of steps in left and right directions, // subject to the limit in the maximal size of the interval int j = static_cast(rng->uniform() * _max); int k = _max - 1 - j; if (L < lower) { L = lower; } else { setValue(L); while (j-- > 0 && logDensity() > z) { L -= width; if (L < lower) { L = lower; break; } setValue(L); } } if (R > upper) { R = upper; } else { setValue(R); while (k-- > 0 && logDensity() > z) { R += width; if (R > upper) { R = upper; break; } setValue(R); } } // Keep sampling from the interval until acceptance (the loop is // guaranteed to terminate). double xnew; for(;;) { if (_discrete) { xnew = L + floor(rng->uniform() * (R - L + 1)); } else { xnew = L + rng->uniform() * (R - L); } setValue(xnew); double g = logDensity(); if (g >= z - DBL_EPSILON) { // Accept point break; } else { // shrink the interval if (xnew < xold) { L = xnew; } else { R = xnew; } } } if (_adapt) { _sumdiff += fabs(xnew - xold); } } void SumMethod::update(RNG *rng) { unsigned int len = _gv->length(); if (len == 1) { //Value of single sampled node is determined by sum //constraint so it can never move. But we still check //that the sum constraint is satisfied. if (_sumchild->logDensity(_chain, PDF_LIKELIHOOD) != 0) { throw logic_error("Failure to preserve sum in SumMethod"); } return; } //Generate random permutation (rp) of indices 0...(len-1) //using Fisher Yates algorithm. vector rp(len+1); for (unsigned int i = 0; i < len; ++i) { unsigned int j = static_cast(rng->uniform() * (i+1)); rp[i] = rp[j]; rp[j] = i; } rp[len] = rp[0]; //Cycle back to the start for (unsigned int i = 0; i < len; ++i) { _i = rp[i]; _j = rp[i+1]; updateStep(rng); //Slice update of par (_i, _j) } if (_adapt) { if (++_iter % 50 == 0) { _width = _sumdiff / (50 * len); _sumdiff = 0; if (_discrete) { _width = ceil(_width); } } } //updateStep does not update the deterministic descendants //but we need to leave these in a correct state in case they //are being monitored vector const &d = _gv->deterministicChildren(); for(vector::const_iterator p = d.begin(); p != d.end(); ++p) { (*p)->deterministicSample(_chain); } //Sanity check if (_sumchild->logDensity(_chain, PDF_LIKELIHOOD) != 0) { throw logic_error("Failure to preserve sum in SumMethod"); } } void SumMethod::setValue(double x) { double delta = x - _x[_i]; _x[_i] = x; _x[_j] -= delta; _gv->nodes()[_i]->setValue(&_x[_i], 1, _chain); _gv->nodes()[_j]->setValue(&_x[_j], 1, _chain); if (!_fast) { //Have to update deterministic descendants vector const &dtrm = _gv->deterministicChildren(); for (vector::const_iterator p(dtrm.begin()); p != dtrm.end(); ++p) { (*p)->deterministicSample(_chain); } } } double SumMethod::value() const { return _x[_i]; } void SumMethod::getLimits(double *lower, double *upper) const { vector const &n = _gv->nodes(); double li, ui, lj, uj; n[_i]->support(&li, &ui, 1U, _chain); n[_j]->support(&lj, &uj, 1U, _chain); double sum_ij = n[_i]->value(_chain)[0] + n[_j]->value(_chain)[0]; *lower = max(li, sum_ij - uj); *upper = min(ui, sum_ij - lj); } bool SumMethod::isAdaptive() const { return true; } void SumMethod::adaptOff() { _adapt=false; } double SumMethod::logDensity() const { if (_fast) { //Log density depends only on the prior of the two nodes //that are currently active return _gv->nodes()[_i]->logDensity(_chain, PDF_PRIOR) + _gv->nodes()[_j]->logDensity(_chain, PDF_PRIOR); } else { return _gv->logFullConditional(_chain); } } bool SumMethod::checkAdaptation() const { return true; } } // namespace bugs } //namespace jags JAGS-4.3.2/src/modules/bugs/samplers/SumFactory.cc0000664000175000017500000000332314224052371016620 00000000000000#include //#include #include #include //#include #include #include #include "SumFactory.h" #include "SumMethod.h" //#include #include using std::list; using std::vector; using std::string; using std::map; namespace jags { namespace bugs { vector SumFactory::makeSamplers(list const &nodes, Graph const &graph) const { vector samplers; vector sum_nodes; map > smap; map >::iterator i; for (list::const_iterator p = nodes.begin(); p != nodes.end(); ++p) { StochasticNode const *sum = SumMethod::isCandidate(*p, graph); if (sum) { i = smap.find(sum); if (i == smap.end()) { sum_nodes.push_back(sum); smap[sum] = vector(1, *p); } else { i->second.push_back(*p); } } } for (vector::const_iterator p = sum_nodes.begin(); p != sum_nodes.end(); ++p) { i = smap.find(*p); if (!SumMethod::canSample(i->second, graph)) continue; GraphView *gv = new GraphView(i->second, graph, true); unsigned int N = nchain(gv); vector methods(N); for (unsigned int ch = 0; ch < N; ++ch) { methods[ch] = new SumMethod(gv, ch); } Sampler *s = new MutableSampler(gv, methods, "bugs::Sum"); samplers.push_back(s); } return samplers; } string SumFactory::name() const { return "bugs::Sum"; } } } JAGS-4.3.2/src/modules/bugs/samplers/RW1.cc0000664000175000017500000000352214224052371015136 00000000000000#include #include "RW1.h" //#include //#include //#include #include #include #include #include #include using std::vector; using std::copy; using std::exp; using std::sqrt; using std::min; using std::string; namespace jags { namespace bugs { RW1::RW1(SingletonGraphView const *gv, unsigned int chain) : Metropolis(vector(gv->length(), 0)), _gv(gv), _chain(chain), _step_adapter(0.1), _pmean(0), _niter(2) { gv->checkFinite(chain); //Check validity of initial values } RW1::~RW1() { } void RW1::update(RNG *rng) { double logdensity = -_gv->logFullConditional(_chain); double step = _step_adapter.stepSize(); double const *xold = _gv->node()->value(_chain); unsigned int N = _gv->length(); vector xnew(N); double S = 0; for (unsigned int i = 0; i < N; ++i) { double eps = rng->normal(); xnew[i] = xold[i] + eps * step; S += xnew[i]; } S /= N; for (unsigned int i = 0; i < N; ++i) { xnew[i] -= S; } setValue(xnew); logdensity += _gv->logFullConditional(_chain); accept(rng, exp(logdensity)); } void RW1::rescale(double p) { _step_adapter.rescale(p); // We keep a weighted mean estimate of the mean acceptance // probability with the weights in favour of more recent // iterations _pmean += 2 * (p - _pmean) / _niter; _niter++; } bool RW1::checkAdaptation() const { return (_pmean >= 0.15) && (_pmean <= 0.35); } void RW1::getValue(vector &value) const { double const *v = _gv->node()->value(_chain); copy(v, v + _gv->length(), value.begin()); } void RW1::setValue(vector const &value) { _gv->setValue(value, _chain); } } } JAGS-4.3.2/src/modules/bugs/samplers/RW1Factory.cc0000664000175000017500000000165614224052514016473 00000000000000#include #include "RW1.h" #include "RW1Factory.h" #include #include #include #include #include #include using std::vector; using std::string; namespace jags { namespace bugs { bool RW1Factory::canSample(StochasticNode * snode, Graph const &graph) const { return snode->distribution()->name() == "drw1"; } Sampler * RW1Factory::makeSampler(StochasticNode *snode, Graph const &graph) const { unsigned int N = snode->nchain(); vector methods(N, 0); SingletonGraphView *gv = new SingletonGraphView(snode, graph); for (unsigned int ch = 0; ch < N; ++ch) { methods[ch] = new RW1(gv, ch); } return new MutableSampler(gv, methods, "bugs::RW1"); } string RW1Factory::name() const { return "bugs::RW1"; } } } JAGS-4.3.2/src/modules/bugs/samplers/BinomSlicer.cc0000664000175000017500000000453614224052514016740 00000000000000#include #include #include #include #include #include "BinomSlicer.h" #include using std::vector; using std::string; using std::log; namespace jags { namespace bugs { BinomSlicer::BinomSlicer(SingletonGraphView const *gv, unsigned int chain, double width, long maxwidth) : Slicer(width, maxwidth), _gv(gv), _chain(chain) { gv->checkFinite(chain); } bool BinomSlicer::canSample(StochasticNode *node, Graph const &graph) { if (node->isDiscreteValued() || node->length() != 1) return false; if (node->df() == 0) return false; SingletonGraphView gv(node, graph); vector const &schild = gv.stochasticChildren(); for (unsigned int i = 0; i < schild.size(); ++i) { if (schild[i]->distribution()->name() != "dbin") { return false; } if (!schild[i]->parents()[1]->isFixed()) { return false; } } return true; } double BinomSlicer::value() const { return _gv->node()->value(_chain)[0]; } void BinomSlicer::setValue(double value) { _gv->setValue(&value, 1, _chain); } void BinomSlicer::getLimits(double *lower, double *upper) const { _gv->node()->support(lower, upper, 1, _chain); } void BinomSlicer::update(RNG *rng) { if (!updateStep(rng)) { switch(state()) { case SLICER_POSINF: throwNodeError(_gv->node(), "Slicer stuck at value with infinite density"); break; case SLICER_NEGINF: throwNodeError(_gv->node(), "Current value is inconsistent with data"); break; case SLICER_OK: break; } } } double BinomSlicer::logDensity() const { //Override expensive log likelihood calculations for binomial double loglik = _gv->logPrior(_chain); vector const &schild = _gv->stochasticChildren(); for (unsigned int i = 0; i < schild.size(); ++i) { double y = schild[i]->value(_chain)[0]; double p = schild[i]->parents()[0]->value(_chain)[0]; double n = schild[i]->parents()[1]->value(_chain)[0]; if (y==0) { //FIXME: Need C++11 for log1p loglik += n*log(1-p); } else if (y==n) { loglik += y*log(p); } else { loglik += y*log(p)+(n-y)*log(1-p); } } return loglik; } } } JAGS-4.3.2/src/modules/bugs/samplers/BinomSliceFactory.cc0000664000175000017500000000170114224052514020075 00000000000000#include #include "BinomSlicer.h" #include "BinomSliceFactory.h" #include #include #include #include using std::vector; using std::string; namespace jags { namespace bugs { bool BinomSliceFactory::canSample(StochasticNode * node, Graph const &graph) const { return BinomSlicer::canSample(node, graph); } Sampler *BinomSliceFactory::makeSampler(StochasticNode *snode, Graph const &graph) const { unsigned int nchain = snode->nchain(); vector methods(nchain, 0); SingletonGraphView *gv = new SingletonGraphView(snode, graph); for (unsigned int ch = 0; ch < nchain; ++ch) { methods[ch] = new BinomSlicer(gv, ch); } return new MutableSampler(gv, methods, "bugs::BinomSlicer"); } string BinomSliceFactory::name() const { return "bugs::BinomSlice"; } } } JAGS-4.3.2/src/modules/bugs/matrix/0000755000175000017500000000000014400711325013745 500000000000000JAGS-4.3.2/src/modules/bugs/matrix/Makefile.am0000664000175000017500000000025114224052514015723 00000000000000noinst_LTLIBRARIES = libbugsmatrix.la libbugsmatrix_la_CPPFLAGS = -I$(top_srcdir)/src/include libbugsmatrix_la_SOURCES = matrix.cc noinst_HEADERS = lapack.h matrix.h JAGS-4.3.2/src/modules/bugs/matrix/lapack.h0000664000175000017500000000772314224052514015306 00000000000000#ifndef JAGS_LAPACK_H_ #define JAGS_LAPACK_H_ #define F77_DGEEV F77_FUNC(dgeev,DGEEV) #define F77_DSYEV F77_FUNC(dsyev,DSYEV) #define F77_DGESV F77_FUNC(dgesv,DGESV) #define F77_DSYSV F77_FUNC(dsysv,DSYSV) #define F77_DPOSV F77_FUNC(dposv,DPOSV) /* #define F77_DGEQP3 F77_FUNC(dgeqp3,DGEQP3) */ #define F77_DPOTRF F77_FUNC(dpotrf,DPOTRF) #define F77_DLANGE F77_FUNC(dlange,DLANGE) #define F77_DGEMM F77_FUNC(dgemm,DGEMM) #define F77_DGEMV F77_FUNC(dgemv,DGEMV) #define F77_DCOPY F77_FUNC(dcopy,DCOPY) #define F77_DSCAL F77_FUNC(dscal,DSCAL) #define F77_DAXPY F77_FUNC(daxpy,DAXPY) #define F77_DSYR F77_FUNC(dsyr,DSYR) #define F77_DSYMM F77_FUNC(dsymm, DSYMM) #define F77_DPOTRI F77_FUNC(dpotri, DPOTRI) #define F77_DDOT F77_FUNC(ddot, DDOT) #define F77_DTRTRI F77_FUNC(dtrtri, DTRTRI) #define F77_DTRMM F77_FUNC(dtrmm, DTRMM) #define F77_DSYRK F77_FUNC(dsyrk, DSYRK) extern "C" { /* void F77_DGEEV (const char* jobvl, const char* jobvr, const int* n, double* a, const int* lda, double* wr, double* wi, double* vl, const int* ldvl, double* vr, const int* ldvr, double* work, const int* lwork, int* info); */ void F77_DSYEV (const char* jobz, const char* uplo, const int* n, double* a, const int* lda, double* w, double* work, const int* lwork, int* info); void F77_DGESV (const int* n, const int* nrhs, double* a, const int* lda, int* ipiv, double* b, const int* ldb, int* info); void F77_DSYSV (const char *uplo, const int *n, const int *nrhs, double *a, const int *lda, int *ipiv, double *b, const int *ldb, double *work, const int *lwork, int *info); void F77_DPOSV (const char* uplo, const int *n, const int *nrhs, double* a, const int *lda, double* b, const int* ldb, int* info); void F77_DPOTRF (const char *uplo, const int *n, double *a, const int *lda, const int *info); void F77_DPOTRI (const char *uplo, const int *n, double *a, const int *lda, const int *info); double F77_DLANGE (const char *norm, const int *m, const int *n, const double *a, const int *lda, double *work); /* BLAS routines */ void F77_DSYMM (const char *side, const char *uplo, const int *m, const int *n, const double *alpha, const double *a, const int *lda, const double *b, const int *ldb, const double *beta, double *c, const int *ldc); void F77_DGEMV (const char *trans, const int *m, const int *n, const double *alpha, const double *a, const int *lda, const double *x, const int *incx, const double *beta, double *y, const int *incy); void F77_DGEMM (const char* transa, const char* transb, const int* m, const int* n , const int* k, const double* alpha, const double* A, const int* lda, const double* B, const int* ldb, const double* beta, double* C, const int* ldc); void F77_DSYR (const char *uplo, const int *n, const double *alpha, const double *x, const int *incx, double *a, const int *lda); void F77_DAXPY (const int *n, const double *alpha, const double *dx, const int *incx, double *dy, const int *incy); void F77_DCOPY (const int* n, double const *X, const int* incx, double *Y, const int *incy); void F77_DSCAL (const int* n, double const *alpha, double *X, const int *incx); double F77_DDOT (const int* n, double const *X, const int *incx, double const *Y, const int *incy); void F77_DTRTRI (const char *uplo, const char *diag, const int *n, double *a, const int *lda, const int *info); void F77_DTRMM(const char *side, const char *uplo, const char *transa, const char *diag, const int *m, const int *n, const double *alpha, const double *a, const int *lda, double *b, const int *ldb); void F77_DSYRK(const char *uplo, const char *trans, const int *n, const int *k, const double *alpha, const double *a, const int *lda, const double *beta, double *c, const int *ldc); } #endif JAGS-4.3.2/src/modules/bugs/matrix/matrix.h0000664000175000017500000000342414224052514015351 00000000000000#ifndef MATRIX_H_ #define MATRIX_H_ namespace jags { namespace bugs { /** * Inverts a general square matrix using the LAPACK routine DGESV * * @param X Pointer to an array of length n squared, which will contain * the inverse on exit. * * @param A pointer to array containing the values of the matrix * * @param n number or rows or columns in the matrix */ bool inverse (double *X, double const *A, int n); /** * Inverts a symmetrix positive definite matrix by Cholesky * decomposition using the LAPACK routines DPOTRF and DPOTRI. * * @param X Pointer to an array of length n squared, which will contain * the inverse on exit. * * @param A pointer to array containing the values of the matrix. Only * the lower triangle of the matrix (in column-major order) is used. * * @param n number or rows or columns in the matrix */ bool inverse_spd (double *X, double const *A, int n); /** * Checks whether a symmetric matrix is positive definite * * @param A pointer to array containing the values of the matrix. Only * the lower triangle (in column-major order) is used. * * @param n number or rows or columns in the matrix */ bool check_symmetric_ispd(double const *a, int n); /** * Log determinant of a symmetric positive definite matrix * * @param A pointer to array containing the values of the matrix. Only * the lower triangle (in column-major order) is used. * * @param n number or rows or columns in the matrix */ double logdet(double const *A, int n); /** * Checks the symmetry of a square matrix * * @param A pointer to array containing the values of the matrix * * @param n number or rows or columns in the matrix * * @param tol tolerance for symmetry test */ bool check_symmetry(double const *X, unsigned int n, double tol=1e-7); }} #endif /* MATRIX_H_ */ JAGS-4.3.2/src/modules/bugs/matrix/Makefile.in0000644000175000017500000005030114400675236015743 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/bugs/matrix ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libbugsmatrix_la_LIBADD = am_libbugsmatrix_la_OBJECTS = libbugsmatrix_la-matrix.lo libbugsmatrix_la_OBJECTS = $(am_libbugsmatrix_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libbugsmatrix_la-matrix.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libbugsmatrix_la_SOURCES) DIST_SOURCES = $(libbugsmatrix_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libbugsmatrix.la libbugsmatrix_la_CPPFLAGS = -I$(top_srcdir)/src/include libbugsmatrix_la_SOURCES = matrix.cc noinst_HEADERS = lapack.h matrix.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/bugs/matrix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/bugs/matrix/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libbugsmatrix.la: $(libbugsmatrix_la_OBJECTS) $(libbugsmatrix_la_DEPENDENCIES) $(EXTRA_libbugsmatrix_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libbugsmatrix_la_OBJECTS) $(libbugsmatrix_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libbugsmatrix_la-matrix.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libbugsmatrix_la-matrix.lo: matrix.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libbugsmatrix_la-matrix.lo -MD -MP -MF $(DEPDIR)/libbugsmatrix_la-matrix.Tpo -c -o libbugsmatrix_la-matrix.lo `test -f 'matrix.cc' || echo '$(srcdir)/'`matrix.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libbugsmatrix_la-matrix.Tpo $(DEPDIR)/libbugsmatrix_la-matrix.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='matrix.cc' object='libbugsmatrix_la-matrix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libbugsmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libbugsmatrix_la-matrix.lo `test -f 'matrix.cc' || echo '$(srcdir)/'`matrix.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libbugsmatrix_la-matrix.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libbugsmatrix_la-matrix.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/bugs/matrix/matrix.cc0000664000175000017500000001147214224052514015511 00000000000000#include #include #include #include #include #include #include "lapack.h" #include "matrix.h" using std::log; using std::fabs; using std::copy; using std::vector; namespace jags { namespace bugs { double logdet(double const *a, int n) { // Log determinant of n x n symmetric positive matrix a */ int N = n*n; double *acopy = new double[N]; for (int i = 0; i < N; i++) { acopy[i] = a[i]; } double *w = new double[n]; int lwork = -1; double worktest = 0; int info = 0; F77_DSYEV("N","U", &n, acopy, &n, w, &worktest, &lwork, &info); if (info != 0) { delete [] acopy; delete [] w; throwRuntimeError("unable to calculate workspace size for dsyev"); } lwork = static_cast(worktest); double *work = new double[lwork]; F77_DSYEV("N","U", &n, acopy, &n, w, work, &lwork, &info); delete [] acopy; delete [] work; if (info != 0) { delete [] w; throwRuntimeError("unable to calculate eigenvalues in dsyev"); } if (w[0] <= 0) { throwRuntimeError("Non positive definite matrix in call to logdet"); } double logdet = 0; for (int i = 0; i < n; i++) { logdet += log(w[i]); } delete [] w; return logdet; } bool check_symmetric_ispd(double const *a, int n) { /* Checks that an n x n symmetric matrix is positive definite. The code is essentially the same as logdet, but we return false if the smallest eigenvalue is less than zero. */ int N = n*n; vector acopy(N); copy(a, a+N, acopy.begin()); //Workspace query to get optimal workspace vector w(n); int lwork = -1; double worktest = 0; int info = 0; F77_DSYEV("N","U", &n, &acopy[0], &n, &w[0], &worktest, &lwork, &info); if (info != 0) { throwRuntimeError("unable to calculate workspace size for dsyev"); } lwork = static_cast(worktest); vector work(lwork); //Calculate eigenvalues F77_DSYEV("N","U", &n, &acopy[0], &n, &w[0], &work[0], &lwork, &info); if (info != 0) { throwRuntimeError("unable to calculate eigenvalues in dsyev"); } return w[0] > 0; } /* double det(double const *a, int n) { // Determinant of n x n matrix a via the QR decomposition int N = n*n; double *acopy = new double[N]; for (int i = 0; i < N; i++) { acopy[i] = a[i]; } int *jpvt = new int[n]; for (int i = 0; i < n; i++) { jpvt[i] = 0; } double *tau = new double[N]; int lwork = -1; double worktest = 0; int info = 0; F77_DGEQRF(&n, &n, acopy, &n, jpvt, tau, &worktest, &lwork, &info); if (info != 0) { delete [] acopy; delete [] jpvt; delete [] tau; throw runtime_error("unable to calculate workspace size for dgeqrf"); } lwork = static_cast(worktest); double *work = new double[lwork]; F77_DGEQRF(&n, &n, acopy, &n, jpvt, tau, work, &lwork, &info); if (info != 0) { delete [] acopy; delete [] jpvt; delete [] tau; throw runtime_error("unable to calculate eigenvalues in dgeqrf"); } double det = (n % 2 == 1) ? 1.0 : -1.0; for (int i = 0; i < n; i++) { det *= acopy[i + n*i]; } delete [] acopy; delete [] jpvt; delete [] tau; return det; } */ bool inverse_spd (double *X, double const *A, int n) { /* invert n x n symmetric positive definite matrix A. Put result in X*/ int N = n*n; double *Acopy = new double[N]; for (int i = 0; i < N; i++) { Acopy[i] = A[i]; } int info = 0; F77_DPOTRF ("L", &n, Acopy, &n, &info); if (info < 0) { throwLogicError("Illegal argument in inverse_spd"); } else if (info > 0) { delete [] Acopy; throwRuntimeError("Cannot invert matrix: not positive definite"); } F77_DPOTRI ("L", &n, Acopy, &n, &info); for (int i = 0; i < n; ++i) { X[i*n + i] = Acopy[i*n + i]; for (int j = 0; j < i; ++j) { X[i*n + j] = X[j*n + i] = Acopy[j*n + i]; } } delete [] Acopy; if (info != 0) { throwRuntimeError("Unable to invert symmetric positive definite matrix"); } return true; } bool inverse (double *X, double const *A, int n) { /* invert n x n matrix A. Put result in X */ int N = n*n; double *Acopy = new double[N]; for (int i = 0; i < N; i++) { Acopy[i] = A[i]; X[i] = 0; } for (int i = 0; i < n; i++) { X[i*n + i] = 1; } int info = 0; int *ipiv = new int[n]; F77_DGESV (&n, &n, Acopy, &n, ipiv, X, &n, &info); delete [] ipiv; delete [] Acopy; if (info != 0) { return false; } return true; } bool check_symmetry(double const *x, unsigned int n, double tol) { for (unsigned int i = 1; i < n; ++i) { double const *xp = x + i; double const *yp = x + n*i; for (unsigned int j = 0; j < i; ++j) { if (fabs(*xp - *yp) > tol) return false; xp += n; yp++; } } return true; } }} JAGS-4.3.2/src/modules/msm/0000755000175000017500000000000014400711325012275 500000000000000JAGS-4.3.2/src/modules/msm/Makefile.am0000664000175000017500000000103214224052371014252 00000000000000SUBDIRS = distributions functions matrix jagsmod_LTLIBRARIES = msm.la msm_la_SOURCES = msm.cc msm_la_CPPFLAGS = -I$(top_srcdir)/src/include msm_la_LIBADD = distributions/msmdist.la \ functions/msmfunc.la \ matrix/msmmatrix.la \ $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la \ @LAPACK_LIBS@ @BLAS_LIBS@ msm_la_LDFLAGS = -module -avoid-version if WINDOWS msm_la_LDFLAGS += -no-undefined endif JAGS-4.3.2/src/modules/msm/Makefile.in0000644000175000017500000006627314400675236014312 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WINDOWS_TRUE@am__append_1 = -no-undefined subdir = src/modules/msm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(jagsmoddir)" LTLIBRARIES = $(jagsmod_LTLIBRARIES) msm_la_DEPENDENCIES = distributions/msmdist.la functions/msmfunc.la \ matrix/msmmatrix.la $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la am_msm_la_OBJECTS = msm_la-msm.lo msm_la_OBJECTS = $(am_msm_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = msm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(msm_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/msm_la-msm.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(msm_la_SOURCES) DIST_SOURCES = $(msm_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = distributions functions matrix jagsmod_LTLIBRARIES = msm.la msm_la_SOURCES = msm.cc msm_la_CPPFLAGS = -I$(top_srcdir)/src/include msm_la_LIBADD = distributions/msmdist.la \ functions/msmfunc.la \ matrix/msmmatrix.la \ $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la \ @LAPACK_LIBS@ @BLAS_LIBS@ msm_la_LDFLAGS = -module -avoid-version $(am__append_1) all: all-recursive .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/msm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/msm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-jagsmodLTLIBRARIES: $(jagsmod_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(jagsmoddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(jagsmoddir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(jagsmoddir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(jagsmoddir)"; \ } uninstall-jagsmodLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(jagsmoddir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(jagsmoddir)/$$f"; \ done clean-jagsmodLTLIBRARIES: -test -z "$(jagsmod_LTLIBRARIES)" || rm -f $(jagsmod_LTLIBRARIES) @list='$(jagsmod_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } msm.la: $(msm_la_OBJECTS) $(msm_la_DEPENDENCIES) $(EXTRA_msm_la_DEPENDENCIES) $(AM_V_CXXLD)$(msm_la_LINK) -rpath $(jagsmoddir) $(msm_la_OBJECTS) $(msm_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msm_la-msm.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< msm_la-msm.lo: msm.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(msm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT msm_la-msm.lo -MD -MP -MF $(DEPDIR)/msm_la-msm.Tpo -c -o msm_la-msm.lo `test -f 'msm.cc' || echo '$(srcdir)/'`msm.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/msm_la-msm.Tpo $(DEPDIR)/msm_la-msm.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='msm.cc' object='msm_la-msm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(msm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o msm_la-msm.lo `test -f 'msm.cc' || echo '$(srcdir)/'`msm.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(jagsmoddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-jagsmodLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/msm_la-msm.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-jagsmodLTLIBRARIES install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/msm_la-msm.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-jagsmodLTLIBRARIES .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic \ clean-jagsmodLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-jagsmodLTLIBRARIES install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-jagsmodLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/msm/msm.cc0000664000175000017500000000124414224052515013326 00000000000000#include #include #include using std::vector; namespace jags { namespace msm { class MSMModule : public Module { public: MSMModule(); ~MSMModule(); }; MSMModule::MSMModule() : Module("msm") { insert(new DMState); insert(new Mexp); } MSMModule::~MSMModule() { vector const &dvec = distributions(); for (unsigned int i = 0; i < dvec.size(); ++i) { delete dvec[i]; } vector const &fvec = functions(); for (unsigned int i = 0; i < fvec.size(); ++i) { delete fvec[i]; } } }} jags::msm::MSMModule _msm_module; JAGS-4.3.2/src/modules/msm/distributions/0000755000175000017500000000000014400711325015177 500000000000000JAGS-4.3.2/src/modules/msm/distributions/Makefile.am0000664000175000017500000000036514224052371017164 00000000000000noinst_LTLIBRARIES = msmdist.la msmdist_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/msm/matrix msmdist_la_LDFLAGS = -no-undefined -module -avoid-version msmdist_la_SOURCES = DMState.cc noinst_HEADERS = DMState.h JAGS-4.3.2/src/modules/msm/distributions/DMState.h0000664000175000017500000000355714224052515016610 00000000000000#ifndef DMSTATE_H_ #define DMSTATE_H_ #include namespace jags { namespace msm { /** * Distribution of x in multi-state homogeneous Markov model at time t * when state at time 0 was xold and transition intensity matrix is * Lambda *
 
 * x ~ dmstate(xold, dt, Lambda[,]) 
 * 
* @short Interval censored transitions in a multistate Markov model */ class DMState : public ArrayDist { public: DMState(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector > const &dims) const; bool isSupportFixed(std::vector const &fixmask) const; bool checkParameterDim(std::vector > const &dims) const; bool checkParameterDiscrete(std::vector const &mask) const; bool checkParameterValue(std::vector const &par, std::vector > const &dims) const; std::vector dim(std::vector > const &dims) const; bool isDiscreteValued(std::vector const &mask) const; }; }} #endif /* DMSTATE_H_ */ JAGS-4.3.2/src/modules/msm/distributions/Makefile.in0000644000175000017500000005051114400675236017200 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/msm/distributions ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) msmdist_la_LIBADD = am_msmdist_la_OBJECTS = msmdist_la-DMState.lo msmdist_la_OBJECTS = $(am_msmdist_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = msmdist_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(msmdist_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/msmdist_la-DMState.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(msmdist_la_SOURCES) DIST_SOURCES = $(msmdist_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = msmdist.la msmdist_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/msm/matrix msmdist_la_LDFLAGS = -no-undefined -module -avoid-version msmdist_la_SOURCES = DMState.cc noinst_HEADERS = DMState.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/msm/distributions/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/msm/distributions/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } msmdist.la: $(msmdist_la_OBJECTS) $(msmdist_la_DEPENDENCIES) $(EXTRA_msmdist_la_DEPENDENCIES) $(AM_V_CXXLD)$(msmdist_la_LINK) $(msmdist_la_OBJECTS) $(msmdist_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msmdist_la-DMState.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< msmdist_la-DMState.lo: DMState.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(msmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT msmdist_la-DMState.lo -MD -MP -MF $(DEPDIR)/msmdist_la-DMState.Tpo -c -o msmdist_la-DMState.lo `test -f 'DMState.cc' || echo '$(srcdir)/'`DMState.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/msmdist_la-DMState.Tpo $(DEPDIR)/msmdist_la-DMState.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DMState.cc' object='msmdist_la-DMState.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(msmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o msmdist_la-DMState.lo `test -f 'DMState.cc' || echo '$(srcdir)/'`DMState.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/msmdist_la-DMState.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/msmdist_la-DMState.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/msm/distributions/DMState.cc0000664000175000017500000001114514224052515016736 00000000000000#include #include "DMState.h" #include #include #include "matexp.h" #include #include #include #include #include using std::min; using std::max; using std::vector; #define INITIAL(par) ((int) *par[0]) #define TIME(par) (*par[1]) #define NSTATE(dims) (dims[2][0]) #define INTENSITY(par) (par[2]) namespace jags { namespace msm { DMState::DMState() : ArrayDist ("dmstate", 3) {} bool DMState::checkParameterDim(vector > const &dims) const { return isScalar(dims[0]) && isScalar(dims[1]) && isSquareMatrix(dims[2]); } bool DMState::checkParameterDiscrete(vector const &mask) const { return mask[0]; //Initial state must be discrete } bool DMState::checkParameterValue(vector const &par, vector > const &dims) const { int initial = static_cast(INITIAL(par)); double time = TIME(par); int nstates = NSTATE(dims); double const *intensity = INTENSITY(par); // Number of states must be greater than 1 if (nstates <= 1) return false; // Current state must be in range if (initial < 1 || initial > nstates) return false; // Time must be positive if (time < 0) return false; // Intensity parameter must be a real intensity matrix for (int i = 0; i < nstates; ++i) { double sum = 0.0; for (int j = 0; j < nstates; ++j) { double rate = intensity[i + nstates * j]; // Diagonal elements are non-positive. Others are non-negative if (i == j) { if (rate > 0.0) return false; } else { if (rate < 0.0) return false; } sum += rate; } // Rows of intensity matrix sum to 0 if (fabs(sum) > 1.0E-6) { // fixme: we should relate the tolerance to the machine precision return false; } } return true; } double DMState::logDensity(double const *y, unsigned int length, PDFType type, vector const &par, vector > const &dims, double const *lower, double const *upper) const { int initial = INITIAL(par); double time = TIME(par); int nstate = NSTATE(dims); double const *intensity = INTENSITY(par); int x = static_cast(*y); if (x < 1 || x > nstate) { return JAGS_NEGINF; } else { /* FIXME: There is a big problem here with hidden Markov models. If the node is not observed, then we will need to evaluate the log-likelihood at different values of x, but with the same par. This is hugely inefficient at the moment because we calculate - and THROW AWAY - the transition probability matrix each time. SOLUTION: Maybe a cache? */ double *P = new double[nstate*nstate]; //MatrixExp(P, intensity, nstate, time); MatrixExpPade(P, intensity, nstate, time); double lik = P[(initial - 1) + nstate * (x - 1)]; delete [] P; if (lik <= 0) { /* Allow for some numerical imprecision that may create small negative probabilities */ return JAGS_NEGINF; } else { return log(lik); } } } static double q(double p, int initial, double time, unsigned int nstate, double const *intensity) { double *P = new double[nstate*nstate]; MatrixExpPade(P, intensity, nstate, time); /* Categorize */ double sump = 0.0; for (unsigned int j = 1; j < nstate; j++) { sump += P[(initial - 1) + nstate * (j - 1)]; if (p <= sump) { delete [] P; return j; } } delete [] P; return nstate; } void DMState::randomSample(double *x, unsigned int length, vector const &par, vector > const &dims, double const *lower, double const *upper, RNG *rng) const { *x = q(runif(0, 1, rng), INITIAL(par), TIME(par), NSTATE(dims), INTENSITY(par)); } bool DMState::isSupportFixed(vector const &fixmask) const { return true; } void DMState::support(double *lower, double *upper, unsigned int length, vector const &par, vector > const &dims) const { *lower = 1; *upper = NSTATE(dims); } void DMState::typicalValue(double *x, unsigned int length, vector const &par, vector > const &dims, double const *lower, double const *upper) const { *x = q(0.5, INITIAL(par), TIME(par), NSTATE(dims), INTENSITY(par)); } vector DMState::dim(vector > const &dims) const { return vector(1, 1); } bool DMState::isDiscreteValued(vector const &mask) const { return true; } }} JAGS-4.3.2/src/modules/msm/functions/0000755000175000017500000000000014400711325014305 500000000000000JAGS-4.3.2/src/modules/msm/functions/Makefile.am0000664000175000017500000000035714224052371016273 00000000000000noinst_LTLIBRARIES = msmfunc.la msmfunc_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/msm/matrix msmfunc_la_LDFLAGS = -no-undefined -module -avoid-version msmfunc_la_SOURCES = Mexp.cc noinst_HEADERS = Mexp.h JAGS-4.3.2/src/modules/msm/functions/Mexp.h0000664000175000017500000000106114224052515015312 00000000000000#ifndef MEXP_H_ #define MEXP_H_ #include namespace jags { namespace msm { class Mexp : public ArrayFunction { public: Mexp(); void evaluate (double *value, std::vector const &args, std::vector > const &dims) const; std::vector dim(std::vector > const &dims, std::vector const &values) const; bool checkParameterDim(std::vector > const &dims) const; }; }} #endif /* MEXP_H_ */ JAGS-4.3.2/src/modules/msm/functions/Makefile.in0000644000175000017500000005037614400675236016317 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/msm/functions ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) msmfunc_la_LIBADD = am_msmfunc_la_OBJECTS = msmfunc_la-Mexp.lo msmfunc_la_OBJECTS = $(am_msmfunc_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = msmfunc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(msmfunc_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/msmfunc_la-Mexp.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(msmfunc_la_SOURCES) DIST_SOURCES = $(msmfunc_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = msmfunc.la msmfunc_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/msm/matrix msmfunc_la_LDFLAGS = -no-undefined -module -avoid-version msmfunc_la_SOURCES = Mexp.cc noinst_HEADERS = Mexp.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/msm/functions/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/msm/functions/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } msmfunc.la: $(msmfunc_la_OBJECTS) $(msmfunc_la_DEPENDENCIES) $(EXTRA_msmfunc_la_DEPENDENCIES) $(AM_V_CXXLD)$(msmfunc_la_LINK) $(msmfunc_la_OBJECTS) $(msmfunc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msmfunc_la-Mexp.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< msmfunc_la-Mexp.lo: Mexp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(msmfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT msmfunc_la-Mexp.lo -MD -MP -MF $(DEPDIR)/msmfunc_la-Mexp.Tpo -c -o msmfunc_la-Mexp.lo `test -f 'Mexp.cc' || echo '$(srcdir)/'`Mexp.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/msmfunc_la-Mexp.Tpo $(DEPDIR)/msmfunc_la-Mexp.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Mexp.cc' object='msmfunc_la-Mexp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(msmfunc_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o msmfunc_la-Mexp.lo `test -f 'Mexp.cc' || echo '$(srcdir)/'`Mexp.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/msmfunc_la-Mexp.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/msmfunc_la-Mexp.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/msm/functions/Mexp.cc0000664000175000017500000000121714224052515015453 00000000000000#include #include "Mexp.h" #include "matexp.h" #include using std::vector; namespace jags { namespace msm { Mexp::Mexp() : ArrayFunction("mexp",1) { } void Mexp::evaluate (double *value, vector const &args, vector > const &dims) const { MatrixExpPade(value, args[0], dims[0][0], 1); } vector Mexp::dim (vector > const &dims, vector const &values) const { return dims[0]; } bool Mexp::checkParameterDim (vector > const &dims) const { return isSquareMatrix(dims[0]); } }} JAGS-4.3.2/src/modules/msm/matrix/0000755000175000017500000000000014400711326013602 500000000000000JAGS-4.3.2/src/modules/msm/matrix/Makefile.am0000664000175000017500000000033414224052371015562 00000000000000noinst_LTLIBRARIES = msmmatrix.la msmmatrix_la_CPPFLAGS = -I$(top_srcdir)/src/include msmmatrix_la_LDFLAGS = -no-undefined -module -avoid-version msmmatrix_la_SOURCES = matexp.cc noinst_HEADERS = matexp.h lapack.h JAGS-4.3.2/src/modules/msm/matrix/matexp.h0000664000175000017500000000035714224052371015202 00000000000000#ifndef MATEXP_H_ #define MATEXP_H_ namespace jags { namespace msm { void MatrixExp(double *expmat, double const *mat, int n, double t); void MatrixExpPade(double *expmat, double const *mat, int n, double t); }} #endif /* MATEXP_H_ */ JAGS-4.3.2/src/modules/msm/matrix/lapack.h0000664000175000017500000000210214224052371015125 00000000000000#ifndef MSM_LAPACK_H_ #define MSM_LAPACK_H_ #define F77_DCOPY F77_FUNC(dcopy,DCOPY) #define F77_DGESV F77_FUNC(dgesv,DGESV) #define F77_DGEMM F77_FUNC(dgemm,DGEMM) #define F77_DSCAL F77_FUNC(dscal,DSCAL) #define F77_DLANGE F77_FUNC(dlange,DLANGE) extern "C" { /* LAPACK routines */ void F77_DGESV (const int* n, const int* nrhs, double* a, const int* lda, int* ipiv, double* b, const int* ldb, int* info); double F77_DLANGE (const char *norm, const int *m, const int *n, const double *a, const int *lda, double *work); /* BLAS routines */ void F77_DGEMM (const char* transa, const char* transb, const int* m, const int* n , const int* k, const double* alpha, const double* A, const int* lda, const double* B, const int* ldb, const double* beta, double* C, const int* ldc); void F77_DCOPY (const int* n, double const *X, const int* incx, double *Y, const int *incy); void F77_DSCAL (const int* n, double const *alpha, double *X, const int *incx); } #endif /* MSM_LAPACK_H_ */ JAGS-4.3.2/src/modules/msm/matrix/Makefile.in0000644000175000017500000005050414400675236015604 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/msm/matrix ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) msmmatrix_la_LIBADD = am_msmmatrix_la_OBJECTS = msmmatrix_la-matexp.lo msmmatrix_la_OBJECTS = $(am_msmmatrix_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = msmmatrix_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(msmmatrix_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/msmmatrix_la-matexp.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(msmmatrix_la_SOURCES) DIST_SOURCES = $(msmmatrix_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = msmmatrix.la msmmatrix_la_CPPFLAGS = -I$(top_srcdir)/src/include msmmatrix_la_LDFLAGS = -no-undefined -module -avoid-version msmmatrix_la_SOURCES = matexp.cc noinst_HEADERS = matexp.h lapack.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/msm/matrix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/msm/matrix/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } msmmatrix.la: $(msmmatrix_la_OBJECTS) $(msmmatrix_la_DEPENDENCIES) $(EXTRA_msmmatrix_la_DEPENDENCIES) $(AM_V_CXXLD)$(msmmatrix_la_LINK) $(msmmatrix_la_OBJECTS) $(msmmatrix_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msmmatrix_la-matexp.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< msmmatrix_la-matexp.lo: matexp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(msmmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT msmmatrix_la-matexp.lo -MD -MP -MF $(DEPDIR)/msmmatrix_la-matexp.Tpo -c -o msmmatrix_la-matexp.lo `test -f 'matexp.cc' || echo '$(srcdir)/'`matexp.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/msmmatrix_la-matexp.Tpo $(DEPDIR)/msmmatrix_la-matexp.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='matexp.cc' object='msmmatrix_la-matexp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(msmmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o msmmatrix_la-matexp.lo `test -f 'matexp.cc' || echo '$(srcdir)/'`matexp.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/msmmatrix_la-matexp.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/msmmatrix_la-matexp.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/msm/matrix/matexp.cc0000664000175000017500000001177314224052515015344 00000000000000/* MatrixExp Function for calculating exponential of real square matrix. Based on pijt.c by Chris Jackson Copyright (C) 2001 Changes: * Matrices are assumed to be filled by columns, not rows * Use LAPACK routines instead of EISPACK * const correctness * Ported to C++ with corresponding minor syntactic changes */ #include #include #include #include #include "lapack.h" #include "matexp.h" using std::pow; using std::exp; using std::log; namespace jags { namespace msm { static int c_1 = 1; /* index to treat a vector as a matrix, assuming matrix is filled by columns */ static inline int MI(int i, int j, int ncols) {return j*ncols + i;} static void MultMat(double *AB, double const *A, double const *B, int n) { /* Multiply two square matrices together */ for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { AB[MI(i, j, n)] = 0; for (int k = 0; k < n; ++k) AB[MI(i, j, n)] += A[MI(i, k, n)] * B[MI(k, j, n)]; } } } static void FormIdentity(double *A, int n) { /* Set A to be an n x n identiy matrix */ for (int i = 0; i < (n*n); ++i) { A[i] = 0; } for (int i = 0; i < n; ++i) { A[MI(i, i, n)] = 1; } } static void solve (double *X, double const *A, double const *B, int n) { /* Solve AX = B, where all matrices are square */ int N = n*n; double *Acopy = new double[N]; F77_DCOPY(&N, A, &c_1, Acopy, &c_1); F77_DCOPY(&N, B, &c_1, X, &c_1); /* for (int i = 0; i < N; i++) { Acopy[i] = A[i]; X[i] = B[i]; } */ int *ipiv = new int[n]; int info = 0; F77_DGESV (&n, &n, Acopy, &n, ipiv, X, &n, &info); if (info != 0) { throwRuntimeError("Unable to solve linear equations"); } delete [] Acopy; delete [] ipiv; } static void MatrixExpSeries(double *expmat, double const *A, int n, double t) { /* Calculate a matrix exponential using a power series approximation */ /* Adapted from mexp in Jim Lindsey's rmutil library */ const int order = 20; /* number of terms in series */ const int underflow_correct = 3; double *At = new double[n*n]; double *Apower = new double[n*n]; double *Temp = new double[n*n]; for (int i = 0; i < (n*n); ++i) { At[i] = A[i] * t / pow(2.0, underflow_correct); } FormIdentity(expmat, n); FormIdentity(Apower, n); for (int i = 1; i <= order; i++) { MultMat(Temp, At, Apower, n); for (int j = 0; j < (n*n); ++j){ Apower[j] = Temp[j] / i; expmat[j] += Apower[j]; } } for (int i = 0; i < underflow_correct; ++i){ MultMat(Temp, expmat, expmat, n); for (int j = 0; j < (n*n); ++j) expmat[j] = Temp[j]; } delete [] At; delete [] Apower; delete [] Temp; } void MatrixExp(double *expmat, double const *mat, int n, double t) { MatrixExpSeries(expmat, mat, n, t); } static void padeseries (double *Sum, double const *A, int n, int order, double scale, double *Temp) { double zero = 0; int N = n*n; FormIdentity(Sum, n); for (int j = order; j >= 1; --j) { double s = (order-j+1) / (j*(2*order-j+1) * scale); F77_DGEMM ("n","n", &n, &n, &n, &s, Sum, &n, A, &n, &zero, Temp, &n); F77_DCOPY(&N, Temp, &c_1, Sum, &c_1); /* MultMat(Temp, Sum, A, n); for (int i = 0; i < N; ++i) { Sum[i] = Temp[i] * s; } */ for (int r = 0; r < n; ++r) { Sum[r*n+r] += 1; } } } void MatrixExpPade(double *ExpAt, double const *A, int n, double t) { /* Calculate exp(A*t) by diagonal Pade approximation with scaling and squaring */ int order = 8; int N = n*n; double *workspace = new double[4*N]; double * const Temp = workspace; double * const At = workspace + N; double * const Num = workspace + 2*N; double * const Denom = workspace + 3*N; // Take a copy of the matrix and scale it by t F77_DCOPY(&N, A, &c_1, At, &c_1); F77_DSCAL(&N, &t, At, &c_1); /* for (int i = 0; i < N; ++i) { At[i] = A[i] * t; } */ // Scale the matrix by a power of 2 double l1 = F77_DLANGE("1", &n, &n, At, &n, 0); //L-1 norm double linf = F77_DLANGE("i", &n, &n, At, &n, Temp); //L-Infinity norm /* sqrt(l1 * linf) is an upper bound on the L2 norm of the matrix At (i.e the largest eigenvalue). We want to take the log, to base 2 of this to get the smallest K, st ||At/2^K|| <= 1. */ double K = (log(l1) + log(linf))/log(4.0); int npower = static_cast(K) + 1; if (npower < 0) { npower = 0; } double scale = pow(2.0, npower); // Calculate exp(A/scale) by Pade series padeseries (Num, At, n, order, scale, Temp); for (int i = 0; i < N; ++i) { At[i] = -At[i]; } padeseries (Denom, At, n, order, scale, Temp); solve(ExpAt, Denom, Num, n); // Now repeatedly square the result for (int i = 0; i < npower; ++i) { for (int j = 0; j < N; ++j) { Temp[j] = ExpAt[j]; } MultMat(ExpAt, Temp, Temp, n); } delete [] workspace; } }} JAGS-4.3.2/src/modules/mix/0000755000175000017500000000000014400711326012277 500000000000000JAGS-4.3.2/src/modules/mix/Makefile.am0000664000175000017500000000206614224052371014263 00000000000000SUBDIRS = distributions samplers jagsmod_LTLIBRARIES = mix.la mix_la_SOURCES = mix.cc mix_la_CPPFLAGS = -I$(top_srcdir)/src/include mix_la_LIBADD = distributions/libmixdist.la \ samplers/libmixsamp.la \ $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la mix_la_LDFLAGS = -module -avoid-version if WINDOWS mix_la_LDFLAGS += -no-undefined endif ### Test library if CANCHECK check_LTLIBRARIES = libmixtest.la libmixtest_la_SOURCES = testmix.cc testmix.h libmixtest_la_CPPFLAGS = -I$(top_srcdir)/src/include libmixtest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) libmixtest_la_LDFLAGS = $(CPPUNIT_LDFLAGS) libmixtest_la_LIBADD = distributions/libmixdisttest.la \ distributions/libmixdist.la \ $(top_builddir)/src/modules/base/rngs/libbaserngs.la \ $(top_builddir)/src/lib/libtest.la \ $(top_builddir)/src/lib/libjags.la \ $(top_builddir)/src/jrmath/libjrmath.la \ @LAPACK_LIBS@ @BLAS_LIBS@ if WINDOWS libmixtest_la_LDFLAGS += -no-undefined else libmixtest_la_LIBADD += @FLIBS@ endif endif JAGS-4.3.2/src/modules/mix/Makefile.in0000644000175000017500000007672414400675236014315 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WINDOWS_TRUE@am__append_1 = -no-undefined @CANCHECK_TRUE@@WINDOWS_TRUE@am__append_2 = -no-undefined @CANCHECK_TRUE@@WINDOWS_FALSE@am__append_3 = @FLIBS@ subdir = src/modules/mix ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(jagsmoddir)" LTLIBRARIES = $(jagsmod_LTLIBRARIES) am__DEPENDENCIES_1 = @CANCHECK_TRUE@libmixtest_la_DEPENDENCIES = \ @CANCHECK_TRUE@ distributions/libmixdisttest.la \ @CANCHECK_TRUE@ distributions/libmixdist.la \ @CANCHECK_TRUE@ $(top_builddir)/src/modules/base/rngs/libbaserngs.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libtest.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libjags.la \ @CANCHECK_TRUE@ $(top_builddir)/src/jrmath/libjrmath.la \ @CANCHECK_TRUE@ $(am__DEPENDENCIES_1) am__libmixtest_la_SOURCES_DIST = testmix.cc testmix.h @CANCHECK_TRUE@am_libmixtest_la_OBJECTS = libmixtest_la-testmix.lo libmixtest_la_OBJECTS = $(am_libmixtest_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libmixtest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libmixtest_la_CXXFLAGS) $(CXXFLAGS) $(libmixtest_la_LDFLAGS) \ $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libmixtest_la_rpath = mix_la_DEPENDENCIES = distributions/libmixdist.la \ samplers/libmixsamp.la $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la am_mix_la_OBJECTS = mix_la-mix.lo mix_la_OBJECTS = $(am_mix_la_OBJECTS) mix_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(mix_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libmixtest_la-testmix.Plo \ ./$(DEPDIR)/mix_la-mix.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libmixtest_la_SOURCES) $(mix_la_SOURCES) DIST_SOURCES = $(am__libmixtest_la_SOURCES_DIST) $(mix_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = distributions samplers jagsmod_LTLIBRARIES = mix.la mix_la_SOURCES = mix.cc mix_la_CPPFLAGS = -I$(top_srcdir)/src/include mix_la_LIBADD = distributions/libmixdist.la \ samplers/libmixsamp.la \ $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/lib/libjags.la mix_la_LDFLAGS = -module -avoid-version $(am__append_1) ### Test library @CANCHECK_TRUE@check_LTLIBRARIES = libmixtest.la @CANCHECK_TRUE@libmixtest_la_SOURCES = testmix.cc testmix.h @CANCHECK_TRUE@libmixtest_la_CPPFLAGS = -I$(top_srcdir)/src/include @CANCHECK_TRUE@libmixtest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) @CANCHECK_TRUE@libmixtest_la_LDFLAGS = $(CPPUNIT_LDFLAGS) \ @CANCHECK_TRUE@ $(am__append_2) @CANCHECK_TRUE@libmixtest_la_LIBADD = distributions/libmixdisttest.la \ @CANCHECK_TRUE@ distributions/libmixdist.la \ @CANCHECK_TRUE@ $(top_builddir)/src/modules/base/rngs/libbaserngs.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libtest.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libjags.la \ @CANCHECK_TRUE@ $(top_builddir)/src/jrmath/libjrmath.la \ @CANCHECK_TRUE@ @LAPACK_LIBS@ @BLAS_LIBS@ $(am__append_3) all: all-recursive .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/mix/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/mix/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-jagsmodLTLIBRARIES: $(jagsmod_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(jagsmoddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(jagsmoddir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(jagsmoddir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(jagsmoddir)"; \ } uninstall-jagsmodLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(jagsmoddir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(jagsmoddir)/$$f"; \ done clean-jagsmodLTLIBRARIES: -test -z "$(jagsmod_LTLIBRARIES)" || rm -f $(jagsmod_LTLIBRARIES) @list='$(jagsmod_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libmixtest.la: $(libmixtest_la_OBJECTS) $(libmixtest_la_DEPENDENCIES) $(EXTRA_libmixtest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libmixtest_la_LINK) $(am_libmixtest_la_rpath) $(libmixtest_la_OBJECTS) $(libmixtest_la_LIBADD) $(LIBS) mix.la: $(mix_la_OBJECTS) $(mix_la_DEPENDENCIES) $(EXTRA_mix_la_DEPENDENCIES) $(AM_V_CXXLD)$(mix_la_LINK) -rpath $(jagsmoddir) $(mix_la_OBJECTS) $(mix_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixtest_la-testmix.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mix_la-mix.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libmixtest_la-testmix.lo: testmix.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixtest_la_CPPFLAGS) $(CPPFLAGS) $(libmixtest_la_CXXFLAGS) $(CXXFLAGS) -MT libmixtest_la-testmix.lo -MD -MP -MF $(DEPDIR)/libmixtest_la-testmix.Tpo -c -o libmixtest_la-testmix.lo `test -f 'testmix.cc' || echo '$(srcdir)/'`testmix.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixtest_la-testmix.Tpo $(DEPDIR)/libmixtest_la-testmix.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testmix.cc' object='libmixtest_la-testmix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixtest_la_CPPFLAGS) $(CPPFLAGS) $(libmixtest_la_CXXFLAGS) $(CXXFLAGS) -c -o libmixtest_la-testmix.lo `test -f 'testmix.cc' || echo '$(srcdir)/'`testmix.cc mix_la-mix.lo: mix.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mix_la-mix.lo -MD -MP -MF $(DEPDIR)/mix_la-mix.Tpo -c -o mix_la-mix.lo `test -f 'mix.cc' || echo '$(srcdir)/'`mix.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mix_la-mix.Tpo $(DEPDIR)/mix_la-mix.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='mix.cc' object='mix_la-mix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mix_la-mix.lo `test -f 'mix.cc' || echo '$(srcdir)/'`mix.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(jagsmoddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-checkLTLIBRARIES clean-generic \ clean-jagsmodLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/libmixtest_la-testmix.Plo -rm -f ./$(DEPDIR)/mix_la-mix.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-jagsmodLTLIBRARIES install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/libmixtest_la-testmix.Plo -rm -f ./$(DEPDIR)/mix_la-mix.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-jagsmodLTLIBRARIES .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-checkLTLIBRARIES \ clean-generic clean-jagsmodLTLIBRARIES clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-jagsmodLTLIBRARIES \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-jagsmodLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/mix/testmix.cc0000664000175000017500000000026714224052371014234 00000000000000#include "testmix.h" #include "distributions/testmixdist.h" #include void init_mix_test() { CPPUNIT_TEST_SUITE_REGISTRATION( MixDistTest ); } JAGS-4.3.2/src/modules/mix/testmix.h0000664000175000017500000000013114224052371014064 00000000000000#ifndef MIX_TEST_H_ #define MIX_TEST_H_ void init_mix_test(); #endif /* MIX_TEST_H_ */ JAGS-4.3.2/src/modules/mix/mix.cc0000664000175000017500000000166514224052515013337 00000000000000#include #include #include #include #include #include #include using std::vector; namespace jags { namespace mix { class MIXModule : public Module { public: MIXModule(); ~MIXModule(); }; MIXModule::MIXModule() : Module("mix") { insert(new DBetaBin); insert(new DNormMix); insert(new DPick); insert(new MixSamplerFactory); insert(new DirichletCatFactory); insert(new LDAFactory); } MIXModule::~MIXModule() { vector const &dvec = distributions(); for (unsigned int i = 0; i < dvec.size(); ++i) { delete dvec[i]; } vector const &svec = samplerFactories(); for (unsigned int i = 0; i < svec.size(); ++i) { delete svec[i]; } } }} jags::mix::MIXModule _mix_module; JAGS-4.3.2/src/modules/mix/distributions/0000755000175000017500000000000014400711326015201 500000000000000JAGS-4.3.2/src/modules/mix/distributions/Makefile.am0000664000175000017500000000102714224052371017161 00000000000000noinst_LTLIBRARIES = libmixdist.la libmixdist_la_CPPFLAGS = -I$(top_srcdir)/src/include libmixdist_la_LDFLAGS = -no-undefined -module -avoid-version libmixdist_la_SOURCES = DNormMix.cc DBetaBin.cc DPick.cc noinst_HEADERS = DNormMix.h DBetaBin.h DPick.h ### Test library if CANCHECK check_LTLIBRARIES = libmixdisttest.la libmixdisttest_la_SOURCES = testmixdist.cc testmixdist.h libmixdisttest_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/base/rngs libmixdisttest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) endif JAGS-4.3.2/src/modules/mix/distributions/DNormMix.h0000664000175000017500000000365114224052515017000 00000000000000#ifndef DNORM_MIX_H_ #define DNORM_MIX_H_ #include namespace jags { namespace mix { /** * @short Mixture of normal distribution *
 * x ~ dnorm(mu, tau, pi)
 * 
* The parameters mu, tau, pi are conforming vectors or arrays. Each * element corresponds to a component of the mixture. If all parameters * are vectors then component i is normal with mean mu[i], tau[i] and * probability of selection pi[i]/sum(pi). * * Note that the parameter pi is redundant: the likelihood depends * only on pi/sum(pi). */ class DNormMix : public VectorDist { public: DNormMix(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector const &lengths) const; bool isSupportFixed(std::vector const &fixmask) const; bool checkParameterLength(std::vector const &lengths) const; bool checkParameterValue(std::vector const ¶meters, std::vector const &lengths) const; void typicalValue(double *x, std::vector const &par, std::vector const &lengths) const; unsigned int length(std::vector const &parlengths) const; }; }} #endif /* DNORM_MIX_H_ */ JAGS-4.3.2/src/modules/mix/distributions/DBetaBin.h0000664000175000017500000000235014224052515016706 00000000000000#ifndef DBETA_BIN_H_ #define DBETA_BIN_H_ #include namespace jags { namespace mix { /** * @short Beta-Binomial distribution *
 * Y ~ dbetabin(a, b, n)
 * f(y|a,b,n) = choose(n, x) * beta(x + a, n - x + b) / beta(a, b);
 * 
*/ class DBetaBin : public RScalarDist { public: DBetaBin(); std::string alias() const; double d(double x, PDFType type, std::vector const ¶meters, bool give_log) const; double p(double x, std::vector const ¶meters, bool lower, bool give_log) const; double q(double p, std::vector const ¶meters, bool lower, bool log_p) const; double r(std::vector const ¶meters, RNG *rng) const; double l(std::vector const ¶meters) const; double u(std::vector const ¶meters) const; /** * Checks that n is discrete-valued. */ bool checkParameterDiscrete (std::vector const &mask) const; /** * Checks that p lies in (0,1), n >= 1, a > 0, b > 0 */ bool checkParameterValue(std::vector const ¶meters) const; bool isSupportFixed(std::vector const &fixmask) const; }; }} #endif /* DBETA_BIN_H_ */ JAGS-4.3.2/src/modules/mix/distributions/DPick.h0000664000175000017500000000212014224052515016263 00000000000000#ifndef DPICK_H_ #define DPICK_H_ #include namespace jags { namespace mix { class DPick : public ScalarDist { public: DPick(); double logDensity(double const x, PDFType type, std::vector const ¶meters, double const *lower, double const *upper) const; double randomSample(std::vector const ¶meters, double const *lower, double const *upper, RNG *rng) const; double typicalValue(std::vector const ¶meters, double const *lower, double const *upper) const; void support(double *lower, double *upper, std::vector const ¶meters) const; bool isSupportFixed(std::vector const &fixmask) const; bool checkParameterValue(std::vector const &par) const; double typicalValue(std::vector const &par) const; unsigned int length(std::vector const &lengths) const; bool isDiscreteValued(std::vector const &mask) const; }; } } #endif /* DPICK_H_ */ JAGS-4.3.2/src/modules/mix/distributions/Makefile.in0000644000175000017500000006542414400675236017212 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/mix/distributions ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmixdist_la_LIBADD = am_libmixdist_la_OBJECTS = libmixdist_la-DNormMix.lo \ libmixdist_la-DBetaBin.lo libmixdist_la-DPick.lo libmixdist_la_OBJECTS = $(am_libmixdist_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libmixdist_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libmixdist_la_LDFLAGS) $(LDFLAGS) \ -o $@ libmixdisttest_la_LIBADD = am__libmixdisttest_la_SOURCES_DIST = testmixdist.cc testmixdist.h @CANCHECK_TRUE@am_libmixdisttest_la_OBJECTS = \ @CANCHECK_TRUE@ libmixdisttest_la-testmixdist.lo libmixdisttest_la_OBJECTS = $(am_libmixdisttest_la_OBJECTS) libmixdisttest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libmixdisttest_la_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libmixdisttest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libmixdist_la-DBetaBin.Plo \ ./$(DEPDIR)/libmixdist_la-DNormMix.Plo \ ./$(DEPDIR)/libmixdist_la-DPick.Plo \ ./$(DEPDIR)/libmixdisttest_la-testmixdist.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libmixdist_la_SOURCES) $(libmixdisttest_la_SOURCES) DIST_SOURCES = $(libmixdist_la_SOURCES) \ $(am__libmixdisttest_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libmixdist.la libmixdist_la_CPPFLAGS = -I$(top_srcdir)/src/include libmixdist_la_LDFLAGS = -no-undefined -module -avoid-version libmixdist_la_SOURCES = DNormMix.cc DBetaBin.cc DPick.cc noinst_HEADERS = DNormMix.h DBetaBin.h DPick.h ### Test library @CANCHECK_TRUE@check_LTLIBRARIES = libmixdisttest.la @CANCHECK_TRUE@libmixdisttest_la_SOURCES = testmixdist.cc testmixdist.h @CANCHECK_TRUE@libmixdisttest_la_CPPFLAGS = -I$(top_srcdir)/src/include \ @CANCHECK_TRUE@ -I$(top_srcdir)/src/modules/base/rngs @CANCHECK_TRUE@libmixdisttest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/mix/distributions/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/mix/distributions/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libmixdist.la: $(libmixdist_la_OBJECTS) $(libmixdist_la_DEPENDENCIES) $(EXTRA_libmixdist_la_DEPENDENCIES) $(AM_V_CXXLD)$(libmixdist_la_LINK) $(libmixdist_la_OBJECTS) $(libmixdist_la_LIBADD) $(LIBS) libmixdisttest.la: $(libmixdisttest_la_OBJECTS) $(libmixdisttest_la_DEPENDENCIES) $(EXTRA_libmixdisttest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libmixdisttest_la_LINK) $(am_libmixdisttest_la_rpath) $(libmixdisttest_la_OBJECTS) $(libmixdisttest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixdist_la-DBetaBin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixdist_la-DNormMix.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixdist_la-DPick.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixdisttest_la-testmixdist.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libmixdist_la-DNormMix.lo: DNormMix.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixdist_la-DNormMix.lo -MD -MP -MF $(DEPDIR)/libmixdist_la-DNormMix.Tpo -c -o libmixdist_la-DNormMix.lo `test -f 'DNormMix.cc' || echo '$(srcdir)/'`DNormMix.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixdist_la-DNormMix.Tpo $(DEPDIR)/libmixdist_la-DNormMix.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DNormMix.cc' object='libmixdist_la-DNormMix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixdist_la-DNormMix.lo `test -f 'DNormMix.cc' || echo '$(srcdir)/'`DNormMix.cc libmixdist_la-DBetaBin.lo: DBetaBin.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixdist_la-DBetaBin.lo -MD -MP -MF $(DEPDIR)/libmixdist_la-DBetaBin.Tpo -c -o libmixdist_la-DBetaBin.lo `test -f 'DBetaBin.cc' || echo '$(srcdir)/'`DBetaBin.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixdist_la-DBetaBin.Tpo $(DEPDIR)/libmixdist_la-DBetaBin.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DBetaBin.cc' object='libmixdist_la-DBetaBin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixdist_la-DBetaBin.lo `test -f 'DBetaBin.cc' || echo '$(srcdir)/'`DBetaBin.cc libmixdist_la-DPick.lo: DPick.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixdist_la-DPick.lo -MD -MP -MF $(DEPDIR)/libmixdist_la-DPick.Tpo -c -o libmixdist_la-DPick.lo `test -f 'DPick.cc' || echo '$(srcdir)/'`DPick.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixdist_la-DPick.Tpo $(DEPDIR)/libmixdist_la-DPick.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DPick.cc' object='libmixdist_la-DPick.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixdist_la-DPick.lo `test -f 'DPick.cc' || echo '$(srcdir)/'`DPick.cc libmixdisttest_la-testmixdist.lo: testmixdist.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixdisttest_la_CPPFLAGS) $(CPPFLAGS) $(libmixdisttest_la_CXXFLAGS) $(CXXFLAGS) -MT libmixdisttest_la-testmixdist.lo -MD -MP -MF $(DEPDIR)/libmixdisttest_la-testmixdist.Tpo -c -o libmixdisttest_la-testmixdist.lo `test -f 'testmixdist.cc' || echo '$(srcdir)/'`testmixdist.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixdisttest_la-testmixdist.Tpo $(DEPDIR)/libmixdisttest_la-testmixdist.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testmixdist.cc' object='libmixdisttest_la-testmixdist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixdisttest_la_CPPFLAGS) $(CPPFLAGS) $(libmixdisttest_la_CXXFLAGS) $(CXXFLAGS) -c -o libmixdisttest_la-testmixdist.lo `test -f 'testmixdist.cc' || echo '$(srcdir)/'`testmixdist.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libmixdist_la-DBetaBin.Plo -rm -f ./$(DEPDIR)/libmixdist_la-DNormMix.Plo -rm -f ./$(DEPDIR)/libmixdist_la-DPick.Plo -rm -f ./$(DEPDIR)/libmixdisttest_la-testmixdist.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libmixdist_la-DBetaBin.Plo -rm -f ./$(DEPDIR)/libmixdist_la-DNormMix.Plo -rm -f ./$(DEPDIR)/libmixdist_la-DPick.Plo -rm -f ./$(DEPDIR)/libmixdisttest_la-testmixdist.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/mix/distributions/DNormMix.cc0000664000175000017500000000573314224052515017141 00000000000000#include #include "DNormMix.h" #include #include #include #include using std::vector; #define MU(par) (par[0]) #define TAU(par) (par[1]) #define PROB(par) (par[2]) #define NCAT(lengths) (lengths[0]) namespace jags { namespace mix { DNormMix::DNormMix() : VectorDist("dnormmix", 3) {} bool DNormMix::checkParameterLength(vector const &lengths) const { if (lengths[0] == 1) return false; // Must be a mixture // Parameter lengths must match return (lengths[0] == lengths[1]) && (lengths[0] == lengths[2]); } bool DNormMix::checkParameterValue(vector const &par, vector const &lengths) const { for (unsigned int i = 0; i < NCAT(lengths); ++i) { if (TAU(par)[i] <= 0) return false; if (PROB(par)[i] <= 0) return false; } return true; } double DNormMix::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector const &lengths, double const *lower, double const *upper) const { double density = 0.0; double psum = 0.0; for (unsigned int i = 0; i < NCAT(lengths); ++i) { density += PROB(par)[i] * dnorm(*x, MU(par)[i], 1/sqrt(TAU(par)[i]), 0); psum += PROB(par)[i]; } return log(density) - log(psum); } void DNormMix::randomSample(double *x, unsigned int length, vector const &par, vector const &lengths, double const *lower, double const *upper, RNG *rng) const { unsigned long Ncat = NCAT(lengths); // Rescale probability parameter double sump = 0; for (unsigned int i = 0; i < Ncat; ++i) { sump += PROB(par)[i]; } double p_rand = runif(0, 1, rng) * sump; sump = 0; // Select mixture component (r) unsigned int r = Ncat - 1; for (unsigned int i = 0; i < Ncat - 1; ++i) { sump += PROB(par)[i]; if (sump > p_rand) { r = i; break; } } // Now sample from conditional distribution of component r double ans = rnorm(MU(par)[r], 1/sqrt(TAU(par)[r]), rng); *x = ans; } void DNormMix::typicalValue(double *x, unsigned int length, vector const &par, vector const &lengths, double const *lower, double const *upper) const { double const *mu = MU(par); unsigned int Ncat = lengths[0]; unsigned int j = 0; for (unsigned int i = 1; i < Ncat; ++i) { if (PROB(par)[i] > PROB(par)[j]) { j = i; } } *x = mu[j]; } bool DNormMix::isSupportFixed(vector const &fixmask) const { return true; } void DNormMix::support(double *lower, double *upper, unsigned int length, vector const ¶meters, vector const &lengths) const { *lower = JAGS_NEGINF; *upper = JAGS_POSINF; } unsigned int DNormMix::length(vector const &parlengths) const { return 1; } }} JAGS-4.3.2/src/modules/mix/distributions/DBetaBin.cc0000664000175000017500000000530214224052371017044 00000000000000#include #include "DBetaBin.h" #include #include #include using std::vector; using std::max; using std::min; using std::string; #define A(par) (*par[0]) #define B(par) (*par[1]) #define SIZE(par) (*par[2]) static inline double dbb(double x, double a, double b, double n) { //Probability density function //return choose(a+x-1, x) * choose(b+n-x-1, n-x) / choose(a+b+n-1, n); return choose(n, x) * beta(x + a, n - x + b) / beta(a, b); } static inline double ldbb(double x, double a, double b, double n) { //Log probability density function return lchoose(n, x) + lbeta(x + a, n - x + b) - lbeta(a, b); } namespace jags { namespace mix { DBetaBin::DBetaBin() : RScalarDist("dbetabin", 3, DIST_SPECIAL, true) {} string DBetaBin::alias() const { return "dbetabinom"; } bool DBetaBin::checkParameterDiscrete (vector const &mask) const { return mask[2] == true; } bool DBetaBin::checkParameterValue (vector const &par) const { return (SIZE(par) >= 0 && A(par) > 0.0 && B(par) > 0.0); } double DBetaBin::d(double x, PDFType type, vector const &par, bool give_log) const { if (give_log) return ldbb(x, A(par), B(par), SIZE(par)); else return dbb(x, A(par), B(par), SIZE(par)); } static double pbb(double x, double a, double b, double n) { //Distribution function if (x < 0) return 0; if (x >= n) return 1; double y = 0; for (int i = 0; i <= x; ++i) { y += dbb(i, a, b, n); } return y; } double DBetaBin::p(double x, vector const &par, bool lower, bool give_log) const { double y = pbb(x, A(par), B(par), SIZE(par)); if (!lower) y = 1 - y; return give_log ? log(y) : y; } static double qbb(double p, double a, double b, double n) { //Quantile function if (p < 0) return 0; if (p >= 1) return n; /* fuzz to ensure left continuity: */ p *= 1 - 64*DBL_EPSILON; double psum = 0; for (int i = 0; i < n; ++i) { psum += dbb(i, a, b, n); if (psum > p) return i; } return n; } double DBetaBin::q(double p, vector const &par, bool lower, bool log_p) const { if (log_p) p = exp(p); if (!lower) p = 1 - p; return qbb(p, A(par), B(par), SIZE(par)); } double DBetaBin::r(vector const &par, RNG *rng) const { return rbinom(SIZE(par), rbeta(A(par), B(par), rng), rng); } double DBetaBin::l(vector const &par) const { return 0; } double DBetaBin::u(vector const &par) const { return SIZE(par); } bool DBetaBin::isSupportFixed(vector const &fixmask) const { return fixmask[2]; //SIZE is fixed; } }} JAGS-4.3.2/src/modules/mix/distributions/DPick.cc0000664000175000017500000000347114224052515016433 00000000000000#include #include "DPick.h" #include #include #include using std::vector; using std::min; using std::max; using std::log; #define PROB(par) (*par[0]) #define VAL1(par) (*par[1]) #define VAL2(par) (*par[2]) namespace jags { namespace mix { DPick::DPick() : ScalarDist("dpick", 3, DIST_SPECIAL) {} bool DPick::checkParameterValue(vector const &par) const { if (PROB(par) <= 0.0 || PROB(par) >= 1.0) return false; return true; } double DPick::logDensity(double x, PDFType type, vector const &par, double const *lower, double const *upper) const { double v1 = VAL1(par); double v2 = VAL2(par); if (v1 == x && v2 == x) { return 0; } else if (v1 == x) { return log(PROB(par)); } else if (v2 == x) { return log(1 - PROB(par)); } else { return JAGS_NEGINF; } } double DPick::randomSample(vector const &par, double const *lower, double const *upper, RNG *rng) const { if (rng->uniform() <= PROB(par)) { return VAL1(par); } else { return VAL2(par); } } double DPick::typicalValue(vector const &par, double const *lower, double const *upper) const { if (PROB(par) >= 0.5) { return VAL1(par); } else { return VAL2(par); } } bool DPick::isSupportFixed(vector const &fixmask) const { return fixmask[1] && fixmask[2]; } void DPick::support(double *lower, double *upper, vector const &par) const { *lower = min(VAL1(par), VAL2(par)); *upper = max(VAL1(par), VAL2(par)); } bool DPick::isDiscreteValued(std::vector const &mask) const { return mask[1] && mask[2]; } } } JAGS-4.3.2/src/modules/mix/distributions/testmixdist.cc0000664000175000017500000002422614224052515020023 00000000000000#include "testmixdist.h" #include "DBetaBin.h" #include "DNormMix.h" #include #include #include #include #include #include #include using std::string; using std::vector; using std::sqrt; using std::max; using std::min; using std::multiset; using std::abs; using std::ostringstream; using std::sort; using jags::ScalarDist; using jags::RScalarDist; using jags::PDF_FULL; void MixDistTest::setUp() { _rng = new jags::base::MersenneTwisterRNG(1234567, jags::KINDERMAN_RAMAGE); _dbetabin = new jags::mix::DBetaBin(); _dnormmix = new jags::mix::DNormMix(); } void MixDistTest::tearDown() { delete _rng; delete _dbetabin; delete _dnormmix; } void MixDistTest::npar() { //CPPUNIT_ASSERT_MESSAGE("npar check", false); CPPUNIT_ASSERT_EQUAL(_dbetabin->npar(), 3U); CPPUNIT_ASSERT_EQUAL(_dnormmix->npar(), 3U); } void MixDistTest::name() { CPPUNIT_ASSERT_EQUAL(string("dbetabin"), _dbetabin->name()); CPPUNIT_ASSERT_EQUAL(string("dnormmix"), _dnormmix->name()); } void MixDistTest::alias() { CPPUNIT_ASSERT_EQUAL(string("dbetabinom"), _dbetabin->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dnormmix->alias()); } void MixDistTest::rscalar_rpq(RScalarDist const *dist, vector const &par) { /* Simultaneous test of r, p, and q functions for distributions inheriting from RScalarDist. */ unsigned int nsim = 100; unsigned int nsim2 = 10; unsigned int nquant = 10; CPPUNIT_ASSERT_MESSAGE(dist->name(), checkNPar(dist, par.size())); CPPUNIT_ASSERT_MESSAGE(dist->name(), dist->checkParameterValue(par)); for (unsigned int s = 0; s < nsim; ++s) { //Generate random variable from distribution double y = dist->r(par, _rng); //Pass to distribution function and then to quantile function double p = dist->p(y, par, true, false); CPPUNIT_ASSERT_MESSAGE(dist->name(), p >= 0 && p <= 1); double z = dist->q(p, par, true, false); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); //Now do the same on a log scale double logp = dist->p(y, par, true, true); CPPUNIT_ASSERT_MESSAGE(dist->name(), logp <= 0); z = dist->q(logp, par, true, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); //Using upper tail p = dist->p(y, par, false, false); CPPUNIT_ASSERT_MESSAGE(dist->name(), p >= 0 && p <= 1); z = dist->q(p, par, false, false); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); //Upper tail on log scale logp = dist->p(y, par, false, true); CPPUNIT_ASSERT_MESSAGE(dist->name(), logp <= 0); z = dist->q(logp, par, false, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); } for (unsigned int s = 0; s < nsim2; ++s) { // Test truncated sampling for (unsigned int i = 0; i <= nquant; ++i) { double plim1 = static_cast(i)/nquant; double lim1 = dist->q(plim1, par, true, false); if (i > 0) { // Test sampling from lower tail double y = dist->randomSample(par, 0, &lim1, _rng); CPPUNIT_ASSERT_MESSAGE(dist->name(), y <= lim1); double logpy = dist->p(y, par, true, true); double z = dist->q(logpy, par, true, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol * abs(y)); } if (i < nquant) { // Test sampling from upper tail double y = dist->randomSample(par, &lim1, 0, _rng); CPPUNIT_ASSERT_MESSAGE(dist->name(), y >= lim1); double logpy = dist->p(y, par, false, true); double z = dist->q(logpy, par, false, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol * abs(y)); } for (unsigned int j = i+1; j <= nquant; ++j) { // Test sampling between lower and upper limits double plim2 = static_cast(j)/nquant; double lim2 = dist->q(plim2, par, true, false); double y = dist->randomSample(par, &lim1, &lim2, _rng); CPPUNIT_ASSERT_MESSAGE(dist->name(), y >= lim1 && y <= lim2); double py = dist->p(y, par, true, false); double z = dist->q(py, par, true, false); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol * abs(y)); } } } //rscalar_trunclik(dist, par); } /* static vector mkPar(double const &v1) { vector par; par.push_back(&v1); return par; } */ /* static vector mkPar(double const &v1, double const &v2) { vector par; par.push_back(&v1); par.push_back(&v2); return par; } */ static vector mkPar(double const &v1, double const &v2, double const &v3) { vector par; par.push_back(&v1); par.push_back(&v2); par.push_back(&v3); return par; } /* static vector mkPar(double const &v1, double const &v2, double const &v3, double const &v4) { vector par; par.push_back(&v1); par.push_back(&v2); par.push_back(&v3); par.push_back(&v4); return par; } */ void MixDistTest::rscalar() { rscalar_rpq(_dbetabin, mkPar(1, 1, 5)); rscalar_rpq(_dbetabin, mkPar(2, 1.3, 8)); rscalar_rpq(_dbetabin, mkPar(1.8, 5, 8)); rscalar_rpq(_dbetabin, mkPar(1, 1, 20)); rscalar_rpq(_dbetabin, mkPar(2, 2, 30)); } static double superror(RScalarDist const *dist, unsigned int N, vector const &par, jags::RNG *rng) { //Calculate test statistic for DKW test multiset xmset; for (unsigned int i =0; i < N; ++i) { double x = dist->r(par, rng); x = fprec(x, 12); xmset.insert(x); } double fhat=0, delta=0; for (multiset::const_iterator q = xmset.begin(); q != xmset.end(); q = xmset.upper_bound(*q)) { double f = dist->p(*q, par, true, false); fhat += static_cast(xmset.count(*q))/N; delta = max(delta, abs(fhat - f)); } return delta; } static double pdkwbound(double n, double t) { return 2*exp(-2*n*t*t); } static double qdkwbound(double n, double p) { return sqrt(log(p/2)/(-2*n)); } void MixDistTest::dkwtest(RScalarDist const *dist, vector const &par, unsigned int N, double pthresh) { /* Test using the Dvoretzky-Kiefer-Wolfowitz (1956) bound on the difference between the empirical distribution function and the theoretical one, with a tight constant derived by Massart (1990) */ //Sanity checks CPPUNIT_ASSERT_MESSAGE(dist->name(), checkNPar(dist, par.size())); CPPUNIT_ASSERT_MESSAGE(dist->name(), dist->checkParameterValue(par)); double s = superror(dist, N, par, _rng); string msg = dist->name(); if (s >= qdkwbound(N, pthresh)) { ostringstream ostr; ostr << "Distribution " << dist->name() << "("; for (unsigned int i = 0; i < par.size(); ++i) { if (i > 0) ostr << ", "; ostr << *par[i]; } ostr << ")\n"; ostr << "supremum error = " << fprec(s, 2) << " with p-value=" << min(1.0, fround(pdkwbound(N,s), 4)); CPPUNIT_FAIL(ostr.str()); } } //FIXME: We should have a atest for simulation from a truncated distribution void MixDistTest::dkw() { //DKW test of random number generation and distribution function //See dkwtest for details //CPPUNIT_ASSERT_MESSAGE("dkw check", false); dkwtest(_dbetabin, mkPar(1,1, 4)); } static double normmix_mean(vector const &par, vector const &lengths) { double const *mu = par[0]; double const *pi = par[2]; double sumpi = 0, mean = 0; for (unsigned int i = 0; i < lengths[0]; ++i) { sumpi += pi[i]; mean += pi[i] * mu[i]; } return mean/sumpi; } static double normmix_var(vector const &par, vector const &len) { double const *mu = par[0]; double const *tau = par[1]; double const *pi = par[2]; double sumpi = 0, mean = 0; for (unsigned int i = 0; i < len[0]; ++i) { sumpi += pi[i]; mean += pi[i] * mu[i]; } mean /= sumpi; double var = 0; for (unsigned int i = 0; i < len[0]; ++i) { var += pi[i] * ((mu[i] - mean)*(mu[i] - mean) + 1/tau[i]); } var /= sumpi; return var; } void MixDistTest::test_mean_normmix(vector const &par, vector const &len, unsigned int N) { CPPUNIT_ASSERT_MESSAGE(_dnormmix->name(), _dnormmix->checkParameterLength(len)); CPPUNIT_ASSERT_MESSAGE(_dnormmix->name(), _dnormmix->checkParameterValue(par, len)); double x; double xmean = 0; for (unsigned int i = 0; i < N; ++i) { _dnormmix->randomSample(&x, 1, par, len, 0, 0, _rng); xmean += x; } xmean /= N; double zmean = normmix_mean(par, len); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(_dnormmix->name(), zmean, xmean, 0.01); } void MixDistTest::test_var_normmix(vector const &par, vector const &len, unsigned int N) { CPPUNIT_ASSERT_MESSAGE(_dnormmix->name(), _dnormmix->checkParameterLength(len)); CPPUNIT_ASSERT_MESSAGE(_dnormmix->name(), _dnormmix->checkParameterValue(par, len)); double x; double xmean = 0; for (unsigned int i = 0; i < N; ++i) { _dnormmix->randomSample(&x, 1, par, len, 0, 0, _rng); xmean += x; } xmean /= N; double xvar = 0; for (unsigned int i = 0; i < N; ++i) { _dnormmix->randomSample(&x, 1, par, len, 0, 0, _rng); xvar += (x - xmean) * (x - xmean); } xvar /= N; double zvar = normmix_var(par, len); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(_dnormmix->name(), zvar, xvar, 0.1); } void MixDistTest::normmix() { unsigned int N = 100000; //Construct parameter vector of length 2 vector mu(2), tau(2), pi(2); vector par2; par2.push_back(&mu[0]); par2.push_back(&tau[0]); par2.push_back(&pi[0]); //Construct length vector corresponding to par2 vector len2(3, 2); //Set up example mu[0] = -1; mu[1] = 3; tau[0] = 0.1; tau[1] = 0.2; pi[0] = 8; pi[1] = 2; test_mean_normmix(par2, len2, N); test_var_normmix(par2, len2, N); mu[0] = 1; mu[1] = 1; tau[0] = 1; tau[1] = 1; test_mean_normmix(par2, len2, N); test_var_normmix(par2, len2, N); } JAGS-4.3.2/src/modules/mix/distributions/testmixdist.h0000664000175000017500000000250114224052515017655 00000000000000#ifndef MIX_DIST_TEST_H #define MIX_DIST_TEST_H namespace jags { class RScalarDist; class ScalarDist; class VectorDist; class ArrayDist; struct RNG; } #include #include class MixDistTest : public CppUnit::TestFixture, public JAGSFixture { CPPUNIT_TEST_SUITE( MixDistTest ); CPPUNIT_TEST( npar ); CPPUNIT_TEST( name ); CPPUNIT_TEST( alias ); CPPUNIT_TEST( rscalar ); CPPUNIT_TEST( dkw ); CPPUNIT_TEST( normmix ); CPPUNIT_TEST_SUITE_END( ); jags::RNG *_rng; jags::RScalarDist *_dbetabin; jags::VectorDist *_dnormmix; void rscalar_rpq(jags::RScalarDist const *dist, std::vector const &par); void dkwtest(jags::RScalarDist const *dist, std::vector const &par, unsigned int N=10000, double pthresh=0.001); void test_mean_normmix(std::vector const &par, std::vector const &lengths, unsigned int N); void test_var_normmix(std::vector const &par, std::vector const &len, unsigned int N); public: void setUp(); void tearDown(); void npar(); void name(); void alias(); void rscalar(); void dkw(); void normmix(); }; #endif /* MIX_DIST_TEST_H */ JAGS-4.3.2/src/modules/mix/samplers/0000755000175000017500000000000014400711326014125 500000000000000JAGS-4.3.2/src/modules/mix/samplers/Makefile.am0000664000175000017500000000070114224052371016103 00000000000000noinst_LTLIBRARIES = libmixsamp.la libmixsamp_la_CPPFLAGS = -I$(top_srcdir)/src/include libmixsamp_la_LDFLAGS = -no-undefined -module -avoid-version libmixsamp_la_SOURCES = DirichletInfo.cc NormMix.cc \ MixSamplerFactory.cc DirichletCat.cc DirichletCatFactory.cc \ CatDirichlet.cc LDA.cc LDAFactory.cc noinst_HEADERS = DirichletInfo.h NormMix.h MixSamplerFactory.h \ DirichletCat.h DirichletCatFactory.h CatDirichlet.h LDA.h \ LDAFactory.h JAGS-4.3.2/src/modules/mix/samplers/DirichletInfo.h0000664000175000017500000000110514224052515016742 00000000000000#ifndef DIRICHLET_INFO_H_ #define DIRICHLET_INFO_H_ namespace jags { class StochasticNode; namespace mix { /** * Helper class to store information about nodes with a Dirichlet * distribution. This is used to invoke special rules for the * NormMix sample method. */ struct DirichletInfo { unsigned int start; unsigned int end; unsigned int length; double sum; double shape; DirichletInfo(StochasticNode const *snode, unsigned int start, unsigned int chain); double gammaPenalty() const; }; }} #endif /* DIRICHLET_INFO_H_ */ JAGS-4.3.2/src/modules/mix/samplers/NormMix.h0000664000175000017500000000307614224052515015621 00000000000000#ifndef NORM_MIX_METHOD_H_ #define NORM_MIX_METHOD_H_ #include #include #include namespace jags { class Graph; class GraphView; namespace mix { struct DirichletInfo; /** * @short Sample method for normal mixture models * * NormMix implements a Metropolis-Hastings method for normal * mixture models with tempered transitions as recommended for mixture * models by Celeux et al (Celeux G, Hurn, M, Robert CP, Computational * and inferential difficulties with mixture posterior distributions, * J Am Statist Ass, 95, 957-970, 2000). */ class NormMix : public TemperedMetropolis { GraphView const *_gv; unsigned int _chain; double *_lower; double *_upper; std::vector _di; public: /** * Constructor for Mix Method with tempered transitions * * @param nlevel Number of levels between minimum and maximum * temperature * * @param max_temp Maximum temperature * * @param nrep Number of Metropolis-Hastings updates to do at * each level */ NormMix(GraphView const *gv, unsigned int chain, unsigned int max_level, double max_temp, unsigned int nrep); ~NormMix(); void getValue(std::vector &value) const; void setValue(std::vector const &value); double logPrior() const; double logLikelihood() const; double logJacobian(std::vector const &value) const; void step(std::vector &value, double step, RNG *rng) const; static bool canSample(std::vector const &snodes); }; }} #endif /* NORM_MIX_METHOD_H_ */ JAGS-4.3.2/src/modules/mix/samplers/MixSamplerFactory.h0000664000175000017500000000104614224052515017634 00000000000000#ifndef MIX_SAMPLER_FACTORY_H_ #define MIX_SAMPLER_FACTORY_H_ #include namespace jags { namespace mix { /** * @short Factory object for mixture samplers */ class MixSamplerFactory : public SamplerFactory { public: Sampler * makeSampler(std::list const &nodes, Graph const &graph) const; std::vector makeSamplers(std::list const &nodes, Graph const &graph) const; std::string name() const; }; }} #endif /* MIX_SAMPLER_FACTORY_H_ */ JAGS-4.3.2/src/modules/mix/samplers/DirichletCat.h0000664000175000017500000000204114224052515016556 00000000000000#ifndef DIRICHLET_CAT_H_ #define DIRICHLET_CAT_H_ #include #include #include namespace jags { class MixtureNode; class Node; class GraphView; namespace mix { /** * @short Block sampler for Dirichlet nodes in a mixture model. * */ class DirichletCat : public SampleMethodNoAdapt { GraphView const *_gv; std::map > _parmap; std::vector _mixparents; unsigned int _chain; unsigned int _size; void updateParMap(); public: DirichletCat(GraphView const *gv, unsigned int chain); void update(RNG *rng); static bool canSample(GraphView const *gv); /** * Returns the active parameter for the stochastic child * with index i. This is used by the companion sampler * CatDirichlet in the case where the stochastic children * are also unobserved. */ std::vector &getActiveParameter(unsigned int i); }; } } #endif /* DIRICHLET_CAT_H_ */ JAGS-4.3.2/src/modules/mix/samplers/DirichletCatFactory.h0000664000175000017500000000110114224052515020102 00000000000000#ifndef DIRICHLET_CAT_FACTORY_H_ #define DIRICHLET_CAT_FACTORY_H_ #include namespace jags { namespace mix { /** * @short Factory object for DirichletCat samplers */ class DirichletCatFactory : public SamplerFactory { public: Sampler * makeSampler(std::vector const &snodes, Graph const &graph) const; std::vector makeSamplers(std::list const &nodes, Graph const &graph) const; std::string name() const; }; } } #endif /* DIRICHLET_CAT_FACTORY_H_ */ JAGS-4.3.2/src/modules/mix/samplers/CatDirichlet.h0000664000175000017500000000111614224052515016560 00000000000000#ifndef CAT_DIRICHLET_H_ #define CAT_DIRICHLET_H_ #include namespace jags { class GraphView; namespace mix { class DirichletCat; /** * @short Collapsed sampler for categorical nodes in a * Dirichlet mixture model. */ class CatDirichlet : public SampleMethodNoAdapt { GraphView const *_gv; DirichletCat *_dc; unsigned int _chain; unsigned int _size; public: CatDirichlet(GraphView const *gv, DirichletCat *dc, unsigned int chain); void update(RNG *rng); }; } } #endif /* CAT_DIRICHLET_H_ */ JAGS-4.3.2/src/modules/mix/samplers/LDA.h0000664000175000017500000000540314224052515014624 00000000000000#ifndef LDA_H_ #define LDA_H_ #include #include namespace jags { class Graph; class GraphView; class StochasticNode; namespace mix { /** * @short Collapsed sampler for Latent Dirichlet Allocation * models. */ class LDA : public SampleMethodNoAdapt { const unsigned int _nTopic, _nWord, _nDoc; double const *_topicHyper; double const *_wordHyper; GraphView const *_gv; const unsigned int _chain; std::vector > _topicTokens, _wordTokens; std::vector > _topicsByWord, _topicsByDoc; std::vector _docSums, _topicSums; bool _wordsObserved; void rebuildTable(); public: /** * Constructor. * * @param topics Topic indicators with a categorical * distribution, organized hierarchically within * documents. Hence topics.size() is nDoc, the number of * documents, and topics[d] contains the topic indicators * for document d. These are the nodes that are sampled * by the LDA sampler. * * @param words Word indicators with a categorical * distribution, organized in the same way as * topics. Hence words[d][i] is the stochastic child of * topics[d][i]. All words must be observed. * * @param topic_priors Vector of length nDoc containing * Dirichlet priors for the topic indicators, one for each * document. All topic priors share a common hyper-prior. * * @param word_priors Vector of length nTopic, the number * of topics, containing Dirichlet priors for the * words. The choice of which element of word_prior to use * as prior for words[d][i] is determined by the value of * topics[d][i]. All word priors share a common * hyper-prior. * * @param gv Pointer to the GraphView within which sampling * takes place. */ LDA(std::vector > const &topics, std::vector > const &words, std::vector const &topic_priors, std::vector const &word_priors, GraphView const *gv, unsigned int chain); void update(RNG *rng); /** * Tests whether a set of topics can be sampled by the LDA * method. The arguments are the same as for the LDA * constructor, except that a Graph is passed as the last * argument instead of a GraphView. */ static bool canSample( std::vector > const &topics, std::vector > const &words, std::vector const &topic_priors, std::vector const &word_priors, Graph const &graph); }; } } #endif /* LDA_H_ */ JAGS-4.3.2/src/modules/mix/samplers/LDAFactory.h0000664000175000017500000000120414224052515016147 00000000000000#ifndef LDA_FACTORY_H_ #define LDA_FACTORY_H_ #include namespace jags { namespace mix { /** * @short Factory object for LDA samplers */ class LDAFactory : public SamplerFactory { public: Sampler * makeSampler(std::vector const &topicPriors, std::vector const &wordPriors, std::list const &free_nodes, Graph const &graph) const; std::vector makeSamplers(std::list const &nodes, Graph const &graph) const; std::string name() const; }; } } #endif /* LDA_FACTORY_H_ */ JAGS-4.3.2/src/modules/mix/samplers/Makefile.in0000644000175000017500000007506214400675236016135 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/mix/samplers ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libmixsamp_la_LIBADD = am_libmixsamp_la_OBJECTS = libmixsamp_la-DirichletInfo.lo \ libmixsamp_la-NormMix.lo libmixsamp_la-MixSamplerFactory.lo \ libmixsamp_la-DirichletCat.lo \ libmixsamp_la-DirichletCatFactory.lo \ libmixsamp_la-CatDirichlet.lo libmixsamp_la-LDA.lo \ libmixsamp_la-LDAFactory.lo libmixsamp_la_OBJECTS = $(am_libmixsamp_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libmixsamp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libmixsamp_la_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libmixsamp_la-CatDirichlet.Plo \ ./$(DEPDIR)/libmixsamp_la-DirichletCat.Plo \ ./$(DEPDIR)/libmixsamp_la-DirichletCatFactory.Plo \ ./$(DEPDIR)/libmixsamp_la-DirichletInfo.Plo \ ./$(DEPDIR)/libmixsamp_la-LDA.Plo \ ./$(DEPDIR)/libmixsamp_la-LDAFactory.Plo \ ./$(DEPDIR)/libmixsamp_la-MixSamplerFactory.Plo \ ./$(DEPDIR)/libmixsamp_la-NormMix.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(libmixsamp_la_SOURCES) DIST_SOURCES = $(libmixsamp_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libmixsamp.la libmixsamp_la_CPPFLAGS = -I$(top_srcdir)/src/include libmixsamp_la_LDFLAGS = -no-undefined -module -avoid-version libmixsamp_la_SOURCES = DirichletInfo.cc NormMix.cc \ MixSamplerFactory.cc DirichletCat.cc DirichletCatFactory.cc \ CatDirichlet.cc LDA.cc LDAFactory.cc noinst_HEADERS = DirichletInfo.h NormMix.h MixSamplerFactory.h \ DirichletCat.h DirichletCatFactory.h CatDirichlet.h LDA.h \ LDAFactory.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/mix/samplers/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/mix/samplers/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libmixsamp.la: $(libmixsamp_la_OBJECTS) $(libmixsamp_la_DEPENDENCIES) $(EXTRA_libmixsamp_la_DEPENDENCIES) $(AM_V_CXXLD)$(libmixsamp_la_LINK) $(libmixsamp_la_OBJECTS) $(libmixsamp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixsamp_la-CatDirichlet.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixsamp_la-DirichletCat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixsamp_la-DirichletCatFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixsamp_la-DirichletInfo.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixsamp_la-LDA.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixsamp_la-LDAFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixsamp_la-MixSamplerFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmixsamp_la-NormMix.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libmixsamp_la-DirichletInfo.lo: DirichletInfo.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixsamp_la-DirichletInfo.lo -MD -MP -MF $(DEPDIR)/libmixsamp_la-DirichletInfo.Tpo -c -o libmixsamp_la-DirichletInfo.lo `test -f 'DirichletInfo.cc' || echo '$(srcdir)/'`DirichletInfo.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixsamp_la-DirichletInfo.Tpo $(DEPDIR)/libmixsamp_la-DirichletInfo.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DirichletInfo.cc' object='libmixsamp_la-DirichletInfo.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixsamp_la-DirichletInfo.lo `test -f 'DirichletInfo.cc' || echo '$(srcdir)/'`DirichletInfo.cc libmixsamp_la-NormMix.lo: NormMix.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixsamp_la-NormMix.lo -MD -MP -MF $(DEPDIR)/libmixsamp_la-NormMix.Tpo -c -o libmixsamp_la-NormMix.lo `test -f 'NormMix.cc' || echo '$(srcdir)/'`NormMix.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixsamp_la-NormMix.Tpo $(DEPDIR)/libmixsamp_la-NormMix.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='NormMix.cc' object='libmixsamp_la-NormMix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixsamp_la-NormMix.lo `test -f 'NormMix.cc' || echo '$(srcdir)/'`NormMix.cc libmixsamp_la-MixSamplerFactory.lo: MixSamplerFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixsamp_la-MixSamplerFactory.lo -MD -MP -MF $(DEPDIR)/libmixsamp_la-MixSamplerFactory.Tpo -c -o libmixsamp_la-MixSamplerFactory.lo `test -f 'MixSamplerFactory.cc' || echo '$(srcdir)/'`MixSamplerFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixsamp_la-MixSamplerFactory.Tpo $(DEPDIR)/libmixsamp_la-MixSamplerFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MixSamplerFactory.cc' object='libmixsamp_la-MixSamplerFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixsamp_la-MixSamplerFactory.lo `test -f 'MixSamplerFactory.cc' || echo '$(srcdir)/'`MixSamplerFactory.cc libmixsamp_la-DirichletCat.lo: DirichletCat.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixsamp_la-DirichletCat.lo -MD -MP -MF $(DEPDIR)/libmixsamp_la-DirichletCat.Tpo -c -o libmixsamp_la-DirichletCat.lo `test -f 'DirichletCat.cc' || echo '$(srcdir)/'`DirichletCat.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixsamp_la-DirichletCat.Tpo $(DEPDIR)/libmixsamp_la-DirichletCat.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DirichletCat.cc' object='libmixsamp_la-DirichletCat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixsamp_la-DirichletCat.lo `test -f 'DirichletCat.cc' || echo '$(srcdir)/'`DirichletCat.cc libmixsamp_la-DirichletCatFactory.lo: DirichletCatFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixsamp_la-DirichletCatFactory.lo -MD -MP -MF $(DEPDIR)/libmixsamp_la-DirichletCatFactory.Tpo -c -o libmixsamp_la-DirichletCatFactory.lo `test -f 'DirichletCatFactory.cc' || echo '$(srcdir)/'`DirichletCatFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixsamp_la-DirichletCatFactory.Tpo $(DEPDIR)/libmixsamp_la-DirichletCatFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DirichletCatFactory.cc' object='libmixsamp_la-DirichletCatFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixsamp_la-DirichletCatFactory.lo `test -f 'DirichletCatFactory.cc' || echo '$(srcdir)/'`DirichletCatFactory.cc libmixsamp_la-CatDirichlet.lo: CatDirichlet.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixsamp_la-CatDirichlet.lo -MD -MP -MF $(DEPDIR)/libmixsamp_la-CatDirichlet.Tpo -c -o libmixsamp_la-CatDirichlet.lo `test -f 'CatDirichlet.cc' || echo '$(srcdir)/'`CatDirichlet.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixsamp_la-CatDirichlet.Tpo $(DEPDIR)/libmixsamp_la-CatDirichlet.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='CatDirichlet.cc' object='libmixsamp_la-CatDirichlet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixsamp_la-CatDirichlet.lo `test -f 'CatDirichlet.cc' || echo '$(srcdir)/'`CatDirichlet.cc libmixsamp_la-LDA.lo: LDA.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixsamp_la-LDA.lo -MD -MP -MF $(DEPDIR)/libmixsamp_la-LDA.Tpo -c -o libmixsamp_la-LDA.lo `test -f 'LDA.cc' || echo '$(srcdir)/'`LDA.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixsamp_la-LDA.Tpo $(DEPDIR)/libmixsamp_la-LDA.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LDA.cc' object='libmixsamp_la-LDA.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixsamp_la-LDA.lo `test -f 'LDA.cc' || echo '$(srcdir)/'`LDA.cc libmixsamp_la-LDAFactory.lo: LDAFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libmixsamp_la-LDAFactory.lo -MD -MP -MF $(DEPDIR)/libmixsamp_la-LDAFactory.Tpo -c -o libmixsamp_la-LDAFactory.lo `test -f 'LDAFactory.cc' || echo '$(srcdir)/'`LDAFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmixsamp_la-LDAFactory.Tpo $(DEPDIR)/libmixsamp_la-LDAFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LDAFactory.cc' object='libmixsamp_la-LDAFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmixsamp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libmixsamp_la-LDAFactory.lo `test -f 'LDAFactory.cc' || echo '$(srcdir)/'`LDAFactory.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libmixsamp_la-CatDirichlet.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-DirichletCat.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-DirichletCatFactory.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-DirichletInfo.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-LDA.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-LDAFactory.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-MixSamplerFactory.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-NormMix.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libmixsamp_la-CatDirichlet.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-DirichletCat.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-DirichletCatFactory.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-DirichletInfo.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-LDA.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-LDAFactory.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-MixSamplerFactory.Plo -rm -f ./$(DEPDIR)/libmixsamp_la-NormMix.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/mix/samplers/DirichletInfo.cc0000664000175000017500000000114114224052515017100 00000000000000#include #include "DirichletInfo.h" #include #include #include using std::log; namespace jags { namespace mix { DirichletInfo::DirichletInfo(StochasticNode const *snode, unsigned int s, unsigned int chain) : start(s), end(s + snode->length()), length(snode->length()), sum(1), shape(0) { for (unsigned int i = 0; i < snode->length(); ++i) { shape += snode->parents()[0]->value(chain)[i]; } } double DirichletInfo::gammaPenalty() const { return (shape - 1) * log(sum) - shape * sum; } }} JAGS-4.3.2/src/modules/mix/samplers/NormMix.cc0000664000175000017500000001315014224052515015751 00000000000000#include #include "NormMix.h" #include "DirichletInfo.h" #include #include #include #include #include #include class Graph; using std::vector; using std::log; using std::exp; using std::string; using std::pair; using std::set; namespace jags { static bool isDirch(StochasticNode const *snode) { return snode->distribution()->name() == "ddirch"; } static vector initialValue(GraphView const *gv, unsigned int chain) { vector ivalue(gv->length()); gv->getValue(ivalue, chain); return ivalue; } static void reflect (double &x, double LLIM=-30, double ULIM=30) { //boundary reflection on log scale to to prevent overflow/underflow //when taking exponentials. while (x < LLIM || x > ULIM) { if (x < LLIM) { x = 2*LLIM - x; } if (x > ULIM) { x = 2*ULIM - x; } } } namespace mix { NormMix::NormMix(GraphView const *gv, unsigned int chain, unsigned int nlevel, double max_temp, unsigned int nrep) : TemperedMetropolis(initialValue(gv, chain), nlevel, max_temp, nrep), _gv(gv), _chain(chain) { int N = gv->length(); _lower = new double[N]; _upper = new double[N]; double *lp = _lower; double *up = _upper; vector const &snodes = _gv->nodes(); for (unsigned int j = 0; j < snodes.size(); ++j) { unsigned int length_j = snodes[j]->length(); if (isDirch(snodes[j])) { //Special rule for Dirichlet distribution to enforce //log transformation for (unsigned int k = 0; k < length_j; ++k) { lp[k] = 0; up[k] = JAGS_POSINF; } _di.push_back(new DirichletInfo(snodes[j], lp - _lower, chain)); } else { snodes[j]->support(lp, up, length_j, chain); } lp += length_j; up += length_j; if (lp - _lower > N) { throwLogicError("Invalid length in read_bounds (NormMix)"); } } } NormMix::~NormMix() { delete [] _lower; delete [] _upper; for (unsigned int i = 0; i < _di.size(); ++i) { delete _di[i]; } } void NormMix::step(vector &x, double step, RNG *rng) const { for (unsigned int i = 0; i < x.size(); ++i) { bool bb = jags_finite(_lower[i]); //bounded below bool ba = jags_finite(_upper[i]); //bounded above double eps = rng->normal() * step; if (bb && ba) { x[i] = log(x[i] - _lower[i]) - log(_upper[i] - x[i]); x[i] += eps; reflect(x[i]); double w = 1.0 / (1 + exp(-x[i])); x[i] = (1 - w) * _lower[i] + w * _upper[i]; } else if (bb) { x[i] = log(x[i] - _lower[i]); x[i] += eps; reflect(x[i]); x[i] = _lower[i] + exp(x[i]); } else if (ba) { x[i] = log(_upper[i] - x[i]); x[i] += eps; reflect(x[i]); x[i] = _upper[i] - exp(x[i]); } else { x[i] = x[i] + eps; } } } double NormMix::logJacobian(vector const &x) const { double lj = 0; for (unsigned int i = 0; i < x.size(); ++i) { bool bb = jags_finite(_lower[i]); //bounded below bool ba = jags_finite(_upper[i]); //bounded above if (bb && ba) { lj += log(x[i] - _lower[i]) + log(_upper[i] - x[i]); } else if (bb) { lj += log(x[i] - _lower[i]); } else if (ba) { lj += log(_upper[i] - x[i]); } } return lj; } bool NormMix::canSample(vector const &snodes) { if (snodes.empty()) return false; for (unsigned int i = 0; i < snodes.size(); ++i) { if (snodes[i]->isDiscreteValued()) { return false; } /* Check that the bounds (if any) of each node are fixed We rely on parameter transformation for bounded nodes which must remain the same between iterations to guarantee stationarity of the chain */ if (!isSupportFixed(snodes[i])) { return false; } //Check that all nodes are of full rank if (isDirch(snodes[i])) { /* We can't handle structural zeros in the Dirichlet distribution. This excludes Dirichlet nodes with non-fixed parents */ if (!snodes[i]->parents()[0]->isFixed()) { return false; } double const *par = snodes[i]->parents()[0]->value(0); unsigned int plen = snodes[i]->parents()[0]->length(); for (unsigned int j = 0; j < plen; ++j) { if (par[j] == 0) { return false; } } } else if (snodes[i]->length() != snodes[i]->df()) { return false; } } return true; } void NormMix::getValue(vector &x) const { _gv->getValue(x, _chain); for (unsigned int i = 0; i < _di.size(); ++i) { for (unsigned int j = _di[i]->start; j < _di[i]->end; ++j) { x[j] *= _di[i]->sum; } } } void NormMix::setValue(vector const &x) { if (_di.empty()) { _gv->setValue(x, _chain); } else { //Rescale Dirichlet distributions for (unsigned int i = 0; i < _di.size(); ++i) { _di[i]->sum = 0; for (unsigned int j = _di[i]->start; j < _di[i]->end; ++j) { _di[i]->sum += x[j]; } } vector v = x; for (unsigned int i = 0; i < _di.size(); ++i) { for (unsigned int j = _di[i]->start; j < _di[i]->end; ++j) { v[j] /= _di[i]->sum; } } _gv->setValue(v, _chain); } } double NormMix::logPrior() const { double lp = _gv->logPrior(_chain); for (unsigned int i = 0; i < _di.size(); ++i) { //Penalty on unscaled Dirichlet coordinates //Gamma penalty lp += _di[i]->gammaPenalty(); /* double logS = log(_di[i]->sum); lp -= 5 * logS * logS; */ } return lp; } double NormMix::logLikelihood() const { return _gv->logLikelihood(_chain); } }} JAGS-4.3.2/src/modules/mix/samplers/MixSamplerFactory.cc0000664000175000017500000000572414224052515020001 00000000000000#include #include "MixSamplerFactory.h" #include "NormMix.h" #include #include #include #include #include #include using std::set; using std::list; using std::vector; using std::string; #define NLEVEL 200 #define MAX_TEMP 100 #define NREP 5 namespace jags { /* * Returns a pointer to a newly allocated SingletonGraphView if snode * has a stochastic child with distribution "dnormmix", otherwise a * null pointer. */ static SingletonGraphView * isCandidate(StochasticNode *snode, Graph const &graph) { SingletonGraphView *gv = new SingletonGraphView(snode, graph); vector const &schildren = gv->stochasticChildren(); for (unsigned int i = 0; i < schildren.size(); ++i) { if (schildren[i]->distribution()->name() == "dnormmix") { return gv; } } delete gv; return 0; } /* * Used to aggregate nodes with common stochastic children. */ static void aggregate(SingletonGraphView const *gv, vector &nodes, set &common_children) { bool agg = nodes.empty(); vector const &schildren = gv->stochasticChildren(); for (unsigned int i = 0; i < schildren.size(); ++i) { if (common_children.count(schildren[i])) { agg = true; break; } } if (agg) { for (unsigned int i = 0; i < schildren.size(); ++i) { common_children.insert(schildren[i]); } nodes.push_back(gv->node()); } } namespace mix { Sampler * MixSamplerFactory::makeSampler(list const &nodes, Graph const &graph) const { vector gvec; for (list::const_iterator p = nodes.begin(); p != nodes.end(); ++p) { SingletonGraphView *gv = isCandidate(*p, graph); if (gv) { gvec.push_back(gv); } } if (gvec.empty()) return 0; vector sample_nodes; set common_children; for (unsigned int i = 0; i < gvec.size(); ++i) { aggregate(gvec[i], sample_nodes, common_children); delete gvec[i]; } if (NormMix::canSample(sample_nodes)) { GraphView *gv = new GraphView(sample_nodes, graph, true); unsigned int nchain = sample_nodes[0]->nchain(); vector methods(nchain,0); for (unsigned int ch = 0; ch < nchain; ++ch) { methods[ch] = new NormMix(gv, ch, NLEVEL, MAX_TEMP, NREP); } return new MutableSampler(gv, methods, "mix::NormMix"); } else { return 0; } } string MixSamplerFactory::name() const { return "mix::TemperedMix"; } vector MixSamplerFactory::makeSamplers(list const &nodes, Graph const &graph) const { Sampler *s = makeSampler(nodes, graph); if (s) return vector(1, s); else return vector(); } }} JAGS-4.3.2/src/modules/mix/samplers/DirichletCat.cc0000664000175000017500000001156614224052515016730 00000000000000#include #include "DirichletCat.h" #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::string; using std::copy; using std::map; using std::pair; namespace jags { static vector makeMixParents(GraphView const *gv) { vector const &schildren = gv->stochasticChildren(); vector mixnodes; mixnodes.reserve(schildren.size()); for (unsigned int i = 0; i < schildren.size(); ++i) { mixnodes.push_back(asMixture(schildren[i]->parents()[0])); } return mixnodes; } static map > makeParMap(GraphView const *gv) { vector const &snodes = gv->nodes(); map > parmap; unsigned int N = snodes[0]->length(); for (unsigned int i = 0; i < snodes.size(); ++i) { if (snodes[i]->length() != N) { throwLogicError("Length mismatch in MixDirich"); } parmap[snodes[i]] = vector(N); } return parmap; } namespace mix { bool DirichletCat::canSample(GraphView const *gv) { // Check sample nodes vector snodes = gv->nodes(); for (unsigned int i = 0; i < snodes.size(); ++i) { if (isBounded(snodes[i])) return false; if (snodes[i]->distribution()->name() != "ddirch") return false; } set sset; set dset; for (unsigned int i = 0; i < snodes.size(); ++i) { sset.insert(snodes[i]); dset.insert(snodes[i]); } vector const &dchildren = gv->deterministicChildren(); for (unsigned int i = 0; i < dchildren.size(); ++i) { if (MixtureNode const *m = asMixture(dchildren[i])) { vector const &mparents = m->parents(); unsigned int Nindex = m->index_size(); for (unsigned int j = 0; j < Nindex; ++j) { if (dset.count(mparents[j])) return false; } for (unsigned int j = Nindex; j < mparents.size(); ++j) { if (sset.count(mparents[j]) == 0) return false; } } else { return false; } dset.insert(dchildren[i]); } // Check stochastic children vector const &schildren = gv->stochasticChildren(); for (unsigned int i = 0; i < schildren.size(); ++i) { if (isBounded(schildren[i])) return false; if (schildren[i]->distribution()->name() != "dcat") return false; if (sset.count(schildren[i]->parents()[0])) return false; } return true; } DirichletCat::DirichletCat(GraphView const *gv, unsigned int chain) : _gv(gv), _parmap(makeParMap(gv)), _mixparents(makeMixParents(gv)), _chain(chain), _size(gv->nodes()[0]->length()) { updateParMap(); } vector &DirichletCat::getActiveParameter(unsigned int i) { Node const *active = _mixparents[i]->activeParent(_chain); map >::iterator p = _parmap.find(active); if (p == _parmap.end()) { throwLogicError("No active parameter in DirichletCat sampler"); } return p->second; } void DirichletCat::updateParMap() { vector const &snodes = _gv->nodes(); //Priors for (unsigned int i = 0; i < snodes.size(); ++i) { double const *prior = snodes[i]->parents()[0]->value(_chain); vector ¶m = _parmap[snodes[i]]; copy(prior, prior + _size, param.begin()); } vector const &schildren = _gv->stochasticChildren(); //Likelihoods for (unsigned int j = 0; j < schildren.size(); ++j) { Node const *active = _mixparents[j]->activeParent(_chain); vector ¶m = _parmap.find(active)->second; int index = static_cast(*schildren[j]->value(_chain)) - 1; if (param[index] > 0) { param[index] += 1; } else { throwNodeError(schildren[j], "Likelihood error in DirichletCat sample"); } } } void DirichletCat::update(RNG *rng) { updateParMap(); /* Draw Dirichlet sample by drawing independent gamma random variates and then normalizing */ vector const &snodes = _gv->nodes(); vector xnew(_gv->length()); for (unsigned int i = 0; i < snodes.size(); ++i) { vector const &alpha = _parmap[snodes[i]]; double xsum = 0.0; unsigned int offset = i * _size; for (unsigned int j = 0; j < _size; ++j) { if (alpha[j] > 0) { xnew[j + offset] = rgamma(alpha[j], 1, rng); xsum += xnew[j + offset]; } else { xnew[j + offset] = 0; } } for (unsigned int j = 0; j < _size; ++j) { xnew[j + offset] /= xsum; } } _gv->setValue(xnew, _chain); } } } JAGS-4.3.2/src/modules/mix/samplers/DirichletCatFactory.cc0000664000175000017500000000565414224052515020261 00000000000000#include #include "DirichletCatFactory.h" #include "DirichletCat.h" #include #include #include #include #include #include #include #include #include using std::list; using std::set; using std::vector; using std::string; using std::map; #define NLEVEL 200 #define MAX_TEMP 100 #define NREP 5 namespace jags { //STL syntax becomes unreadable if we don't use a typedef typedef map, vector > DCMap; static bool isCandidate(SingletonGraphView const &gv) { vector const &schild = gv.stochasticChildren(); vector const &dchild = gv.deterministicChildren(); //A necessary but not sufficient condition: we do this first //because it is fast if (schild.size() != dchild.size()) return false; //Stochastic children must all have dcat distribution Distribution const *dist0 = schild[0]->distribution(); if (dist0->name() != "dcat") return false; for (unsigned int i = 1; i < schild.size(); ++i) { if (schild[i]->distribution() != dist0) return false; } //Deterministic descendants must all be mixture nodes for (unsigned int j = 0; j < dchild.size(); ++j) { if (!isMixture(dchild[j])) return false; } return true; } namespace mix { Sampler * DirichletCatFactory::makeSampler(vector const &snodes, Graph const &graph) const { GraphView *gv = new GraphView(snodes, graph); Sampler * sampler = 0; unsigned int nchain = snodes[0]->nchain(); if (DirichletCat::canSample(gv)) { vector methods(nchain); for (unsigned int ch = 0; ch < nchain; ++ch) { methods[ch] = new DirichletCat(gv, ch); } sampler = new MutableSampler(gv, methods, "mix::DirichletCat"); } else { delete gv; } return sampler; } string DirichletCatFactory::name() const { return "mix::DirichletCat"; } vector DirichletCatFactory::makeSamplers(list const &nodes, Graph const &graph) const { //Assemble candidates from available nodes and classify //them by their stochastic children DCMap cmap; for (list::const_iterator p = nodes.begin(); p != nodes.end(); ++p) { if ((*p)->distribution()->name() != "ddirch") continue; SingletonGraphView gv(*p, graph); if (isCandidate(gv)) { cmap[gv.stochasticChildren()].push_back(*p); } } //Now traverse the candidate map and generate samplers vector samplers; for (DCMap::const_iterator q = cmap.begin(); q != cmap.end(); ++q) { Sampler *s = makeSampler(q->second, graph); if (s) samplers.push_back(s); } return samplers; } } } JAGS-4.3.2/src/modules/mix/samplers/CatDirichlet.cc0000664000175000017500000000236114224052371016721 00000000000000#include #include "CatDirichlet.h" #include "DirichletCat.h" #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::string; using std::copy; using std::map; using std::pair; namespace jags { namespace mix { CatDirichlet::CatDirichlet(GraphView const *gv, DirichletCat *dc, unsigned int chain) : _gv(gv), _dc(dc), _chain(chain), _size(gv->nodes()[0]->length()) { } void CatDirichlet::update(RNG *rng) { vector const &snodes = _gv->nodes(); vector xnew(_gv->length()); for (unsigned int i = 0; i < snodes.size(); ++i) { int index = static_cast(*snodes[i]->value(_chain)) - 1; vector &alpha = _dc->getActiveParameter(i); alpha[index] -= 1; double sump = 0.0; unsigned int j = 0; for ( ; j < _size; ++j) { sump += alpha[j]; } double p = sump * rng->uniform(); for ( ; j > 1; --j) { sump -= alpha[j-1]; if (sump <= p) break; } xnew[i] = j; alpha[j] += 1; } } } } JAGS-4.3.2/src/modules/mix/samplers/LDA.cc0000664000175000017500000002403314224052515014762 00000000000000#include #include "LDA.h" #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::string; using std::upper_bound; using std::accumulate; using std::partial_sum; namespace jags { bool isCat(StochasticNode const *snode) { return snode->distribution()->name() == "dcat"; } bool isDirichlet(StochasticNode const *snode) { return snode->distribution()->name() == "ddirch"; } namespace mix { LDA::LDA(vector > const &topics, vector > const &words, vector const &topic_priors, vector const &word_priors, GraphView const *gv, unsigned int ch) : _nTopic(word_priors.size()), _nWord(word_priors[0]->length()), _nDoc(topics.size()), _topicHyper(topic_priors[0]->parents()[0]->value(ch)), _wordHyper(word_priors[0]->parents()[0]->value(ch)), _gv(gv), _chain(ch), _topicTokens(_nDoc), _wordTokens(_nDoc), _topicsByWord(_nWord, vector(_nTopic, 0)), _topicsByDoc(_nDoc, vector(_nTopic, 0)), _docSums(_nDoc), _topicSums(_nTopic), _wordsObserved(true) { //Set up tables for (unsigned int d = 0; d < _nDoc; ++d) { _docSums[d] = topics[d].size(); for (unsigned int i = 0; i < _docSums[d]; ++i) { int topic = static_cast(*topics[d][i]->value(ch)) - 1; _topicTokens[d].push_back(topic); _topicsByDoc[d][topic]++; _topicSums[topic]++; int word = static_cast(*words[d][i]->value(ch)) - 1; _wordTokens[d].push_back(word); _topicsByWord[word][topic]++; if (!isObserved(words[d][i])) _wordsObserved = false; } } //Sanity check on gv: vector const &snodes = gv->nodes(); unsigned int offset = 0; for (unsigned int doc = 0; doc < _nDoc; ++doc) { for (unsigned int i = 0; i < _docSums[doc]; ++i) { if (topics[doc][i] != snodes[offset + i]) { throwLogicError("Bad GraphView in LD constructor"); } } offset += _docSums[doc]; } } void LDA::rebuildTable() { for (unsigned int t = 0; t < _nTopic; ++t) { for (unsigned int w = 0; w < _nWord; ++w) { _topicsByWord[w][t] = 0; } } vector const &s = _gv->nodes(); unsigned int offset = 0; for (unsigned int d = 0; d < _nDoc; ++d) { for (unsigned int i = 0; i < _docSums[d]; ++i) { int topic = _topicTokens[d][i]; int word = static_cast(*s[offset + i]->value(_chain)) - 1; _topicsByWord[word][topic]++; } offset += _docSums[d]; } } void LDA::update(RNG *rng) { if (!_wordsObserved) { rebuildTable(); } double wordHyperSum = accumulate(_wordHyper, _wordHyper + _nWord, 0.0); vector sump(_nTopic); for (unsigned int doc = 0; doc < _nDoc; ++doc) { vector &thisDocTopics = _topicsByDoc[doc]; for (unsigned int i = 0; i < _docSums[doc]; ++i) { //Find current topic and word values int &topic = _topicTokens[doc][i]; int const &word = _wordTokens[doc][i]; vector &thisWordTopics = _topicsByWord[word]; //Remove current value from tables thisDocTopics[topic]--; thisWordTopics[topic]--; _topicSums[topic]--; //Calculate probability vector vector prob(_nTopic); for (unsigned int t = 0; t < _nTopic; ++t) { double prior = thisDocTopics[t] + _topicHyper[t]; double likelihood = (thisWordTopics[t] + _wordHyper[word]) / (_topicSums[t] + wordHyperSum); prob[t] = prior * likelihood; } //Draw random sample from categorical distribution partial_sum(prob.begin(), prob.end(), sump.begin()); double p = rng->uniform() * sump.back(); topic = upper_bound(sump.begin(), sump.end(), p) - sump.begin(); if (topic == _nTopic) --topic; //Restore current value to tables thisDocTopics[topic]++; thisWordTopics[topic]++; _topicSums[topic]++; } } vector value; value.reserve(_gv->length()); for (unsigned int d = 0; d < _nDoc; ++d) { for (unsigned int i = 0; i < _docSums[d]; ++i) { value.push_back(_topicTokens[d][i] + 1); } } _gv->setValue(value, _chain); } bool LDA::canSample(vector > const &topics, vector > const &words, vector const &topic_priors, vector const &word_priors, Graph const &graph) { //Set up dimensions unsigned int nDoc = topics.size(); if (nDoc == 0) return false; if (words.size() != nDoc) return false; if (topic_priors.size() != nDoc) return false; unsigned int nTopic = word_priors.size(); if (nTopic == 0) return false; unsigned int nWord = word_priors[0]->length(); if (nWord == 0) return false; //topics and words are arranged hierarchically by document //topics and words have categorical distribution topics //must be unobserved (because we are sampling them) and //words must be observed (this may be relaxed in a future version). for (unsigned int d = 0; d < nDoc; ++d) { if (topics[d].size() != words[d].size()) return false; for (unsigned int i = 0; i < topics[d].size(); ++i) { if (!isCat(topics[d][i])) return false; if (!isCat(words[d][i])) return false; if (isObserved(topics[d][i])) return false; if (!isObserved(words[d][i])) return false; } } //Word priors have a Dirichlet distribution. They are //unobserved, as we need to marginalize over their //distribution for (unsigned int t = 0; t < nTopic; ++t) { if (!isDirichlet(word_priors[t])) return false; if (isObserved(word_priors[t])) return false; if (word_priors[t]->length() != nWord) return false; } //Word priors have a common hyper-prior Node const *word_hyper = word_priors[0]->parents()[0]; for (unsigned int t = 1; t < nTopic; ++t) { if (word_priors[t]->parents()[0] != word_hyper) return false; } //Topic priors have a Dirichlet distribution. They are //unobserved, as we need to marginalize over their //distribution. for (unsigned int d = 0; d < nDoc; ++d) { if (!isDirichlet(topic_priors[d])) return false; if (isObserved(topic_priors[d])) return false; if (topic_priors[d]->length() != nTopic) return false; } //Topic priors have a common hyper-prior Node const *topic_hyper = topic_priors[0]->parents()[0]; for (unsigned int d = 1; d < nDoc; ++d) { if (topic_priors[d]->parents()[0] != topic_hyper) return false; } //topics[d] is the stochastic children of topic_priors[d]. //There are no intermediate deterministic nodes. for (unsigned int d = 0; d < nDoc; ++d) { SingletonGraphView tp_gv(topic_priors[d], graph); if (!tp_gv.deterministicChildren().empty()) return false; set set1, set2; set1.insert(tp_gv.stochasticChildren().begin(), tp_gv.stochasticChildren().end()); set2.insert(topics[d].begin(), topics[d].end()); if (set1 != set2) return false; } //The stochastic children of word_priors are in words[0] //... words[nDoc] GraphView wp_gv(word_priors, graph); set wp_schildren; wp_schildren.insert(wp_gv.stochasticChildren().begin(), wp_gv.stochasticChildren().end()); set all_words; for (unsigned int d = 0; d < nDoc; ++d) { all_words.insert(words[d].begin(), words[d].end()); } if (wp_schildren != all_words) return false; //Create set to contain all mixture node children of word_priors set wp_mixnodes; //The intermediate deterministic nodes are all mixture //nodes with a common mixTab. vector const &wp_dchild = wp_gv.deterministicChildren(); MixTab const *mtab = 0; for (unsigned int i = 0; i < wp_dchild.size(); ++i) { MixtureNode const *m = asMixture(wp_dchild[i]); if (m == 0) return false; if (i == 0) { mtab = m->mixTab(); } else if (m->mixTab() != mtab) { return false; } wp_mixnodes.insert(m); } //The only possible values of the mixTab are in word_priors set wp_set; #ifndef _RWSTD_NO_MEMBER_TEMPLATES wp_set.insert(word_priors.begin(), word_priors.end()); #else for (vector::const_iterator p = word_priors.begin(); p != word_priors.end(); ++p) { wp_set.insert(*p); } #endif for (RangeIterator p(mtab->range()); !p.atEnd(); p.nextLeft()) { if (wp_set.count(mtab->getNode(p)) == 0) return false; } //Create set to contain all mixture node children of topics set topic_mixnodes; //Each topic is the index of a single mixture node and its //single stochastic child is the corresponding word. All //mixture nodes have the same mixTab for (unsigned int d = 0; d < nDoc; ++d) { for (unsigned int i = 0; i < topics[d].size(); ++i) { SingletonGraphView topic_gv(topics[d][i], graph); vector topic_dchild = topic_gv.deterministicChildren(); if (topic_dchild.size() != 1) return false; MixtureNode const *m = asMixture(topic_dchild[0]); if (m->index_size() != 1) return false; if (m->parents()[0] != topics[d][i]) return false; if (m->mixTab() != mtab) return false; topic_mixnodes.insert(m); vector topic_schild = topic_gv.stochasticChildren(); if (topic_schild.size() != 1) return false; if (topic_schild[0] != words[d][i]) return false; } } //Finally, check that the deterministic children of topics //and of word_priors are the same if (wp_mixnodes != topic_mixnodes) return false; return true; } } } JAGS-4.3.2/src/modules/mix/samplers/LDAFactory.cc0000664000175000017500000001363614224052515016321 00000000000000#include #include "LDAFactory.h" #include "LDA.h" #include #include #include #include #include #include #include #include #include #include #include #include using std::set; using std::vector; using std::string; using std::map; using std::list; using std::find; namespace jags { /* Struct to hold Dirichlet nodes that will be marginalized out by the LDA sampler */ struct DirichletPriors { vector words; vector topics; }; typedef map LDAMap; static inline bool isCat(StochasticNode const *snode) { return snode->distribution()->name() == "dcat"; } MixTab const *checkTopicPrior(GraphView const &gv, Graph const &graph) { /* Dirichlet node TopicPrior has categorical stochastic children. There are no intermediate deterministic children. */ if (!gv.deterministicChildren().empty()) return 0; vector const &schild = gv.stochasticChildren(); for (unsigned int i = 0; i < schild.size(); ++i) { if (!isCat(schild[i])) return 0; } /* Each stochastic child acts as the index of a single mixture node. This mixture node has a single stochastic child with a categorical distribution. All the mixture nodes have a common MixTab. */ MixTab const *mtab = 0; for (unsigned int i = 0; i < schild.size(); ++i) { SingletonGraphView gvi(schild[i], graph); vector const &si = gvi.stochasticChildren(); if (si.size() != 1) return 0; if (!isCat(si[0])) return 0; vector const &di = gvi.deterministicChildren(); if (di.size() != 1) return 0; MixtureNode const *m = asMixture(di[0]); if (m == 0) return 0; //Check that schild[i] is the index of the mixture node if (m->index_size() != 1) return 0; if (m->parents()[0] != schild[i]) return 0; for (unsigned int j = 1; j < m->parents().size(); ++j) { if (m->parents()[j] == schild[i]) return 0; } if (i == 0) { mtab = m->mixTab(); } else { if (m->mixTab() != mtab) return 0; } } return mtab; } MixTab const *checkWordPrior(GraphView const &gv, Graph const &graph) { /* Dirichlet node WordPrior is related to multiple categorical outcomes via a set of mixture nodes that all share the same mixTable. */ vector const &schild = gv.stochasticChildren(); for (unsigned int i = 0; i < schild.size(); ++i) { if (!isCat(schild[i])) return 0; } MixTab const *mtab = 0; vector const &dchild = gv.deterministicChildren(); for (unsigned int j = 0; j < dchild.size(); ++j) { MixtureNode const *m = asMixture(dchild[j]); if (m == 0) return 0; if (j == 0) { mtab = m->mixTab(); } else if (mtab != m->mixTab()) { return 0; } } return mtab; } namespace mix { Sampler * LDAFactory::makeSampler(vector const &topicPriors, vector const &wordPriors, list const &free_nodes, Graph const &graph) const { if (topicPriors.empty() || wordPriors.empty()) return 0; unsigned int nDoc = topicPriors.size(); vector > topics(nDoc), words(nDoc); vector snodes; for (unsigned int d = 0; d < nDoc; ++d) { SingletonGraphView gvd(topicPriors[d], graph); topics[d] = gvd.stochasticChildren(); for (unsigned int i = 0; i < topics[d].size(); ++i) { if (find(free_nodes.begin(), free_nodes.end(), topics[d][i]) == free_nodes.end()) { return 0; } SingletonGraphView gvi(topics[d][i], graph); words[d].push_back(gvi.stochasticChildren()[0]); snodes.push_back(topics[d][i]); } } if (LDA::canSample(topics, words, topicPriors, wordPriors, graph)) { GraphView *view = new GraphView(snodes, graph); unsigned int N = nchain(view); vector methods(N); for (unsigned int ch = 0; ch < N; ++ch) { methods[ch] = new LDA(topics, words, topicPriors, wordPriors, view, ch); } return new MutableSampler(view, methods, "mix::LDA"); } else return 0; } string LDAFactory::name() const { return "mix::LDA"; } vector LDAFactory::makeSamplers(list const &free_nodes, Graph const &graph) const { //First we need to traverse the graph looking for //Dirichlet nodes. We are not interested in sampling //them, but they are the basis for finding the categorical //nodes that we do want to sample set dirichlet_nodes; for (Graph::const_iterator p = graph.begin(); p != graph.end(); ++p) { VectorStochasticNode *vsnode = dynamic_cast(*p); if (vsnode && vsnode->distribution()->name() == "ddirch") { dirichlet_nodes.insert(vsnode); } } // Now classify them according to their MixTab LDAMap dirichlet_map; for (set::iterator p = dirichlet_nodes.begin(); p != dirichlet_nodes.end(); ++p) { SingletonGraphView gv(*p, graph); if (MixTab const *mtab = checkWordPrior(gv, graph)) { dirichlet_map[mtab].words.push_back(*p); } else if (MixTab const *mtab = checkTopicPrior(gv, graph)) { dirichlet_map[mtab].topics.push_back(*p); } } // Traverse the elements of the mixtable vector samplers; for (LDAMap::const_iterator p = dirichlet_map.begin(); p != dirichlet_map.end(); ++p) { Sampler *s = makeSampler(p->second.topics, p->second.words, free_nodes, graph); if (s) samplers.push_back(s); } return samplers; } } } JAGS-4.3.2/src/modules/lecuyer/0000755000175000017500000000000014400711326013152 500000000000000JAGS-4.3.2/src/modules/lecuyer/Makefile.am0000664000175000017500000000054214224052371015133 00000000000000jagsmod_LTLIBRARIES = lecuyer.la lecuyer_la_SOURCES = lecuyer.cc RngStream.cc RngStreamFactory.cc lecuyer_la_CPPFLAGS = -I$(top_srcdir)/src/include lecuyer_la_LDFLAGS = -module -avoid-version if WINDOWS lecuyer_la_LDFLAGS += -no-undefined endif lecuyer_la_LIBADD = $(top_builddir)/src/lib/libjags.la noinst_HEADERS = RngStream.h RngStreamFactory.h JAGS-4.3.2/src/modules/lecuyer/RngStream.h0000664000175000017500000000170714224052515015156 00000000000000#ifndef _RNG_STREAM_H_ #define _RNG_STREAM_H_ #include #define m1 4294967087.0 #define m2 4294944443.0 namespace jags { namespace lecuyer { /** * @short MRG32k3a combined multiple recursive generator */ class RngStream : public RmathRNG { double Cg[6]; public: /** * Constructor for RngStream random number generator * * @param state Initial state for the RNG. The first three * elements must be less than m1, and the second three must be * less than m2. The first three elements may not be all zero * and the second elements may not be all zero. */ RngStream(unsigned int state[6]); void init(unsigned int seed); bool setState(std::vector const &state); void getState(std::vector &state) const; double uniform(); /** * Generates a state vector from a random seed */ static void seedToState(unsigned int seed, unsigned int state[6]); }; }} #endif /* _RNGSTREAM_H_ */ JAGS-4.3.2/src/modules/lecuyer/RngStreamFactory.h0000664000175000017500000000113714224052515016503 00000000000000#ifndef RNG_STREAM_FACTORY_H_ #define RNG_STREAM_FACTORY_H_ #include #include "RngStream.h" namespace jags { namespace lecuyer { /** * @short Factory object for Lecuyer RNG Stream */ class RngStreamFactory : public RNGFactory { double Bg[6], Ig[6]; std::vector _rngvec; public: RngStreamFactory(); ~RngStreamFactory(); void setSeed(unsigned int seed); void nextStream(); void nextSubstream(); std::vector makeRNGs(unsigned int n); RNG * makeRNG(std::string const &name); std::string name() const; }; }} #endif /* RNG_STREAM_FACTORY_H_ */ JAGS-4.3.2/src/modules/lecuyer/Makefile.in0000644000175000017500000006326114400675236015160 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WINDOWS_TRUE@am__append_1 = -no-undefined subdir = src/modules/lecuyer ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(jagsmoddir)" LTLIBRARIES = $(jagsmod_LTLIBRARIES) lecuyer_la_DEPENDENCIES = $(top_builddir)/src/lib/libjags.la am_lecuyer_la_OBJECTS = lecuyer_la-lecuyer.lo lecuyer_la-RngStream.lo \ lecuyer_la-RngStreamFactory.lo lecuyer_la_OBJECTS = $(am_lecuyer_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = lecuyer_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(lecuyer_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/lecuyer_la-RngStream.Plo \ ./$(DEPDIR)/lecuyer_la-RngStreamFactory.Plo \ ./$(DEPDIR)/lecuyer_la-lecuyer.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(lecuyer_la_SOURCES) DIST_SOURCES = $(lecuyer_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ jagsmod_LTLIBRARIES = lecuyer.la lecuyer_la_SOURCES = lecuyer.cc RngStream.cc RngStreamFactory.cc lecuyer_la_CPPFLAGS = -I$(top_srcdir)/src/include lecuyer_la_LDFLAGS = -module -avoid-version $(am__append_1) lecuyer_la_LIBADD = $(top_builddir)/src/lib/libjags.la noinst_HEADERS = RngStream.h RngStreamFactory.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/lecuyer/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/lecuyer/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-jagsmodLTLIBRARIES: $(jagsmod_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(jagsmoddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(jagsmoddir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(jagsmoddir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(jagsmoddir)"; \ } uninstall-jagsmodLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(jagsmoddir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(jagsmoddir)/$$f"; \ done clean-jagsmodLTLIBRARIES: -test -z "$(jagsmod_LTLIBRARIES)" || rm -f $(jagsmod_LTLIBRARIES) @list='$(jagsmod_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } lecuyer.la: $(lecuyer_la_OBJECTS) $(lecuyer_la_DEPENDENCIES) $(EXTRA_lecuyer_la_DEPENDENCIES) $(AM_V_CXXLD)$(lecuyer_la_LINK) -rpath $(jagsmoddir) $(lecuyer_la_OBJECTS) $(lecuyer_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lecuyer_la-RngStream.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lecuyer_la-RngStreamFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lecuyer_la-lecuyer.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< lecuyer_la-lecuyer.lo: lecuyer.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lecuyer_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lecuyer_la-lecuyer.lo -MD -MP -MF $(DEPDIR)/lecuyer_la-lecuyer.Tpo -c -o lecuyer_la-lecuyer.lo `test -f 'lecuyer.cc' || echo '$(srcdir)/'`lecuyer.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lecuyer_la-lecuyer.Tpo $(DEPDIR)/lecuyer_la-lecuyer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='lecuyer.cc' object='lecuyer_la-lecuyer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lecuyer_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lecuyer_la-lecuyer.lo `test -f 'lecuyer.cc' || echo '$(srcdir)/'`lecuyer.cc lecuyer_la-RngStream.lo: RngStream.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lecuyer_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lecuyer_la-RngStream.lo -MD -MP -MF $(DEPDIR)/lecuyer_la-RngStream.Tpo -c -o lecuyer_la-RngStream.lo `test -f 'RngStream.cc' || echo '$(srcdir)/'`RngStream.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lecuyer_la-RngStream.Tpo $(DEPDIR)/lecuyer_la-RngStream.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RngStream.cc' object='lecuyer_la-RngStream.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lecuyer_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lecuyer_la-RngStream.lo `test -f 'RngStream.cc' || echo '$(srcdir)/'`RngStream.cc lecuyer_la-RngStreamFactory.lo: RngStreamFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lecuyer_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT lecuyer_la-RngStreamFactory.lo -MD -MP -MF $(DEPDIR)/lecuyer_la-RngStreamFactory.Tpo -c -o lecuyer_la-RngStreamFactory.lo `test -f 'RngStreamFactory.cc' || echo '$(srcdir)/'`RngStreamFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/lecuyer_la-RngStreamFactory.Tpo $(DEPDIR)/lecuyer_la-RngStreamFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RngStreamFactory.cc' object='lecuyer_la-RngStreamFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lecuyer_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o lecuyer_la-RngStreamFactory.lo `test -f 'RngStreamFactory.cc' || echo '$(srcdir)/'`RngStreamFactory.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(jagsmoddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-jagsmodLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/lecuyer_la-RngStream.Plo -rm -f ./$(DEPDIR)/lecuyer_la-RngStreamFactory.Plo -rm -f ./$(DEPDIR)/lecuyer_la-lecuyer.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-jagsmodLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/lecuyer_la-RngStream.Plo -rm -f ./$(DEPDIR)/lecuyer_la-RngStreamFactory.Plo -rm -f ./$(DEPDIR)/lecuyer_la-lecuyer.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-jagsmodLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-jagsmodLTLIBRARIES clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-jagsmodLTLIBRARIES \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-jagsmodLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/lecuyer/lecuyer.cc0000664000175000017500000000105014224052515015051 00000000000000#include #include using std::vector; namespace jags { namespace lecuyer { class LecuyerModule : public Module { public: LecuyerModule(); ~LecuyerModule(); }; LecuyerModule::LecuyerModule() : Module("lecuyer") { insert(new RngStreamFactory); } LecuyerModule::~LecuyerModule() { vector const &rvec = rngFactories(); for (unsigned int i = 0; i < rvec.size(); ++i) { delete rvec[i]; } } }} jags::lecuyer::LecuyerModule _lecuyer_module; JAGS-4.3.2/src/modules/lecuyer/RngStream.cc0000664000175000017500000000736714224052515015324 00000000000000/* * Combined Multiple Recursive Generator MRG32k3a * * L'Ecuyer P (1999) Good parameters and implementations for combined * multiple recursive random number generators. Operations Research 47(1), * 159-164. * * L'Ecuyer P, Simard R, Chen EJ, Kelton WD (2002) An object-oriented * random-number package with many long streams and substreams, Operations * Resarch 50(6), 1073-1075. * Adapted from the original C code by Pierre L'Ecuyer in the R package * rlecuyer 0.2. The core of the code is copyright Pierre L'Ecuyer, * University of Montreal (lecuyer@iro.UMontreal.ca) 2001, and * released under the GPL license. * * The interface has been simplified and adapted to JAGS. The options * to produce antithetical and/or high- precision random variables * have been removed. The code to advance the state of the RNG to the * start of the next stream or substream is in RngStreamFactory.cc */ #include "RngStream.h" #include using std::vector; #define norm 2.328306549295727688e-10 /* 2^-32 */ #define a12 1403580.0 #define a13n 810728.0 #define a21 527612.0 #define a23n 1370589.0 static bool checkState (unsigned int state[6]) { for (int i = 0; i < 3; ++i) { if (state[i] >= m1) return false; } for (int i = 3; i < 6; ++i) { if (state[i] >= m2) return false; } if (state[0] == 0 && state[1] == 0 && state[2] == 0) { return false; } if (state[3] == 0 && state[4] == 0 && state[5] == 0) { return false; } return true; } static void fixState (unsigned int state[6]) { for (int i = 0; i < 3; ++i) { if (state[i] >= m1) state[i] = 0; } for (int i = 3; i < 6; ++i) { if (state[i] >= m2) state[i] = 0; } if (state[0] == 0 && state[1] == 0 && state[2] == 0) { state[0] = 1; } if (state[3] == 0 && state[4] == 0 && state[5] == 0) { state[3] = 1; } } namespace jags { namespace lecuyer { RngStream::RngStream(unsigned int state[6]) : RmathRNG("lecuyer::RngStream", KINDERMAN_RAMAGE) { if (!checkState(state)) { throwLogicError("Invalid initial state in RngStream"); } for (int i = 0; i < 6; ++i) { Cg[i] = state[i]; } } bool RngStream::setState(vector const &state) { /* Pass from int to double via unsigned int */ if (state.size() != 6) return false; unsigned int cg[6]; for (int i = 0; i < 6; ++i) { cg[i] = static_cast(state[i]); } if (!checkState(cg)) return false; for (int i = 0; i < 6; ++i) { Cg[i] = cg[i]; } return true; } void RngStream::getState(vector &state) const { /* We pass from double to integer via unsigned integer so as not to lose any information */ state.clear(); unsigned int cg[6]; for (int i = 0; i < 6; ++i) { cg[i] = Cg[i]; } for (int i = 0; i < 6; ++i) { state.push_back(static_cast(cg[i])); } } double RngStream::uniform () { /* Component 1 */ double p1 = a12 * Cg[1] - a13n * Cg[0]; int k = p1 / m1; p1 -= k * m1; if (p1 < 0.0) p1 += m1; Cg[0] = Cg[1]; Cg[1] = Cg[2]; Cg[2] = p1; /* Component 2 */ double p2 = a21 * Cg[5] - a23n * Cg[3]; k = p2 / m2; p2 -= k * m2; if (p2 < 0.0) p2 += m2; Cg[3] = Cg[4]; Cg[4] = Cg[5]; Cg[5] = p2; /* Combination */ return ((p1 > p2) ? (p1 - p2) * norm : (p1 - p2 + m1) * norm); } void RngStream::init(unsigned int seed) { unsigned int state[6]; seedToState(seed, state); for (int i = 0; i < 6; ++i) { Cg[i] = state[i]; } } void RngStream::seedToState(unsigned int seed, unsigned int state[6]) { for (unsigned int i = 0; i < 6; i++) { for(unsigned int j = 0; j < 50; j++) { seed = (69069 * seed + 1); } state[i] = seed; } fixState(state); } }} JAGS-4.3.2/src/modules/lecuyer/RngStreamFactory.cc0000664000175000017500000001063314224052515016642 00000000000000/* * Combined Multiple Recursive Generator MRG32k3a * * L'Ecuyer P (1999) Good parameters and implementations for combined * multiple recursive random number generators. Operations Research 47(1), * 159-164. * * L'Ecuyer P, Simard R, Chen EJ, Kelton WD (2002) An object-oriented * random-number package with many long streams and substreams, Operations * Resarch 50(6), 1073-1075. * Adapted from the original code by Pierre L'Ecuyer in the R package * rlecuyer 0.2. The core of the code is copyright Pierre L'Ecuyer, * University of Montreal (lecuyer@iro.UMontreal.ca) 2001, and * released under the GPL license. * * The core algorithm is untouched, but the interface has been * simplified and adapted to JAGS. The options to produce antithetical * and/or high- precision random variables have been removed. The * code to advance the state of the RNG to the start of the next stream * or substream is in RngStreamFactory.cc */ #include "RngStreamFactory.h" #include "RngStream.h" #include using std::vector; using std::time; using std::string; #define two17 131072.0 /* 2^17 */ #define two53 9007199254740992.0 /* 2^53 */ static const double A1p76[3][3] = { { 82758667.0, 1871391091.0, 4127413238.0 }, { 3672831523.0, 69195019.0, 1871391091.0 }, { 3672091415.0, 3528743235.0, 69195019.0 } }; static const double A2p76[3][3] = { { 1511326704.0, 3759209742.0, 1610795712.0 }, { 4292754251.0, 1511326704.0, 3889917532.0 }, { 3859662829.0, 4292754251.0, 3708466080.0 } }; static const double A1p127[3][3] = { { 2427906178.0, 3580155704.0, 949770784.0 }, { 226153695.0, 1230515664.0, 3580155704.0 }, { 1988835001.0, 986791581.0, 1230515664.0 } }; static const double A2p127[3][3] = { { 1464411153.0, 277697599.0, 1610723613.0 }, { 32183930.0, 1464411153.0, 1022607788.0 }, { 2824425944.0, 32183930.0, 2093834863.0 } }; static double MultModM (double a, double s, double c, double m) /* Compute (a*s + c) % m. m must be < 2^35. Works also for s, c < 0 */ { double v; int a1; v = a * s + c; if ((v >= two53) || (v <= -two53)) { a1 = (int) (a / two17); a -= a1 * two17; v = a1 * s; a1 = (int) (v / m); v -= a1 * m; v = v * two17 + a * s + c; } a1 = (int) (v / m); if ((v -= a1 * m) < 0.0) return v += m; else return v; } static void MatVecModM (const double A[3][3], double s[3], double m) /* Returns s = A*s % m. Assumes that -m < s[i] < m. */ { double x[3] = {0,0,0}; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { x[i] = MultModM (A[i][j], s[j], x[i], m); } } for (int i = 0; i < 3; ++i) s[i] = x[i]; } namespace jags { namespace lecuyer { RngStreamFactory::RngStreamFactory() { unsigned int seed = static_cast(time(NULL)); setSeed(seed); } RngStreamFactory::~RngStreamFactory() { for (unsigned int i = 0; i < _rngvec.size(); ++i) { delete _rngvec[i]; } } void RngStreamFactory::setSeed(unsigned int seed) { unsigned int state[6]; RngStream::seedToState(seed, state); for (int i = 0; i < 6; ++i) { Bg[i] = Ig[i] = state[i]; } } void RngStreamFactory::nextStream () { MatVecModM (A1p127, Ig, m1); MatVecModM (A2p127, &Ig[3], m2); for (int i = 0; i < 6; ++i) { Bg[i] = Ig[i]; } } void RngStreamFactory::nextSubstream () { MatVecModM (A1p76, Bg, m1); MatVecModM (A2p76, &Bg[3], m2); } vector RngStreamFactory::makeRNGs(unsigned int n) { vector ans; for (unsigned int i = 0; i < n; ++i) { unsigned int state[6]; for (int j = 0; j < 6; ++j) { state[j] = Bg[j]; } RNG *rng = new RngStream(state); nextSubstream(); _rngvec.push_back(rng); ans.push_back(rng); } nextStream(); return ans; } RNG * RngStreamFactory::makeRNG(string const &name) { if (name == "lecuyer::RngStream") { unsigned int state[6]; for (int j = 0; j < 6; ++j) { state[j] = Bg[j]; } RNG *rng = new RngStream(state); nextStream(); _rngvec.push_back(rng); return rng; } else { return 0; } } string RngStreamFactory::name() const { return "lecuyer::RngStream"; } }} JAGS-4.3.2/src/modules/glm/0000755000175000017500000000000014400711327012262 500000000000000JAGS-4.3.2/src/modules/glm/Makefile.am0000664000175000017500000000233514224052371014244 00000000000000SUBDIRS = SSparse samplers distributions jagsmod_LTLIBRARIES = glm.la glm_la_SOURCES = glm.cc glm_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include glm_la_LIBADD = samplers/libglmsampler.la SSparse/ssparse.la \ distributions/libglmdist.la \ $(top_builddir)/src/lib/libjags.la \ $(top_builddir)/src/jrmath/libjrmath.la \ @LAPACK_LIBS@ @BLAS_LIBS@ glm_la_LDFLAGS = -module -avoid-version if WINDOWS glm_la_LDFLAGS += -no-undefined endif ### Test library if CANCHECK check_LTLIBRARIES = libglmtest.la libglmtest_la_SOURCES = testglm.cc testglm.h libglmtest_la_CPPFLAGS = -I$(top_srcdir)/src/include libglmtest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) libglmtest_la_LDFLAGS = $(CPPUNIT_LIBS) libglmtest_la_LIBADD = samplers/libglmsamptest.la \ distributions/libglmdisttest.la \ distributions/libglmdist.la \ samplers/libglmsampler.la \ $(top_builddir)/src/lib/libtest.la \ $(top_builddir)/src/lib/libjags.la \ $(top_builddir)/src/jrmath/libjrmath.la \ $(top_builddir)/src/modules/base/rngs/libbaserngs.la \ @LAPACK_LIBS@ @BLAS_LIBS@ if WINDOWS libglmtest_la_LDFLAGS += -no-undefined endif endif JAGS-4.3.2/src/modules/glm/Makefile.in0000644000175000017500000007724714400675236014300 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WINDOWS_TRUE@am__append_1 = -no-undefined @CANCHECK_TRUE@@WINDOWS_TRUE@am__append_2 = -no-undefined subdir = src/modules/glm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(jagsmoddir)" LTLIBRARIES = $(jagsmod_LTLIBRARIES) glm_la_DEPENDENCIES = samplers/libglmsampler.la SSparse/ssparse.la \ distributions/libglmdist.la $(top_builddir)/src/lib/libjags.la \ $(top_builddir)/src/jrmath/libjrmath.la am_glm_la_OBJECTS = glm_la-glm.lo glm_la_OBJECTS = $(am_glm_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = glm_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(glm_la_LDFLAGS) $(LDFLAGS) -o $@ @CANCHECK_TRUE@libglmtest_la_DEPENDENCIES = \ @CANCHECK_TRUE@ samplers/libglmsamptest.la \ @CANCHECK_TRUE@ distributions/libglmdisttest.la \ @CANCHECK_TRUE@ distributions/libglmdist.la \ @CANCHECK_TRUE@ samplers/libglmsampler.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libtest.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libjags.la \ @CANCHECK_TRUE@ $(top_builddir)/src/jrmath/libjrmath.la \ @CANCHECK_TRUE@ $(top_builddir)/src/modules/base/rngs/libbaserngs.la am__libglmtest_la_SOURCES_DIST = testglm.cc testglm.h @CANCHECK_TRUE@am_libglmtest_la_OBJECTS = libglmtest_la-testglm.lo libglmtest_la_OBJECTS = $(am_libglmtest_la_OBJECTS) libglmtest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libglmtest_la_CXXFLAGS) $(CXXFLAGS) $(libglmtest_la_LDFLAGS) \ $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libglmtest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/glm_la-glm.Plo \ ./$(DEPDIR)/libglmtest_la-testglm.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(glm_la_SOURCES) $(libglmtest_la_SOURCES) DIST_SOURCES = $(glm_la_SOURCES) $(am__libglmtest_la_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = SSparse samplers distributions jagsmod_LTLIBRARIES = glm.la glm_la_SOURCES = glm.cc glm_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include glm_la_LIBADD = samplers/libglmsampler.la SSparse/ssparse.la \ distributions/libglmdist.la \ $(top_builddir)/src/lib/libjags.la \ $(top_builddir)/src/jrmath/libjrmath.la \ @LAPACK_LIBS@ @BLAS_LIBS@ glm_la_LDFLAGS = -module -avoid-version $(am__append_1) ### Test library @CANCHECK_TRUE@check_LTLIBRARIES = libglmtest.la @CANCHECK_TRUE@libglmtest_la_SOURCES = testglm.cc testglm.h @CANCHECK_TRUE@libglmtest_la_CPPFLAGS = -I$(top_srcdir)/src/include @CANCHECK_TRUE@libglmtest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) @CANCHECK_TRUE@libglmtest_la_LDFLAGS = $(CPPUNIT_LIBS) $(am__append_2) @CANCHECK_TRUE@libglmtest_la_LIBADD = samplers/libglmsamptest.la \ @CANCHECK_TRUE@ distributions/libglmdisttest.la \ @CANCHECK_TRUE@ distributions/libglmdist.la \ @CANCHECK_TRUE@ samplers/libglmsampler.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libtest.la \ @CANCHECK_TRUE@ $(top_builddir)/src/lib/libjags.la \ @CANCHECK_TRUE@ $(top_builddir)/src/jrmath/libjrmath.la \ @CANCHECK_TRUE@ $(top_builddir)/src/modules/base/rngs/libbaserngs.la \ @CANCHECK_TRUE@ @LAPACK_LIBS@ @BLAS_LIBS@ all: all-recursive .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } install-jagsmodLTLIBRARIES: $(jagsmod_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(jagsmoddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(jagsmoddir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(jagsmoddir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(jagsmoddir)"; \ } uninstall-jagsmodLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(jagsmoddir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(jagsmoddir)/$$f"; \ done clean-jagsmodLTLIBRARIES: -test -z "$(jagsmod_LTLIBRARIES)" || rm -f $(jagsmod_LTLIBRARIES) @list='$(jagsmod_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } glm.la: $(glm_la_OBJECTS) $(glm_la_DEPENDENCIES) $(EXTRA_glm_la_DEPENDENCIES) $(AM_V_CXXLD)$(glm_la_LINK) -rpath $(jagsmoddir) $(glm_la_OBJECTS) $(glm_la_LIBADD) $(LIBS) libglmtest.la: $(libglmtest_la_OBJECTS) $(libglmtest_la_DEPENDENCIES) $(EXTRA_libglmtest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libglmtest_la_LINK) $(am_libglmtest_la_rpath) $(libglmtest_la_OBJECTS) $(libglmtest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glm_la-glm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmtest_la-testglm.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< glm_la-glm.lo: glm.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(glm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT glm_la-glm.lo -MD -MP -MF $(DEPDIR)/glm_la-glm.Tpo -c -o glm_la-glm.lo `test -f 'glm.cc' || echo '$(srcdir)/'`glm.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/glm_la-glm.Tpo $(DEPDIR)/glm_la-glm.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='glm.cc' object='glm_la-glm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(glm_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o glm_la-glm.lo `test -f 'glm.cc' || echo '$(srcdir)/'`glm.cc libglmtest_la-testglm.lo: testglm.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmtest_la_CPPFLAGS) $(CPPFLAGS) $(libglmtest_la_CXXFLAGS) $(CXXFLAGS) -MT libglmtest_la-testglm.lo -MD -MP -MF $(DEPDIR)/libglmtest_la-testglm.Tpo -c -o libglmtest_la-testglm.lo `test -f 'testglm.cc' || echo '$(srcdir)/'`testglm.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmtest_la-testglm.Tpo $(DEPDIR)/libglmtest_la-testglm.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testglm.cc' object='libglmtest_la-testglm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmtest_la_CPPFLAGS) $(CPPFLAGS) $(libglmtest_la_CXXFLAGS) $(CXXFLAGS) -c -o libglmtest_la-testglm.lo `test -f 'testglm.cc' || echo '$(srcdir)/'`testglm.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(jagsmoddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-checkLTLIBRARIES clean-generic \ clean-jagsmodLTLIBRARIES clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/glm_la-glm.Plo -rm -f ./$(DEPDIR)/libglmtest_la-testglm.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-jagsmodLTLIBRARIES install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/glm_la-glm.Plo -rm -f ./$(DEPDIR)/libglmtest_la-testglm.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-jagsmodLTLIBRARIES .MAKE: $(am__recursive_targets) check-am install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-checkLTLIBRARIES \ clean-generic clean-jagsmodLTLIBRARIES clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-jagsmodLTLIBRARIES \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am \ uninstall-jagsmodLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/glm.cc0000664000175000017500000000376114224052515013302 00000000000000#include //#include "samplers/IWLSFactory.h" #include "samplers/HolmesHeldFactory.h" //#include "samplers/ConjugateFFactory.h" #include "samplers/GLMGenericFactory.h" #include "samplers/ScaledGammaFactory.h" #include "samplers/ScaledWishartFactory.h" #include "samplers/REScaledGammaFactory.h" #include "samplers/REScaledWishartFactory.h" #include "samplers/REGammaFactory.h" #include "distributions/DScaledGamma.h" #include "distributions/DScaledWishart.h" #include "distributions/DOrderedLogit.h" #include "distributions/DOrderedProbit.h" #include using std::vector; cholmod_common *glm_wk = 0; /* Workspace for CHOLMOD */ namespace jags { namespace glm { class GLMModule : public Module { public: GLMModule(); ~GLMModule(); }; GLMModule::GLMModule() : Module("glm") { glm_wk = new cholmod_common; cholmod_start(glm_wk); //Force use of simplicial factorization. Supernodal factorizations //have a completely different data structure, although held in //the same object. glm_wk->supernodal = CHOLMOD_SIMPLICIAL; /* //Force use of LL' factorisation instead of LDL //glm_wk->final_ll = true; //For debuggin purposes we may choose not to reorder matrices //Use only on small problems glm_wk->nmethods = 1 ; glm_wk->method [0].ordering = CHOLMOD_NATURAL ; glm_wk->postorder = 0 ; */ insert(new ScaledGammaFactory); insert(new ScaledWishartFactory); //insert(new IWLSFactory); insert(new GLMGenericFactory); insert(new HolmesHeldFactory); /* insert(new REScaledGammaFactory); insert(new REScaledWishartFactory); insert(new REGammaFactory); */ insert(new DScaledGamma); insert(new DScaledWishart); insert(new DOrderedLogit); insert(new DOrderedProbit); } GLMModule::~GLMModule() { vector const &svec = samplerFactories(); for (unsigned int i = 0; i < svec.size(); ++i) { delete svec[i]; } cholmod_finish(glm_wk); delete glm_wk; } }} jags::glm::GLMModule _glm_module; JAGS-4.3.2/src/modules/glm/testglm.cc0000664000175000017500000000041514224052371014173 00000000000000#include "testglm.h" #include "samplers/testglmsamp.h" #include "distributions/testglmdist.h" #include void init_glm_test() { CPPUNIT_TEST_SUITE_REGISTRATION( GLMSampTest ); CPPUNIT_TEST_SUITE_REGISTRATION( GLMDistTest ); } JAGS-4.3.2/src/modules/glm/testglm.h0000664000175000017500000000013114224052371014030 00000000000000#ifndef GLM_TEST_H_ #define GLM_TEST_H_ void init_glm_test(); #endif /* GLM_TEST_H_ */ JAGS-4.3.2/src/modules/glm/SSparse/0000755000175000017500000000000014400711326013641 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/Makefile.am0000664000175000017500000000043414224052371015622 00000000000000SUBDIRS = config AMD CAMD CCOLAMD COLAMD CHOLMOD noinst_LTLIBRARIES = ssparse.la ssparse_la_SOURCES = ssparse_la_LIBADD = AMD/amd.la CAMD/camd.la CCOLAMD/ccolamd.la \ COLAMD/colamd.la CHOLMOD/cholmod.la config/config.la ssparse_la_LDFLAGS = -no-undefined -module -avoid-version JAGS-4.3.2/src/modules/glm/SSparse/Makefile.in0000644000175000017500000005274214400675236015651 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) ssparse_la_DEPENDENCIES = AMD/amd.la CAMD/camd.la CCOLAMD/ccolamd.la \ COLAMD/colamd.la CHOLMOD/cholmod.la config/config.la am_ssparse_la_OBJECTS = ssparse_la_OBJECTS = $(am_ssparse_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = ssparse_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(ssparse_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(ssparse_la_SOURCES) DIST_SOURCES = $(ssparse_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = config AMD CAMD CCOLAMD COLAMD CHOLMOD noinst_LTLIBRARIES = ssparse.la ssparse_la_SOURCES = ssparse_la_LIBADD = AMD/amd.la CAMD/camd.la CCOLAMD/ccolamd.la \ COLAMD/colamd.la CHOLMOD/cholmod.la config/config.la ssparse_la_LDFLAGS = -no-undefined -module -avoid-version all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } ssparse.la: $(ssparse_la_OBJECTS) $(ssparse_la_DEPENDENCIES) $(EXTRA_ssparse_la_DEPENDENCIES) $(AM_V_CCLD)$(ssparse_la_LINK) $(ssparse_la_OBJECTS) $(ssparse_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/config/0000755000175000017500000000000014400711326015106 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/config/Makefile.am0000664000175000017500000000036214224052371017067 00000000000000noinst_LTLIBRARIES = config.la config_la_SOURCES = SuiteSparse_config.c config_la_CPPFLAGS = -I$(top_srcdir)/src/modules/glm/SSparse/config noinst_HEADERS = SuiteSparse_config.h config_la_LDFLAGS = -no-undefined -module -avoid-version JAGS-4.3.2/src/modules/glm/SSparse/config/SuiteSparse_config.h0000664000175000017500000002134014224052371020777 00000000000000/* ========================================================================== */ /* === SuiteSparse_config =================================================== */ /* ========================================================================== */ /* Configuration file for SuiteSparse: a Suite of Sparse matrix packages * (AMD, COLAMD, CCOLAMD, CAMD, CHOLMOD, UMFPACK, CXSparse, and others). * * SuiteSparse_config.h provides the definition of the long integer. On most * systems, a C program can be compiled in LP64 mode, in which long's and * pointers are both 64-bits, and int's are 32-bits. Windows 64, however, uses * the LLP64 model, in which int's and long's are 32-bits, and long long's and * pointers are 64-bits. * * SuiteSparse packages that include long integer versions are * intended for the LP64 mode. However, as a workaround for Windows 64 * (and perhaps other systems), the long integer can be redefined. * * If _WIN64 is defined, then the __int64 type is used instead of long. * * The long integer can also be defined at compile time. For example, this * could be added to SuiteSparse_config.mk: * * CFLAGS = -O -D'SuiteSparse_long=long long' \ * -D'SuiteSparse_long_max=9223372036854775801' -D'SuiteSparse_long_idd="lld"' * * This file defines SuiteSparse_long as either long (on all but _WIN64) or * __int64 on Windows 64. The intent is that a SuiteSparse_long is always a * 64-bit integer in a 64-bit code. ptrdiff_t might be a better choice than * long; it is always the same size as a pointer. * * This file also defines the SUITESPARSE_VERSION and related definitions. * * Copyright (c) 2012, Timothy A. Davis. No licensing restrictions apply * to this file or to the SuiteSparse_config directory. * Author: Timothy A. Davis. */ #ifndef SUITESPARSE_CONFIG_H #define SUITESPARSE_CONFIG_H #ifdef __cplusplus extern "C" { #endif #include #include /* ========================================================================== */ /* === SuiteSparse_long ===================================================== */ /* ========================================================================== */ #ifndef SuiteSparse_long #ifdef _WIN64 #define SuiteSparse_long __int64 #define SuiteSparse_long_max _I64_MAX #define SuiteSparse_long_idd "I64d" #else #define SuiteSparse_long long #define SuiteSparse_long_max LONG_MAX #define SuiteSparse_long_idd "ld" #endif #define SuiteSparse_long_id "%" SuiteSparse_long_idd #endif /* ========================================================================== */ /* === SuiteSparse_config parameters and functions ========================== */ /* ========================================================================== */ /* SuiteSparse-wide parameters are placed in this struct. It is meant to be an extern, globally-accessible struct. It is not meant to be updated frequently by multiple threads. Rather, if an application needs to modify SuiteSparse_config, it should do it once at the beginning of the application, before multiple threads are launched. The intent of these function pointers is that they not be used in your application directly, except to assign them to the desired user-provided functions. Rather, you should use the */ struct SuiteSparse_config_struct { void *(*malloc_func) (size_t) ; /* pointer to malloc */ void *(*calloc_func) (size_t, size_t) ; /* pointer to calloc */ void *(*realloc_func) (void *, size_t) ; /* pointer to realloc */ void (*free_func) (void *) ; /* pointer to free */ int (*printf_func) (const char *, ...) ; /* pointer to printf */ double (*hypot_func) (double, double) ; /* pointer to hypot */ int (*divcomplex_func) (double, double, double, double, double *, double *); } ; extern struct SuiteSparse_config_struct SuiteSparse_config ; void SuiteSparse_start ( void ) ; /* called to start SuiteSparse */ void SuiteSparse_finish ( void ) ; /* called to finish SuiteSparse */ void *SuiteSparse_malloc /* pointer to allocated block of memory */ ( size_t nitems, /* number of items to malloc (>=1 is enforced) */ size_t size_of_item /* sizeof each item */ ) ; void *SuiteSparse_calloc /* pointer to allocated block of memory */ ( size_t nitems, /* number of items to calloc (>=1 is enforced) */ size_t size_of_item /* sizeof each item */ ) ; void *SuiteSparse_realloc /* pointer to reallocated block of memory, or to original block if the realloc failed. */ ( size_t nitems_new, /* new number of items in the object */ size_t nitems_old, /* old number of items in the object */ size_t size_of_item, /* sizeof each item */ void *p, /* old object to reallocate */ int *ok /* 1 if successful, 0 otherwise */ ) ; void *SuiteSparse_free /* always returns NULL */ ( void *p /* block to free */ ) ; void SuiteSparse_tic /* start the timer */ ( double tic [2] /* output, contents undefined on input */ ) ; double SuiteSparse_toc /* return time in seconds since last tic */ ( double tic [2] /* input: from last call to SuiteSparse_tic */ ) ; double SuiteSparse_time /* returns current wall clock time in seconds */ ( void ) ; /* returns sqrt (x^2 + y^2), computed reliably */ double SuiteSparse_hypot (double x, double y) ; /* complex division of c = a/b */ int SuiteSparse_divcomplex ( double ar, double ai, /* real and imaginary parts of a */ double br, double bi, /* real and imaginary parts of b */ double *cr, double *ci /* real and imaginary parts of c */ ) ; /* determine which timer to use, if any */ #ifndef NTIMER #ifdef _POSIX_C_SOURCE #if _POSIX_C_SOURCE >= 199309L #define SUITESPARSE_TIMER_ENABLED #endif #endif #endif /* SuiteSparse printf macro */ #define SUITESPARSE_PRINTF(params) \ { \ if (SuiteSparse_config.printf_func != NULL) \ { \ (void) (SuiteSparse_config.printf_func) params ; \ } \ } /* ========================================================================== */ /* === SuiteSparse version ================================================== */ /* ========================================================================== */ /* SuiteSparse is not a package itself, but a collection of packages, some of * which must be used together (UMFPACK requires AMD, CHOLMOD requires AMD, * COLAMD, CAMD, and CCOLAMD, etc). A version number is provided here for the * collection itself. The versions of packages within each version of * SuiteSparse are meant to work together. Combining one package from one * version of SuiteSparse, with another package from another version of * SuiteSparse, may or may not work. * * SuiteSparse contains the following packages: * * SuiteSparse_config version 4.5.1 (version always the same as SuiteSparse) * AMD version 2.4.4 * BTF version 1.2.4 * CAMD version 2.4.4 * CCOLAMD version 2.9.4 * CHOLMOD version 3.0.9 * COLAMD version 2.9.4 * CSparse version 3.1.7 * CXSparse version 3.1.7 * GPUQREngine version 1.0.3 * KLU version 1.3.6 * LDL version 2.2.4 * RBio version 2.2.4 * SPQR version 2.0.5 * SuiteSparse_GPURuntime version 1.0.3 * UMFPACK version 5.7.3 * MATLAB_Tools various packages & M-files * xerbla version 1.0.2 * * Other package dependencies: * BLAS required by CHOLMOD and UMFPACK * LAPACK required by CHOLMOD * METIS 5.1.0 required by CHOLMOD (optional) and KLU (optional) * CUBLAS, CUDART NVIDIA libraries required by CHOLMOD and SPQR when * they are compiled with GPU acceleration. */ int SuiteSparse_version /* returns SUITESPARSE_VERSION */ ( /* output, not defined on input. Not used if NULL. Returns the three version codes in version [0..2]: version [0] is SUITESPARSE_MAIN_VERSION version [1] is SUITESPARSE_SUB_VERSION version [2] is SUITESPARSE_SUBSUB_VERSION */ int version [3] ) ; /* Versions prior to 4.2.0 do not have the above function. The following code fragment will work with any version of SuiteSparse: #ifdef SUITESPARSE_HAS_VERSION_FUNCTION v = SuiteSparse_version (NULL) ; #else v = SUITESPARSE_VERSION ; #endif */ #define SUITESPARSE_HAS_VERSION_FUNCTION #define SUITESPARSE_DATE "Jan 30, 2016" #define SUITESPARSE_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define SUITESPARSE_MAIN_VERSION 4 #define SUITESPARSE_SUB_VERSION 5 #define SUITESPARSE_SUBSUB_VERSION 0 #define SUITESPARSE_VERSION \ SUITESPARSE_VER_CODE(SUITESPARSE_MAIN_VERSION,SUITESPARSE_SUB_VERSION) #ifdef __cplusplus } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/config/Makefile.in0000644000175000017500000005057514400675236017120 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/config ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) config_la_LIBADD = am_config_la_OBJECTS = config_la-SuiteSparse_config.lo config_la_OBJECTS = $(am_config_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = config_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(config_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/config_la-SuiteSparse_config.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(config_la_SOURCES) DIST_SOURCES = $(config_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = config.la config_la_SOURCES = SuiteSparse_config.c config_la_CPPFLAGS = -I$(top_srcdir)/src/modules/glm/SSparse/config noinst_HEADERS = SuiteSparse_config.h config_la_LDFLAGS = -no-undefined -module -avoid-version all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/config/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/config/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } config.la: $(config_la_OBJECTS) $(config_la_DEPENDENCIES) $(EXTRA_config_la_DEPENDENCIES) $(AM_V_CCLD)$(config_la_LINK) $(config_la_OBJECTS) $(config_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config_la-SuiteSparse_config.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< config_la-SuiteSparse_config.lo: SuiteSparse_config.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(config_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT config_la-SuiteSparse_config.lo -MD -MP -MF $(DEPDIR)/config_la-SuiteSparse_config.Tpo -c -o config_la-SuiteSparse_config.lo `test -f 'SuiteSparse_config.c' || echo '$(srcdir)/'`SuiteSparse_config.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/config_la-SuiteSparse_config.Tpo $(DEPDIR)/config_la-SuiteSparse_config.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SuiteSparse_config.c' object='config_la-SuiteSparse_config.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(config_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o config_la-SuiteSparse_config.lo `test -f 'SuiteSparse_config.c' || echo '$(srcdir)/'`SuiteSparse_config.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/config_la-SuiteSparse_config.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/config_la-SuiteSparse_config.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/config/SuiteSparse_config.c0000664000175000017500000004010014224052371020765 00000000000000/* ========================================================================== */ /* === SuiteSparse_config =================================================== */ /* ========================================================================== */ /* SuiteSparse configuration : memory manager and printf functions. */ /* Copyright (c) 2013, Timothy A. Davis. No licensing restrictions * apply to this file or to the SuiteSparse_config directory. * Author: Timothy A. Davis. */ #include #include #ifndef NPRINT #include #endif #ifdef MATLAB_MEX_FILE #include "mex.h" #include "matrix.h" #endif #ifndef NULL #define NULL ((void *) 0) #endif #include "SuiteSparse_config.h" /* -------------------------------------------------------------------------- */ /* SuiteSparse_config : a global extern struct */ /* -------------------------------------------------------------------------- */ /* The SuiteSparse_config struct is available to all SuiteSparse functions and to all applications that use those functions. It must be modified with care, particularly in a multithreaded context. Normally, the application will initialize this object once, via SuiteSparse_start, possibily followed by application-specific modifications if the applications wants to use alternative memory manager functions. The user can redefine these global pointers at run-time to change the memory manager and printf function used by SuiteSparse. If -DNMALLOC is defined at compile-time, then no memory-manager is specified. You must define them at run-time, after calling SuiteSparse_start. If -DPRINT is defined a compile time, then printf is disabled, and SuiteSparse will not use printf. */ struct SuiteSparse_config_struct SuiteSparse_config = { /* memory management functions */ #ifndef NMALLOC #ifdef MATLAB_MEX_FILE /* MATLAB mexFunction: */ mxMalloc, mxCalloc, mxRealloc, mxFree, #else /* standard ANSI C: */ malloc, calloc, realloc, free, #endif #else /* no memory manager defined; you must define one at run-time: */ NULL, NULL, NULL, NULL, #endif /* printf function */ #ifndef NPRINT #ifdef MATLAB_MEX_FILE /* MATLAB mexFunction: */ mexPrintf, #else /* standard ANSI C: */ printf, #endif #else /* printf is disabled */ NULL, #endif SuiteSparse_hypot, SuiteSparse_divcomplex } ; /* -------------------------------------------------------------------------- */ /* SuiteSparse_start */ /* -------------------------------------------------------------------------- */ /* All applications that use SuiteSparse should call SuiteSparse_start prior to using any SuiteSparse function. Only a single thread should call this function, in a multithreaded application. Currently, this function is optional, since all this function currently does is to set the four memory function pointers to NULL (which tells SuiteSparse to use the default functions). In a multi- threaded application, only a single thread should call this function. Future releases of SuiteSparse might enforce a requirement that SuiteSparse_start be called prior to calling any SuiteSparse function. */ void SuiteSparse_start ( void ) { /* memory management functions */ #ifndef NMALLOC #ifdef MATLAB_MEX_FILE /* MATLAB mexFunction: */ SuiteSparse_config.malloc_func = mxMalloc ; SuiteSparse_config.calloc_func = mxCalloc ; SuiteSparse_config.realloc_func = mxRealloc ; SuiteSparse_config.free_func = mxFree ; #else /* standard ANSI C: */ SuiteSparse_config.malloc_func = malloc ; SuiteSparse_config.calloc_func = calloc ; SuiteSparse_config.realloc_func = realloc ; SuiteSparse_config.free_func = free ; #endif #else /* no memory manager defined; you must define one after calling SuiteSparse_start */ SuiteSparse_config.malloc_func = NULL ; SuiteSparse_config.calloc_func = NULL ; SuiteSparse_config.realloc_func = NULL ; SuiteSparse_config.free_func = NULL ; #endif /* printf function */ #ifndef NPRINT #ifdef MATLAB_MEX_FILE /* MATLAB mexFunction: */ SuiteSparse_config.printf_func = mexPrintf ; #else /* standard ANSI C: */ SuiteSparse_config.printf_func = printf ; #endif #else /* printf is disabled */ SuiteSparse_config.printf_func = NULL ; #endif /* math functions */ SuiteSparse_config.hypot_func = SuiteSparse_hypot ; SuiteSparse_config.divcomplex_func = SuiteSparse_divcomplex ; } /* -------------------------------------------------------------------------- */ /* SuiteSparse_finish */ /* -------------------------------------------------------------------------- */ /* This currently does nothing, but in the future, applications should call SuiteSparse_start before calling any SuiteSparse function, and then SuiteSparse_finish after calling the last SuiteSparse function, just before exiting. In a multithreaded application, only a single thread should call this function. Future releases of SuiteSparse might use this function for any SuiteSparse-wide cleanup operations or finalization of statistics. */ void SuiteSparse_finish ( void ) { /* do nothing */ ; } /* -------------------------------------------------------------------------- */ /* SuiteSparse_malloc: malloc wrapper */ /* -------------------------------------------------------------------------- */ void *SuiteSparse_malloc /* pointer to allocated block of memory */ ( size_t nitems, /* number of items to malloc */ size_t size_of_item /* sizeof each item */ ) { void *p ; size_t size ; if (nitems < 1) nitems = 1 ; if (size_of_item < 1) size_of_item = 1 ; size = nitems * size_of_item ; if (size != ((double) nitems) * size_of_item) { /* size_t overflow */ p = NULL ; } else { p = (void *) (SuiteSparse_config.malloc_func) (size) ; } return (p) ; } /* -------------------------------------------------------------------------- */ /* SuiteSparse_calloc: calloc wrapper */ /* -------------------------------------------------------------------------- */ void *SuiteSparse_calloc /* pointer to allocated block of memory */ ( size_t nitems, /* number of items to calloc */ size_t size_of_item /* sizeof each item */ ) { void *p ; size_t size ; if (nitems < 1) nitems = 1 ; if (size_of_item < 1) size_of_item = 1 ; size = nitems * size_of_item ; if (size != ((double) nitems) * size_of_item) { /* size_t overflow */ p = NULL ; } else { p = (void *) (SuiteSparse_config.calloc_func) (nitems, size_of_item) ; } return (p) ; } /* -------------------------------------------------------------------------- */ /* SuiteSparse_realloc: realloc wrapper */ /* -------------------------------------------------------------------------- */ /* If p is non-NULL on input, it points to a previously allocated object of size nitems_old * size_of_item. The object is reallocated to be of size nitems_new * size_of_item. If p is NULL on input, then a new object of that size is allocated. On success, a pointer to the new object is returned, and ok is returned as 1. If the allocation fails, ok is set to 0 and a pointer to the old (unmodified) object is returned. */ void *SuiteSparse_realloc /* pointer to reallocated block of memory, or to original block if the realloc failed. */ ( size_t nitems_new, /* new number of items in the object */ size_t nitems_old, /* old number of items in the object */ size_t size_of_item, /* sizeof each item */ void *p, /* old object to reallocate */ int *ok /* 1 if successful, 0 otherwise */ ) { size_t size ; if (nitems_old < 1) nitems_old = 1 ; if (nitems_new < 1) nitems_new = 1 ; if (size_of_item < 1) size_of_item = 1 ; size = nitems_new * size_of_item ; if (size != ((double) nitems_new) * size_of_item) { /* size_t overflow */ (*ok) = 0 ; } else if (p == NULL) { /* a fresh object is being allocated */ p = SuiteSparse_malloc (nitems_new, size_of_item) ; (*ok) = (p != NULL) ; } else if (nitems_old == nitems_new) { /* the object does not change; do nothing */ (*ok) = 1 ; } else { /* change the size of the object from nitems_old to nitems_new */ void *pnew ; pnew = (void *) (SuiteSparse_config.realloc_func) (p, size) ; if (pnew == NULL) { if (nitems_new < nitems_old) { /* the attempt to reduce the size of the block failed, but the old block is unchanged. So pretend to succeed. */ (*ok) = 1 ; } else { /* out of memory */ (*ok) = 0 ; } } else { /* success */ p = pnew ; (*ok) = 1 ; } } return (p) ; } /* -------------------------------------------------------------------------- */ /* SuiteSparse_free: free wrapper */ /* -------------------------------------------------------------------------- */ void *SuiteSparse_free /* always returns NULL */ ( void *p /* block to free */ ) { if (p) { (SuiteSparse_config.free_func) (p) ; } return (NULL) ; } /* -------------------------------------------------------------------------- */ /* SuiteSparse_tic: return current wall clock time */ /* -------------------------------------------------------------------------- */ /* Returns the number of seconds (tic [0]) and nanoseconds (tic [1]) since some * unspecified but fixed time in the past. If no timer is installed, zero is * returned. A scalar double precision value for 'tic' could be used, but this * might cause loss of precision because clock_getttime returns the time from * some distant time in the past. Thus, an array of size 2 is used. * * The timer is enabled by default. To disable the timer, compile with * -DNTIMER. If enabled on a POSIX C 1993 system, the timer requires linking * with the -lrt library. * * example: * * double tic [2], r, s, t ; * SuiteSparse_tic (tic) ; // start the timer * // do some work A * t = SuiteSparse_toc (tic) ; // t is time for work A, in seconds * // do some work B * s = SuiteSparse_toc (tic) ; // s is time for work A and B, in seconds * SuiteSparse_tic (tic) ; // restart the timer * // do some work C * r = SuiteSparse_toc (tic) ; // s is time for work C, in seconds * * A double array of size 2 is used so that this routine can be more easily * ported to non-POSIX systems. The caller does not rely on the POSIX * include file. */ #ifdef SUITESPARSE_TIMER_ENABLED #include void SuiteSparse_tic ( double tic [2] /* output, contents undefined on input */ ) { /* POSIX C 1993 timer, requires -librt */ struct timespec t ; clock_gettime (CLOCK_MONOTONIC, &t) ; tic [0] = (double) (t.tv_sec) ; tic [1] = (double) (t.tv_nsec) ; } #else void SuiteSparse_tic ( double tic [2] /* output, contents undefined on input */ ) { /* no timer installed */ tic [0] = 0 ; tic [1] = 0 ; } #endif /* -------------------------------------------------------------------------- */ /* SuiteSparse_toc: return time since last tic */ /* -------------------------------------------------------------------------- */ /* Assuming SuiteSparse_tic is accurate to the nanosecond, this function is * accurate down to the nanosecond for 2^53 nanoseconds since the last call to * SuiteSparse_tic, which is sufficient for SuiteSparse (about 104 days). If * additional accuracy is required, the caller can use two calls to * SuiteSparse_tic and do the calculations differently. */ double SuiteSparse_toc /* returns time in seconds since last tic */ ( double tic [2] /* input, not modified from last call to SuiteSparse_tic */ ) { double toc [2] ; SuiteSparse_tic (toc) ; return ((toc [0] - tic [0]) + 1e-9 * (toc [1] - tic [1])) ; } /* -------------------------------------------------------------------------- */ /* SuiteSparse_time: return current wallclock time in seconds */ /* -------------------------------------------------------------------------- */ /* This function might not be accurate down to the nanosecond. */ double SuiteSparse_time /* returns current wall clock time in seconds */ ( void ) { double toc [2] ; SuiteSparse_tic (toc) ; return (toc [0] + 1e-9 * toc [1]) ; } /* -------------------------------------------------------------------------- */ /* SuiteSparse_version: return the current version of SuiteSparse */ /* -------------------------------------------------------------------------- */ int SuiteSparse_version ( int version [3] ) { if (version != NULL) { version [0] = SUITESPARSE_MAIN_VERSION ; version [1] = SUITESPARSE_SUB_VERSION ; version [2] = SUITESPARSE_SUBSUB_VERSION ; } return (SUITESPARSE_VERSION) ; } /* -------------------------------------------------------------------------- */ /* SuiteSparse_hypot */ /* -------------------------------------------------------------------------- */ /* There is an equivalent routine called hypot in , which conforms * to ANSI C99. However, SuiteSparse does not assume that ANSI C99 is * available. You can use the ANSI C99 hypot routine with: * * #include *i SuiteSparse_config.hypot_func = hypot ; * * Default value of the SuiteSparse_config.hypot_func pointer is * SuiteSparse_hypot, defined below. * * s = hypot (x,y) computes s = sqrt (x*x + y*y) but does so more accurately. * The NaN cases for the double relops x >= y and x+y == x are safely ignored. * * Source: Algorithm 312, "Absolute value and square root of a complex number," * P. Friedland, Comm. ACM, vol 10, no 10, October 1967, page 665. */ double SuiteSparse_hypot (double x, double y) { double s, r ; x = fabs (x) ; y = fabs (y) ; if (x >= y) { if (x + y == x) { s = x ; } else { r = y / x ; s = x * sqrt (1.0 + r*r) ; } } else { if (y + x == y) { s = y ; } else { r = x / y ; s = y * sqrt (1.0 + r*r) ; } } return (s) ; } /* -------------------------------------------------------------------------- */ /* SuiteSparse_divcomplex */ /* -------------------------------------------------------------------------- */ /* c = a/b where c, a, and b are complex. The real and imaginary parts are * passed as separate arguments to this routine. The NaN case is ignored * for the double relop br >= bi. Returns 1 if the denominator is zero, * 0 otherwise. * * This uses ACM Algo 116, by R. L. Smith, 1962, which tries to avoid * underflow and overflow. * * c can be the same variable as a or b. * * Default value of the SuiteSparse_config.divcomplex_func pointer is * SuiteSparse_divcomplex. */ int SuiteSparse_divcomplex ( double ar, double ai, /* real and imaginary parts of a */ double br, double bi, /* real and imaginary parts of b */ double *cr, double *ci /* real and imaginary parts of c */ ) { double tr, ti, r, den ; if (fabs (br) >= fabs (bi)) { r = bi / br ; den = br + r * bi ; tr = (ar + ai * r) / den ; ti = (ai - ar * r) / den ; } else { r = br / bi ; den = r * br + bi ; tr = (ar * r + ai) / den ; ti = (ai * r - ar) / den ; } *cr = tr ; *ci = ti ; return (den == 0.) ; } JAGS-4.3.2/src/modules/glm/SSparse/AMD/0000755000175000017500000000000014400711326014242 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/AMD/Include/0000755000175000017500000000000014400711326015625 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/AMD/Include/amd.h0000664000175000017500000004263514224052371016475 00000000000000/* ========================================================================= */ /* === AMD: approximate minimum degree ordering =========================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD Version 2.4, Copyright (c) 1996-2013 by Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* AMD finds a symmetric ordering P of a matrix A so that the Cholesky * factorization of P*A*P' has fewer nonzeros and takes less work than the * Cholesky factorization of A. If A is not symmetric, then it performs its * ordering on the matrix A+A'. Two sets of user-callable routines are * provided, one for int integers and the other for SuiteSparse_long integers. * * The method is based on the approximate minimum degree algorithm, discussed * in Amestoy, Davis, and Duff, "An approximate degree ordering algorithm", * SIAM Journal of Matrix Analysis and Applications, vol. 17, no. 4, pp. * 886-905, 1996. This package can perform both the AMD ordering (with * aggressive absorption), and the AMDBAR ordering (without aggressive * absorption) discussed in the above paper. This package differs from the * Fortran codes discussed in the paper: * * (1) it can ignore "dense" rows and columns, leading to faster run times * (2) it computes the ordering of A+A' if A is not symmetric * (3) it is followed by a depth-first post-ordering of the assembly tree * (or supernodal elimination tree) * * For historical reasons, the Fortran versions, amd.f and amdbar.f, have * been left (nearly) unchanged. They compute the identical ordering as * described in the above paper. */ #ifndef AMD_H #define AMD_H /* make it easy for C++ programs to include AMD */ #ifdef __cplusplus extern "C" { #endif /* get the definition of size_t: */ #include #include "SuiteSparse_config.h" int amd_order /* returns AMD_OK, AMD_OK_BUT_JUMBLED, * AMD_INVALID, or AMD_OUT_OF_MEMORY */ ( int n, /* A is n-by-n. n must be >= 0. */ const int Ap [ ], /* column pointers for A, of size n+1 */ const int Ai [ ], /* row indices of A, of size nz = Ap [n] */ int P [ ], /* output permutation, of size n */ double Control [ ], /* input Control settings, of size AMD_CONTROL */ double Info [ ] /* output Info statistics, of size AMD_INFO */ ) ; SuiteSparse_long amd_l_order /* see above for description of arguments */ ( SuiteSparse_long n, const SuiteSparse_long Ap [ ], const SuiteSparse_long Ai [ ], SuiteSparse_long P [ ], double Control [ ], double Info [ ] ) ; /* Input arguments (not modified): * * n: the matrix A is n-by-n. * Ap: an int/SuiteSparse_long array of size n+1, containing column * pointers of A. * Ai: an int/SuiteSparse_long array of size nz, containing the row * indices of A, where nz = Ap [n]. * Control: a double array of size AMD_CONTROL, containing control * parameters. Defaults are used if Control is NULL. * * Output arguments (not defined on input): * * P: an int/SuiteSparse_long array of size n, containing the output * permutation. If row i is the kth pivot row, then P [k] = i. In * MATLAB notation, the reordered matrix is A (P,P). * Info: a double array of size AMD_INFO, containing statistical * information. Ignored if Info is NULL. * * On input, the matrix A is stored in column-oriented form. The row indices * of nonzero entries in column j are stored in Ai [Ap [j] ... Ap [j+1]-1]. * * If the row indices appear in ascending order in each column, and there * are no duplicate entries, then amd_order is slightly more efficient in * terms of time and memory usage. If this condition does not hold, a copy * of the matrix is created (where these conditions do hold), and the copy is * ordered. This feature is new to v2.0 (v1.2 and earlier required this * condition to hold for the input matrix). * * Row indices must be in the range 0 to * n-1. Ap [0] must be zero, and thus nz = Ap [n] is the number of nonzeros * in A. The array Ap is of size n+1, and the array Ai is of size nz = Ap [n]. * The matrix does not need to be symmetric, and the diagonal does not need to * be present (if diagonal entries are present, they are ignored except for * the output statistic Info [AMD_NZDIAG]). The arrays Ai and Ap are not * modified. This form of the Ap and Ai arrays to represent the nonzero * pattern of the matrix A is the same as that used internally by MATLAB. * If you wish to use a more flexible input structure, please see the * umfpack_*_triplet_to_col routines in the UMFPACK package, at * http://www.suitesparse.com. * * Restrictions: n >= 0. Ap [0] = 0. Ap [j] <= Ap [j+1] for all j in the * range 0 to n-1. nz = Ap [n] >= 0. Ai [0..nz-1] must be in the range 0 * to n-1. Finally, Ai, Ap, and P must not be NULL. If any of these * restrictions are not met, AMD returns AMD_INVALID. * * AMD returns: * * AMD_OK if the matrix is valid and sufficient memory can be allocated to * perform the ordering. * * AMD_OUT_OF_MEMORY if not enough memory can be allocated. * * AMD_INVALID if the input arguments n, Ap, Ai are invalid, or if P is * NULL. * * AMD_OK_BUT_JUMBLED if the matrix had unsorted columns, and/or duplicate * entries, but was otherwise valid. * * The AMD routine first forms the pattern of the matrix A+A', and then * computes a fill-reducing ordering, P. If P [k] = i, then row/column i of * the original is the kth pivotal row. In MATLAB notation, the permuted * matrix is A (P,P), except that 0-based indexing is used instead of the * 1-based indexing in MATLAB. * * The Control array is used to set various parameters for AMD. If a NULL * pointer is passed, default values are used. The Control array is not * modified. * * Control [AMD_DENSE]: controls the threshold for "dense" rows/columns. * A dense row/column in A+A' can cause AMD to spend a lot of time in * ordering the matrix. If Control [AMD_DENSE] >= 0, rows/columns * with more than Control [AMD_DENSE] * sqrt (n) entries are ignored * during the ordering, and placed last in the output order. The * default value of Control [AMD_DENSE] is 10. If negative, no * rows/columns are treated as "dense". Rows/columns with 16 or * fewer off-diagonal entries are never considered "dense". * * Control [AMD_AGGRESSIVE]: controls whether or not to use aggressive * absorption, in which a prior element is absorbed into the current * element if is a subset of the current element, even if it is not * adjacent to the current pivot element (refer to Amestoy, Davis, * & Duff, 1996, for more details). The default value is nonzero, * which means to perform aggressive absorption. This nearly always * leads to a better ordering (because the approximate degrees are * more accurate) and a lower execution time. There are cases where * it can lead to a slightly worse ordering, however. To turn it off, * set Control [AMD_AGGRESSIVE] to 0. * * Control [2..4] are not used in the current version, but may be used in * future versions. * * The Info array provides statistics about the ordering on output. If it is * not present, the statistics are not returned. This is not an error * condition. * * Info [AMD_STATUS]: the return value of AMD, either AMD_OK, * AMD_OK_BUT_JUMBLED, AMD_OUT_OF_MEMORY, or AMD_INVALID. * * Info [AMD_N]: n, the size of the input matrix * * Info [AMD_NZ]: the number of nonzeros in A, nz = Ap [n] * * Info [AMD_SYMMETRY]: the symmetry of the matrix A. It is the number * of "matched" off-diagonal entries divided by the total number of * off-diagonal entries. An entry A(i,j) is matched if A(j,i) is also * an entry, for any pair (i,j) for which i != j. In MATLAB notation, * S = spones (A) ; * B = tril (S, -1) + triu (S, 1) ; * symmetry = nnz (B & B') / nnz (B) ; * * Info [AMD_NZDIAG]: the number of entries on the diagonal of A. * * Info [AMD_NZ_A_PLUS_AT]: the number of nonzeros in A+A', excluding the * diagonal. If A is perfectly symmetric (Info [AMD_SYMMETRY] = 1) * with a fully nonzero diagonal, then Info [AMD_NZ_A_PLUS_AT] = nz-n * (the smallest possible value). If A is perfectly unsymmetric * (Info [AMD_SYMMETRY] = 0, for an upper triangular matrix, for * example) with no diagonal, then Info [AMD_NZ_A_PLUS_AT] = 2*nz * (the largest possible value). * * Info [AMD_NDENSE]: the number of "dense" rows/columns of A+A' that were * removed from A prior to ordering. These are placed last in the * output order P. * * Info [AMD_MEMORY]: the amount of memory used by AMD, in bytes. In the * current version, this is 1.2 * Info [AMD_NZ_A_PLUS_AT] + 9*n * times the size of an integer. This is at most 2.4nz + 9n. This * excludes the size of the input arguments Ai, Ap, and P, which have * a total size of nz + 2*n + 1 integers. * * Info [AMD_NCMPA]: the number of garbage collections performed. * * Info [AMD_LNZ]: the number of nonzeros in L (excluding the diagonal). * This is a slight upper bound because mass elimination is combined * with the approximate degree update. It is a rough upper bound if * there are many "dense" rows/columns. The rest of the statistics, * below, are also slight or rough upper bounds, for the same reasons. * The post-ordering of the assembly tree might also not exactly * correspond to a true elimination tree postordering. * * Info [AMD_NDIV]: the number of divide operations for a subsequent LDL' * or LU factorization of the permuted matrix A (P,P). * * Info [AMD_NMULTSUBS_LDL]: the number of multiply-subtract pairs for a * subsequent LDL' factorization of A (P,P). * * Info [AMD_NMULTSUBS_LU]: the number of multiply-subtract pairs for a * subsequent LU factorization of A (P,P), assuming that no numerical * pivoting is required. * * Info [AMD_DMAX]: the maximum number of nonzeros in any column of L, * including the diagonal. * * Info [14..19] are not used in the current version, but may be used in * future versions. */ /* ------------------------------------------------------------------------- */ /* direct interface to AMD */ /* ------------------------------------------------------------------------- */ /* amd_2 is the primary AMD ordering routine. It is not meant to be * user-callable because of its restrictive inputs and because it destroys * the user's input matrix. It does not check its inputs for errors, either. * However, if you can work with these restrictions it can be faster than * amd_order and use less memory (assuming that you can create your own copy * of the matrix for AMD to destroy). Refer to AMD/Source/amd_2.c for a * description of each parameter. */ void amd_2 ( int n, int Pe [ ], int Iw [ ], int Len [ ], int iwlen, int pfree, int Nv [ ], int Next [ ], int Last [ ], int Head [ ], int Elen [ ], int Degree [ ], int W [ ], double Control [ ], double Info [ ] ) ; void amd_l2 ( SuiteSparse_long n, SuiteSparse_long Pe [ ], SuiteSparse_long Iw [ ], SuiteSparse_long Len [ ], SuiteSparse_long iwlen, SuiteSparse_long pfree, SuiteSparse_long Nv [ ], SuiteSparse_long Next [ ], SuiteSparse_long Last [ ], SuiteSparse_long Head [ ], SuiteSparse_long Elen [ ], SuiteSparse_long Degree [ ], SuiteSparse_long W [ ], double Control [ ], double Info [ ] ) ; /* ------------------------------------------------------------------------- */ /* amd_valid */ /* ------------------------------------------------------------------------- */ /* Returns AMD_OK or AMD_OK_BUT_JUMBLED if the matrix is valid as input to * amd_order; the latter is returned if the matrix has unsorted and/or * duplicate row indices in one or more columns. Returns AMD_INVALID if the * matrix cannot be passed to amd_order. For amd_order, the matrix must also * be square. The first two arguments are the number of rows and the number * of columns of the matrix. For its use in AMD, these must both equal n. * * NOTE: this routine returned TRUE/FALSE in v1.2 and earlier. */ int amd_valid ( int n_row, /* # of rows */ int n_col, /* # of columns */ const int Ap [ ], /* column pointers, of size n_col+1 */ const int Ai [ ] /* row indices, of size Ap [n_col] */ ) ; SuiteSparse_long amd_l_valid ( SuiteSparse_long n_row, SuiteSparse_long n_col, const SuiteSparse_long Ap [ ], const SuiteSparse_long Ai [ ] ) ; /* ------------------------------------------------------------------------- */ /* AMD memory manager and printf routines */ /* ------------------------------------------------------------------------- */ /* moved to SuiteSparse_config.c */ /* ------------------------------------------------------------------------- */ /* AMD Control and Info arrays */ /* ------------------------------------------------------------------------- */ /* amd_defaults: sets the default control settings */ void amd_defaults (double Control [ ]) ; void amd_l_defaults (double Control [ ]) ; /* amd_control: prints the control settings */ void amd_control (double Control [ ]) ; void amd_l_control (double Control [ ]) ; /* amd_info: prints the statistics */ void amd_info (double Info [ ]) ; void amd_l_info (double Info [ ]) ; #define AMD_CONTROL 5 /* size of Control array */ #define AMD_INFO 20 /* size of Info array */ /* contents of Control */ #define AMD_DENSE 0 /* "dense" if degree > Control [0] * sqrt (n) */ #define AMD_AGGRESSIVE 1 /* do aggressive absorption if Control [1] != 0 */ /* default Control settings */ #define AMD_DEFAULT_DENSE 10.0 /* default "dense" degree 10*sqrt(n) */ #define AMD_DEFAULT_AGGRESSIVE 1 /* do aggressive absorption by default */ /* contents of Info */ #define AMD_STATUS 0 /* return value of amd_order and amd_l_order */ #define AMD_N 1 /* A is n-by-n */ #define AMD_NZ 2 /* number of nonzeros in A */ #define AMD_SYMMETRY 3 /* symmetry of pattern (1 is sym., 0 is unsym.) */ #define AMD_NZDIAG 4 /* # of entries on diagonal */ #define AMD_NZ_A_PLUS_AT 5 /* nz in A+A' */ #define AMD_NDENSE 6 /* number of "dense" rows/columns in A */ #define AMD_MEMORY 7 /* amount of memory used by AMD */ #define AMD_NCMPA 8 /* number of garbage collections in AMD */ #define AMD_LNZ 9 /* approx. nz in L, excluding the diagonal */ #define AMD_NDIV 10 /* number of fl. point divides for LU and LDL' */ #define AMD_NMULTSUBS_LDL 11 /* number of fl. point (*,-) pairs for LDL' */ #define AMD_NMULTSUBS_LU 12 /* number of fl. point (*,-) pairs for LU */ #define AMD_DMAX 13 /* max nz. in any column of L, incl. diagonal */ /* ------------------------------------------------------------------------- */ /* return values of AMD */ /* ------------------------------------------------------------------------- */ #define AMD_OK 0 /* success */ #define AMD_OUT_OF_MEMORY -1 /* malloc failed, or problem too large */ #define AMD_INVALID -2 /* input arguments are not valid */ #define AMD_OK_BUT_JUMBLED 1 /* input matrix is OK for amd_order, but * columns were not sorted, and/or duplicate entries were present. AMD had * to do extra work before ordering the matrix. This is a warning, not an * error. */ /* ========================================================================== */ /* === AMD version ========================================================== */ /* ========================================================================== */ /* AMD Version 1.2 and later include the following definitions. * As an example, to test if the version you are using is 1.2 or later: * * #ifdef AMD_VERSION * if (AMD_VERSION >= AMD_VERSION_CODE (1,2)) ... * #endif * * This also works during compile-time: * * #if defined(AMD_VERSION) && (AMD_VERSION >= AMD_VERSION_CODE (1,2)) * printf ("This is version 1.2 or later\n") ; * #else * printf ("This is an early version\n") ; * #endif * * Versions 1.1 and earlier of AMD do not include a #define'd version number. */ #define AMD_DATE "Feb 1, 2016" #define AMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define AMD_MAIN_VERSION 2 #define AMD_SUB_VERSION 4 #define AMD_SUBSUB_VERSION 4 #define AMD_VERSION AMD_VERSION_CODE(AMD_MAIN_VERSION,AMD_SUB_VERSION) #ifdef __cplusplus } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/AMD/Include/amd_internal.h0000664000175000017500000002005614224052371020362 00000000000000/* ========================================================================= */ /* === amd_internal.h ====================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* This file is for internal use in AMD itself, and does not normally need to * be included in user code (it is included in UMFPACK, however). All others * should use amd.h instead. */ /* ========================================================================= */ /* === NDEBUG ============================================================== */ /* ========================================================================= */ /* * Turning on debugging takes some work (see below). If you do not edit this * file, then debugging is always turned off, regardless of whether or not * -DNDEBUG is specified in your compiler options. * * If AMD is being compiled as a mexFunction, then MATLAB_MEX_FILE is defined, * and mxAssert is used instead of assert. If debugging is not enabled, no * MATLAB include files or functions are used. Thus, the AMD library libamd.a * can be safely used in either a stand-alone C program or in another * mexFunction, without any change. */ /* AMD will be exceedingly slow when running in debug mode. The next three lines ensure that debugging is turned off. */ #ifndef NDEBUG #define NDEBUG #endif /* To enable debugging, uncomment the following line: #undef NDEBUG */ /* ------------------------------------------------------------------------- */ /* ANSI include files */ /* ------------------------------------------------------------------------- */ /* from stdlib.h: size_t, malloc, free, realloc, and calloc */ #include #if !defined(NPRINT) || !defined(NDEBUG) /* from stdio.h: printf. Not included if NPRINT is defined at compile time. * fopen and fscanf are used when debugging. */ #include #endif /* from limits.h: INT_MAX and LONG_MAX */ #include /* from math.h: sqrt */ #include /* ------------------------------------------------------------------------- */ /* MATLAB include files (only if being used in or via MATLAB) */ /* ------------------------------------------------------------------------- */ #ifdef MATLAB_MEX_FILE #include "matrix.h" #include "mex.h" #endif /* ------------------------------------------------------------------------- */ /* basic definitions */ /* ------------------------------------------------------------------------- */ #ifdef FLIP #undef FLIP #endif #ifdef MAX #undef MAX #endif #ifdef MIN #undef MIN #endif #ifdef EMPTY #undef EMPTY #endif #ifdef GLOBAL #undef GLOBAL #endif #ifdef PRIVATE #undef PRIVATE #endif /* FLIP is a "negation about -1", and is used to mark an integer i that is * normally non-negative. FLIP (EMPTY) is EMPTY. FLIP of a number > EMPTY * is negative, and FLIP of a number < EMTPY is positive. FLIP (FLIP (i)) = i * for all integers i. UNFLIP (i) is >= EMPTY. */ #define EMPTY (-1) #define FLIP(i) (-(i)-2) #define UNFLIP(i) ((i < EMPTY) ? FLIP (i) : (i)) /* for integer MAX/MIN, or for doubles when we don't care how NaN's behave: */ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) /* logical expression of p implies q: */ #define IMPLIES(p,q) (!(p) || (q)) /* Note that the IBM RS 6000 xlc predefines TRUE and FALSE in . */ /* The Compaq Alpha also predefines TRUE and FALSE. */ #ifdef TRUE #undef TRUE #endif #ifdef FALSE #undef FALSE #endif #define TRUE (1) #define FALSE (0) #define PRIVATE static #define GLOBAL #define EMPTY (-1) /* Note that Linux's gcc 2.96 defines NULL as ((void *) 0), but other */ /* compilers (even gcc 2.95.2 on Solaris) define NULL as 0 or (0). We */ /* need to use the ANSI standard value of 0. */ #ifdef NULL #undef NULL #endif #define NULL 0 /* largest value of size_t */ #ifndef SIZE_T_MAX #ifdef SIZE_MAX /* C99 only */ #define SIZE_T_MAX SIZE_MAX #else #define SIZE_T_MAX ((size_t) (-1)) #endif #endif /* ------------------------------------------------------------------------- */ /* integer type for AMD: int or SuiteSparse_long */ /* ------------------------------------------------------------------------- */ #include "amd.h" #if defined (DLONG) || defined (ZLONG) #define Int SuiteSparse_long #define ID SuiteSparse_long_id #define Int_MAX SuiteSparse_long_max #define AMD_order amd_l_order #define AMD_defaults amd_l_defaults #define AMD_control amd_l_control #define AMD_info amd_l_info #define AMD_1 amd_l1 #define AMD_2 amd_l2 #define AMD_valid amd_l_valid #define AMD_aat amd_l_aat #define AMD_postorder amd_l_postorder #define AMD_post_tree amd_l_post_tree #define AMD_dump amd_l_dump #define AMD_debug amd_l_debug #define AMD_debug_init amd_l_debug_init #define AMD_preprocess amd_l_preprocess #else #define Int int #define ID "%d" #define Int_MAX INT_MAX #define AMD_order amd_order #define AMD_defaults amd_defaults #define AMD_control amd_control #define AMD_info amd_info #define AMD_1 amd_1 #define AMD_2 amd_2 #define AMD_valid amd_valid #define AMD_aat amd_aat #define AMD_postorder amd_postorder #define AMD_post_tree amd_post_tree #define AMD_dump amd_dump #define AMD_debug amd_debug #define AMD_debug_init amd_debug_init #define AMD_preprocess amd_preprocess #endif /* ------------------------------------------------------------------------- */ /* AMD routine definitions (not user-callable) */ /* ------------------------------------------------------------------------- */ GLOBAL size_t AMD_aat ( Int n, const Int Ap [ ], const Int Ai [ ], Int Len [ ], Int Tp [ ], double Info [ ] ) ; GLOBAL void AMD_1 ( Int n, const Int Ap [ ], const Int Ai [ ], Int P [ ], Int Pinv [ ], Int Len [ ], Int slen, Int S [ ], double Control [ ], double Info [ ] ) ; GLOBAL void AMD_postorder ( Int nn, Int Parent [ ], Int Npiv [ ], Int Fsize [ ], Int Order [ ], Int Child [ ], Int Sibling [ ], Int Stack [ ] ) ; GLOBAL Int AMD_post_tree ( Int root, Int k, Int Child [ ], const Int Sibling [ ], Int Order [ ], Int Stack [ ] #ifndef NDEBUG , Int nn #endif ) ; GLOBAL void AMD_preprocess ( Int n, const Int Ap [ ], const Int Ai [ ], Int Rp [ ], Int Ri [ ], Int W [ ], Int Flag [ ] ) ; /* ------------------------------------------------------------------------- */ /* debugging definitions */ /* ------------------------------------------------------------------------- */ #ifndef NDEBUG /* from assert.h: assert macro */ #include #ifndef EXTERN #define EXTERN extern #endif EXTERN Int AMD_debug ; GLOBAL void AMD_debug_init ( char *s ) ; GLOBAL void AMD_dump ( Int n, Int Pe [ ], Int Iw [ ], Int Len [ ], Int iwlen, Int pfree, Int Nv [ ], Int Next [ ], Int Last [ ], Int Head [ ], Int Elen [ ], Int Degree [ ], Int W [ ], Int nel ) ; #ifdef ASSERT #undef ASSERT #endif /* Use mxAssert if AMD is compiled into a mexFunction */ #ifdef MATLAB_MEX_FILE #define ASSERT(expression) (mxAssert ((expression), "")) #else #define ASSERT(expression) (assert (expression)) #endif #define AMD_DEBUG0(params) { SUITESPARSE_PRINTF (params) ; } #define AMD_DEBUG1(params) { if (AMD_debug >= 1) SUITESPARSE_PRINTF (params) ; } #define AMD_DEBUG2(params) { if (AMD_debug >= 2) SUITESPARSE_PRINTF (params) ; } #define AMD_DEBUG3(params) { if (AMD_debug >= 3) SUITESPARSE_PRINTF (params) ; } #define AMD_DEBUG4(params) { if (AMD_debug >= 4) SUITESPARSE_PRINTF (params) ; } #else /* no debugging */ #define ASSERT(expression) #define AMD_DEBUG0(params) #define AMD_DEBUG1(params) #define AMD_DEBUG2(params) #define AMD_DEBUG3(params) #define AMD_DEBUG4(params) #endif JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/0000755000175000017500000000000014400711326015502 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_1.c0000664000175000017500000001311614224052371016555 00000000000000/* ========================================================================= */ /* === AMD_1 =============================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* AMD_1: Construct A+A' for a sparse matrix A and perform the AMD ordering. * * The n-by-n sparse matrix A can be unsymmetric. It is stored in MATLAB-style * compressed-column form, with sorted row indices in each column, and no * duplicate entries. Diagonal entries may be present, but they are ignored. * Row indices of column j of A are stored in Ai [Ap [j] ... Ap [j+1]-1]. * Ap [0] must be zero, and nz = Ap [n] is the number of entries in A. The * size of the matrix, n, must be greater than or equal to zero. * * This routine must be preceded by a call to AMD_aat, which computes the * number of entries in each row/column in A+A', excluding the diagonal. * Len [j], on input, is the number of entries in row/column j of A+A'. This * routine constructs the matrix A+A' and then calls AMD_2. No error checking * is performed (this was done in AMD_valid). */ #include "amd_internal.h" GLOBAL void AMD_1 ( Int n, /* n > 0 */ const Int Ap [ ], /* input of size n+1, not modified */ const Int Ai [ ], /* input of size nz = Ap [n], not modified */ Int P [ ], /* size n output permutation */ Int Pinv [ ], /* size n output inverse permutation */ Int Len [ ], /* size n input, undefined on output */ Int slen, /* slen >= sum (Len [0..n-1]) + 7n, * ideally slen = 1.2 * sum (Len) + 8n */ Int S [ ], /* size slen workspace */ double Control [ ], /* input array of size AMD_CONTROL */ double Info [ ] /* output array of size AMD_INFO */ ) { Int i, j, k, p, pfree, iwlen, pj, p1, p2, pj2, *Iw, *Pe, *Nv, *Head, *Elen, *Degree, *s, *W, *Sp, *Tp ; /* --------------------------------------------------------------------- */ /* construct the matrix for AMD_2 */ /* --------------------------------------------------------------------- */ ASSERT (n > 0) ; iwlen = slen - 6*n ; s = S ; Pe = s ; s += n ; Nv = s ; s += n ; Head = s ; s += n ; Elen = s ; s += n ; Degree = s ; s += n ; W = s ; s += n ; Iw = s ; s += iwlen ; ASSERT (AMD_valid (n, n, Ap, Ai) == AMD_OK) ; /* construct the pointers for A+A' */ Sp = Nv ; /* use Nv and W as workspace for Sp and Tp [ */ Tp = W ; pfree = 0 ; for (j = 0 ; j < n ; j++) { Pe [j] = pfree ; Sp [j] = pfree ; pfree += Len [j] ; } /* Note that this restriction on iwlen is slightly more restrictive than * what is strictly required in AMD_2. AMD_2 can operate with no elbow * room at all, but it will be very slow. For better performance, at * least size-n elbow room is enforced. */ ASSERT (iwlen >= pfree + n) ; #ifndef NDEBUG for (p = 0 ; p < iwlen ; p++) Iw [p] = EMPTY ; #endif for (k = 0 ; k < n ; k++) { AMD_DEBUG1 (("Construct row/column k= "ID" of A+A'\n", k)) ; p1 = Ap [k] ; p2 = Ap [k+1] ; /* construct A+A' */ for (p = p1 ; p < p2 ; ) { /* scan the upper triangular part of A */ j = Ai [p] ; ASSERT (j >= 0 && j < n) ; if (j < k) { /* entry A (j,k) in the strictly upper triangular part */ ASSERT (Sp [j] < (j == n-1 ? pfree : Pe [j+1])) ; ASSERT (Sp [k] < (k == n-1 ? pfree : Pe [k+1])) ; Iw [Sp [j]++] = k ; Iw [Sp [k]++] = j ; p++ ; } else if (j == k) { /* skip the diagonal */ p++ ; break ; } else /* j > k */ { /* first entry below the diagonal */ break ; } /* scan lower triangular part of A, in column j until reaching * row k. Start where last scan left off. */ ASSERT (Ap [j] <= Tp [j] && Tp [j] <= Ap [j+1]) ; pj2 = Ap [j+1] ; for (pj = Tp [j] ; pj < pj2 ; ) { i = Ai [pj] ; ASSERT (i >= 0 && i < n) ; if (i < k) { /* A (i,j) is only in the lower part, not in upper */ ASSERT (Sp [i] < (i == n-1 ? pfree : Pe [i+1])) ; ASSERT (Sp [j] < (j == n-1 ? pfree : Pe [j+1])) ; Iw [Sp [i]++] = j ; Iw [Sp [j]++] = i ; pj++ ; } else if (i == k) { /* entry A (k,j) in lower part and A (j,k) in upper */ pj++ ; break ; } else /* i > k */ { /* consider this entry later, when k advances to i */ break ; } } Tp [j] = pj ; } Tp [k] = p ; } /* clean up, for remaining mismatched entries */ for (j = 0 ; j < n ; j++) { for (pj = Tp [j] ; pj < Ap [j+1] ; pj++) { i = Ai [pj] ; ASSERT (i >= 0 && i < n) ; /* A (i,j) is only in the lower part, not in upper */ ASSERT (Sp [i] < (i == n-1 ? pfree : Pe [i+1])) ; ASSERT (Sp [j] < (j == n-1 ? pfree : Pe [j+1])) ; Iw [Sp [i]++] = j ; Iw [Sp [j]++] = i ; } } #ifndef NDEBUG for (j = 0 ; j < n-1 ; j++) ASSERT (Sp [j] == Pe [j+1]) ; ASSERT (Sp [n-1] == pfree) ; #endif /* Tp and Sp no longer needed ] */ /* --------------------------------------------------------------------- */ /* order the matrix */ /* --------------------------------------------------------------------- */ AMD_2 (n, Pe, Iw, Len, iwlen, pfree, Nv, Pinv, P, Head, Elen, Degree, W, Control, Info) ; } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amdbar.f0000664000175000017500000014607214224052371017035 00000000000000C----------------------------------------------------------------------- C AMDBAR: approximate minimum degree, without aggressive absorption C----------------------------------------------------------------------- SUBROUTINE AMDBAR $ (N, PE, IW, LEN, IWLEN, PFREE, NV, NEXT, $ LAST, HEAD, ELEN, DEGREE, NCMPA, W) INTEGER N, IWLEN, PFREE, NCMPA, IW (IWLEN), PE (N), $ DEGREE (N), NV (N), NEXT (N), LAST (N), HEAD (N), $ ELEN (N), W (N), LEN (N) C Given a representation of the nonzero pattern of a symmetric matrix, C A, (excluding the diagonal) perform an approximate minimum C (UMFPACK/MA38-style) degree ordering to compute a pivot order C such that the introduction of nonzeros (fill-in) in the Cholesky C factors A = LL^T are kept low. At each step, the pivot C selected is the one with the minimum UMFPACK/MA38-style C upper-bound on the external degree. C C This routine does not do aggresive absorption (as done by AMD). C ********************************************************************** C ***** CAUTION: ARGUMENTS ARE NOT CHECKED FOR ERRORS ON INPUT. ****** C ********************************************************************** C References: C C [1] Timothy A. Davis and Iain Duff, "An unsymmetric-pattern C multifrontal method for sparse LU factorization", SIAM J. C Matrix Analysis and Applications, vol. 18, no. 1, pp. C 140-158. Discusses UMFPACK / MA38, which first introduced C the approximate minimum degree used by this routine. C C [2] Patrick Amestoy, Timothy A. Davis, and Iain S. Duff, "An C approximate degree ordering algorithm," SIAM J. Matrix C Analysis and Applications, vol. 17, no. 4, pp. 886-905, C 1996. Discusses AMD, AMDBAR, and MC47B. C C [3] Alan George and Joseph Liu, "The evolution of the minimum C degree ordering algorithm," SIAM Review, vol. 31, no. 1, C pp. 1-19, 1989. We list below the features mentioned in C that paper that this code includes: C C mass elimination: C Yes. MA27 relied on supervariable detection for mass C elimination. C indistinguishable nodes: C Yes (we call these "supervariables"). This was also in C the MA27 code - although we modified the method of C detecting them (the previous hash was the true degree, C which we no longer keep track of). A supervariable is C a set of rows with identical nonzero pattern. All C variables in a supervariable are eliminated together. C Each supervariable has as its numerical name that of C one of its variables (its principal variable). C quotient graph representation: C Yes. We use the term "element" for the cliques formed C during elimination. This was also in the MA27 code. C The algorithm can operate in place, but it will work C more efficiently if given some "elbow room." C element absorption: C Yes. This was also in the MA27 code. C external degree: C Yes. The MA27 code was based on the true degree. C incomplete degree update and multiple elimination: C No. This was not in MA27, either. Our method of C degree update within MC47B/BD is element-based, not C variable-based. It is thus not well-suited for use C with incomplete degree update or multiple elimination. C----------------------------------------------------------------------- C Authors, and Copyright (C) 1995 by: C Timothy A. Davis, Patrick Amestoy, Iain S. Duff, & John K. Reid. C C Acknowledgements: C This work (and the UMFPACK package) was supported by the C National Science Foundation (ASC-9111263 and DMS-9223088). C The UMFPACK/MA38 approximate degree update algorithm, the C unsymmetric analog which forms the basis of MC47B/BD, was C developed while Tim Davis was supported by CERFACS (Toulouse, C France) in a post-doctoral position. C C Date: September, 1995 C----------------------------------------------------------------------- C----------------------------------------------------------------------- C INPUT ARGUMENTS (unaltered): C----------------------------------------------------------------------- C n: The matrix order. C C Restriction: 1 .le. n .lt. (iovflo/2)-2, where iovflo is C the largest positive integer that your computer can represent. C iwlen: The length of iw (1..iwlen). On input, the matrix is C stored in iw (1..pfree-1). However, iw (1..iwlen) should be C slightly larger than what is required to hold the matrix, at C least iwlen .ge. pfree + n is recommended. Otherwise, C excessive compressions will take place. C *** We do not recommend running this algorithm with *** C *** iwlen .lt. pfree + n. *** C *** Better performance will be obtained if *** C *** iwlen .ge. pfree + n *** C *** or better yet *** C *** iwlen .gt. 1.2 * pfree *** C *** (where pfree is its value on input). *** C The algorithm will not run at all if iwlen .lt. pfree-1. C C Restriction: iwlen .ge. pfree-1 C----------------------------------------------------------------------- C INPUT/OUPUT ARGUMENTS: C----------------------------------------------------------------------- C pe: On input, pe (i) is the index in iw of the start of row i, or C zero if row i has no off-diagonal non-zeros. C C During execution, it is used for both supervariables and C elements: C C * Principal supervariable i: index into iw of the C description of supervariable i. A supervariable C represents one or more rows of the matrix C with identical nonzero pattern. C * Non-principal supervariable i: if i has been absorbed C into another supervariable j, then pe (i) = -j. C That is, j has the same pattern as i. C Note that j might later be absorbed into another C supervariable j2, in which case pe (i) is still -j, C and pe (j) = -j2. C * Unabsorbed element e: the index into iw of the description C of element e, if e has not yet been absorbed by a C subsequent element. Element e is created when C the supervariable of the same name is selected as C the pivot. C * Absorbed element e: if element e is absorbed into element C e2, then pe (e) = -e2. This occurs when the pattern of C e (that is, Le) is found to be a subset of the pattern C of e2 (that is, Le2). If element e is "null" (it has C no nonzeros outside its pivot block), then pe (e) = 0. C C On output, pe holds the assembly tree/forest, which implicitly C represents a pivot order with identical fill-in as the actual C order (via a depth-first search of the tree). C C On output: C If nv (i) .gt. 0, then i represents a node in the assembly tree, C and the parent of i is -pe (i), or zero if i is a root. C If nv (i) = 0, then (i,-pe (i)) represents an edge in a C subtree, the root of which is a node in the assembly tree. C pfree: On input the tail end of the array, iw (pfree..iwlen), C is empty, and the matrix is stored in iw (1..pfree-1). C During execution, additional data is placed in iw, and pfree C is modified so that iw (pfree..iwlen) is always the unused part C of iw. On output, pfree is set equal to the size of iw that C would have been needed for no compressions to occur. If C ncmpa is zero, then pfree (on output) is less than or equal to C iwlen, and the space iw (pfree+1 ... iwlen) was not used. C Otherwise, pfree (on output) is greater than iwlen, and all the C memory in iw was used. C----------------------------------------------------------------------- C INPUT/MODIFIED (undefined on output): C----------------------------------------------------------------------- C len: On input, len (i) holds the number of entries in row i of the C matrix, excluding the diagonal. The contents of len (1..n) C are undefined on output. C iw: On input, iw (1..pfree-1) holds the description of each row i C in the matrix. The matrix must be symmetric, and both upper C and lower triangular parts must be present. The diagonal must C not be present. Row i is held as follows: C C len (i): the length of the row i data structure C iw (pe (i) ... pe (i) + len (i) - 1): C the list of column indices for nonzeros C in row i (simple supervariables), excluding C the diagonal. All supervariables start with C one row/column each (supervariable i is just C row i). C if len (i) is zero on input, then pe (i) is ignored C on input. C C Note that the rows need not be in any particular order, C and there may be empty space between the rows. C C During execution, the supervariable i experiences fill-in. C This is represented by placing in i a list of the elements C that cause fill-in in supervariable i: C C len (i): the length of supervariable i C iw (pe (i) ... pe (i) + elen (i) - 1): C the list of elements that contain i. This list C is kept short by removing absorbed elements. C iw (pe (i) + elen (i) ... pe (i) + len (i) - 1): C the list of supervariables in i. This list C is kept short by removing nonprincipal C variables, and any entry j that is also C contained in at least one of the elements C (j in Le) in the list for i (e in row i). C C When supervariable i is selected as pivot, we create an C element e of the same name (e=i): C C len (e): the length of element e C iw (pe (e) ... pe (e) + len (e) - 1): C the list of supervariables in element e. C C An element represents the fill-in that occurs when supervariable C i is selected as pivot (which represents the selection of row i C and all non-principal variables whose principal variable is i). C We use the term Le to denote the set of all supervariables C in element e. Absorbed supervariables and elements are pruned C from these lists when computationally convenient. C C CAUTION: THE INPUT MATRIX IS OVERWRITTEN DURING COMPUTATION. C The contents of iw are undefined on output. C----------------------------------------------------------------------- C OUTPUT (need not be set on input): C----------------------------------------------------------------------- C nv: During execution, abs (nv (i)) is equal to the number of rows C that are represented by the principal supervariable i. If i is C a nonprincipal variable, then nv (i) = 0. Initially, C nv (i) = 1 for all i. nv (i) .lt. 0 signifies that i is a C principal variable in the pattern Lme of the current pivot C element me. On output, nv (e) holds the true degree of element C e at the time it was created (including the diagonal part). C ncmpa: The number of times iw was compressed. If this is C excessive, then the execution took longer than what could have C been. To reduce ncmpa, try increasing iwlen to be 10% or 20% C larger than the value of pfree on input (or at least C iwlen .ge. pfree + n). The fastest performance will be C obtained when ncmpa is returned as zero. If iwlen is set to C the value returned by pfree on *output*, then no compressions C will occur. C elen: See the description of iw above. At the start of execution, C elen (i) is set to zero. During execution, elen (i) is the C number of elements in the list for supervariable i. When e C becomes an element, elen (e) = -nel is set, where nel is the C current step of factorization. elen (i) = 0 is done when i C becomes nonprincipal. C C For variables, elen (i) .ge. 0 holds until just before the C permutation vectors are computed. For elements, C elen (e) .lt. 0 holds. C C On output elen (1..n) holds the inverse permutation (the same C as the 'INVP' argument in Sparspak). That is, if k = elen (i), C then row i is the kth pivot row. Row i of A appears as the C (elen(i))-th row in the permuted matrix, PAP^T. C last: In a degree list, last (i) is the supervariable preceding i, C or zero if i is the head of the list. In a hash bucket, C last (i) is the hash key for i. last (head (hash)) is also C used as the head of a hash bucket if head (hash) contains a C degree list (see head, below). C C On output, last (1..n) holds the permutation (the same as the C 'PERM' argument in Sparspak). That is, if i = last (k), then C row i is the kth pivot row. Row last (k) of A is the k-th row C in the permuted matrix, PAP^T. C----------------------------------------------------------------------- C LOCAL (not input or output - used only during execution): C----------------------------------------------------------------------- C degree: If i is a supervariable, then degree (i) holds the C current approximation of the external degree of row i (an upper C bound). The external degree is the number of nonzeros in row i, C minus abs (nv (i)) (the diagonal part). The bound is equal to C the external degree if elen (i) is less than or equal to two. C C We also use the term "external degree" for elements e to refer C to |Le \ Lme|. If e is an element, then degree (e) holds |Le|, C which is the degree of the off-diagonal part of the element e C (not including the diagonal part). C head: head is used for degree lists. head (deg) is the first C supervariable in a degree list (all supervariables i in a C degree list deg have the same approximate degree, namely, C deg = degree (i)). If the list deg is empty then C head (deg) = 0. C C During supervariable detection head (hash) also serves as a C pointer to a hash bucket. C If head (hash) .gt. 0, there is a degree list of degree hash. C The hash bucket head pointer is last (head (hash)). C If head (hash) = 0, then the degree list and hash bucket are C both empty. C If head (hash) .lt. 0, then the degree list is empty, and C -head (hash) is the head of the hash bucket. C After supervariable detection is complete, all hash buckets C are empty, and the (last (head (hash)) = 0) condition is C restored for the non-empty degree lists. C next: next (i) is the supervariable following i in a link list, or C zero if i is the last in the list. Used for two kinds of C lists: degree lists and hash buckets (a supervariable can be C in only one kind of list at a time). C w: The flag array w determines the status of elements and C variables, and the external degree of elements. C C for elements: C if w (e) = 0, then the element e is absorbed C if w (e) .ge. wflg, then w (e) - wflg is the size of C the set |Le \ Lme|, in terms of nonzeros (the C sum of abs (nv (i)) for each principal variable i that C is both in the pattern of element e and NOT in the C pattern of the current pivot element, me). C if wflg .gt. w (e) .gt. 0, then e is not absorbed and has C not yet been seen in the scan of the element lists in C the computation of |Le\Lme| in loop 150 below. C C for variables: C during supervariable detection, if w (j) .ne. wflg then j is C not in the pattern of variable i C C The w array is initialized by setting w (i) = 1 for all i, C and by setting wflg = 2. It is reinitialized if wflg becomes C too large (to ensure that wflg+n does not cause integer C overflow). C----------------------------------------------------------------------- C LOCAL INTEGERS: C----------------------------------------------------------------------- INTEGER DEG, DEGME, DMAX, E, ELENME, ELN, HASH, HMOD, I, $ ILAST, INEXT, J, JLAST, JNEXT, K, KNT1, KNT2, KNT3, $ LENJ, LN, MAXMEM, ME, MEM, MINDEG, NEL, NEWMEM, $ NLEFT, NVI, NVJ, NVPIV, SLENME, WE, WFLG, WNVI, X C deg: the degree of a variable or element C degme: size, |Lme|, of the current element, me (= degree (me)) C dext: external degree, |Le \ Lme|, of some element e C dmax: largest |Le| seen so far C e: an element C elenme: the length, elen (me), of element list of pivotal var. C eln: the length, elen (...), of an element list C hash: the computed value of the hash function C hmod: the hash function is computed modulo hmod = max (1,n-1) C i: a supervariable C ilast: the entry in a link list preceding i C inext: the entry in a link list following i C j: a supervariable C jlast: the entry in a link list preceding j C jnext: the entry in a link list, or path, following j C k: the pivot order of an element or variable C knt1: loop counter used during element construction C knt2: loop counter used during element construction C knt3: loop counter used during compression C lenj: len (j) C ln: length of a supervariable list C maxmem: amount of memory needed for no compressions C me: current supervariable being eliminated, and the C current element created by eliminating that C supervariable C mem: memory in use assuming no compressions have occurred C mindeg: current minimum degree C nel: number of pivots selected so far C newmem: amount of new memory needed for current pivot element C nleft: n - nel, the number of nonpivotal rows/columns remaining C nvi: the number of variables in a supervariable i (= nv (i)) C nvj: the number of variables in a supervariable j (= nv (j)) C nvpiv: number of pivots in current element C slenme: number of variables in variable list of pivotal variable C we: w (e) C wflg: used for flagging the w array. See description of iw. C wnvi: wflg - nv (i) C x: either a supervariable or an element C----------------------------------------------------------------------- C LOCAL POINTERS: C----------------------------------------------------------------------- INTEGER P, P1, P2, P3, PDST, PEND, PJ, PME, PME1, PME2, PN, PSRC C Any parameter (pe (...) or pfree) or local variable C starting with "p" (for Pointer) is an index into iw, C and all indices into iw use variables starting with C "p." The only exception to this rule is the iwlen C input argument. C p: pointer into lots of things C p1: pe (i) for some variable i (start of element list) C p2: pe (i) + elen (i) - 1 for some var. i (end of el. list) C p3: index of first supervariable in clean list C pdst: destination pointer, for compression C pend: end of memory to compress C pj: pointer into an element or variable C pme: pointer into the current element (pme1...pme2) C pme1: the current element, me, is stored in iw (pme1...pme2) C pme2: the end of the current element C pn: pointer into a "clean" variable, also used to compress C psrc: source pointer, for compression C----------------------------------------------------------------------- C FUNCTIONS CALLED: C----------------------------------------------------------------------- INTRINSIC MAX, MIN, MOD C======================================================================= C INITIALIZATIONS C======================================================================= WFLG = 2 MINDEG = 1 NCMPA = 0 NEL = 0 HMOD = MAX (1, N-1) DMAX = 0 MEM = PFREE - 1 MAXMEM = MEM ME = 0 DO 10 I = 1, N LAST (I) = 0 HEAD (I) = 0 NV (I) = 1 W (I) = 1 ELEN (I) = 0 DEGREE (I) = LEN (I) 10 CONTINUE C ---------------------------------------------------------------- C initialize degree lists and eliminate rows with no off-diag. nz. C ---------------------------------------------------------------- DO 20 I = 1, N DEG = DEGREE (I) IF (DEG .GT. 0) THEN C ---------------------------------------------------------- C place i in the degree list corresponding to its degree C ---------------------------------------------------------- INEXT = HEAD (DEG) IF (INEXT .NE. 0) LAST (INEXT) = I NEXT (I) = INEXT HEAD (DEG) = I ELSE C ---------------------------------------------------------- C we have a variable that can be eliminated at once because C there is no off-diagonal non-zero in its row. C ---------------------------------------------------------- NEL = NEL + 1 ELEN (I) = -NEL PE (I) = 0 W (I) = 0 ENDIF 20 CONTINUE C======================================================================= C WHILE (selecting pivots) DO C======================================================================= 30 CONTINUE IF (NEL .LT. N) THEN C======================================================================= C GET PIVOT OF MINIMUM DEGREE C======================================================================= C ------------------------------------------------------------- C find next supervariable for elimination C ------------------------------------------------------------- DO 40 DEG = MINDEG, N ME = HEAD (DEG) IF (ME .GT. 0) GOTO 50 40 CONTINUE 50 CONTINUE MINDEG = DEG C ------------------------------------------------------------- C remove chosen variable from link list C ------------------------------------------------------------- INEXT = NEXT (ME) IF (INEXT .NE. 0) LAST (INEXT) = 0 HEAD (DEG) = INEXT C ------------------------------------------------------------- C me represents the elimination of pivots nel+1 to nel+nv(me). C place me itself as the first in this set. It will be moved C to the nel+nv(me) position when the permutation vectors are C computed. C ------------------------------------------------------------- ELENME = ELEN (ME) ELEN (ME) = - (NEL + 1) NVPIV = NV (ME) NEL = NEL + NVPIV C======================================================================= C CONSTRUCT NEW ELEMENT C======================================================================= C ------------------------------------------------------------- C At this point, me is the pivotal supervariable. It will be C converted into the current element. Scan list of the C pivotal supervariable, me, setting tree pointers and C constructing new list of supervariables for the new element, C me. p is a pointer to the current position in the old list. C ------------------------------------------------------------- C flag the variable "me" as being in Lme by negating nv (me) NV (ME) = -NVPIV DEGME = 0 IF (ELENME .EQ. 0) THEN C ---------------------------------------------------------- C construct the new element in place C ---------------------------------------------------------- PME1 = PE (ME) PME2 = PME1 - 1 DO 60 P = PME1, PME1 + LEN (ME) - 1 I = IW (P) NVI = NV (I) IF (NVI .GT. 0) THEN C ---------------------------------------------------- C i is a principal variable not yet placed in Lme. C store i in new list C ---------------------------------------------------- DEGME = DEGME + NVI C flag i as being in Lme by negating nv (i) NV (I) = -NVI PME2 = PME2 + 1 IW (PME2) = I C ---------------------------------------------------- C remove variable i from degree list. C ---------------------------------------------------- ILAST = LAST (I) INEXT = NEXT (I) IF (INEXT .NE. 0) LAST (INEXT) = ILAST IF (ILAST .NE. 0) THEN NEXT (ILAST) = INEXT ELSE C i is at the head of the degree list HEAD (DEGREE (I)) = INEXT ENDIF ENDIF 60 CONTINUE C this element takes no new memory in iw: NEWMEM = 0 ELSE C ---------------------------------------------------------- C construct the new element in empty space, iw (pfree ...) C ---------------------------------------------------------- P = PE (ME) PME1 = PFREE SLENME = LEN (ME) - ELENME DO 120 KNT1 = 1, ELENME + 1 IF (KNT1 .GT. ELENME) THEN C search the supervariables in me. E = ME PJ = P LN = SLENME ELSE C search the elements in me. E = IW (P) P = P + 1 PJ = PE (E) LN = LEN (E) ENDIF C ------------------------------------------------------- C search for different supervariables and add them to the C new list, compressing when necessary. this loop is C executed once for each element in the list and once for C all the supervariables in the list. C ------------------------------------------------------- DO 110 KNT2 = 1, LN I = IW (PJ) PJ = PJ + 1 NVI = NV (I) IF (NVI .GT. 0) THEN C ------------------------------------------------- C compress iw, if necessary C ------------------------------------------------- IF (PFREE .GT. IWLEN) THEN C prepare for compressing iw by adjusting C pointers and lengths so that the lists being C searched in the inner and outer loops contain C only the remaining entries. PE (ME) = P LEN (ME) = LEN (ME) - KNT1 IF (LEN (ME) .EQ. 0) THEN C nothing left of supervariable me PE (ME) = 0 ENDIF PE (E) = PJ LEN (E) = LN - KNT2 IF (LEN (E) .EQ. 0) THEN C nothing left of element e PE (E) = 0 ENDIF NCMPA = NCMPA + 1 C store first item in pe C set first entry to -item DO 70 J = 1, N PN = PE (J) IF (PN .GT. 0) THEN PE (J) = IW (PN) IW (PN) = -J ENDIF 70 CONTINUE C psrc/pdst point to source/destination PDST = 1 PSRC = 1 PEND = PME1 - 1 C while loop: 80 CONTINUE IF (PSRC .LE. PEND) THEN C search for next negative entry J = -IW (PSRC) PSRC = PSRC + 1 IF (J .GT. 0) THEN IW (PDST) = PE (J) PE (J) = PDST PDST = PDST + 1 C copy from source to destination LENJ = LEN (J) DO 90 KNT3 = 0, LENJ - 2 IW (PDST + KNT3) = IW (PSRC + KNT3) 90 CONTINUE PDST = PDST + LENJ - 1 PSRC = PSRC + LENJ - 1 ENDIF GOTO 80 ENDIF C move the new partially-constructed element P1 = PDST DO 100 PSRC = PME1, PFREE - 1 IW (PDST) = IW (PSRC) PDST = PDST + 1 100 CONTINUE PME1 = P1 PFREE = PDST PJ = PE (E) P = PE (ME) ENDIF C ------------------------------------------------- C i is a principal variable not yet placed in Lme C store i in new list C ------------------------------------------------- DEGME = DEGME + NVI C flag i as being in Lme by negating nv (i) NV (I) = -NVI IW (PFREE) = I PFREE = PFREE + 1 C ------------------------------------------------- C remove variable i from degree link list C ------------------------------------------------- ILAST = LAST (I) INEXT = NEXT (I) IF (INEXT .NE. 0) LAST (INEXT) = ILAST IF (ILAST .NE. 0) THEN NEXT (ILAST) = INEXT ELSE C i is at the head of the degree list HEAD (DEGREE (I)) = INEXT ENDIF ENDIF 110 CONTINUE IF (E .NE. ME) THEN C set tree pointer and flag to indicate element e is C absorbed into new element me (the parent of e is me) PE (E) = -ME W (E) = 0 ENDIF 120 CONTINUE PME2 = PFREE - 1 C this element takes newmem new memory in iw (possibly zero) NEWMEM = PFREE - PME1 MEM = MEM + NEWMEM MAXMEM = MAX (MAXMEM, MEM) ENDIF C ------------------------------------------------------------- C me has now been converted into an element in iw (pme1..pme2) C ------------------------------------------------------------- C degme holds the external degree of new element DEGREE (ME) = DEGME PE (ME) = PME1 LEN (ME) = PME2 - PME1 + 1 C ------------------------------------------------------------- C make sure that wflg is not too large. With the current C value of wflg, wflg+n must not cause integer overflow C ------------------------------------------------------------- IF (WFLG + N .LE. WFLG) THEN DO 130 X = 1, N IF (W (X) .NE. 0) W (X) = 1 130 CONTINUE WFLG = 2 ENDIF C======================================================================= C COMPUTE (w (e) - wflg) = |Le\Lme| FOR ALL ELEMENTS C======================================================================= C ------------------------------------------------------------- C Scan 1: compute the external degrees of previous elements C with respect to the current element. That is: C (w (e) - wflg) = |Le \ Lme| C for each element e that appears in any supervariable in Lme. C The notation Le refers to the pattern (list of C supervariables) of a previous element e, where e is not yet C absorbed, stored in iw (pe (e) + 1 ... pe (e) + iw (pe (e))). C The notation Lme refers to the pattern of the current element C (stored in iw (pme1..pme2)). If (w (e) - wflg) becomes C zero, then the element e will be absorbed in scan 2. C ------------------------------------------------------------- DO 150 PME = PME1, PME2 I = IW (PME) ELN = ELEN (I) IF (ELN .GT. 0) THEN C note that nv (i) has been negated to denote i in Lme: NVI = -NV (I) WNVI = WFLG - NVI DO 140 P = PE (I), PE (I) + ELN - 1 E = IW (P) WE = W (E) IF (WE .GE. WFLG) THEN C unabsorbed element e has been seen in this loop WE = WE - NVI ELSE IF (WE .NE. 0) THEN C e is an unabsorbed element C this is the first we have seen e in all of Scan 1 WE = DEGREE (E) + WNVI ENDIF W (E) = WE 140 CONTINUE ENDIF 150 CONTINUE C======================================================================= C DEGREE UPDATE AND ELEMENT ABSORPTION C======================================================================= C ------------------------------------------------------------- C Scan 2: for each i in Lme, sum up the degree of Lme (which C is degme), plus the sum of the external degrees of each Le C for the elements e appearing within i, plus the C supervariables in i. Place i in hash list. C ------------------------------------------------------------- DO 180 PME = PME1, PME2 I = IW (PME) P1 = PE (I) P2 = P1 + ELEN (I) - 1 PN = P1 HASH = 0 DEG = 0 C ---------------------------------------------------------- C scan the element list associated with supervariable i C ---------------------------------------------------------- C UMFPACK/MA38-style approximate degree: DO 160 P = P1, P2 E = IW (P) WE = W (E) IF (WE .NE. 0) THEN C e is an unabsorbed element DEG = DEG + WE - WFLG IW (PN) = E PN = PN + 1 HASH = HASH + E ENDIF 160 CONTINUE C count the number of elements in i (including me): ELEN (I) = PN - P1 + 1 C ---------------------------------------------------------- C scan the supervariables in the list associated with i C ---------------------------------------------------------- P3 = PN DO 170 P = P2 + 1, P1 + LEN (I) - 1 J = IW (P) NVJ = NV (J) IF (NVJ .GT. 0) THEN C j is unabsorbed, and not in Lme. C add to degree and add to new list DEG = DEG + NVJ IW (PN) = J PN = PN + 1 HASH = HASH + J ENDIF 170 CONTINUE C ---------------------------------------------------------- C update the degree and check for mass elimination C ---------------------------------------------------------- IF (ELEN (I) .EQ. 1 .AND. P3 .EQ. PN) THEN C ------------------------------------------------------- C mass elimination C ------------------------------------------------------- C There is nothing left of this node except for an C edge to the current pivot element. elen (i) is 1, C and there are no variables adjacent to node i. C Absorb i into the current pivot element, me. PE (I) = -ME NVI = -NV (I) DEGME = DEGME - NVI NVPIV = NVPIV + NVI NEL = NEL + NVI NV (I) = 0 ELEN (I) = 0 ELSE C ------------------------------------------------------- C update the upper-bound degree of i C ------------------------------------------------------- C the following degree does not yet include the size C of the current element, which is added later: DEGREE (I) = MIN (DEGREE (I), DEG) C ------------------------------------------------------- C add me to the list for i C ------------------------------------------------------- C move first supervariable to end of list IW (PN) = IW (P3) C move first element to end of element part of list IW (P3) = IW (P1) C add new element to front of list. IW (P1) = ME C store the new length of the list in len (i) LEN (I) = PN - P1 + 1 C ------------------------------------------------------- C place in hash bucket. Save hash key of i in last (i). C ------------------------------------------------------- HASH = MOD (HASH, HMOD) + 1 J = HEAD (HASH) IF (J .LE. 0) THEN C the degree list is empty, hash head is -j NEXT (I) = -J HEAD (HASH) = -I ELSE C degree list is not empty C use last (head (hash)) as hash head NEXT (I) = LAST (J) LAST (J) = I ENDIF LAST (I) = HASH ENDIF 180 CONTINUE DEGREE (ME) = DEGME C ------------------------------------------------------------- C Clear the counter array, w (...), by incrementing wflg. C ------------------------------------------------------------- DMAX = MAX (DMAX, DEGME) WFLG = WFLG + DMAX C make sure that wflg+n does not cause integer overflow IF (WFLG + N .LE. WFLG) THEN DO 190 X = 1, N IF (W (X) .NE. 0) W (X) = 1 190 CONTINUE WFLG = 2 ENDIF C at this point, w (1..n) .lt. wflg holds C======================================================================= C SUPERVARIABLE DETECTION C======================================================================= DO 250 PME = PME1, PME2 I = IW (PME) IF (NV (I) .LT. 0) THEN C i is a principal variable in Lme C ------------------------------------------------------- C examine all hash buckets with 2 or more variables. We C do this by examing all unique hash keys for super- C variables in the pattern Lme of the current element, me C ------------------------------------------------------- HASH = LAST (I) C let i = head of hash bucket, and empty the hash bucket J = HEAD (HASH) IF (J .EQ. 0) GOTO 250 IF (J .LT. 0) THEN C degree list is empty I = -J HEAD (HASH) = 0 ELSE C degree list is not empty, restore last () of head I = LAST (J) LAST (J) = 0 ENDIF IF (I .EQ. 0) GOTO 250 C while loop: 200 CONTINUE IF (NEXT (I) .NE. 0) THEN C ---------------------------------------------------- C this bucket has one or more variables following i. C scan all of them to see if i can absorb any entries C that follow i in hash bucket. Scatter i into w. C ---------------------------------------------------- LN = LEN (I) ELN = ELEN (I) C do not flag the first element in the list (me) DO 210 P = PE (I) + 1, PE (I) + LN - 1 W (IW (P)) = WFLG 210 CONTINUE C ---------------------------------------------------- C scan every other entry j following i in bucket C ---------------------------------------------------- JLAST = I J = NEXT (I) C while loop: 220 CONTINUE IF (J .NE. 0) THEN C ------------------------------------------------- C check if j and i have identical nonzero pattern C ------------------------------------------------- IF (LEN (J) .NE. LN) THEN C i and j do not have same size data structure GOTO 240 ENDIF IF (ELEN (J) .NE. ELN) THEN C i and j do not have same number of adjacent el GOTO 240 ENDIF C do not flag the first element in the list (me) DO 230 P = PE (J) + 1, PE (J) + LN - 1 IF (W (IW (P)) .NE. WFLG) THEN C an entry (iw(p)) is in j but not in i GOTO 240 ENDIF 230 CONTINUE C ------------------------------------------------- C found it! j can be absorbed into i C ------------------------------------------------- PE (J) = -I C both nv (i) and nv (j) are negated since they C are in Lme, and the absolute values of each C are the number of variables in i and j: NV (I) = NV (I) + NV (J) NV (J) = 0 ELEN (J) = 0 C delete j from hash bucket J = NEXT (J) NEXT (JLAST) = J GOTO 220 C ------------------------------------------------- 240 CONTINUE C j cannot be absorbed into i C ------------------------------------------------- JLAST = J J = NEXT (J) GOTO 220 ENDIF C ---------------------------------------------------- C no more variables can be absorbed into i C go to next i in bucket and clear flag array C ---------------------------------------------------- WFLG = WFLG + 1 I = NEXT (I) IF (I .NE. 0) GOTO 200 ENDIF ENDIF 250 CONTINUE C======================================================================= C RESTORE DEGREE LISTS AND REMOVE NONPRINCIPAL SUPERVAR. FROM ELEMENT C======================================================================= P = PME1 NLEFT = N - NEL DO 260 PME = PME1, PME2 I = IW (PME) NVI = -NV (I) IF (NVI .GT. 0) THEN C i is a principal variable in Lme C restore nv (i) to signify that i is principal NV (I) = NVI C ------------------------------------------------------- C compute the external degree (add size of current elem) C ------------------------------------------------------- DEG = MAX (1, MIN (DEGREE (I) + DEGME-NVI, NLEFT-NVI)) C ------------------------------------------------------- C place the supervariable at the head of the degree list C ------------------------------------------------------- INEXT = HEAD (DEG) IF (INEXT .NE. 0) LAST (INEXT) = I NEXT (I) = INEXT LAST (I) = 0 HEAD (DEG) = I C ------------------------------------------------------- C save the new degree, and find the minimum degree C ------------------------------------------------------- MINDEG = MIN (MINDEG, DEG) DEGREE (I) = DEG C ------------------------------------------------------- C place the supervariable in the element pattern C ------------------------------------------------------- IW (P) = I P = P + 1 ENDIF 260 CONTINUE C======================================================================= C FINALIZE THE NEW ELEMENT C======================================================================= NV (ME) = NVPIV + DEGME C nv (me) is now the degree of pivot (including diagonal part) C save the length of the list for the new element me LEN (ME) = P - PME1 IF (LEN (ME) .EQ. 0) THEN C there is nothing left of the current pivot element PE (ME) = 0 W (ME) = 0 ENDIF IF (NEWMEM .NE. 0) THEN C element was not constructed in place: deallocate part C of it (final size is less than or equal to newmem, C since newly nonprincipal variables have been removed). PFREE = P MEM = MEM - NEWMEM + LEN (ME) ENDIF C======================================================================= C END WHILE (selecting pivots) GOTO 30 ENDIF C======================================================================= C======================================================================= C COMPUTE THE PERMUTATION VECTORS C======================================================================= C ---------------------------------------------------------------- C The time taken by the following code is O(n). At this C point, elen (e) = -k has been done for all elements e, C and elen (i) = 0 has been done for all nonprincipal C variables i. At this point, there are no principal C supervariables left, and all elements are absorbed. C ---------------------------------------------------------------- C ---------------------------------------------------------------- C compute the ordering of unordered nonprincipal variables C ---------------------------------------------------------------- DO 290 I = 1, N IF (ELEN (I) .EQ. 0) THEN C ---------------------------------------------------------- C i is an un-ordered row. Traverse the tree from i until C reaching an element, e. The element, e, was the C principal supervariable of i and all nodes in the path C from i to when e was selected as pivot. C ---------------------------------------------------------- J = -PE (I) C while (j is a variable) do: 270 CONTINUE IF (ELEN (J) .GE. 0) THEN J = -PE (J) GOTO 270 ENDIF E = J C ---------------------------------------------------------- C get the current pivot ordering of e C ---------------------------------------------------------- K = -ELEN (E) C ---------------------------------------------------------- C traverse the path again from i to e, and compress the C path (all nodes point to e). Path compression allows C this code to compute in O(n) time. Order the unordered C nodes in the path, and place the element e at the end. C ---------------------------------------------------------- J = I C while (j is a variable) do: 280 CONTINUE IF (ELEN (J) .GE. 0) THEN JNEXT = -PE (J) PE (J) = -E IF (ELEN (J) .EQ. 0) THEN C j is an unordered row ELEN (J) = K K = K + 1 ENDIF J = JNEXT GOTO 280 ENDIF C leave elen (e) negative, so we know it is an element ELEN (E) = -K ENDIF 290 CONTINUE C ---------------------------------------------------------------- C reset the inverse permutation (elen (1..n)) to be positive, C and compute the permutation (last (1..n)). C ---------------------------------------------------------------- DO 300 I = 1, N K = ABS (ELEN (I)) LAST (K) = I ELEN (I) = K 300 CONTINUE C======================================================================= C RETURN THE MEMORY USAGE IN IW C======================================================================= C If maxmem is less than or equal to iwlen, then no compressions C occurred, and iw (maxmem+1 ... iwlen) was unused. Otherwise C compressions did occur, and iwlen would have had to have been C greater than or equal to maxmem for no compressions to occur. C Return the value of maxmem in the pfree argument. PFREE = MAXMEM RETURN END JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_dump.c0000664000175000017500000001162414224052371017364 00000000000000/* ========================================================================= */ /* === AMD_dump ============================================================ */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* Debugging routines for AMD. Not used if NDEBUG is not defined at compile- * time (the default). See comments in amd_internal.h on how to enable * debugging. Not user-callable. */ #include "amd_internal.h" #ifndef NDEBUG /* This global variable is present only when debugging */ GLOBAL Int AMD_debug = -999 ; /* default is no debug printing */ /* ========================================================================= */ /* === AMD_debug_init ====================================================== */ /* ========================================================================= */ /* Sets the debug print level, by reading the file debug.amd (if it exists) */ GLOBAL void AMD_debug_init ( char *s ) { FILE *f ; f = fopen ("debug.amd", "r") ; if (f == (FILE *) NULL) { AMD_debug = -999 ; } else { fscanf (f, ID, &AMD_debug) ; fclose (f) ; } if (AMD_debug >= 0) { printf ("%s: AMD_debug_init, D= "ID"\n", s, AMD_debug) ; } } /* ========================================================================= */ /* === AMD_dump ============================================================ */ /* ========================================================================= */ /* Dump AMD's data structure, except for the hash buckets. This routine * cannot be called when the hash buckets are non-empty. */ GLOBAL void AMD_dump ( Int n, /* A is n-by-n */ Int Pe [ ], /* pe [0..n-1]: index in iw of start of row i */ Int Iw [ ], /* workspace of size iwlen, iwlen [0..pfree-1] * holds the matrix on input */ Int Len [ ], /* len [0..n-1]: length for row i */ Int iwlen, /* length of iw */ Int pfree, /* iw [pfree ... iwlen-1] is empty on input */ Int Nv [ ], /* nv [0..n-1] */ Int Next [ ], /* next [0..n-1] */ Int Last [ ], /* last [0..n-1] */ Int Head [ ], /* head [0..n-1] */ Int Elen [ ], /* size n */ Int Degree [ ], /* size n */ Int W [ ], /* size n */ Int nel ) { Int i, pe, elen, nv, len, e, p, k, j, deg, w, cnt, ilast ; if (AMD_debug < 0) return ; ASSERT (pfree <= iwlen) ; AMD_DEBUG3 (("\nAMD dump, pfree: "ID"\n", pfree)) ; for (i = 0 ; i < n ; i++) { pe = Pe [i] ; elen = Elen [i] ; nv = Nv [i] ; len = Len [i] ; w = W [i] ; if (elen >= EMPTY) { if (nv == 0) { AMD_DEBUG3 (("\nI "ID": nonprincipal: ", i)) ; ASSERT (elen == EMPTY) ; if (pe == EMPTY) { AMD_DEBUG3 ((" dense node\n")) ; ASSERT (w == 1) ; } else { ASSERT (pe < EMPTY) ; AMD_DEBUG3 ((" i "ID" -> parent "ID"\n", i, FLIP (Pe[i]))); } } else { AMD_DEBUG3 (("\nI "ID": active principal supervariable:\n",i)); AMD_DEBUG3 ((" nv(i): "ID" Flag: %d\n", nv, (nv < 0))) ; ASSERT (elen >= 0) ; ASSERT (nv > 0 && pe >= 0) ; p = pe ; AMD_DEBUG3 ((" e/s: ")) ; if (elen == 0) AMD_DEBUG3 ((" : ")) ; ASSERT (pe + len <= pfree) ; for (k = 0 ; k < len ; k++) { j = Iw [p] ; AMD_DEBUG3 ((" "ID"", j)) ; ASSERT (j >= 0 && j < n) ; if (k == elen-1) AMD_DEBUG3 ((" : ")) ; p++ ; } AMD_DEBUG3 (("\n")) ; } } else { e = i ; if (w == 0) { AMD_DEBUG3 (("\nE "ID": absorbed element: w "ID"\n", e, w)) ; ASSERT (nv > 0 && pe < 0) ; AMD_DEBUG3 ((" e "ID" -> parent "ID"\n", e, FLIP (Pe [e]))) ; } else { AMD_DEBUG3 (("\nE "ID": unabsorbed element: w "ID"\n", e, w)) ; ASSERT (nv > 0 && pe >= 0) ; p = pe ; AMD_DEBUG3 ((" : ")) ; ASSERT (pe + len <= pfree) ; for (k = 0 ; k < len ; k++) { j = Iw [p] ; AMD_DEBUG3 ((" "ID"", j)) ; ASSERT (j >= 0 && j < n) ; p++ ; } AMD_DEBUG3 (("\n")) ; } } } /* this routine cannot be called when the hash buckets are non-empty */ AMD_DEBUG3 (("\nDegree lists:\n")) ; if (nel >= 0) { cnt = 0 ; for (deg = 0 ; deg < n ; deg++) { if (Head [deg] == EMPTY) continue ; ilast = EMPTY ; AMD_DEBUG3 ((ID": \n", deg)) ; for (i = Head [deg] ; i != EMPTY ; i = Next [i]) { AMD_DEBUG3 ((" "ID" : next "ID" last "ID" deg "ID"\n", i, Next [i], Last [i], Degree [i])) ; ASSERT (i >= 0 && i < n && ilast == Last [i] && deg == Degree [i]) ; cnt += Nv [i] ; ilast = i ; } AMD_DEBUG3 (("\n")) ; } ASSERT (cnt == n - nel) ; } } #endif JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_info.c0000664000175000017500000001030514224052371017345 00000000000000/* ========================================================================= */ /* === AMD_info ============================================================ */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* User-callable. Prints the output statistics for AMD. See amd.h * for details. If the Info array is not present, nothing is printed. */ #include "amd_internal.h" #define PRI(format,x) { if (x >= 0) { SUITESPARSE_PRINTF ((format, x)) ; }} GLOBAL void AMD_info ( double Info [ ] ) { double n, ndiv, nmultsubs_ldl, nmultsubs_lu, lnz, lnzd ; SUITESPARSE_PRINTF (("\nAMD version %d.%d.%d, %s, results:\n", AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION, AMD_DATE)) ; if (!Info) { return ; } n = Info [AMD_N] ; ndiv = Info [AMD_NDIV] ; nmultsubs_ldl = Info [AMD_NMULTSUBS_LDL] ; nmultsubs_lu = Info [AMD_NMULTSUBS_LU] ; lnz = Info [AMD_LNZ] ; lnzd = (n >= 0 && lnz >= 0) ? (n + lnz) : (-1) ; /* AMD return status */ SUITESPARSE_PRINTF ((" status: ")) ; if (Info [AMD_STATUS] == AMD_OK) { SUITESPARSE_PRINTF (("OK\n")) ; } else if (Info [AMD_STATUS] == AMD_OUT_OF_MEMORY) { SUITESPARSE_PRINTF (("out of memory\n")) ; } else if (Info [AMD_STATUS] == AMD_INVALID) { SUITESPARSE_PRINTF (("invalid matrix\n")) ; } else if (Info [AMD_STATUS] == AMD_OK_BUT_JUMBLED) { SUITESPARSE_PRINTF (("OK, but jumbled\n")) ; } else { SUITESPARSE_PRINTF (("unknown\n")) ; } /* statistics about the input matrix */ PRI (" n, dimension of A: %.20g\n", n); PRI (" nz, number of nonzeros in A: %.20g\n", Info [AMD_NZ]) ; PRI (" symmetry of A: %.4f\n", Info [AMD_SYMMETRY]) ; PRI (" number of nonzeros on diagonal: %.20g\n", Info [AMD_NZDIAG]) ; PRI (" nonzeros in pattern of A+A' (excl. diagonal): %.20g\n", Info [AMD_NZ_A_PLUS_AT]) ; PRI (" # dense rows/columns of A+A': %.20g\n", Info [AMD_NDENSE]) ; /* statistics about AMD's behavior */ PRI (" memory used, in bytes: %.20g\n", Info [AMD_MEMORY]) ; PRI (" # of memory compactions: %.20g\n", Info [AMD_NCMPA]) ; /* statistics about the ordering quality */ SUITESPARSE_PRINTF (("\n" " The following approximate statistics are for a subsequent\n" " factorization of A(P,P) + A(P,P)'. They are slight upper\n" " bounds if there are no dense rows/columns in A+A', and become\n" " looser if dense rows/columns exist.\n\n")) ; PRI (" nonzeros in L (excluding diagonal): %.20g\n", lnz) ; PRI (" nonzeros in L (including diagonal): %.20g\n", lnzd) ; PRI (" # divide operations for LDL' or LU: %.20g\n", ndiv) ; PRI (" # multiply-subtract operations for LDL': %.20g\n", nmultsubs_ldl) ; PRI (" # multiply-subtract operations for LU: %.20g\n", nmultsubs_lu) ; PRI (" max nz. in any column of L (incl. diagonal): %.20g\n", Info [AMD_DMAX]) ; /* total flop counts for various factorizations */ if (n >= 0 && ndiv >= 0 && nmultsubs_ldl >= 0 && nmultsubs_lu >= 0) { SUITESPARSE_PRINTF (("\n" " chol flop count for real A, sqrt counted as 1 flop: %.20g\n" " LDL' flop count for real A: %.20g\n" " LDL' flop count for complex A: %.20g\n" " LU flop count for real A (with no pivoting): %.20g\n" " LU flop count for complex A (with no pivoting): %.20g\n\n", n + ndiv + 2*nmultsubs_ldl, ndiv + 2*nmultsubs_ldl, 9*ndiv + 8*nmultsubs_ldl, ndiv + 2*nmultsubs_lu, 9*ndiv + 8*nmultsubs_lu)) ; } } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_post_tree.c0000664000175000017500000000716714224052371020432 00000000000000/* ========================================================================= */ /* === AMD_post_tree ======================================================= */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* Post-ordering of a supernodal elimination tree. */ #include "amd_internal.h" GLOBAL Int AMD_post_tree ( Int root, /* root of the tree */ Int k, /* start numbering at k */ Int Child [ ], /* input argument of size nn, undefined on * output. Child [i] is the head of a link * list of all nodes that are children of node * i in the tree. */ const Int Sibling [ ], /* input argument of size nn, not modified. * If f is a node in the link list of the * children of node i, then Sibling [f] is the * next child of node i. */ Int Order [ ], /* output order, of size nn. Order [i] = k * if node i is the kth node of the reordered * tree. */ Int Stack [ ] /* workspace of size nn */ #ifndef NDEBUG , Int nn /* nodes are in the range 0..nn-1. */ #endif ) { Int f, head, h, i ; #if 0 /* --------------------------------------------------------------------- */ /* recursive version (Stack [ ] is not used): */ /* --------------------------------------------------------------------- */ /* this is simple, but can caouse stack overflow if nn is large */ i = root ; for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { k = AMD_post_tree (f, k, Child, Sibling, Order, Stack, nn) ; } Order [i] = k++ ; return (k) ; #endif /* --------------------------------------------------------------------- */ /* non-recursive version, using an explicit stack */ /* --------------------------------------------------------------------- */ /* push root on the stack */ head = 0 ; Stack [0] = root ; while (head >= 0) { /* get head of stack */ ASSERT (head < nn) ; i = Stack [head] ; AMD_DEBUG1 (("head of stack "ID" \n", i)) ; ASSERT (i >= 0 && i < nn) ; if (Child [i] != EMPTY) { /* the children of i are not yet ordered */ /* push each child onto the stack in reverse order */ /* so that small ones at the head of the list get popped first */ /* and the biggest one at the end of the list gets popped last */ for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { head++ ; ASSERT (head < nn) ; ASSERT (f >= 0 && f < nn) ; } h = head ; ASSERT (head < nn) ; for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { ASSERT (h > 0) ; Stack [h--] = f ; AMD_DEBUG1 (("push "ID" on stack\n", f)) ; ASSERT (f >= 0 && f < nn) ; } ASSERT (Stack [h] == i) ; /* delete child list so that i gets ordered next time we see it */ Child [i] = EMPTY ; } else { /* the children of i (if there were any) are already ordered */ /* remove i from the stack and order it. Front i is kth front */ head-- ; AMD_DEBUG1 (("pop "ID" order "ID"\n", i, k)) ; Order [i] = k++ ; ASSERT (k <= nn) ; } #ifndef NDEBUG AMD_DEBUG1 (("\nStack:")) ; for (h = head ; h >= 0 ; h--) { Int j = Stack [h] ; AMD_DEBUG1 ((" "ID, j)) ; ASSERT (j >= 0 && j < nn) ; } AMD_DEBUG1 (("\n\n")) ; ASSERT (head < nn) ; #endif } return (k) ; } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_2.c0000664000175000017500000017647114224052371016574 00000000000000/* ========================================================================= */ /* === AMD_2 =============================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* AMD_2: performs the AMD ordering on a symmetric sparse matrix A, followed * by a postordering (via depth-first search) of the assembly tree using the * AMD_postorder routine. */ #include "amd_internal.h" /* ========================================================================= */ /* === clear_flag ========================================================== */ /* ========================================================================= */ static Int clear_flag (Int wflg, Int wbig, Int W [ ], Int n) { Int x ; if (wflg < 2 || wflg >= wbig) { for (x = 0 ; x < n ; x++) { if (W [x] != 0) W [x] = 1 ; } wflg = 2 ; } /* at this point, W [0..n-1] < wflg holds */ return (wflg) ; } /* ========================================================================= */ /* === AMD_2 =============================================================== */ /* ========================================================================= */ GLOBAL void AMD_2 ( Int n, /* A is n-by-n, where n > 0 */ Int Pe [ ], /* Pe [0..n-1]: index in Iw of row i on input */ Int Iw [ ], /* workspace of size iwlen. Iw [0..pfree-1] * holds the matrix on input */ Int Len [ ], /* Len [0..n-1]: length for row/column i on input */ Int iwlen, /* length of Iw. iwlen >= pfree + n */ Int pfree, /* Iw [pfree ... iwlen-1] is empty on input */ /* 7 size-n workspaces, not defined on input: */ Int Nv [ ], /* the size of each supernode on output */ Int Next [ ], /* the output inverse permutation */ Int Last [ ], /* the output permutation */ Int Head [ ], Int Elen [ ], /* the size columns of L for each supernode */ Int Degree [ ], Int W [ ], /* control parameters and output statistics */ double Control [ ], /* array of size AMD_CONTROL */ double Info [ ] /* array of size AMD_INFO */ ) { /* * Given a representation of the nonzero pattern of a symmetric matrix, A, * (excluding the diagonal) perform an approximate minimum (UMFPACK/MA38-style) * degree ordering to compute a pivot order such that the introduction of * nonzeros (fill-in) in the Cholesky factors A = LL' is kept low. At each * step, the pivot selected is the one with the minimum UMFAPACK/MA38-style * upper-bound on the external degree. This routine can optionally perform * aggresive absorption (as done by MC47B in the Harwell Subroutine * Library). * * The approximate degree algorithm implemented here is the symmetric analog of * the degree update algorithm in MA38 and UMFPACK (the Unsymmetric-pattern * MultiFrontal PACKage, both by Davis and Duff). The routine is based on the * MA27 minimum degree ordering algorithm by Iain Duff and John Reid. * * This routine is a translation of the original AMDBAR and MC47B routines, * in Fortran, with the following modifications: * * (1) dense rows/columns are removed prior to ordering the matrix, and placed * last in the output order. The presence of a dense row/column can * increase the ordering time by up to O(n^2), unless they are removed * prior to ordering. * * (2) the minimum degree ordering is followed by a postordering (depth-first * search) of the assembly tree. Note that mass elimination (discussed * below) combined with the approximate degree update can lead to the mass * elimination of nodes with lower exact degree than the current pivot * element. No additional fill-in is caused in the representation of the * Schur complement. The mass-eliminated nodes merge with the current * pivot element. They are ordered prior to the current pivot element. * Because they can have lower exact degree than the current element, the * merger of two or more of these nodes in the current pivot element can * lead to a single element that is not a "fundamental supernode". The * diagonal block can have zeros in it. Thus, the assembly tree used here * is not guaranteed to be the precise supernodal elemination tree (with * "funadmental" supernodes), and the postordering performed by this * routine is not guaranteed to be a precise postordering of the * elimination tree. * * (3) input parameters are added, to control aggressive absorption and the * detection of "dense" rows/columns of A. * * (4) additional statistical information is returned, such as the number of * nonzeros in L, and the flop counts for subsequent LDL' and LU * factorizations. These are slight upper bounds, because of the mass * elimination issue discussed above. * * (5) additional routines are added to interface this routine to MATLAB * to provide a simple C-callable user-interface, to check inputs for * errors, compute the symmetry of the pattern of A and the number of * nonzeros in each row/column of A+A', to compute the pattern of A+A', * to perform the assembly tree postordering, and to provide debugging * ouput. Many of these functions are also provided by the Fortran * Harwell Subroutine Library routine MC47A. * * (6) both int and SuiteSparse_long versions are provided. In the * descriptions below and integer is and int or SuiteSparse_long depending * on which version is being used. ********************************************************************** ***** CAUTION: ARGUMENTS ARE NOT CHECKED FOR ERRORS ON INPUT. ****** ********************************************************************** ** If you want error checking, a more versatile input format, and a ** ** simpler user interface, use amd_order or amd_l_order instead. ** ** This routine is not meant to be user-callable. ** ********************************************************************** * ---------------------------------------------------------------------------- * References: * ---------------------------------------------------------------------------- * * [1] Timothy A. Davis and Iain Duff, "An unsymmetric-pattern multifrontal * method for sparse LU factorization", SIAM J. Matrix Analysis and * Applications, vol. 18, no. 1, pp. 140-158. Discusses UMFPACK / MA38, * which first introduced the approximate minimum degree used by this * routine. * * [2] Patrick Amestoy, Timothy A. Davis, and Iain S. Duff, "An approximate * minimum degree ordering algorithm," SIAM J. Matrix Analysis and * Applications, vol. 17, no. 4, pp. 886-905, 1996. Discusses AMDBAR and * MC47B, which are the Fortran versions of this routine. * * [3] Alan George and Joseph Liu, "The evolution of the minimum degree * ordering algorithm," SIAM Review, vol. 31, no. 1, pp. 1-19, 1989. * We list below the features mentioned in that paper that this code * includes: * * mass elimination: * Yes. MA27 relied on supervariable detection for mass elimination. * * indistinguishable nodes: * Yes (we call these "supervariables"). This was also in the MA27 * code - although we modified the method of detecting them (the * previous hash was the true degree, which we no longer keep track * of). A supervariable is a set of rows with identical nonzero * pattern. All variables in a supervariable are eliminated together. * Each supervariable has as its numerical name that of one of its * variables (its principal variable). * * quotient graph representation: * Yes. We use the term "element" for the cliques formed during * elimination. This was also in the MA27 code. The algorithm can * operate in place, but it will work more efficiently if given some * "elbow room." * * element absorption: * Yes. This was also in the MA27 code. * * external degree: * Yes. The MA27 code was based on the true degree. * * incomplete degree update and multiple elimination: * No. This was not in MA27, either. Our method of degree update * within MC47B is element-based, not variable-based. It is thus * not well-suited for use with incomplete degree update or multiple * elimination. * * Authors, and Copyright (C) 2004 by: * Timothy A. Davis, Patrick Amestoy, Iain S. Duff, John K. Reid. * * Acknowledgements: This work (and the UMFPACK package) was supported by the * National Science Foundation (ASC-9111263, DMS-9223088, and CCR-0203270). * The UMFPACK/MA38 approximate degree update algorithm, the unsymmetric analog * which forms the basis of AMD, was developed while Tim Davis was supported by * CERFACS (Toulouse, France) in a post-doctoral position. This C version, and * the etree postorder, were written while Tim Davis was on sabbatical at * Stanford University and Lawrence Berkeley National Laboratory. * ---------------------------------------------------------------------------- * INPUT ARGUMENTS (unaltered): * ---------------------------------------------------------------------------- * n: The matrix order. Restriction: n >= 1. * * iwlen: The size of the Iw array. On input, the matrix is stored in * Iw [0..pfree-1]. However, Iw [0..iwlen-1] should be slightly larger * than what is required to hold the matrix, at least iwlen >= pfree + n. * Otherwise, excessive compressions will take place. The recommended * value of iwlen is 1.2 * pfree + n, which is the value used in the * user-callable interface to this routine (amd_order.c). The algorithm * will not run at all if iwlen < pfree. Restriction: iwlen >= pfree + n. * Note that this is slightly more restrictive than the actual minimum * (iwlen >= pfree), but AMD_2 will be very slow with no elbow room. * Thus, this routine enforces a bare minimum elbow room of size n. * * pfree: On input the tail end of the array, Iw [pfree..iwlen-1], is empty, * and the matrix is stored in Iw [0..pfree-1]. During execution, * additional data is placed in Iw, and pfree is modified so that * Iw [pfree..iwlen-1] is always the unused part of Iw. * * Control: A double array of size AMD_CONTROL containing input parameters * that affect how the ordering is computed. If NULL, then default * settings are used. * * Control [AMD_DENSE] is used to determine whether or not a given input * row is "dense". A row is "dense" if the number of entries in the row * exceeds Control [AMD_DENSE] times sqrt (n), except that rows with 16 or * fewer entries are never considered "dense". To turn off the detection * of dense rows, set Control [AMD_DENSE] to a negative number, or to a * number larger than sqrt (n). The default value of Control [AMD_DENSE] * is AMD_DEFAULT_DENSE, which is defined in amd.h as 10. * * Control [AMD_AGGRESSIVE] is used to determine whether or not aggressive * absorption is to be performed. If nonzero, then aggressive absorption * is performed (this is the default). * ---------------------------------------------------------------------------- * INPUT/OUPUT ARGUMENTS: * ---------------------------------------------------------------------------- * * Pe: An integer array of size n. On input, Pe [i] is the index in Iw of * the start of row i. Pe [i] is ignored if row i has no off-diagonal * entries. Thus Pe [i] must be in the range 0 to pfree-1 for non-empty * rows. * * During execution, it is used for both supervariables and elements: * * Principal supervariable i: index into Iw of the description of * supervariable i. A supervariable represents one or more rows of * the matrix with identical nonzero pattern. In this case, * Pe [i] >= 0. * * Non-principal supervariable i: if i has been absorbed into another * supervariable j, then Pe [i] = FLIP (j), where FLIP (j) is defined * as (-(j)-2). Row j has the same pattern as row i. Note that j * might later be absorbed into another supervariable j2, in which * case Pe [i] is still FLIP (j), and Pe [j] = FLIP (j2) which is * < EMPTY, where EMPTY is defined as (-1) in amd_internal.h. * * Unabsorbed element e: the index into Iw of the description of element * e, if e has not yet been absorbed by a subsequent element. Element * e is created when the supervariable of the same name is selected as * the pivot. In this case, Pe [i] >= 0. * * Absorbed element e: if element e is absorbed into element e2, then * Pe [e] = FLIP (e2). This occurs when the pattern of e (which we * refer to as Le) is found to be a subset of the pattern of e2 (that * is, Le2). In this case, Pe [i] < EMPTY. If element e is "null" * (it has no nonzeros outside its pivot block), then Pe [e] = EMPTY, * and e is the root of an assembly subtree (or the whole tree if * there is just one such root). * * Dense variable i: if i is "dense", then Pe [i] = EMPTY. * * On output, Pe holds the assembly tree/forest, which implicitly * represents a pivot order with identical fill-in as the actual order * (via a depth-first search of the tree), as follows. If Nv [i] > 0, * then i represents a node in the assembly tree, and the parent of i is * Pe [i], or EMPTY if i is a root. If Nv [i] = 0, then (i, Pe [i]) * represents an edge in a subtree, the root of which is a node in the * assembly tree. Note that i refers to a row/column in the original * matrix, not the permuted matrix. * * Info: A double array of size AMD_INFO. If present, (that is, not NULL), * then statistics about the ordering are returned in the Info array. * See amd.h for a description. * ---------------------------------------------------------------------------- * INPUT/MODIFIED (undefined on output): * ---------------------------------------------------------------------------- * * Len: An integer array of size n. On input, Len [i] holds the number of * entries in row i of the matrix, excluding the diagonal. The contents * of Len are undefined on output. * * Iw: An integer array of size iwlen. On input, Iw [0..pfree-1] holds the * description of each row i in the matrix. The matrix must be symmetric, * and both upper and lower triangular parts must be present. The * diagonal must not be present. Row i is held as follows: * * Len [i]: the length of the row i data structure in the Iw array. * Iw [Pe [i] ... Pe [i] + Len [i] - 1]: * the list of column indices for nonzeros in row i (simple * supervariables), excluding the diagonal. All supervariables * start with one row/column each (supervariable i is just row i). * If Len [i] is zero on input, then Pe [i] is ignored on input. * * Note that the rows need not be in any particular order, and there * may be empty space between the rows. * * During execution, the supervariable i experiences fill-in. This is * represented by placing in i a list of the elements that cause fill-in * in supervariable i: * * Len [i]: the length of supervariable i in the Iw array. * Iw [Pe [i] ... Pe [i] + Elen [i] - 1]: * the list of elements that contain i. This list is kept short * by removing absorbed elements. * Iw [Pe [i] + Elen [i] ... Pe [i] + Len [i] - 1]: * the list of supervariables in i. This list is kept short by * removing nonprincipal variables, and any entry j that is also * contained in at least one of the elements (j in Le) in the list * for i (e in row i). * * When supervariable i is selected as pivot, we create an element e of * the same name (e=i): * * Len [e]: the length of element e in the Iw array. * Iw [Pe [e] ... Pe [e] + Len [e] - 1]: * the list of supervariables in element e. * * An element represents the fill-in that occurs when supervariable i is * selected as pivot (which represents the selection of row i and all * non-principal variables whose principal variable is i). We use the * term Le to denote the set of all supervariables in element e. Absorbed * supervariables and elements are pruned from these lists when * computationally convenient. * * CAUTION: THE INPUT MATRIX IS OVERWRITTEN DURING COMPUTATION. * The contents of Iw are undefined on output. * ---------------------------------------------------------------------------- * OUTPUT (need not be set on input): * ---------------------------------------------------------------------------- * * Nv: An integer array of size n. During execution, ABS (Nv [i]) is equal to * the number of rows that are represented by the principal supervariable * i. If i is a nonprincipal or dense variable, then Nv [i] = 0. * Initially, Nv [i] = 1 for all i. Nv [i] < 0 signifies that i is a * principal variable in the pattern Lme of the current pivot element me. * After element me is constructed, Nv [i] is set back to a positive * value. * * On output, Nv [i] holds the number of pivots represented by super * row/column i of the original matrix, or Nv [i] = 0 for non-principal * rows/columns. Note that i refers to a row/column in the original * matrix, not the permuted matrix. * * Elen: An integer array of size n. See the description of Iw above. At the * start of execution, Elen [i] is set to zero for all rows i. During * execution, Elen [i] is the number of elements in the list for * supervariable i. When e becomes an element, Elen [e] = FLIP (esize) is * set, where esize is the size of the element (the number of pivots, plus * the number of nonpivotal entries). Thus Elen [e] < EMPTY. * Elen (i) = EMPTY set when variable i becomes nonprincipal. * * For variables, Elen (i) >= EMPTY holds until just before the * postordering and permutation vectors are computed. For elements, * Elen [e] < EMPTY holds. * * On output, Elen [i] is the degree of the row/column in the Cholesky * factorization of the permuted matrix, corresponding to the original row * i, if i is a super row/column. It is equal to EMPTY if i is * non-principal. Note that i refers to a row/column in the original * matrix, not the permuted matrix. * * Note that the contents of Elen on output differ from the Fortran * version (Elen holds the inverse permutation in the Fortran version, * which is instead returned in the Next array in this C version, * described below). * * Last: In a degree list, Last [i] is the supervariable preceding i, or EMPTY * if i is the head of the list. In a hash bucket, Last [i] is the hash * key for i. * * Last [Head [hash]] is also used as the head of a hash bucket if * Head [hash] contains a degree list (see the description of Head, * below). * * On output, Last [0..n-1] holds the permutation. That is, if * i = Last [k], then row i is the kth pivot row (where k ranges from 0 to * n-1). Row Last [k] of A is the kth row in the permuted matrix, PAP'. * * Next: Next [i] is the supervariable following i in a link list, or EMPTY if * i is the last in the list. Used for two kinds of lists: degree lists * and hash buckets (a supervariable can be in only one kind of list at a * time). * * On output Next [0..n-1] holds the inverse permutation. That is, if * k = Next [i], then row i is the kth pivot row. Row i of A appears as * the (Next[i])-th row in the permuted matrix, PAP'. * * Note that the contents of Next on output differ from the Fortran * version (Next is undefined on output in the Fortran version). * ---------------------------------------------------------------------------- * LOCAL WORKSPACE (not input or output - used only during execution): * ---------------------------------------------------------------------------- * * Degree: An integer array of size n. If i is a supervariable, then * Degree [i] holds the current approximation of the external degree of * row i (an upper bound). The external degree is the number of nonzeros * in row i, minus ABS (Nv [i]), the diagonal part. The bound is equal to * the exact external degree if Elen [i] is less than or equal to two. * * We also use the term "external degree" for elements e to refer to * |Le \ Lme|. If e is an element, then Degree [e] is |Le|, which is the * degree of the off-diagonal part of the element e (not including the * diagonal part). * * Head: An integer array of size n. Head is used for degree lists. * Head [deg] is the first supervariable in a degree list. All * supervariables i in a degree list Head [deg] have the same approximate * degree, namely, deg = Degree [i]. If the list Head [deg] is empty then * Head [deg] = EMPTY. * * During supervariable detection Head [hash] also serves as a pointer to * a hash bucket. If Head [hash] >= 0, there is a degree list of degree * hash. The hash bucket head pointer is Last [Head [hash]]. If * Head [hash] = EMPTY, then the degree list and hash bucket are both * empty. If Head [hash] < EMPTY, then the degree list is empty, and * FLIP (Head [hash]) is the head of the hash bucket. After supervariable * detection is complete, all hash buckets are empty, and the * (Last [Head [hash]] = EMPTY) condition is restored for the non-empty * degree lists. * * W: An integer array of size n. The flag array W determines the status of * elements and variables, and the external degree of elements. * * for elements: * if W [e] = 0, then the element e is absorbed. * if W [e] >= wflg, then W [e] - wflg is the size of the set * |Le \ Lme|, in terms of nonzeros (the sum of ABS (Nv [i]) for * each principal variable i that is both in the pattern of * element e and NOT in the pattern of the current pivot element, * me). * if wflg > W [e] > 0, then e is not absorbed and has not yet been * seen in the scan of the element lists in the computation of * |Le\Lme| in Scan 1 below. * * for variables: * during supervariable detection, if W [j] != wflg then j is * not in the pattern of variable i. * * The W array is initialized by setting W [i] = 1 for all i, and by * setting wflg = 2. It is reinitialized if wflg becomes too large (to * ensure that wflg+n does not cause integer overflow). * ---------------------------------------------------------------------------- * LOCAL INTEGERS: * ---------------------------------------------------------------------------- */ Int deg, degme, dext, lemax, e, elenme, eln, i, ilast, inext, j, jlast, jnext, k, knt1, knt2, knt3, lenj, ln, me, mindeg, nel, nleft, nvi, nvj, nvpiv, slenme, wbig, we, wflg, wnvi, ok, ndense, ncmpa, dense, aggressive ; unsigned Int hash ; /* unsigned, so that hash % n is well defined.*/ /* * deg: the degree of a variable or element * degme: size, |Lme|, of the current element, me (= Degree [me]) * dext: external degree, |Le \ Lme|, of some element e * lemax: largest |Le| seen so far (called dmax in Fortran version) * e: an element * elenme: the length, Elen [me], of element list of pivotal variable * eln: the length, Elen [...], of an element list * hash: the computed value of the hash function * i: a supervariable * ilast: the entry in a link list preceding i * inext: the entry in a link list following i * j: a supervariable * jlast: the entry in a link list preceding j * jnext: the entry in a link list, or path, following j * k: the pivot order of an element or variable * knt1: loop counter used during element construction * knt2: loop counter used during element construction * knt3: loop counter used during compression * lenj: Len [j] * ln: length of a supervariable list * me: current supervariable being eliminated, and the current * element created by eliminating that supervariable * mindeg: current minimum degree * nel: number of pivots selected so far * nleft: n - nel, the number of nonpivotal rows/columns remaining * nvi: the number of variables in a supervariable i (= Nv [i]) * nvj: the number of variables in a supervariable j (= Nv [j]) * nvpiv: number of pivots in current element * slenme: number of variables in variable list of pivotal variable * wbig: = (INT_MAX - n) for the int version, (SuiteSparse_long_max - n) * for the SuiteSparse_long version. wflg is not allowed to * be >= wbig. * we: W [e] * wflg: used for flagging the W array. See description of Iw. * wnvi: wflg - Nv [i] * x: either a supervariable or an element * * ok: true if supervariable j can be absorbed into i * ndense: number of "dense" rows/columns * dense: rows/columns with initial degree > dense are considered "dense" * aggressive: true if aggressive absorption is being performed * ncmpa: number of garbage collections * ---------------------------------------------------------------------------- * LOCAL DOUBLES, used for statistical output only (except for alpha): * ---------------------------------------------------------------------------- */ double f, r, ndiv, s, nms_lu, nms_ldl, dmax, alpha, lnz, lnzme ; /* * f: nvpiv * r: degme + nvpiv * ndiv: number of divisions for LU or LDL' factorizations * s: number of multiply-subtract pairs for LU factorization, for the * current element me * nms_lu number of multiply-subtract pairs for LU factorization * nms_ldl number of multiply-subtract pairs for LDL' factorization * dmax: the largest number of entries in any column of L, including the * diagonal * alpha: "dense" degree ratio * lnz: the number of nonzeros in L (excluding the diagonal) * lnzme: the number of nonzeros in L (excl. the diagonal) for the * current element me * ---------------------------------------------------------------------------- * LOCAL "POINTERS" (indices into the Iw array) * ---------------------------------------------------------------------------- */ Int p, p1, p2, p3, p4, pdst, pend, pj, pme, pme1, pme2, pn, psrc ; /* * Any parameter (Pe [...] or pfree) or local variable starting with "p" (for * Pointer) is an index into Iw, and all indices into Iw use variables starting * with "p." The only exception to this rule is the iwlen input argument. * * p: pointer into lots of things * p1: Pe [i] for some variable i (start of element list) * p2: Pe [i] + Elen [i] - 1 for some variable i * p3: index of first supervariable in clean list * p4: * pdst: destination pointer, for compression * pend: end of memory to compress * pj: pointer into an element or variable * pme: pointer into the current element (pme1...pme2) * pme1: the current element, me, is stored in Iw [pme1...pme2] * pme2: the end of the current element * pn: pointer into a "clean" variable, also used to compress * psrc: source pointer, for compression */ /* ========================================================================= */ /* INITIALIZATIONS */ /* ========================================================================= */ /* Note that this restriction on iwlen is slightly more restrictive than * what is actually required in AMD_2. AMD_2 can operate with no elbow * room at all, but it will be slow. For better performance, at least * size-n elbow room is enforced. */ ASSERT (iwlen >= pfree + n) ; ASSERT (n > 0) ; /* initialize output statistics */ lnz = 0 ; ndiv = 0 ; nms_lu = 0 ; nms_ldl = 0 ; dmax = 1 ; me = EMPTY ; mindeg = 0 ; ncmpa = 0 ; nel = 0 ; lemax = 0 ; /* get control parameters */ if (Control != (double *) NULL) { alpha = Control [AMD_DENSE] ; aggressive = (Control [AMD_AGGRESSIVE] != 0) ; } else { alpha = AMD_DEFAULT_DENSE ; aggressive = AMD_DEFAULT_AGGRESSIVE ; } /* Note: if alpha is NaN, this is undefined: */ if (alpha < 0) { /* only remove completely dense rows/columns */ dense = n-2 ; } else { dense = alpha * sqrt ((double) n) ; } dense = MAX (16, dense) ; dense = MIN (n, dense) ; AMD_DEBUG1 (("\n\nAMD (debug), alpha %g, aggr. "ID"\n", alpha, aggressive)) ; for (i = 0 ; i < n ; i++) { Last [i] = EMPTY ; Head [i] = EMPTY ; Next [i] = EMPTY ; /* if separate Hhead array is used for hash buckets: * Hhead [i] = EMPTY ; */ Nv [i] = 1 ; W [i] = 1 ; Elen [i] = 0 ; Degree [i] = Len [i] ; } #ifndef NDEBUG AMD_DEBUG1 (("\n======Nel "ID" initial\n", nel)) ; AMD_dump (n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, -1) ; #endif /* initialize wflg */ wbig = Int_MAX - n ; wflg = clear_flag (0, wbig, W, n) ; /* --------------------------------------------------------------------- */ /* initialize degree lists and eliminate dense and empty rows */ /* --------------------------------------------------------------------- */ ndense = 0 ; for (i = 0 ; i < n ; i++) { deg = Degree [i] ; ASSERT (deg >= 0 && deg < n) ; if (deg == 0) { /* ------------------------------------------------------------- * we have a variable that can be eliminated at once because * there is no off-diagonal non-zero in its row. Note that * Nv [i] = 1 for an empty variable i. It is treated just * the same as an eliminated element i. * ------------------------------------------------------------- */ Elen [i] = FLIP (1) ; nel++ ; Pe [i] = EMPTY ; W [i] = 0 ; } else if (deg > dense) { /* ------------------------------------------------------------- * Dense variables are not treated as elements, but as unordered, * non-principal variables that have no parent. They do not take * part in the postorder, since Nv [i] = 0. Note that the Fortran * version does not have this option. * ------------------------------------------------------------- */ AMD_DEBUG1 (("Dense node "ID" degree "ID"\n", i, deg)) ; ndense++ ; Nv [i] = 0 ; /* do not postorder this node */ Elen [i] = EMPTY ; nel++ ; Pe [i] = EMPTY ; } else { /* ------------------------------------------------------------- * place i in the degree list corresponding to its degree * ------------------------------------------------------------- */ inext = Head [deg] ; ASSERT (inext >= EMPTY && inext < n) ; if (inext != EMPTY) Last [inext] = i ; Next [i] = inext ; Head [deg] = i ; } } /* ========================================================================= */ /* WHILE (selecting pivots) DO */ /* ========================================================================= */ while (nel < n) { #ifndef NDEBUG AMD_DEBUG1 (("\n======Nel "ID"\n", nel)) ; if (AMD_debug >= 2) { AMD_dump (n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, nel) ; } #endif /* ========================================================================= */ /* GET PIVOT OF MINIMUM DEGREE */ /* ========================================================================= */ /* ----------------------------------------------------------------- */ /* find next supervariable for elimination */ /* ----------------------------------------------------------------- */ ASSERT (mindeg >= 0 && mindeg < n) ; for (deg = mindeg ; deg < n ; deg++) { me = Head [deg] ; if (me != EMPTY) break ; } mindeg = deg ; ASSERT (me >= 0 && me < n) ; AMD_DEBUG1 (("=================me: "ID"\n", me)) ; /* ----------------------------------------------------------------- */ /* remove chosen variable from link list */ /* ----------------------------------------------------------------- */ inext = Next [me] ; ASSERT (inext >= EMPTY && inext < n) ; if (inext != EMPTY) Last [inext] = EMPTY ; Head [deg] = inext ; /* ----------------------------------------------------------------- */ /* me represents the elimination of pivots nel to nel+Nv[me]-1. */ /* place me itself as the first in this set. */ /* ----------------------------------------------------------------- */ elenme = Elen [me] ; nvpiv = Nv [me] ; ASSERT (nvpiv > 0) ; nel += nvpiv ; /* ========================================================================= */ /* CONSTRUCT NEW ELEMENT */ /* ========================================================================= */ /* ----------------------------------------------------------------- * At this point, me is the pivotal supervariable. It will be * converted into the current element. Scan list of the pivotal * supervariable, me, setting tree pointers and constructing new list * of supervariables for the new element, me. p is a pointer to the * current position in the old list. * ----------------------------------------------------------------- */ /* flag the variable "me" as being in Lme by negating Nv [me] */ Nv [me] = -nvpiv ; degme = 0 ; ASSERT (Pe [me] >= 0 && Pe [me] < iwlen) ; if (elenme == 0) { /* ------------------------------------------------------------- */ /* construct the new element in place */ /* ------------------------------------------------------------- */ pme1 = Pe [me] ; pme2 = pme1 - 1 ; for (p = pme1 ; p <= pme1 + Len [me] - 1 ; p++) { i = Iw [p] ; ASSERT (i >= 0 && i < n && Nv [i] >= 0) ; nvi = Nv [i] ; if (nvi > 0) { /* ----------------------------------------------------- */ /* i is a principal variable not yet placed in Lme. */ /* store i in new list */ /* ----------------------------------------------------- */ /* flag i as being in Lme by negating Nv [i] */ degme += nvi ; Nv [i] = -nvi ; Iw [++pme2] = i ; /* ----------------------------------------------------- */ /* remove variable i from degree list. */ /* ----------------------------------------------------- */ ilast = Last [i] ; inext = Next [i] ; ASSERT (ilast >= EMPTY && ilast < n) ; ASSERT (inext >= EMPTY && inext < n) ; if (inext != EMPTY) Last [inext] = ilast ; if (ilast != EMPTY) { Next [ilast] = inext ; } else { /* i is at the head of the degree list */ ASSERT (Degree [i] >= 0 && Degree [i] < n) ; Head [Degree [i]] = inext ; } } } } else { /* ------------------------------------------------------------- */ /* construct the new element in empty space, Iw [pfree ...] */ /* ------------------------------------------------------------- */ p = Pe [me] ; pme1 = pfree ; slenme = Len [me] - elenme ; for (knt1 = 1 ; knt1 <= elenme + 1 ; knt1++) { if (knt1 > elenme) { /* search the supervariables in me. */ e = me ; pj = p ; ln = slenme ; AMD_DEBUG2 (("Search sv: "ID" "ID" "ID"\n", me,pj,ln)) ; } else { /* search the elements in me. */ e = Iw [p++] ; ASSERT (e >= 0 && e < n) ; pj = Pe [e] ; ln = Len [e] ; AMD_DEBUG2 (("Search element e "ID" in me "ID"\n", e,me)) ; ASSERT (Elen [e] < EMPTY && W [e] > 0 && pj >= 0) ; } ASSERT (ln >= 0 && (ln == 0 || (pj >= 0 && pj < iwlen))) ; /* --------------------------------------------------------- * search for different supervariables and add them to the * new list, compressing when necessary. this loop is * executed once for each element in the list and once for * all the supervariables in the list. * --------------------------------------------------------- */ for (knt2 = 1 ; knt2 <= ln ; knt2++) { i = Iw [pj++] ; ASSERT (i >= 0 && i < n && (i == me || Elen [i] >= EMPTY)); nvi = Nv [i] ; AMD_DEBUG2 ((": "ID" "ID" "ID" "ID"\n", i, Elen [i], Nv [i], wflg)) ; if (nvi > 0) { /* ------------------------------------------------- */ /* compress Iw, if necessary */ /* ------------------------------------------------- */ if (pfree >= iwlen) { AMD_DEBUG1 (("GARBAGE COLLECTION\n")) ; /* prepare for compressing Iw by adjusting pointers * and lengths so that the lists being searched in * the inner and outer loops contain only the * remaining entries. */ Pe [me] = p ; Len [me] -= knt1 ; /* check if nothing left of supervariable me */ if (Len [me] == 0) Pe [me] = EMPTY ; Pe [e] = pj ; Len [e] = ln - knt2 ; /* nothing left of element e */ if (Len [e] == 0) Pe [e] = EMPTY ; ncmpa++ ; /* one more garbage collection */ /* store first entry of each object in Pe */ /* FLIP the first entry in each object */ for (j = 0 ; j < n ; j++) { pn = Pe [j] ; if (pn >= 0) { ASSERT (pn >= 0 && pn < iwlen) ; Pe [j] = Iw [pn] ; Iw [pn] = FLIP (j) ; } } /* psrc/pdst point to source/destination */ psrc = 0 ; pdst = 0 ; pend = pme1 - 1 ; while (psrc <= pend) { /* search for next FLIP'd entry */ j = FLIP (Iw [psrc++]) ; if (j >= 0) { AMD_DEBUG2 (("Got object j: "ID"\n", j)) ; Iw [pdst] = Pe [j] ; Pe [j] = pdst++ ; lenj = Len [j] ; /* copy from source to destination */ for (knt3 = 0 ; knt3 <= lenj - 2 ; knt3++) { Iw [pdst++] = Iw [psrc++] ; } } } /* move the new partially-constructed element */ p1 = pdst ; for (psrc = pme1 ; psrc <= pfree-1 ; psrc++) { Iw [pdst++] = Iw [psrc] ; } pme1 = p1 ; pfree = pdst ; pj = Pe [e] ; p = Pe [me] ; } /* ------------------------------------------------- */ /* i is a principal variable not yet placed in Lme */ /* store i in new list */ /* ------------------------------------------------- */ /* flag i as being in Lme by negating Nv [i] */ degme += nvi ; Nv [i] = -nvi ; Iw [pfree++] = i ; AMD_DEBUG2 ((" s: "ID" nv "ID"\n", i, Nv [i])); /* ------------------------------------------------- */ /* remove variable i from degree link list */ /* ------------------------------------------------- */ ilast = Last [i] ; inext = Next [i] ; ASSERT (ilast >= EMPTY && ilast < n) ; ASSERT (inext >= EMPTY && inext < n) ; if (inext != EMPTY) Last [inext] = ilast ; if (ilast != EMPTY) { Next [ilast] = inext ; } else { /* i is at the head of the degree list */ ASSERT (Degree [i] >= 0 && Degree [i] < n) ; Head [Degree [i]] = inext ; } } } if (e != me) { /* set tree pointer and flag to indicate element e is * absorbed into new element me (the parent of e is me) */ AMD_DEBUG1 ((" Element "ID" => "ID"\n", e, me)) ; Pe [e] = FLIP (me) ; W [e] = 0 ; } } pme2 = pfree - 1 ; } /* ----------------------------------------------------------------- */ /* me has now been converted into an element in Iw [pme1..pme2] */ /* ----------------------------------------------------------------- */ /* degme holds the external degree of new element */ Degree [me] = degme ; Pe [me] = pme1 ; Len [me] = pme2 - pme1 + 1 ; ASSERT (Pe [me] >= 0 && Pe [me] < iwlen) ; Elen [me] = FLIP (nvpiv + degme) ; /* FLIP (Elen (me)) is now the degree of pivot (including * diagonal part). */ #ifndef NDEBUG AMD_DEBUG2 (("New element structure: length= "ID"\n", pme2-pme1+1)) ; for (pme = pme1 ; pme <= pme2 ; pme++) AMD_DEBUG3 ((" "ID"", Iw[pme])); AMD_DEBUG3 (("\n")) ; #endif /* ----------------------------------------------------------------- */ /* make sure that wflg is not too large. */ /* ----------------------------------------------------------------- */ /* With the current value of wflg, wflg+n must not cause integer * overflow */ wflg = clear_flag (wflg, wbig, W, n) ; /* ========================================================================= */ /* COMPUTE (W [e] - wflg) = |Le\Lme| FOR ALL ELEMENTS */ /* ========================================================================= */ /* ----------------------------------------------------------------- * Scan 1: compute the external degrees of previous elements with * respect to the current element. That is: * (W [e] - wflg) = |Le \ Lme| * for each element e that appears in any supervariable in Lme. The * notation Le refers to the pattern (list of supervariables) of a * previous element e, where e is not yet absorbed, stored in * Iw [Pe [e] + 1 ... Pe [e] + Len [e]]. The notation Lme * refers to the pattern of the current element (stored in * Iw [pme1..pme2]). If aggressive absorption is enabled, and * (W [e] - wflg) becomes zero, then the element e will be absorbed * in Scan 2. * ----------------------------------------------------------------- */ AMD_DEBUG2 (("me: ")) ; for (pme = pme1 ; pme <= pme2 ; pme++) { i = Iw [pme] ; ASSERT (i >= 0 && i < n) ; eln = Elen [i] ; AMD_DEBUG3 ((""ID" Elen "ID": \n", i, eln)) ; if (eln > 0) { /* note that Nv [i] has been negated to denote i in Lme: */ nvi = -Nv [i] ; ASSERT (nvi > 0 && Pe [i] >= 0 && Pe [i] < iwlen) ; wnvi = wflg - nvi ; for (p = Pe [i] ; p <= Pe [i] + eln - 1 ; p++) { e = Iw [p] ; ASSERT (e >= 0 && e < n) ; we = W [e] ; AMD_DEBUG4 ((" e "ID" we "ID" ", e, we)) ; if (we >= wflg) { /* unabsorbed element e has been seen in this loop */ AMD_DEBUG4 ((" unabsorbed, first time seen")) ; we -= nvi ; } else if (we != 0) { /* e is an unabsorbed element */ /* this is the first we have seen e in all of Scan 1 */ AMD_DEBUG4 ((" unabsorbed")) ; we = Degree [e] + wnvi ; } AMD_DEBUG4 (("\n")) ; W [e] = we ; } } } AMD_DEBUG2 (("\n")) ; /* ========================================================================= */ /* DEGREE UPDATE AND ELEMENT ABSORPTION */ /* ========================================================================= */ /* ----------------------------------------------------------------- * Scan 2: for each i in Lme, sum up the degree of Lme (which is * degme), plus the sum of the external degrees of each Le for the * elements e appearing within i, plus the supervariables in i. * Place i in hash list. * ----------------------------------------------------------------- */ for (pme = pme1 ; pme <= pme2 ; pme++) { i = Iw [pme] ; ASSERT (i >= 0 && i < n && Nv [i] < 0 && Elen [i] >= 0) ; AMD_DEBUG2 (("Updating: i "ID" "ID" "ID"\n", i, Elen[i], Len [i])); p1 = Pe [i] ; p2 = p1 + Elen [i] - 1 ; pn = p1 ; hash = 0 ; deg = 0 ; ASSERT (p1 >= 0 && p1 < iwlen && p2 >= -1 && p2 < iwlen) ; /* ------------------------------------------------------------- */ /* scan the element list associated with supervariable i */ /* ------------------------------------------------------------- */ /* UMFPACK/MA38-style approximate degree: */ if (aggressive) { for (p = p1 ; p <= p2 ; p++) { e = Iw [p] ; ASSERT (e >= 0 && e < n) ; we = W [e] ; if (we != 0) { /* e is an unabsorbed element */ /* dext = | Le \ Lme | */ dext = we - wflg ; if (dext > 0) { deg += dext ; Iw [pn++] = e ; hash += e ; AMD_DEBUG4 ((" e: "ID" hash = "ID"\n",e,hash)) ; } else { /* external degree of e is zero, absorb e into me*/ AMD_DEBUG1 ((" Element "ID" =>"ID" (aggressive)\n", e, me)) ; ASSERT (dext == 0) ; Pe [e] = FLIP (me) ; W [e] = 0 ; } } } } else { for (p = p1 ; p <= p2 ; p++) { e = Iw [p] ; ASSERT (e >= 0 && e < n) ; we = W [e] ; if (we != 0) { /* e is an unabsorbed element */ dext = we - wflg ; ASSERT (dext >= 0) ; deg += dext ; Iw [pn++] = e ; hash += e ; AMD_DEBUG4 ((" e: "ID" hash = "ID"\n",e,hash)) ; } } } /* count the number of elements in i (including me): */ Elen [i] = pn - p1 + 1 ; /* ------------------------------------------------------------- */ /* scan the supervariables in the list associated with i */ /* ------------------------------------------------------------- */ /* The bulk of the AMD run time is typically spent in this loop, * particularly if the matrix has many dense rows that are not * removed prior to ordering. */ p3 = pn ; p4 = p1 + Len [i] ; for (p = p2 + 1 ; p < p4 ; p++) { j = Iw [p] ; ASSERT (j >= 0 && j < n) ; nvj = Nv [j] ; if (nvj > 0) { /* j is unabsorbed, and not in Lme. */ /* add to degree and add to new list */ deg += nvj ; Iw [pn++] = j ; hash += j ; AMD_DEBUG4 ((" s: "ID" hash "ID" Nv[j]= "ID"\n", j, hash, nvj)) ; } } /* ------------------------------------------------------------- */ /* update the degree and check for mass elimination */ /* ------------------------------------------------------------- */ /* with aggressive absorption, deg==0 is identical to the * Elen [i] == 1 && p3 == pn test, below. */ ASSERT (IMPLIES (aggressive, (deg==0) == (Elen[i]==1 && p3==pn))) ; if (Elen [i] == 1 && p3 == pn) { /* --------------------------------------------------------- */ /* mass elimination */ /* --------------------------------------------------------- */ /* There is nothing left of this node except for an edge to * the current pivot element. Elen [i] is 1, and there are * no variables adjacent to node i. Absorb i into the * current pivot element, me. Note that if there are two or * more mass eliminations, fillin due to mass elimination is * possible within the nvpiv-by-nvpiv pivot block. It is this * step that causes AMD's analysis to be an upper bound. * * The reason is that the selected pivot has a lower * approximate degree than the true degree of the two mass * eliminated nodes. There is no edge between the two mass * eliminated nodes. They are merged with the current pivot * anyway. * * No fillin occurs in the Schur complement, in any case, * and this effect does not decrease the quality of the * ordering itself, just the quality of the nonzero and * flop count analysis. It also means that the post-ordering * is not an exact elimination tree post-ordering. */ AMD_DEBUG1 ((" MASS i "ID" => parent e "ID"\n", i, me)) ; Pe [i] = FLIP (me) ; nvi = -Nv [i] ; degme -= nvi ; nvpiv += nvi ; nel += nvi ; Nv [i] = 0 ; Elen [i] = EMPTY ; } else { /* --------------------------------------------------------- */ /* update the upper-bound degree of i */ /* --------------------------------------------------------- */ /* the following degree does not yet include the size * of the current element, which is added later: */ Degree [i] = MIN (Degree [i], deg) ; /* --------------------------------------------------------- */ /* add me to the list for i */ /* --------------------------------------------------------- */ /* move first supervariable to end of list */ Iw [pn] = Iw [p3] ; /* move first element to end of element part of list */ Iw [p3] = Iw [p1] ; /* add new element, me, to front of list. */ Iw [p1] = me ; /* store the new length of the list in Len [i] */ Len [i] = pn - p1 + 1 ; /* --------------------------------------------------------- */ /* place in hash bucket. Save hash key of i in Last [i]. */ /* --------------------------------------------------------- */ /* NOTE: this can fail if hash is negative, because the ANSI C * standard does not define a % b when a and/or b are negative. * That's why hash is defined as an unsigned Int, to avoid this * problem. */ hash = hash % n ; ASSERT (((Int) hash) >= 0 && ((Int) hash) < n) ; /* if the Hhead array is not used: */ j = Head [hash] ; if (j <= EMPTY) { /* degree list is empty, hash head is FLIP (j) */ Next [i] = FLIP (j) ; Head [hash] = FLIP (i) ; } else { /* degree list is not empty, use Last [Head [hash]] as * hash head. */ Next [i] = Last [j] ; Last [j] = i ; } /* if a separate Hhead array is used: * Next [i] = Hhead [hash] ; Hhead [hash] = i ; */ Last [i] = hash ; } } Degree [me] = degme ; /* ----------------------------------------------------------------- */ /* Clear the counter array, W [...], by incrementing wflg. */ /* ----------------------------------------------------------------- */ /* make sure that wflg+n does not cause integer overflow */ lemax = MAX (lemax, degme) ; wflg += lemax ; wflg = clear_flag (wflg, wbig, W, n) ; /* at this point, W [0..n-1] < wflg holds */ /* ========================================================================= */ /* SUPERVARIABLE DETECTION */ /* ========================================================================= */ AMD_DEBUG1 (("Detecting supervariables:\n")) ; for (pme = pme1 ; pme <= pme2 ; pme++) { i = Iw [pme] ; ASSERT (i >= 0 && i < n) ; AMD_DEBUG2 (("Consider i "ID" nv "ID"\n", i, Nv [i])) ; if (Nv [i] < 0) { /* i is a principal variable in Lme */ /* --------------------------------------------------------- * examine all hash buckets with 2 or more variables. We do * this by examing all unique hash keys for supervariables in * the pattern Lme of the current element, me * --------------------------------------------------------- */ /* let i = head of hash bucket, and empty the hash bucket */ ASSERT (Last [i] >= 0 && Last [i] < n) ; hash = Last [i] ; /* if Hhead array is not used: */ j = Head [hash] ; if (j == EMPTY) { /* hash bucket and degree list are both empty */ i = EMPTY ; } else if (j < EMPTY) { /* degree list is empty */ i = FLIP (j) ; Head [hash] = EMPTY ; } else { /* degree list is not empty, restore Last [j] of head j */ i = Last [j] ; Last [j] = EMPTY ; } /* if separate Hhead array is used: * i = Hhead [hash] ; Hhead [hash] = EMPTY ; */ ASSERT (i >= EMPTY && i < n) ; AMD_DEBUG2 (("----i "ID" hash "ID"\n", i, hash)) ; while (i != EMPTY && Next [i] != EMPTY) { /* ----------------------------------------------------- * this bucket has one or more variables following i. * scan all of them to see if i can absorb any entries * that follow i in hash bucket. Scatter i into w. * ----------------------------------------------------- */ ln = Len [i] ; eln = Elen [i] ; ASSERT (ln >= 0 && eln >= 0) ; ASSERT (Pe [i] >= 0 && Pe [i] < iwlen) ; /* do not flag the first element in the list (me) */ for (p = Pe [i] + 1 ; p <= Pe [i] + ln - 1 ; p++) { ASSERT (Iw [p] >= 0 && Iw [p] < n) ; W [Iw [p]] = wflg ; } /* ----------------------------------------------------- */ /* scan every other entry j following i in bucket */ /* ----------------------------------------------------- */ jlast = i ; j = Next [i] ; ASSERT (j >= EMPTY && j < n) ; while (j != EMPTY) { /* ------------------------------------------------- */ /* check if j and i have identical nonzero pattern */ /* ------------------------------------------------- */ AMD_DEBUG3 (("compare i "ID" and j "ID"\n", i,j)) ; /* check if i and j have the same Len and Elen */ ASSERT (Len [j] >= 0 && Elen [j] >= 0) ; ASSERT (Pe [j] >= 0 && Pe [j] < iwlen) ; ok = (Len [j] == ln) && (Elen [j] == eln) ; /* skip the first element in the list (me) */ for (p = Pe [j] + 1 ; ok && p <= Pe [j] + ln - 1 ; p++) { ASSERT (Iw [p] >= 0 && Iw [p] < n) ; if (W [Iw [p]] != wflg) ok = 0 ; } if (ok) { /* --------------------------------------------- */ /* found it! j can be absorbed into i */ /* --------------------------------------------- */ AMD_DEBUG1 (("found it! j "ID" => i "ID"\n", j,i)); Pe [j] = FLIP (i) ; /* both Nv [i] and Nv [j] are negated since they */ /* are in Lme, and the absolute values of each */ /* are the number of variables in i and j: */ Nv [i] += Nv [j] ; Nv [j] = 0 ; Elen [j] = EMPTY ; /* delete j from hash bucket */ ASSERT (j != Next [j]) ; j = Next [j] ; Next [jlast] = j ; } else { /* j cannot be absorbed into i */ jlast = j ; ASSERT (j != Next [j]) ; j = Next [j] ; } ASSERT (j >= EMPTY && j < n) ; } /* ----------------------------------------------------- * no more variables can be absorbed into i * go to next i in bucket and clear flag array * ----------------------------------------------------- */ wflg++ ; i = Next [i] ; ASSERT (i >= EMPTY && i < n) ; } } } AMD_DEBUG2 (("detect done\n")) ; /* ========================================================================= */ /* RESTORE DEGREE LISTS AND REMOVE NONPRINCIPAL SUPERVARIABLES FROM ELEMENT */ /* ========================================================================= */ p = pme1 ; nleft = n - nel ; for (pme = pme1 ; pme <= pme2 ; pme++) { i = Iw [pme] ; ASSERT (i >= 0 && i < n) ; nvi = -Nv [i] ; AMD_DEBUG3 (("Restore i "ID" "ID"\n", i, nvi)) ; if (nvi > 0) { /* i is a principal variable in Lme */ /* restore Nv [i] to signify that i is principal */ Nv [i] = nvi ; /* --------------------------------------------------------- */ /* compute the external degree (add size of current element) */ /* --------------------------------------------------------- */ deg = Degree [i] + degme - nvi ; deg = MIN (deg, nleft - nvi) ; ASSERT (IMPLIES (aggressive, deg > 0) && deg >= 0 && deg < n) ; /* --------------------------------------------------------- */ /* place the supervariable at the head of the degree list */ /* --------------------------------------------------------- */ inext = Head [deg] ; ASSERT (inext >= EMPTY && inext < n) ; if (inext != EMPTY) Last [inext] = i ; Next [i] = inext ; Last [i] = EMPTY ; Head [deg] = i ; /* --------------------------------------------------------- */ /* save the new degree, and find the minimum degree */ /* --------------------------------------------------------- */ mindeg = MIN (mindeg, deg) ; Degree [i] = deg ; /* --------------------------------------------------------- */ /* place the supervariable in the element pattern */ /* --------------------------------------------------------- */ Iw [p++] = i ; } } AMD_DEBUG2 (("restore done\n")) ; /* ========================================================================= */ /* FINALIZE THE NEW ELEMENT */ /* ========================================================================= */ AMD_DEBUG2 (("ME = "ID" DONE\n", me)) ; Nv [me] = nvpiv ; /* save the length of the list for the new element me */ Len [me] = p - pme1 ; if (Len [me] == 0) { /* there is nothing left of the current pivot element */ /* it is a root of the assembly tree */ Pe [me] = EMPTY ; W [me] = 0 ; } if (elenme != 0) { /* element was not constructed in place: deallocate part of */ /* it since newly nonprincipal variables may have been removed */ pfree = p ; } /* The new element has nvpiv pivots and the size of the contribution * block for a multifrontal method is degme-by-degme, not including * the "dense" rows/columns. If the "dense" rows/columns are included, * the frontal matrix is no larger than * (degme+ndense)-by-(degme+ndense). */ if (Info != (double *) NULL) { f = nvpiv ; r = degme + ndense ; dmax = MAX (dmax, f + r) ; /* number of nonzeros in L (excluding the diagonal) */ lnzme = f*r + (f-1)*f/2 ; lnz += lnzme ; /* number of divide operations for LDL' and for LU */ ndiv += lnzme ; /* number of multiply-subtract pairs for LU */ s = f*r*r + r*(f-1)*f + (f-1)*f*(2*f-1)/6 ; nms_lu += s ; /* number of multiply-subtract pairs for LDL' */ nms_ldl += (s + lnzme)/2 ; } #ifndef NDEBUG AMD_DEBUG2 (("finalize done nel "ID" n "ID"\n ::::\n", nel, n)) ; for (pme = Pe [me] ; pme <= Pe [me] + Len [me] - 1 ; pme++) { AMD_DEBUG3 ((" "ID"", Iw [pme])) ; } AMD_DEBUG3 (("\n")) ; #endif } /* ========================================================================= */ /* DONE SELECTING PIVOTS */ /* ========================================================================= */ if (Info != (double *) NULL) { /* count the work to factorize the ndense-by-ndense submatrix */ f = ndense ; dmax = MAX (dmax, (double) ndense) ; /* number of nonzeros in L (excluding the diagonal) */ lnzme = (f-1)*f/2 ; lnz += lnzme ; /* number of divide operations for LDL' and for LU */ ndiv += lnzme ; /* number of multiply-subtract pairs for LU */ s = (f-1)*f*(2*f-1)/6 ; nms_lu += s ; /* number of multiply-subtract pairs for LDL' */ nms_ldl += (s + lnzme)/2 ; /* number of nz's in L (excl. diagonal) */ Info [AMD_LNZ] = lnz ; /* number of divide ops for LU and LDL' */ Info [AMD_NDIV] = ndiv ; /* number of multiply-subtract pairs for LDL' */ Info [AMD_NMULTSUBS_LDL] = nms_ldl ; /* number of multiply-subtract pairs for LU */ Info [AMD_NMULTSUBS_LU] = nms_lu ; /* number of "dense" rows/columns */ Info [AMD_NDENSE] = ndense ; /* largest front is dmax-by-dmax */ Info [AMD_DMAX] = dmax ; /* number of garbage collections in AMD */ Info [AMD_NCMPA] = ncmpa ; /* successful ordering */ Info [AMD_STATUS] = AMD_OK ; } /* ========================================================================= */ /* POST-ORDERING */ /* ========================================================================= */ /* ------------------------------------------------------------------------- * Variables at this point: * * Pe: holds the elimination tree. The parent of j is FLIP (Pe [j]), * or EMPTY if j is a root. The tree holds both elements and * non-principal (unordered) variables absorbed into them. * Dense variables are non-principal and unordered. * * Elen: holds the size of each element, including the diagonal part. * FLIP (Elen [e]) > 0 if e is an element. For unordered * variables i, Elen [i] is EMPTY. * * Nv: Nv [e] > 0 is the number of pivots represented by the element e. * For unordered variables i, Nv [i] is zero. * * Contents no longer needed: * W, Iw, Len, Degree, Head, Next, Last. * * The matrix itself has been destroyed. * * n: the size of the matrix. * No other scalars needed (pfree, iwlen, etc.) * ------------------------------------------------------------------------- */ /* restore Pe */ for (i = 0 ; i < n ; i++) { Pe [i] = FLIP (Pe [i]) ; } /* restore Elen, for output information, and for postordering */ for (i = 0 ; i < n ; i++) { Elen [i] = FLIP (Elen [i]) ; } /* Now the parent of j is Pe [j], or EMPTY if j is a root. Elen [e] > 0 * is the size of element e. Elen [i] is EMPTY for unordered variable i. */ #ifndef NDEBUG AMD_DEBUG2 (("\nTree:\n")) ; for (i = 0 ; i < n ; i++) { AMD_DEBUG2 ((" "ID" parent: "ID" ", i, Pe [i])) ; ASSERT (Pe [i] >= EMPTY && Pe [i] < n) ; if (Nv [i] > 0) { /* this is an element */ e = i ; AMD_DEBUG2 ((" element, size is "ID"\n", Elen [i])) ; ASSERT (Elen [e] > 0) ; } AMD_DEBUG2 (("\n")) ; } AMD_DEBUG2 (("\nelements:\n")) ; for (e = 0 ; e < n ; e++) { if (Nv [e] > 0) { AMD_DEBUG3 (("Element e= "ID" size "ID" nv "ID" \n", e, Elen [e], Nv [e])) ; } } AMD_DEBUG2 (("\nvariables:\n")) ; for (i = 0 ; i < n ; i++) { Int cnt ; if (Nv [i] == 0) { AMD_DEBUG3 (("i unordered: "ID"\n", i)) ; j = Pe [i] ; cnt = 0 ; AMD_DEBUG3 ((" j: "ID"\n", j)) ; if (j == EMPTY) { AMD_DEBUG3 ((" i is a dense variable\n")) ; } else { ASSERT (j >= 0 && j < n) ; while (Nv [j] == 0) { AMD_DEBUG3 ((" j : "ID"\n", j)) ; j = Pe [j] ; AMD_DEBUG3 ((" j:: "ID"\n", j)) ; cnt++ ; if (cnt > n) break ; } e = j ; AMD_DEBUG3 ((" got to e: "ID"\n", e)) ; } } } #endif /* ========================================================================= */ /* compress the paths of the variables */ /* ========================================================================= */ for (i = 0 ; i < n ; i++) { if (Nv [i] == 0) { /* ------------------------------------------------------------- * i is an un-ordered row. Traverse the tree from i until * reaching an element, e. The element, e, was the principal * supervariable of i and all nodes in the path from i to when e * was selected as pivot. * ------------------------------------------------------------- */ AMD_DEBUG1 (("Path compression, i unordered: "ID"\n", i)) ; j = Pe [i] ; ASSERT (j >= EMPTY && j < n) ; AMD_DEBUG3 ((" j: "ID"\n", j)) ; if (j == EMPTY) { /* Skip a dense variable. It has no parent. */ AMD_DEBUG3 ((" i is a dense variable\n")) ; continue ; } /* while (j is a variable) */ while (Nv [j] == 0) { AMD_DEBUG3 ((" j : "ID"\n", j)) ; j = Pe [j] ; AMD_DEBUG3 ((" j:: "ID"\n", j)) ; ASSERT (j >= 0 && j < n) ; } /* got to an element e */ e = j ; AMD_DEBUG3 (("got to e: "ID"\n", e)) ; /* ------------------------------------------------------------- * traverse the path again from i to e, and compress the path * (all nodes point to e). Path compression allows this code to * compute in O(n) time. * ------------------------------------------------------------- */ j = i ; /* while (j is a variable) */ while (Nv [j] == 0) { jnext = Pe [j] ; AMD_DEBUG3 (("j "ID" jnext "ID"\n", j, jnext)) ; Pe [j] = e ; j = jnext ; ASSERT (j >= 0 && j < n) ; } } } /* ========================================================================= */ /* postorder the assembly tree */ /* ========================================================================= */ AMD_postorder (n, Pe, Nv, Elen, W, /* output order */ Head, Next, Last) ; /* workspace */ /* ========================================================================= */ /* compute output permutation and inverse permutation */ /* ========================================================================= */ /* W [e] = k means that element e is the kth element in the new * order. e is in the range 0 to n-1, and k is in the range 0 to * the number of elements. Use Head for inverse order. */ for (k = 0 ; k < n ; k++) { Head [k] = EMPTY ; Next [k] = EMPTY ; } for (e = 0 ; e < n ; e++) { k = W [e] ; ASSERT ((k == EMPTY) == (Nv [e] == 0)) ; if (k != EMPTY) { ASSERT (k >= 0 && k < n) ; Head [k] = e ; } } /* construct output inverse permutation in Next, * and permutation in Last */ nel = 0 ; for (k = 0 ; k < n ; k++) { e = Head [k] ; if (e == EMPTY) break ; ASSERT (e >= 0 && e < n && Nv [e] > 0) ; Next [e] = nel ; nel += Nv [e] ; } ASSERT (nel == n - ndense) ; /* order non-principal variables (dense, & those merged into supervar's) */ for (i = 0 ; i < n ; i++) { if (Nv [i] == 0) { e = Pe [i] ; ASSERT (e >= EMPTY && e < n) ; if (e != EMPTY) { /* This is an unordered variable that was merged * into element e via supernode detection or mass * elimination of i when e became the pivot element. * Place i in order just before e. */ ASSERT (Next [i] == EMPTY && Nv [e] > 0) ; Next [i] = Next [e] ; Next [e]++ ; } else { /* This is a dense unordered variable, with no parent. * Place it last in the output order. */ Next [i] = nel++ ; } } } ASSERT (nel == n) ; AMD_DEBUG2 (("\n\nPerm:\n")) ; for (i = 0 ; i < n ; i++) { k = Next [i] ; ASSERT (k >= 0 && k < n) ; Last [k] = i ; AMD_DEBUG2 ((" perm ["ID"] = "ID"\n", k, i)) ; } } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_control.c0000664000175000017500000000351314224052371020075 00000000000000/* ========================================================================= */ /* === AMD_control ========================================================= */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* User-callable. Prints the control parameters for AMD. See amd.h * for details. If the Control array is not present, the defaults are * printed instead. */ #include "amd_internal.h" GLOBAL void AMD_control ( double Control [ ] ) { double alpha ; Int aggressive ; if (Control != (double *) NULL) { alpha = Control [AMD_DENSE] ; aggressive = Control [AMD_AGGRESSIVE] != 0 ; } else { alpha = AMD_DEFAULT_DENSE ; aggressive = AMD_DEFAULT_AGGRESSIVE ; } SUITESPARSE_PRINTF (( "\nAMD version %d.%d.%d, %s: approximate minimum degree ordering\n" " dense row parameter: %g\n", AMD_MAIN_VERSION, AMD_SUB_VERSION, AMD_SUBSUB_VERSION, AMD_DATE, alpha)) ; if (alpha < 0) { SUITESPARSE_PRINTF ((" no rows treated as dense\n")) ; } else { SUITESPARSE_PRINTF (( " (rows with more than max (%g * sqrt (n), 16) entries are\n" " considered \"dense\", and placed last in output permutation)\n", alpha)) ; } if (aggressive) { SUITESPARSE_PRINTF ((" aggressive absorption: yes\n")) ; } else { SUITESPARSE_PRINTF ((" aggressive absorption: no\n")) ; } SUITESPARSE_PRINTF ((" size of AMD integer: %d\n\n", sizeof (Int))) ; } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd.f0000664000175000017500000014662114224052371016350 00000000000000C----------------------------------------------------------------------- C AMD: approximate minimum degree, with aggressive absorption C----------------------------------------------------------------------- SUBROUTINE AMD $ (N, PE, IW, LEN, IWLEN, PFREE, NV, NEXT, $ LAST, HEAD, ELEN, DEGREE, NCMPA, W) INTEGER N, IWLEN, PFREE, NCMPA, IW (IWLEN), PE (N), $ DEGREE (N), NV (N), NEXT (N), LAST (N), HEAD (N), $ ELEN (N), W (N), LEN (N) C Given a representation of the nonzero pattern of a symmetric matrix, C A, (excluding the diagonal) perform an approximate minimum C (UMFPACK/MA38-style) degree ordering to compute a pivot order C such that the introduction of nonzeros (fill-in) in the Cholesky C factors A = LL^T are kept low. At each step, the pivot C selected is the one with the minimum UMFPACK/MA38-style C upper-bound on the external degree. C C Aggresive absorption is used to tighten the bound on the degree. C ********************************************************************** C ***** CAUTION: ARGUMENTS ARE NOT CHECKED FOR ERRORS ON INPUT. ****** C ********************************************************************** C References: C C [1] Timothy A. Davis and Iain Duff, "An unsymmetric-pattern C multifrontal method for sparse LU factorization", SIAM J. C Matrix Analysis and Applications, vol. 18, no. 1, pp. C 140-158. Discusses UMFPACK / MA38, which first introduced C the approximate minimum degree used by this routine. C C [2] Patrick Amestoy, Timothy A. Davis, and Iain S. Duff, "An C approximate degree ordering algorithm," SIAM J. Matrix C Analysis and Applications, vol. 17, no. 4, pp. 886-905, C 1996. Discusses AMD, AMDBAR, and MC47B. C C [3] Alan George and Joseph Liu, "The evolution of the minimum C degree ordering algorithm," SIAM Review, vol. 31, no. 1, C pp. 1-19, 1989. We list below the features mentioned in C that paper that this code includes: C C mass elimination: C Yes. MA27 relied on supervariable detection for mass C elimination. C indistinguishable nodes: C Yes (we call these "supervariables"). This was also in C the MA27 code - although we modified the method of C detecting them (the previous hash was the true degree, C which we no longer keep track of). A supervariable is C a set of rows with identical nonzero pattern. All C variables in a supervariable are eliminated together. C Each supervariable has as its numerical name that of C one of its variables (its principal variable). C quotient graph representation: C Yes. We use the term "element" for the cliques formed C during elimination. This was also in the MA27 code. C The algorithm can operate in place, but it will work C more efficiently if given some "elbow room." C element absorption: C Yes. This was also in the MA27 code. C external degree: C Yes. The MA27 code was based on the true degree. C incomplete degree update and multiple elimination: C No. This was not in MA27, either. Our method of C degree update within MC47B/BD is element-based, not C variable-based. It is thus not well-suited for use C with incomplete degree update or multiple elimination. C----------------------------------------------------------------------- C Authors, and Copyright (C) 1995 by: C Timothy A. Davis, Patrick Amestoy, Iain S. Duff, & John K. Reid. C C Acknowledgements: C This work (and the UMFPACK package) was supported by the C National Science Foundation (ASC-9111263 and DMS-9223088). C The UMFPACK/MA38 approximate degree update algorithm, the C unsymmetric analog which forms the basis of MC47B/BD, was C developed while Tim Davis was supported by CERFACS (Toulouse, C France) in a post-doctoral position. C C Date: September, 1995 C----------------------------------------------------------------------- C----------------------------------------------------------------------- C INPUT ARGUMENTS (unaltered): C----------------------------------------------------------------------- C n: The matrix order. C C Restriction: 1 .le. n .lt. (iovflo/2)-2, where iovflo is C the largest positive integer that your computer can represent. C iwlen: The length of iw (1..iwlen). On input, the matrix is C stored in iw (1..pfree-1). However, iw (1..iwlen) should be C slightly larger than what is required to hold the matrix, at C least iwlen .ge. pfree + n is recommended. Otherwise, C excessive compressions will take place. C *** We do not recommend running this algorithm with *** C *** iwlen .lt. pfree + n. *** C *** Better performance will be obtained if *** C *** iwlen .ge. pfree + n *** C *** or better yet *** C *** iwlen .gt. 1.2 * pfree *** C *** (where pfree is its value on input). *** C The algorithm will not run at all if iwlen .lt. pfree-1. C C Restriction: iwlen .ge. pfree-1 C----------------------------------------------------------------------- C INPUT/OUPUT ARGUMENTS: C----------------------------------------------------------------------- C pe: On input, pe (i) is the index in iw of the start of row i, or C zero if row i has no off-diagonal non-zeros. C C During execution, it is used for both supervariables and C elements: C C * Principal supervariable i: index into iw of the C description of supervariable i. A supervariable C represents one or more rows of the matrix C with identical nonzero pattern. C * Non-principal supervariable i: if i has been absorbed C into another supervariable j, then pe (i) = -j. C That is, j has the same pattern as i. C Note that j might later be absorbed into another C supervariable j2, in which case pe (i) is still -j, C and pe (j) = -j2. C * Unabsorbed element e: the index into iw of the description C of element e, if e has not yet been absorbed by a C subsequent element. Element e is created when C the supervariable of the same name is selected as C the pivot. C * Absorbed element e: if element e is absorbed into element C e2, then pe (e) = -e2. This occurs when the pattern of C e (that is, Le) is found to be a subset of the pattern C of e2 (that is, Le2). If element e is "null" (it has C no nonzeros outside its pivot block), then pe (e) = 0. C C On output, pe holds the assembly tree/forest, which implicitly C represents a pivot order with identical fill-in as the actual C order (via a depth-first search of the tree). C C On output: C If nv (i) .gt. 0, then i represents a node in the assembly tree, C and the parent of i is -pe (i), or zero if i is a root. C If nv (i) = 0, then (i,-pe (i)) represents an edge in a C subtree, the root of which is a node in the assembly tree. C pfree: On input the tail end of the array, iw (pfree..iwlen), C is empty, and the matrix is stored in iw (1..pfree-1). C During execution, additional data is placed in iw, and pfree C is modified so that iw (pfree..iwlen) is always the unused part C of iw. On output, pfree is set equal to the size of iw that C would have been needed for no compressions to occur. If C ncmpa is zero, then pfree (on output) is less than or equal to C iwlen, and the space iw (pfree+1 ... iwlen) was not used. C Otherwise, pfree (on output) is greater than iwlen, and all the C memory in iw was used. C----------------------------------------------------------------------- C INPUT/MODIFIED (undefined on output): C----------------------------------------------------------------------- C len: On input, len (i) holds the number of entries in row i of the C matrix, excluding the diagonal. The contents of len (1..n) C are undefined on output. C iw: On input, iw (1..pfree-1) holds the description of each row i C in the matrix. The matrix must be symmetric, and both upper C and lower triangular parts must be present. The diagonal must C not be present. Row i is held as follows: C C len (i): the length of the row i data structure C iw (pe (i) ... pe (i) + len (i) - 1): C the list of column indices for nonzeros C in row i (simple supervariables), excluding C the diagonal. All supervariables start with C one row/column each (supervariable i is just C row i). C if len (i) is zero on input, then pe (i) is ignored C on input. C C Note that the rows need not be in any particular order, C and there may be empty space between the rows. C C During execution, the supervariable i experiences fill-in. C This is represented by placing in i a list of the elements C that cause fill-in in supervariable i: C C len (i): the length of supervariable i C iw (pe (i) ... pe (i) + elen (i) - 1): C the list of elements that contain i. This list C is kept short by removing absorbed elements. C iw (pe (i) + elen (i) ... pe (i) + len (i) - 1): C the list of supervariables in i. This list C is kept short by removing nonprincipal C variables, and any entry j that is also C contained in at least one of the elements C (j in Le) in the list for i (e in row i). C C When supervariable i is selected as pivot, we create an C element e of the same name (e=i): C C len (e): the length of element e C iw (pe (e) ... pe (e) + len (e) - 1): C the list of supervariables in element e. C C An element represents the fill-in that occurs when supervariable C i is selected as pivot (which represents the selection of row i C and all non-principal variables whose principal variable is i). C We use the term Le to denote the set of all supervariables C in element e. Absorbed supervariables and elements are pruned C from these lists when computationally convenient. C C CAUTION: THE INPUT MATRIX IS OVERWRITTEN DURING COMPUTATION. C The contents of iw are undefined on output. C----------------------------------------------------------------------- C OUTPUT (need not be set on input): C----------------------------------------------------------------------- C nv: During execution, abs (nv (i)) is equal to the number of rows C that are represented by the principal supervariable i. If i is C a nonprincipal variable, then nv (i) = 0. Initially, C nv (i) = 1 for all i. nv (i) .lt. 0 signifies that i is a C principal variable in the pattern Lme of the current pivot C element me. On output, nv (e) holds the true degree of element C e at the time it was created (including the diagonal part). C ncmpa: The number of times iw was compressed. If this is C excessive, then the execution took longer than what could have C been. To reduce ncmpa, try increasing iwlen to be 10% or 20% C larger than the value of pfree on input (or at least C iwlen .ge. pfree + n). The fastest performance will be C obtained when ncmpa is returned as zero. If iwlen is set to C the value returned by pfree on *output*, then no compressions C will occur. C elen: See the description of iw above. At the start of execution, C elen (i) is set to zero. During execution, elen (i) is the C number of elements in the list for supervariable i. When e C becomes an element, elen (e) = -nel is set, where nel is the C current step of factorization. elen (i) = 0 is done when i C becomes nonprincipal. C C For variables, elen (i) .ge. 0 holds until just before the C permutation vectors are computed. For elements, C elen (e) .lt. 0 holds. C C On output elen (1..n) holds the inverse permutation (the same C as the 'INVP' argument in Sparspak). That is, if k = elen (i), C then row i is the kth pivot row. Row i of A appears as the C (elen(i))-th row in the permuted matrix, PAP^T. C last: In a degree list, last (i) is the supervariable preceding i, C or zero if i is the head of the list. In a hash bucket, C last (i) is the hash key for i. last (head (hash)) is also C used as the head of a hash bucket if head (hash) contains a C degree list (see head, below). C C On output, last (1..n) holds the permutation (the same as the C 'PERM' argument in Sparspak). That is, if i = last (k), then C row i is the kth pivot row. Row last (k) of A is the k-th row C in the permuted matrix, PAP^T. C----------------------------------------------------------------------- C LOCAL (not input or output - used only during execution): C----------------------------------------------------------------------- C degree: If i is a supervariable, then degree (i) holds the C current approximation of the external degree of row i (an upper C bound). The external degree is the number of nonzeros in row i, C minus abs (nv (i)) (the diagonal part). The bound is equal to C the external degree if elen (i) is less than or equal to two. C C We also use the term "external degree" for elements e to refer C to |Le \ Lme|. If e is an element, then degree (e) holds |Le|, C which is the degree of the off-diagonal part of the element e C (not including the diagonal part). C head: head is used for degree lists. head (deg) is the first C supervariable in a degree list (all supervariables i in a C degree list deg have the same approximate degree, namely, C deg = degree (i)). If the list deg is empty then C head (deg) = 0. C C During supervariable detection head (hash) also serves as a C pointer to a hash bucket. C If head (hash) .gt. 0, there is a degree list of degree hash. C The hash bucket head pointer is last (head (hash)). C If head (hash) = 0, then the degree list and hash bucket are C both empty. C If head (hash) .lt. 0, then the degree list is empty, and C -head (hash) is the head of the hash bucket. C After supervariable detection is complete, all hash buckets C are empty, and the (last (head (hash)) = 0) condition is C restored for the non-empty degree lists. C next: next (i) is the supervariable following i in a link list, or C zero if i is the last in the list. Used for two kinds of C lists: degree lists and hash buckets (a supervariable can be C in only one kind of list at a time). C w: The flag array w determines the status of elements and C variables, and the external degree of elements. C C for elements: C if w (e) = 0, then the element e is absorbed C if w (e) .ge. wflg, then w (e) - wflg is the size of C the set |Le \ Lme|, in terms of nonzeros (the C sum of abs (nv (i)) for each principal variable i that C is both in the pattern of element e and NOT in the C pattern of the current pivot element, me). C if wflg .gt. w (e) .gt. 0, then e is not absorbed and has C not yet been seen in the scan of the element lists in C the computation of |Le\Lme| in loop 150 below. C C for variables: C during supervariable detection, if w (j) .ne. wflg then j is C not in the pattern of variable i C C The w array is initialized by setting w (i) = 1 for all i, C and by setting wflg = 2. It is reinitialized if wflg becomes C too large (to ensure that wflg+n does not cause integer C overflow). C----------------------------------------------------------------------- C LOCAL INTEGERS: C----------------------------------------------------------------------- INTEGER DEG, DEGME, DEXT, DMAX, E, ELENME, ELN, HASH, HMOD, I, $ ILAST, INEXT, J, JLAST, JNEXT, K, KNT1, KNT2, KNT3, $ LENJ, LN, MAXMEM, ME, MEM, MINDEG, NEL, NEWMEM, $ NLEFT, NVI, NVJ, NVPIV, SLENME, WE, WFLG, WNVI, X C deg: the degree of a variable or element C degme: size, |Lme|, of the current element, me (= degree (me)) C dext: external degree, |Le \ Lme|, of some element e C dmax: largest |Le| seen so far C e: an element C elenme: the length, elen (me), of element list of pivotal var. C eln: the length, elen (...), of an element list C hash: the computed value of the hash function C hmod: the hash function is computed modulo hmod = max (1,n-1) C i: a supervariable C ilast: the entry in a link list preceding i C inext: the entry in a link list following i C j: a supervariable C jlast: the entry in a link list preceding j C jnext: the entry in a link list, or path, following j C k: the pivot order of an element or variable C knt1: loop counter used during element construction C knt2: loop counter used during element construction C knt3: loop counter used during compression C lenj: len (j) C ln: length of a supervariable list C maxmem: amount of memory needed for no compressions C me: current supervariable being eliminated, and the C current element created by eliminating that C supervariable C mem: memory in use assuming no compressions have occurred C mindeg: current minimum degree C nel: number of pivots selected so far C newmem: amount of new memory needed for current pivot element C nleft: n - nel, the number of nonpivotal rows/columns remaining C nvi: the number of variables in a supervariable i (= nv (i)) C nvj: the number of variables in a supervariable j (= nv (j)) C nvpiv: number of pivots in current element C slenme: number of variables in variable list of pivotal variable C we: w (e) C wflg: used for flagging the w array. See description of iw. C wnvi: wflg - nv (i) C x: either a supervariable or an element C----------------------------------------------------------------------- C LOCAL POINTERS: C----------------------------------------------------------------------- INTEGER P, P1, P2, P3, PDST, PEND, PJ, PME, PME1, PME2, PN, PSRC C Any parameter (pe (...) or pfree) or local variable C starting with "p" (for Pointer) is an index into iw, C and all indices into iw use variables starting with C "p." The only exception to this rule is the iwlen C input argument. C p: pointer into lots of things C p1: pe (i) for some variable i (start of element list) C p2: pe (i) + elen (i) - 1 for some var. i (end of el. list) C p3: index of first supervariable in clean list C pdst: destination pointer, for compression C pend: end of memory to compress C pj: pointer into an element or variable C pme: pointer into the current element (pme1...pme2) C pme1: the current element, me, is stored in iw (pme1...pme2) C pme2: the end of the current element C pn: pointer into a "clean" variable, also used to compress C psrc: source pointer, for compression C----------------------------------------------------------------------- C FUNCTIONS CALLED: C----------------------------------------------------------------------- INTRINSIC MAX, MIN, MOD C======================================================================= C INITIALIZATIONS C======================================================================= WFLG = 2 MINDEG = 1 NCMPA = 0 NEL = 0 HMOD = MAX (1, N-1) DMAX = 0 MEM = PFREE - 1 MAXMEM = MEM ME = 0 DO 10 I = 1, N LAST (I) = 0 HEAD (I) = 0 NV (I) = 1 W (I) = 1 ELEN (I) = 0 DEGREE (I) = LEN (I) 10 CONTINUE C ---------------------------------------------------------------- C initialize degree lists and eliminate rows with no off-diag. nz. C ---------------------------------------------------------------- DO 20 I = 1, N DEG = DEGREE (I) IF (DEG .GT. 0) THEN C ---------------------------------------------------------- C place i in the degree list corresponding to its degree C ---------------------------------------------------------- INEXT = HEAD (DEG) IF (INEXT .NE. 0) LAST (INEXT) = I NEXT (I) = INEXT HEAD (DEG) = I ELSE C ---------------------------------------------------------- C we have a variable that can be eliminated at once because C there is no off-diagonal non-zero in its row. C ---------------------------------------------------------- NEL = NEL + 1 ELEN (I) = -NEL PE (I) = 0 W (I) = 0 ENDIF 20 CONTINUE C======================================================================= C WHILE (selecting pivots) DO C======================================================================= 30 CONTINUE IF (NEL .LT. N) THEN C======================================================================= C GET PIVOT OF MINIMUM DEGREE C======================================================================= C ------------------------------------------------------------- C find next supervariable for elimination C ------------------------------------------------------------- DO 40 DEG = MINDEG, N ME = HEAD (DEG) IF (ME .GT. 0) GOTO 50 40 CONTINUE 50 CONTINUE MINDEG = DEG C ------------------------------------------------------------- C remove chosen variable from link list C ------------------------------------------------------------- INEXT = NEXT (ME) IF (INEXT .NE. 0) LAST (INEXT) = 0 HEAD (DEG) = INEXT C ------------------------------------------------------------- C me represents the elimination of pivots nel+1 to nel+nv(me). C place me itself as the first in this set. It will be moved C to the nel+nv(me) position when the permutation vectors are C computed. C ------------------------------------------------------------- ELENME = ELEN (ME) ELEN (ME) = - (NEL + 1) NVPIV = NV (ME) NEL = NEL + NVPIV C======================================================================= C CONSTRUCT NEW ELEMENT C======================================================================= C ------------------------------------------------------------- C At this point, me is the pivotal supervariable. It will be C converted into the current element. Scan list of the C pivotal supervariable, me, setting tree pointers and C constructing new list of supervariables for the new element, C me. p is a pointer to the current position in the old list. C ------------------------------------------------------------- C flag the variable "me" as being in Lme by negating nv (me) NV (ME) = -NVPIV DEGME = 0 IF (ELENME .EQ. 0) THEN C ---------------------------------------------------------- C construct the new element in place C ---------------------------------------------------------- PME1 = PE (ME) PME2 = PME1 - 1 DO 60 P = PME1, PME1 + LEN (ME) - 1 I = IW (P) NVI = NV (I) IF (NVI .GT. 0) THEN C ---------------------------------------------------- C i is a principal variable not yet placed in Lme. C store i in new list C ---------------------------------------------------- DEGME = DEGME + NVI C flag i as being in Lme by negating nv (i) NV (I) = -NVI PME2 = PME2 + 1 IW (PME2) = I C ---------------------------------------------------- C remove variable i from degree list. C ---------------------------------------------------- ILAST = LAST (I) INEXT = NEXT (I) IF (INEXT .NE. 0) LAST (INEXT) = ILAST IF (ILAST .NE. 0) THEN NEXT (ILAST) = INEXT ELSE C i is at the head of the degree list HEAD (DEGREE (I)) = INEXT ENDIF ENDIF 60 CONTINUE C this element takes no new memory in iw: NEWMEM = 0 ELSE C ---------------------------------------------------------- C construct the new element in empty space, iw (pfree ...) C ---------------------------------------------------------- P = PE (ME) PME1 = PFREE SLENME = LEN (ME) - ELENME DO 120 KNT1 = 1, ELENME + 1 IF (KNT1 .GT. ELENME) THEN C search the supervariables in me. E = ME PJ = P LN = SLENME ELSE C search the elements in me. E = IW (P) P = P + 1 PJ = PE (E) LN = LEN (E) ENDIF C ------------------------------------------------------- C search for different supervariables and add them to the C new list, compressing when necessary. this loop is C executed once for each element in the list and once for C all the supervariables in the list. C ------------------------------------------------------- DO 110 KNT2 = 1, LN I = IW (PJ) PJ = PJ + 1 NVI = NV (I) IF (NVI .GT. 0) THEN C ------------------------------------------------- C compress iw, if necessary C ------------------------------------------------- IF (PFREE .GT. IWLEN) THEN C prepare for compressing iw by adjusting C pointers and lengths so that the lists being C searched in the inner and outer loops contain C only the remaining entries. PE (ME) = P LEN (ME) = LEN (ME) - KNT1 IF (LEN (ME) .EQ. 0) THEN C nothing left of supervariable me PE (ME) = 0 ENDIF PE (E) = PJ LEN (E) = LN - KNT2 IF (LEN (E) .EQ. 0) THEN C nothing left of element e PE (E) = 0 ENDIF NCMPA = NCMPA + 1 C store first item in pe C set first entry to -item DO 70 J = 1, N PN = PE (J) IF (PN .GT. 0) THEN PE (J) = IW (PN) IW (PN) = -J ENDIF 70 CONTINUE C psrc/pdst point to source/destination PDST = 1 PSRC = 1 PEND = PME1 - 1 C while loop: 80 CONTINUE IF (PSRC .LE. PEND) THEN C search for next negative entry J = -IW (PSRC) PSRC = PSRC + 1 IF (J .GT. 0) THEN IW (PDST) = PE (J) PE (J) = PDST PDST = PDST + 1 C copy from source to destination LENJ = LEN (J) DO 90 KNT3 = 0, LENJ - 2 IW (PDST + KNT3) = IW (PSRC + KNT3) 90 CONTINUE PDST = PDST + LENJ - 1 PSRC = PSRC + LENJ - 1 ENDIF GOTO 80 ENDIF C move the new partially-constructed element P1 = PDST DO 100 PSRC = PME1, PFREE - 1 IW (PDST) = IW (PSRC) PDST = PDST + 1 100 CONTINUE PME1 = P1 PFREE = PDST PJ = PE (E) P = PE (ME) ENDIF C ------------------------------------------------- C i is a principal variable not yet placed in Lme C store i in new list C ------------------------------------------------- DEGME = DEGME + NVI C flag i as being in Lme by negating nv (i) NV (I) = -NVI IW (PFREE) = I PFREE = PFREE + 1 C ------------------------------------------------- C remove variable i from degree link list C ------------------------------------------------- ILAST = LAST (I) INEXT = NEXT (I) IF (INEXT .NE. 0) LAST (INEXT) = ILAST IF (ILAST .NE. 0) THEN NEXT (ILAST) = INEXT ELSE C i is at the head of the degree list HEAD (DEGREE (I)) = INEXT ENDIF ENDIF 110 CONTINUE IF (E .NE. ME) THEN C set tree pointer and flag to indicate element e is C absorbed into new element me (the parent of e is me) PE (E) = -ME W (E) = 0 ENDIF 120 CONTINUE PME2 = PFREE - 1 C this element takes newmem new memory in iw (possibly zero) NEWMEM = PFREE - PME1 MEM = MEM + NEWMEM MAXMEM = MAX (MAXMEM, MEM) ENDIF C ------------------------------------------------------------- C me has now been converted into an element in iw (pme1..pme2) C ------------------------------------------------------------- C degme holds the external degree of new element DEGREE (ME) = DEGME PE (ME) = PME1 LEN (ME) = PME2 - PME1 + 1 C ------------------------------------------------------------- C make sure that wflg is not too large. With the current C value of wflg, wflg+n must not cause integer overflow C ------------------------------------------------------------- IF (WFLG + N .LE. WFLG) THEN DO 130 X = 1, N IF (W (X) .NE. 0) W (X) = 1 130 CONTINUE WFLG = 2 ENDIF C======================================================================= C COMPUTE (w (e) - wflg) = |Le\Lme| FOR ALL ELEMENTS C======================================================================= C ------------------------------------------------------------- C Scan 1: compute the external degrees of previous elements C with respect to the current element. That is: C (w (e) - wflg) = |Le \ Lme| C for each element e that appears in any supervariable in Lme. C The notation Le refers to the pattern (list of C supervariables) of a previous element e, where e is not yet C absorbed, stored in iw (pe (e) + 1 ... pe (e) + iw (pe (e))). C The notation Lme refers to the pattern of the current element C (stored in iw (pme1..pme2)). If (w (e) - wflg) becomes C zero, then the element e will be absorbed in scan 2. C ------------------------------------------------------------- DO 150 PME = PME1, PME2 I = IW (PME) ELN = ELEN (I) IF (ELN .GT. 0) THEN C note that nv (i) has been negated to denote i in Lme: NVI = -NV (I) WNVI = WFLG - NVI DO 140 P = PE (I), PE (I) + ELN - 1 E = IW (P) WE = W (E) IF (WE .GE. WFLG) THEN C unabsorbed element e has been seen in this loop WE = WE - NVI ELSE IF (WE .NE. 0) THEN C e is an unabsorbed element C this is the first we have seen e in all of Scan 1 WE = DEGREE (E) + WNVI ENDIF W (E) = WE 140 CONTINUE ENDIF 150 CONTINUE C======================================================================= C DEGREE UPDATE AND ELEMENT ABSORPTION C======================================================================= C ------------------------------------------------------------- C Scan 2: for each i in Lme, sum up the degree of Lme (which C is degme), plus the sum of the external degrees of each Le C for the elements e appearing within i, plus the C supervariables in i. Place i in hash list. C ------------------------------------------------------------- DO 180 PME = PME1, PME2 I = IW (PME) P1 = PE (I) P2 = P1 + ELEN (I) - 1 PN = P1 HASH = 0 DEG = 0 C ---------------------------------------------------------- C scan the element list associated with supervariable i C ---------------------------------------------------------- DO 160 P = P1, P2 E = IW (P) C dext = | Le \ Lme | DEXT = W (E) - WFLG IF (DEXT .GT. 0) THEN DEG = DEG + DEXT IW (PN) = E PN = PN + 1 HASH = HASH + E ELSE IF (DEXT .EQ. 0) THEN C aggressive absorption: e is not adjacent to me, but C the |Le \ Lme| is 0, so absorb it into me PE (E) = -ME W (E) = 0 ELSE C element e has already been absorbed, due to C regular absorption, in do loop 120 above. Ignore it. CONTINUE ENDIF 160 CONTINUE C count the number of elements in i (including me): ELEN (I) = PN - P1 + 1 C ---------------------------------------------------------- C scan the supervariables in the list associated with i C ---------------------------------------------------------- P3 = PN DO 170 P = P2 + 1, P1 + LEN (I) - 1 J = IW (P) NVJ = NV (J) IF (NVJ .GT. 0) THEN C j is unabsorbed, and not in Lme. C add to degree and add to new list DEG = DEG + NVJ IW (PN) = J PN = PN + 1 HASH = HASH + J ENDIF 170 CONTINUE C ---------------------------------------------------------- C update the degree and check for mass elimination C ---------------------------------------------------------- IF (DEG .EQ. 0) THEN C ------------------------------------------------------- C mass elimination C ------------------------------------------------------- C There is nothing left of this node except for an C edge to the current pivot element. elen (i) is 1, C and there are no variables adjacent to node i. C Absorb i into the current pivot element, me. PE (I) = -ME NVI = -NV (I) DEGME = DEGME - NVI NVPIV = NVPIV + NVI NEL = NEL + NVI NV (I) = 0 ELEN (I) = 0 ELSE C ------------------------------------------------------- C update the upper-bound degree of i C ------------------------------------------------------- C the following degree does not yet include the size C of the current element, which is added later: DEGREE (I) = MIN (DEGREE (I), DEG) C ------------------------------------------------------- C add me to the list for i C ------------------------------------------------------- C move first supervariable to end of list IW (PN) = IW (P3) C move first element to end of element part of list IW (P3) = IW (P1) C add new element to front of list. IW (P1) = ME C store the new length of the list in len (i) LEN (I) = PN - P1 + 1 C ------------------------------------------------------- C place in hash bucket. Save hash key of i in last (i). C ------------------------------------------------------- HASH = MOD (HASH, HMOD) + 1 J = HEAD (HASH) IF (J .LE. 0) THEN C the degree list is empty, hash head is -j NEXT (I) = -J HEAD (HASH) = -I ELSE C degree list is not empty C use last (head (hash)) as hash head NEXT (I) = LAST (J) LAST (J) = I ENDIF LAST (I) = HASH ENDIF 180 CONTINUE DEGREE (ME) = DEGME C ------------------------------------------------------------- C Clear the counter array, w (...), by incrementing wflg. C ------------------------------------------------------------- DMAX = MAX (DMAX, DEGME) WFLG = WFLG + DMAX C make sure that wflg+n does not cause integer overflow IF (WFLG + N .LE. WFLG) THEN DO 190 X = 1, N IF (W (X) .NE. 0) W (X) = 1 190 CONTINUE WFLG = 2 ENDIF C at this point, w (1..n) .lt. wflg holds C======================================================================= C SUPERVARIABLE DETECTION C======================================================================= DO 250 PME = PME1, PME2 I = IW (PME) IF (NV (I) .LT. 0) THEN C i is a principal variable in Lme C ------------------------------------------------------- C examine all hash buckets with 2 or more variables. We C do this by examing all unique hash keys for super- C variables in the pattern Lme of the current element, me C ------------------------------------------------------- HASH = LAST (I) C let i = head of hash bucket, and empty the hash bucket J = HEAD (HASH) IF (J .EQ. 0) GOTO 250 IF (J .LT. 0) THEN C degree list is empty I = -J HEAD (HASH) = 0 ELSE C degree list is not empty, restore last () of head I = LAST (J) LAST (J) = 0 ENDIF IF (I .EQ. 0) GOTO 250 C while loop: 200 CONTINUE IF (NEXT (I) .NE. 0) THEN C ---------------------------------------------------- C this bucket has one or more variables following i. C scan all of them to see if i can absorb any entries C that follow i in hash bucket. Scatter i into w. C ---------------------------------------------------- LN = LEN (I) ELN = ELEN (I) C do not flag the first element in the list (me) DO 210 P = PE (I) + 1, PE (I) + LN - 1 W (IW (P)) = WFLG 210 CONTINUE C ---------------------------------------------------- C scan every other entry j following i in bucket C ---------------------------------------------------- JLAST = I J = NEXT (I) C while loop: 220 CONTINUE IF (J .NE. 0) THEN C ------------------------------------------------- C check if j and i have identical nonzero pattern C ------------------------------------------------- IF (LEN (J) .NE. LN) THEN C i and j do not have same size data structure GOTO 240 ENDIF IF (ELEN (J) .NE. ELN) THEN C i and j do not have same number of adjacent el GOTO 240 ENDIF C do not flag the first element in the list (me) DO 230 P = PE (J) + 1, PE (J) + LN - 1 IF (W (IW (P)) .NE. WFLG) THEN C an entry (iw(p)) is in j but not in i GOTO 240 ENDIF 230 CONTINUE C ------------------------------------------------- C found it! j can be absorbed into i C ------------------------------------------------- PE (J) = -I C both nv (i) and nv (j) are negated since they C are in Lme, and the absolute values of each C are the number of variables in i and j: NV (I) = NV (I) + NV (J) NV (J) = 0 ELEN (J) = 0 C delete j from hash bucket J = NEXT (J) NEXT (JLAST) = J GOTO 220 C ------------------------------------------------- 240 CONTINUE C j cannot be absorbed into i C ------------------------------------------------- JLAST = J J = NEXT (J) GOTO 220 ENDIF C ---------------------------------------------------- C no more variables can be absorbed into i C go to next i in bucket and clear flag array C ---------------------------------------------------- WFLG = WFLG + 1 I = NEXT (I) IF (I .NE. 0) GOTO 200 ENDIF ENDIF 250 CONTINUE C======================================================================= C RESTORE DEGREE LISTS AND REMOVE NONPRINCIPAL SUPERVAR. FROM ELEMENT C======================================================================= P = PME1 NLEFT = N - NEL DO 260 PME = PME1, PME2 I = IW (PME) NVI = -NV (I) IF (NVI .GT. 0) THEN C i is a principal variable in Lme C restore nv (i) to signify that i is principal NV (I) = NVI C ------------------------------------------------------- C compute the external degree (add size of current elem) C ------------------------------------------------------- DEG = MIN (DEGREE (I) + DEGME - NVI, NLEFT - NVI) C ------------------------------------------------------- C place the supervariable at the head of the degree list C ------------------------------------------------------- INEXT = HEAD (DEG) IF (INEXT .NE. 0) LAST (INEXT) = I NEXT (I) = INEXT LAST (I) = 0 HEAD (DEG) = I C ------------------------------------------------------- C save the new degree, and find the minimum degree C ------------------------------------------------------- MINDEG = MIN (MINDEG, DEG) DEGREE (I) = DEG C ------------------------------------------------------- C place the supervariable in the element pattern C ------------------------------------------------------- IW (P) = I P = P + 1 ENDIF 260 CONTINUE C======================================================================= C FINALIZE THE NEW ELEMENT C======================================================================= NV (ME) = NVPIV + DEGME C nv (me) is now the degree of pivot (including diagonal part) C save the length of the list for the new element me LEN (ME) = P - PME1 IF (LEN (ME) .EQ. 0) THEN C there is nothing left of the current pivot element PE (ME) = 0 W (ME) = 0 ENDIF IF (NEWMEM .NE. 0) THEN C element was not constructed in place: deallocate part C of it (final size is less than or equal to newmem, C since newly nonprincipal variables have been removed). PFREE = P MEM = MEM - NEWMEM + LEN (ME) ENDIF C======================================================================= C END WHILE (selecting pivots) GOTO 30 ENDIF C======================================================================= C======================================================================= C COMPUTE THE PERMUTATION VECTORS C======================================================================= C ---------------------------------------------------------------- C The time taken by the following code is O(n). At this C point, elen (e) = -k has been done for all elements e, C and elen (i) = 0 has been done for all nonprincipal C variables i. At this point, there are no principal C supervariables left, and all elements are absorbed. C ---------------------------------------------------------------- C ---------------------------------------------------------------- C compute the ordering of unordered nonprincipal variables C ---------------------------------------------------------------- DO 290 I = 1, N IF (ELEN (I) .EQ. 0) THEN C ---------------------------------------------------------- C i is an un-ordered row. Traverse the tree from i until C reaching an element, e. The element, e, was the C principal supervariable of i and all nodes in the path C from i to when e was selected as pivot. C ---------------------------------------------------------- J = -PE (I) C while (j is a variable) do: 270 CONTINUE IF (ELEN (J) .GE. 0) THEN J = -PE (J) GOTO 270 ENDIF E = J C ---------------------------------------------------------- C get the current pivot ordering of e C ---------------------------------------------------------- K = -ELEN (E) C ---------------------------------------------------------- C traverse the path again from i to e, and compress the C path (all nodes point to e). Path compression allows C this code to compute in O(n) time. Order the unordered C nodes in the path, and place the element e at the end. C ---------------------------------------------------------- J = I C while (j is a variable) do: 280 CONTINUE IF (ELEN (J) .GE. 0) THEN JNEXT = -PE (J) PE (J) = -E IF (ELEN (J) .EQ. 0) THEN C j is an unordered row ELEN (J) = K K = K + 1 ENDIF J = JNEXT GOTO 280 ENDIF C leave elen (e) negative, so we know it is an element ELEN (E) = -K ENDIF 290 CONTINUE C ---------------------------------------------------------------- C reset the inverse permutation (elen (1..n)) to be positive, C and compute the permutation (last (1..n)). C ---------------------------------------------------------------- DO 300 I = 1, N K = ABS (ELEN (I)) LAST (K) = I ELEN (I) = K 300 CONTINUE C======================================================================= C RETURN THE MEMORY USAGE IN IW C======================================================================= C If maxmem is less than or equal to iwlen, then no compressions C occurred, and iw (maxmem+1 ... iwlen) was unused. Otherwise C compressions did occur, and iwlen would have had to have been C greater than or equal to maxmem for no compressions to occur. C Return the value of maxmem in the pfree argument. PFREE = MAXMEM RETURN END JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_order.c0000664000175000017500000001361714224052371017536 00000000000000/* ========================================================================= */ /* === AMD_order =========================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* User-callable AMD minimum degree ordering routine. See amd.h for * documentation. */ #include "amd_internal.h" /* ========================================================================= */ /* === AMD_order =========================================================== */ /* ========================================================================= */ GLOBAL Int AMD_order ( Int n, const Int Ap [ ], const Int Ai [ ], Int P [ ], double Control [ ], double Info [ ] ) { Int *Len, *S, nz, i, *Pinv, info, status, *Rp, *Ri, *Cp, *Ci, ok ; size_t nzaat, slen ; double mem = 0 ; #ifndef NDEBUG AMD_debug_init ("amd") ; #endif /* clear the Info array, if it exists */ info = Info != (double *) NULL ; if (info) { for (i = 0 ; i < AMD_INFO ; i++) { Info [i] = EMPTY ; } Info [AMD_N] = n ; Info [AMD_STATUS] = AMD_OK ; } /* make sure inputs exist and n is >= 0 */ if (Ai == (Int *) NULL || Ap == (Int *) NULL || P == (Int *) NULL || n < 0) { if (info) Info [AMD_STATUS] = AMD_INVALID ; return (AMD_INVALID) ; /* arguments are invalid */ } if (n == 0) { return (AMD_OK) ; /* n is 0 so there's nothing to do */ } nz = Ap [n] ; if (info) { Info [AMD_NZ] = nz ; } if (nz < 0) { if (info) Info [AMD_STATUS] = AMD_INVALID ; return (AMD_INVALID) ; } /* check if n or nz will cause size_t overflow */ if (((size_t) n) >= SIZE_T_MAX / sizeof (Int) || ((size_t) nz) >= SIZE_T_MAX / sizeof (Int)) { if (info) Info [AMD_STATUS] = AMD_OUT_OF_MEMORY ; return (AMD_OUT_OF_MEMORY) ; /* problem too large */ } /* check the input matrix: AMD_OK, AMD_INVALID, or AMD_OK_BUT_JUMBLED */ status = AMD_valid (n, n, Ap, Ai) ; if (status == AMD_INVALID) { if (info) Info [AMD_STATUS] = AMD_INVALID ; return (AMD_INVALID) ; /* matrix is invalid */ } /* allocate two size-n integer workspaces */ Len = SuiteSparse_malloc (n, sizeof (Int)) ; Pinv = SuiteSparse_malloc (n, sizeof (Int)) ; mem += n ; mem += n ; if (!Len || !Pinv) { /* :: out of memory :: */ SuiteSparse_free (Len) ; SuiteSparse_free (Pinv) ; if (info) Info [AMD_STATUS] = AMD_OUT_OF_MEMORY ; return (AMD_OUT_OF_MEMORY) ; } if (status == AMD_OK_BUT_JUMBLED) { /* sort the input matrix and remove duplicate entries */ AMD_DEBUG1 (("Matrix is jumbled\n")) ; Rp = SuiteSparse_malloc (n+1, sizeof (Int)) ; Ri = SuiteSparse_malloc (nz, sizeof (Int)) ; mem += (n+1) ; mem += MAX (nz,1) ; if (!Rp || !Ri) { /* :: out of memory :: */ SuiteSparse_free (Rp) ; SuiteSparse_free (Ri) ; SuiteSparse_free (Len) ; SuiteSparse_free (Pinv) ; if (info) Info [AMD_STATUS] = AMD_OUT_OF_MEMORY ; return (AMD_OUT_OF_MEMORY) ; } /* use Len and Pinv as workspace to create R = A' */ AMD_preprocess (n, Ap, Ai, Rp, Ri, Len, Pinv) ; Cp = Rp ; Ci = Ri ; } else { /* order the input matrix as-is. No need to compute R = A' first */ Rp = NULL ; Ri = NULL ; Cp = (Int *) Ap ; Ci = (Int *) Ai ; } /* --------------------------------------------------------------------- */ /* determine the symmetry and count off-diagonal nonzeros in A+A' */ /* --------------------------------------------------------------------- */ nzaat = AMD_aat (n, Cp, Ci, Len, P, Info) ; AMD_DEBUG1 (("nzaat: %g\n", (double) nzaat)) ; ASSERT ((MAX (nz-n, 0) <= nzaat) && (nzaat <= 2 * (size_t) nz)) ; /* --------------------------------------------------------------------- */ /* allocate workspace for matrix, elbow room, and 6 size-n vectors */ /* --------------------------------------------------------------------- */ S = NULL ; slen = nzaat ; /* space for matrix */ ok = ((slen + nzaat/5) >= slen) ; /* check for size_t overflow */ slen += nzaat/5 ; /* add elbow room */ for (i = 0 ; ok && i < 7 ; i++) { ok = ((slen + n) > slen) ; /* check for size_t overflow */ slen += n ; /* size-n elbow room, 6 size-n work */ } mem += slen ; ok = ok && (slen < SIZE_T_MAX / sizeof (Int)) ; /* check for overflow */ ok = ok && (slen < Int_MAX) ; /* S[i] for Int i must be OK */ if (ok) { S = SuiteSparse_malloc (slen, sizeof (Int)) ; } AMD_DEBUG1 (("slen %g\n", (double) slen)) ; if (!S) { /* :: out of memory :: (or problem too large) */ SuiteSparse_free (Rp) ; SuiteSparse_free (Ri) ; SuiteSparse_free (Len) ; SuiteSparse_free (Pinv) ; if (info) Info [AMD_STATUS] = AMD_OUT_OF_MEMORY ; return (AMD_OUT_OF_MEMORY) ; } if (info) { /* memory usage, in bytes. */ Info [AMD_MEMORY] = mem * sizeof (Int) ; } /* --------------------------------------------------------------------- */ /* order the matrix */ /* --------------------------------------------------------------------- */ AMD_1 (n, Cp, Ci, P, Pinv, Len, slen, S, Control, Info) ; /* --------------------------------------------------------------------- */ /* free the workspace */ /* --------------------------------------------------------------------- */ SuiteSparse_free (Rp) ; SuiteSparse_free (Ri) ; SuiteSparse_free (Len) ; SuiteSparse_free (Pinv) ; SuiteSparse_free (S) ; if (info) Info [AMD_STATUS] = status ; return (status) ; /* successful ordering */ } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_preprocess.c0000664000175000017500000000734014224052371020604 00000000000000/* ========================================================================= */ /* === AMD_preprocess ====================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* Sorts, removes duplicate entries, and transposes from the nonzero pattern of * a column-form matrix A, to obtain the matrix R. The input matrix can have * duplicate entries and/or unsorted columns (AMD_valid (n,Ap,Ai) must not be * AMD_INVALID). * * This input condition is NOT checked. This routine is not user-callable. */ #include "amd_internal.h" /* ========================================================================= */ /* === AMD_preprocess ====================================================== */ /* ========================================================================= */ /* AMD_preprocess does not check its input for errors or allocate workspace. * On input, the condition (AMD_valid (n,n,Ap,Ai) != AMD_INVALID) must hold. */ GLOBAL void AMD_preprocess ( Int n, /* input matrix: A is n-by-n */ const Int Ap [ ], /* size n+1 */ const Int Ai [ ], /* size nz = Ap [n] */ /* output matrix R: */ Int Rp [ ], /* size n+1 */ Int Ri [ ], /* size nz (or less, if duplicates present) */ Int W [ ], /* workspace of size n */ Int Flag [ ] /* workspace of size n */ ) { /* --------------------------------------------------------------------- */ /* local variables */ /* --------------------------------------------------------------------- */ Int i, j, p, p2 ; ASSERT (AMD_valid (n, n, Ap, Ai) != AMD_INVALID) ; /* --------------------------------------------------------------------- */ /* count the entries in each row of A (excluding duplicates) */ /* --------------------------------------------------------------------- */ for (i = 0 ; i < n ; i++) { W [i] = 0 ; /* # of nonzeros in row i (excl duplicates) */ Flag [i] = EMPTY ; /* Flag [i] = j if i appears in column j */ } for (j = 0 ; j < n ; j++) { p2 = Ap [j+1] ; for (p = Ap [j] ; p < p2 ; p++) { i = Ai [p] ; if (Flag [i] != j) { /* row index i has not yet appeared in column j */ W [i]++ ; /* one more entry in row i */ Flag [i] = j ; /* flag row index i as appearing in col j*/ } } } /* --------------------------------------------------------------------- */ /* compute the row pointers for R */ /* --------------------------------------------------------------------- */ Rp [0] = 0 ; for (i = 0 ; i < n ; i++) { Rp [i+1] = Rp [i] + W [i] ; } for (i = 0 ; i < n ; i++) { W [i] = Rp [i] ; Flag [i] = EMPTY ; } /* --------------------------------------------------------------------- */ /* construct the row form matrix R */ /* --------------------------------------------------------------------- */ /* R = row form of pattern of A */ for (j = 0 ; j < n ; j++) { p2 = Ap [j+1] ; for (p = Ap [j] ; p < p2 ; p++) { i = Ai [p] ; if (Flag [i] != j) { /* row index i has not yet appeared in column j */ Ri [W [i]++] = j ; /* put col j in row i */ Flag [i] = j ; /* flag row index i as appearing in col j*/ } } } #ifndef NDEBUG ASSERT (AMD_valid (n, n, Rp, Ri) == AMD_OK) ; for (j = 0 ; j < n ; j++) { ASSERT (W [j] == Rp [j+1]) ; } #endif } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_aat.c0000664000175000017500000001135714224052371017167 00000000000000/* ========================================================================= */ /* === AMD_aat ============================================================= */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* AMD_aat: compute the symmetry of the pattern of A, and count the number of * nonzeros each column of A+A' (excluding the diagonal). Assumes the input * matrix has no errors, with sorted columns and no duplicates * (AMD_valid (n, n, Ap, Ai) must be AMD_OK, but this condition is not * checked). */ #include "amd_internal.h" GLOBAL size_t AMD_aat /* returns nz in A+A' */ ( Int n, const Int Ap [ ], const Int Ai [ ], Int Len [ ], /* Len [j]: length of column j of A+A', excl diagonal*/ Int Tp [ ], /* workspace of size n */ double Info [ ] ) { Int p1, p2, p, i, j, pj, pj2, k, nzdiag, nzboth, nz ; double sym ; size_t nzaat ; #ifndef NDEBUG AMD_debug_init ("AMD AAT") ; for (k = 0 ; k < n ; k++) Tp [k] = EMPTY ; ASSERT (AMD_valid (n, n, Ap, Ai) == AMD_OK) ; #endif if (Info != (double *) NULL) { /* clear the Info array, if it exists */ for (i = 0 ; i < AMD_INFO ; i++) { Info [i] = EMPTY ; } Info [AMD_STATUS] = AMD_OK ; } for (k = 0 ; k < n ; k++) { Len [k] = 0 ; } nzdiag = 0 ; nzboth = 0 ; nz = Ap [n] ; for (k = 0 ; k < n ; k++) { p1 = Ap [k] ; p2 = Ap [k+1] ; AMD_DEBUG2 (("\nAAT Column: "ID" p1: "ID" p2: "ID"\n", k, p1, p2)) ; /* construct A+A' */ for (p = p1 ; p < p2 ; ) { /* scan the upper triangular part of A */ j = Ai [p] ; if (j < k) { /* entry A (j,k) is in the strictly upper triangular part, * add both A (j,k) and A (k,j) to the matrix A+A' */ Len [j]++ ; Len [k]++ ; AMD_DEBUG3 ((" upper ("ID","ID") ("ID","ID")\n", j,k, k,j)); p++ ; } else if (j == k) { /* skip the diagonal */ p++ ; nzdiag++ ; break ; } else /* j > k */ { /* first entry below the diagonal */ break ; } /* scan lower triangular part of A, in column j until reaching * row k. Start where last scan left off. */ ASSERT (Tp [j] != EMPTY) ; ASSERT (Ap [j] <= Tp [j] && Tp [j] <= Ap [j+1]) ; pj2 = Ap [j+1] ; for (pj = Tp [j] ; pj < pj2 ; ) { i = Ai [pj] ; if (i < k) { /* A (i,j) is only in the lower part, not in upper. * add both A (i,j) and A (j,i) to the matrix A+A' */ Len [i]++ ; Len [j]++ ; AMD_DEBUG3 ((" lower ("ID","ID") ("ID","ID")\n", i,j, j,i)) ; pj++ ; } else if (i == k) { /* entry A (k,j) in lower part and A (j,k) in upper */ pj++ ; nzboth++ ; break ; } else /* i > k */ { /* consider this entry later, when k advances to i */ break ; } } Tp [j] = pj ; } /* Tp [k] points to the entry just below the diagonal in column k */ Tp [k] = p ; } /* clean up, for remaining mismatched entries */ for (j = 0 ; j < n ; j++) { for (pj = Tp [j] ; pj < Ap [j+1] ; pj++) { i = Ai [pj] ; /* A (i,j) is only in the lower part, not in upper. * add both A (i,j) and A (j,i) to the matrix A+A' */ Len [i]++ ; Len [j]++ ; AMD_DEBUG3 ((" lower cleanup ("ID","ID") ("ID","ID")\n", i,j, j,i)) ; } } /* --------------------------------------------------------------------- */ /* compute the symmetry of the nonzero pattern of A */ /* --------------------------------------------------------------------- */ /* Given a matrix A, the symmetry of A is: * B = tril (spones (A), -1) + triu (spones (A), 1) ; * sym = nnz (B & B') / nnz (B) ; * or 1 if nnz (B) is zero. */ if (nz == nzdiag) { sym = 1 ; } else { sym = (2 * (double) nzboth) / ((double) (nz - nzdiag)) ; } nzaat = 0 ; for (k = 0 ; k < n ; k++) { nzaat += Len [k] ; } AMD_DEBUG1 (("AMD nz in A+A', excluding diagonal (nzaat) = %g\n", (double) nzaat)) ; AMD_DEBUG1 ((" nzboth: "ID" nz: "ID" nzdiag: "ID" symmetry: %g\n", nzboth, nz, nzdiag, sym)) ; if (Info != (double *) NULL) { Info [AMD_STATUS] = AMD_OK ; Info [AMD_N] = n ; Info [AMD_NZ] = nz ; Info [AMD_SYMMETRY] = sym ; /* symmetry of pattern of A */ Info [AMD_NZDIAG] = nzdiag ; /* nonzeros on diagonal of A */ Info [AMD_NZ_A_PLUS_AT] = nzaat ; /* nonzeros in A+A' */ } return (nzaat) ; } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_defaults.c0000664000175000017500000000234514224052371020226 00000000000000/* ========================================================================= */ /* === AMD_defaults ======================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* User-callable. Sets default control parameters for AMD. See amd.h * for details. */ #include "amd_internal.h" /* ========================================================================= */ /* === AMD defaults ======================================================== */ /* ========================================================================= */ GLOBAL void AMD_defaults ( double Control [ ] ) { Int i ; if (Control != (double *) NULL) { for (i = 0 ; i < AMD_CONTROL ; i++) { Control [i] = 0 ; } Control [AMD_DENSE] = AMD_DEFAULT_DENSE ; Control [AMD_AGGRESSIVE] = AMD_DEFAULT_AGGRESSIVE ; } } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_global.c0000664000175000017500000000150514224052371017654 00000000000000/* ========================================================================= */ /* === amd_global ========================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* In prior versions of AMD, this file declared the amd_malloc, amd_free, amd_realloc, amd_calloc, and amd_printf functions. They are now replaced by functions defined in SuiteSparse_config/SuiteSparse_config.c. */ JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_postorder.c0000664000175000017500000001260514224052371020440 00000000000000/* ========================================================================= */ /* === AMD_postorder ======================================================= */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* Perform a postordering (via depth-first search) of an assembly tree. */ #include "amd_internal.h" GLOBAL void AMD_postorder ( /* inputs, not modified on output: */ Int nn, /* nodes are in the range 0..nn-1 */ Int Parent [ ], /* Parent [j] is the parent of j, or EMPTY if root */ Int Nv [ ], /* Nv [j] > 0 number of pivots represented by node j, * or zero if j is not a node. */ Int Fsize [ ], /* Fsize [j]: size of node j */ /* output, not defined on input: */ Int Order [ ], /* output post-order */ /* workspaces of size nn: */ Int Child [ ], Int Sibling [ ], Int Stack [ ] ) { Int i, j, k, parent, frsize, f, fprev, maxfrsize, bigfprev, bigf, fnext ; for (j = 0 ; j < nn ; j++) { Child [j] = EMPTY ; Sibling [j] = EMPTY ; } /* --------------------------------------------------------------------- */ /* place the children in link lists - bigger elements tend to be last */ /* --------------------------------------------------------------------- */ for (j = nn-1 ; j >= 0 ; j--) { if (Nv [j] > 0) { /* this is an element */ parent = Parent [j] ; if (parent != EMPTY) { /* place the element in link list of the children its parent */ /* bigger elements will tend to be at the end of the list */ Sibling [j] = Child [parent] ; Child [parent] = j ; } } } #ifndef NDEBUG { Int nels, ff, nchild ; AMD_DEBUG1 (("\n\n================================ AMD_postorder:\n")); nels = 0 ; for (j = 0 ; j < nn ; j++) { if (Nv [j] > 0) { AMD_DEBUG1 (( ""ID" : nels "ID" npiv "ID" size "ID " parent "ID" maxfr "ID"\n", j, nels, Nv [j], Fsize [j], Parent [j], Fsize [j])) ; /* this is an element */ /* dump the link list of children */ nchild = 0 ; AMD_DEBUG1 ((" Children: ")) ; for (ff = Child [j] ; ff != EMPTY ; ff = Sibling [ff]) { AMD_DEBUG1 ((ID" ", ff)) ; ASSERT (Parent [ff] == j) ; nchild++ ; ASSERT (nchild < nn) ; } AMD_DEBUG1 (("\n")) ; parent = Parent [j] ; if (parent != EMPTY) { ASSERT (Nv [parent] > 0) ; } nels++ ; } } } AMD_DEBUG1 (("\n\nGo through the children of each node, and put\n" "the biggest child last in each list:\n")) ; #endif /* --------------------------------------------------------------------- */ /* place the largest child last in the list of children for each node */ /* --------------------------------------------------------------------- */ for (i = 0 ; i < nn ; i++) { if (Nv [i] > 0 && Child [i] != EMPTY) { #ifndef NDEBUG Int nchild ; AMD_DEBUG1 (("Before partial sort, element "ID"\n", i)) ; nchild = 0 ; for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { ASSERT (f >= 0 && f < nn) ; AMD_DEBUG1 ((" f: "ID" size: "ID"\n", f, Fsize [f])) ; nchild++ ; ASSERT (nchild <= nn) ; } #endif /* find the biggest element in the child list */ fprev = EMPTY ; maxfrsize = EMPTY ; bigfprev = EMPTY ; bigf = EMPTY ; for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { ASSERT (f >= 0 && f < nn) ; frsize = Fsize [f] ; if (frsize >= maxfrsize) { /* this is the biggest seen so far */ maxfrsize = frsize ; bigfprev = fprev ; bigf = f ; } fprev = f ; } ASSERT (bigf != EMPTY) ; fnext = Sibling [bigf] ; AMD_DEBUG1 (("bigf "ID" maxfrsize "ID" bigfprev "ID" fnext "ID " fprev " ID"\n", bigf, maxfrsize, bigfprev, fnext, fprev)) ; if (fnext != EMPTY) { /* if fnext is EMPTY then bigf is already at the end of list */ if (bigfprev == EMPTY) { /* delete bigf from the element of the list */ Child [i] = fnext ; } else { /* delete bigf from the middle of the list */ Sibling [bigfprev] = fnext ; } /* put bigf at the end of the list */ Sibling [bigf] = EMPTY ; ASSERT (Child [i] != EMPTY) ; ASSERT (fprev != bigf) ; ASSERT (fprev != EMPTY) ; Sibling [fprev] = bigf ; } #ifndef NDEBUG AMD_DEBUG1 (("After partial sort, element "ID"\n", i)) ; for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { ASSERT (f >= 0 && f < nn) ; AMD_DEBUG1 ((" "ID" "ID"\n", f, Fsize [f])) ; ASSERT (Nv [f] > 0) ; nchild-- ; } ASSERT (nchild == 0) ; #endif } } /* --------------------------------------------------------------------- */ /* postorder the assembly tree */ /* --------------------------------------------------------------------- */ for (i = 0 ; i < nn ; i++) { Order [i] = EMPTY ; } k = 0 ; for (i = 0 ; i < nn ; i++) { if (Parent [i] == EMPTY && Nv [i] > 0) { AMD_DEBUG1 (("Root of assembly tree "ID"\n", i)) ; k = AMD_post_tree (i, k, Child, Sibling, Order, Stack #ifndef NDEBUG , nn #endif ) ; } } } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Source/amd_valid.c0000664000175000017500000000564414224052371017523 00000000000000/* ========================================================================= */ /* === AMD_valid =========================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* AMD, Copyright (c) Timothy A. Davis, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* Check if a column-form matrix is valid or not. The matrix A is * n_row-by-n_col. The row indices of entries in column j are in * Ai [Ap [j] ... Ap [j+1]-1]. Required conditions are: * * n_row >= 0 * n_col >= 0 * nz = Ap [n_col] >= 0 number of entries in the matrix * Ap [0] == 0 * Ap [j] <= Ap [j+1] for all j in the range 0 to n_col. * Ai [0 ... nz-1] must be in the range 0 to n_row-1. * * If any of the above conditions hold, AMD_INVALID is returned. If the * following condition holds, AMD_OK_BUT_JUMBLED is returned (a warning, * not an error): * * row indices in Ai [Ap [j] ... Ap [j+1]-1] are not sorted in ascending * order, and/or duplicate entries exist. * * Otherwise, AMD_OK is returned. * * In v1.2 and earlier, this function returned TRUE if the matrix was valid * (now returns AMD_OK), or FALSE otherwise (now returns AMD_INVALID or * AMD_OK_BUT_JUMBLED). */ #include "amd_internal.h" GLOBAL Int AMD_valid ( /* inputs, not modified on output: */ Int n_row, /* A is n_row-by-n_col */ Int n_col, const Int Ap [ ], /* column pointers of A, of size n_col+1 */ const Int Ai [ ] /* row indices of A, of size nz = Ap [n_col] */ ) { Int nz, j, p1, p2, ilast, i, p, result = AMD_OK ; if (n_row < 0 || n_col < 0 || Ap == NULL || Ai == NULL) { return (AMD_INVALID) ; } nz = Ap [n_col] ; if (Ap [0] != 0 || nz < 0) { /* column pointers must start at Ap [0] = 0, and Ap [n] must be >= 0 */ AMD_DEBUG0 (("column 0 pointer bad or nz < 0\n")) ; return (AMD_INVALID) ; } for (j = 0 ; j < n_col ; j++) { p1 = Ap [j] ; p2 = Ap [j+1] ; AMD_DEBUG2 (("\nColumn: "ID" p1: "ID" p2: "ID"\n", j, p1, p2)) ; if (p1 > p2) { /* column pointers must be ascending */ AMD_DEBUG0 (("column "ID" pointer bad\n", j)) ; return (AMD_INVALID) ; } ilast = EMPTY ; for (p = p1 ; p < p2 ; p++) { i = Ai [p] ; AMD_DEBUG3 (("row: "ID"\n", i)) ; if (i < 0 || i >= n_row) { /* row index out of range */ AMD_DEBUG0 (("index out of range, col "ID" row "ID"\n", j, i)); return (AMD_INVALID) ; } if (i <= ilast) { /* row index unsorted, or duplicate entry present */ AMD_DEBUG1 (("index unsorted/dupl col "ID" row "ID"\n", j, i)); result = AMD_OK_BUT_JUMBLED ; } ilast = i ; } } return (result) ; } JAGS-4.3.2/src/modules/glm/SSparse/AMD/Makefile.am0000664000175000017500000000115214224052371016221 00000000000000noinst_LTLIBRARIES = amd.la amd_la_SOURCES = \ Source/amd_1.c \ Source/amdbar.f \ Source/amd_dump.c \ Source/amd_info.c \ Source/amd_post_tree.c \ Source/amd_2.c \ Source/amd_control.c \ Source/amd.f \ Source/amd_order.c \ Source/amd_preprocess.c \ Source/amd_aat.c \ Source/amd_defaults.c \ Source/amd_global.c \ Source/amd_postorder.c \ Source/amd_valid.c amd_la_CPPFLAGS = -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/AMD/Include noinst_HEADERS = \ Include/amd.h \ Include/amd_internal.h amd_la_LDFLAGS = -no-undefined -module -avoid-version DIST_EXTRA = README.txt JAGS-4.3.2/src/modules/glm/SSparse/AMD/Makefile.in0000644000175000017500000011657314400675236016255 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/AMD ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) amd_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_amd_la_OBJECTS = Source/amd_la-amd_1.lo Source/amdbar.lo \ Source/amd_la-amd_dump.lo Source/amd_la-amd_info.lo \ Source/amd_la-amd_post_tree.lo Source/amd_la-amd_2.lo \ Source/amd_la-amd_control.lo Source/amd.lo \ Source/amd_la-amd_order.lo Source/amd_la-amd_preprocess.lo \ Source/amd_la-amd_aat.lo Source/amd_la-amd_defaults.lo \ Source/amd_la-amd_global.lo Source/amd_la-amd_postorder.lo \ Source/amd_la-amd_valid.lo amd_la_OBJECTS = $(am_amd_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = amd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) \ $(amd_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = Source/$(DEPDIR)/amd_la-amd_1.Plo \ Source/$(DEPDIR)/amd_la-amd_2.Plo \ Source/$(DEPDIR)/amd_la-amd_aat.Plo \ Source/$(DEPDIR)/amd_la-amd_control.Plo \ Source/$(DEPDIR)/amd_la-amd_defaults.Plo \ Source/$(DEPDIR)/amd_la-amd_dump.Plo \ Source/$(DEPDIR)/amd_la-amd_global.Plo \ Source/$(DEPDIR)/amd_la-amd_info.Plo \ Source/$(DEPDIR)/amd_la-amd_order.Plo \ Source/$(DEPDIR)/amd_la-amd_post_tree.Plo \ Source/$(DEPDIR)/amd_la-amd_postorder.Plo \ Source/$(DEPDIR)/amd_la-amd_preprocess.Plo \ Source/$(DEPDIR)/amd_la-amd_valid.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS) LTF77COMPILE = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) AM_V_F77 = $(am__v_F77_@AM_V@) am__v_F77_ = $(am__v_F77_@AM_DEFAULT_V@) am__v_F77_0 = @echo " F77 " $@; am__v_F77_1 = F77LD = $(F77) F77LINK = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_F77LD = $(am__v_F77LD_@AM_V@) am__v_F77LD_ = $(am__v_F77LD_@AM_DEFAULT_V@) am__v_F77LD_0 = @echo " F77LD " $@; am__v_F77LD_1 = SOURCES = $(amd_la_SOURCES) DIST_SOURCES = $(amd_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = amd.la amd_la_SOURCES = \ Source/amd_1.c \ Source/amdbar.f \ Source/amd_dump.c \ Source/amd_info.c \ Source/amd_post_tree.c \ Source/amd_2.c \ Source/amd_control.c \ Source/amd.f \ Source/amd_order.c \ Source/amd_preprocess.c \ Source/amd_aat.c \ Source/amd_defaults.c \ Source/amd_global.c \ Source/amd_postorder.c \ Source/amd_valid.c amd_la_CPPFLAGS = -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/AMD/Include noinst_HEADERS = \ Include/amd.h \ Include/amd_internal.h amd_la_LDFLAGS = -no-undefined -module -avoid-version DIST_EXTRA = README.txt all: all-am .SUFFIXES: .SUFFIXES: .c .f .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/AMD/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/AMD/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } Source/$(am__dirstamp): @$(MKDIR_P) Source @: > Source/$(am__dirstamp) Source/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) Source/$(DEPDIR) @: > Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_1.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amdbar.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_dump.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_info.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_post_tree.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_2.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_control.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd.lo: Source/$(am__dirstamp) Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_order.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_preprocess.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_aat.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_defaults.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_global.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_postorder.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/amd_la-amd_valid.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) amd.la: $(amd_la_OBJECTS) $(amd_la_DEPENDENCIES) $(EXTRA_amd_la_DEPENDENCIES) $(AM_V_F77LD)$(amd_la_LINK) $(amd_la_OBJECTS) $(amd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f Source/*.$(OBJEXT) -rm -f Source/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_1.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_aat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_control.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_defaults.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_dump.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_global.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_info.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_order.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_post_tree.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_postorder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_preprocess.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/amd_la-amd_valid.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< Source/amd_la-amd_1.lo: Source/amd_1.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_1.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_1.Tpo -c -o Source/amd_la-amd_1.lo `test -f 'Source/amd_1.c' || echo '$(srcdir)/'`Source/amd_1.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_1.Tpo Source/$(DEPDIR)/amd_la-amd_1.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_1.c' object='Source/amd_la-amd_1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_1.lo `test -f 'Source/amd_1.c' || echo '$(srcdir)/'`Source/amd_1.c Source/amd_la-amd_dump.lo: Source/amd_dump.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_dump.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_dump.Tpo -c -o Source/amd_la-amd_dump.lo `test -f 'Source/amd_dump.c' || echo '$(srcdir)/'`Source/amd_dump.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_dump.Tpo Source/$(DEPDIR)/amd_la-amd_dump.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_dump.c' object='Source/amd_la-amd_dump.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_dump.lo `test -f 'Source/amd_dump.c' || echo '$(srcdir)/'`Source/amd_dump.c Source/amd_la-amd_info.lo: Source/amd_info.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_info.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_info.Tpo -c -o Source/amd_la-amd_info.lo `test -f 'Source/amd_info.c' || echo '$(srcdir)/'`Source/amd_info.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_info.Tpo Source/$(DEPDIR)/amd_la-amd_info.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_info.c' object='Source/amd_la-amd_info.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_info.lo `test -f 'Source/amd_info.c' || echo '$(srcdir)/'`Source/amd_info.c Source/amd_la-amd_post_tree.lo: Source/amd_post_tree.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_post_tree.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_post_tree.Tpo -c -o Source/amd_la-amd_post_tree.lo `test -f 'Source/amd_post_tree.c' || echo '$(srcdir)/'`Source/amd_post_tree.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_post_tree.Tpo Source/$(DEPDIR)/amd_la-amd_post_tree.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_post_tree.c' object='Source/amd_la-amd_post_tree.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_post_tree.lo `test -f 'Source/amd_post_tree.c' || echo '$(srcdir)/'`Source/amd_post_tree.c Source/amd_la-amd_2.lo: Source/amd_2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_2.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_2.Tpo -c -o Source/amd_la-amd_2.lo `test -f 'Source/amd_2.c' || echo '$(srcdir)/'`Source/amd_2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_2.Tpo Source/$(DEPDIR)/amd_la-amd_2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_2.c' object='Source/amd_la-amd_2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_2.lo `test -f 'Source/amd_2.c' || echo '$(srcdir)/'`Source/amd_2.c Source/amd_la-amd_control.lo: Source/amd_control.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_control.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_control.Tpo -c -o Source/amd_la-amd_control.lo `test -f 'Source/amd_control.c' || echo '$(srcdir)/'`Source/amd_control.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_control.Tpo Source/$(DEPDIR)/amd_la-amd_control.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_control.c' object='Source/amd_la-amd_control.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_control.lo `test -f 'Source/amd_control.c' || echo '$(srcdir)/'`Source/amd_control.c Source/amd_la-amd_order.lo: Source/amd_order.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_order.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_order.Tpo -c -o Source/amd_la-amd_order.lo `test -f 'Source/amd_order.c' || echo '$(srcdir)/'`Source/amd_order.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_order.Tpo Source/$(DEPDIR)/amd_la-amd_order.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_order.c' object='Source/amd_la-amd_order.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_order.lo `test -f 'Source/amd_order.c' || echo '$(srcdir)/'`Source/amd_order.c Source/amd_la-amd_preprocess.lo: Source/amd_preprocess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_preprocess.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_preprocess.Tpo -c -o Source/amd_la-amd_preprocess.lo `test -f 'Source/amd_preprocess.c' || echo '$(srcdir)/'`Source/amd_preprocess.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_preprocess.Tpo Source/$(DEPDIR)/amd_la-amd_preprocess.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_preprocess.c' object='Source/amd_la-amd_preprocess.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_preprocess.lo `test -f 'Source/amd_preprocess.c' || echo '$(srcdir)/'`Source/amd_preprocess.c Source/amd_la-amd_aat.lo: Source/amd_aat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_aat.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_aat.Tpo -c -o Source/amd_la-amd_aat.lo `test -f 'Source/amd_aat.c' || echo '$(srcdir)/'`Source/amd_aat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_aat.Tpo Source/$(DEPDIR)/amd_la-amd_aat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_aat.c' object='Source/amd_la-amd_aat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_aat.lo `test -f 'Source/amd_aat.c' || echo '$(srcdir)/'`Source/amd_aat.c Source/amd_la-amd_defaults.lo: Source/amd_defaults.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_defaults.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_defaults.Tpo -c -o Source/amd_la-amd_defaults.lo `test -f 'Source/amd_defaults.c' || echo '$(srcdir)/'`Source/amd_defaults.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_defaults.Tpo Source/$(DEPDIR)/amd_la-amd_defaults.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_defaults.c' object='Source/amd_la-amd_defaults.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_defaults.lo `test -f 'Source/amd_defaults.c' || echo '$(srcdir)/'`Source/amd_defaults.c Source/amd_la-amd_global.lo: Source/amd_global.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_global.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_global.Tpo -c -o Source/amd_la-amd_global.lo `test -f 'Source/amd_global.c' || echo '$(srcdir)/'`Source/amd_global.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_global.Tpo Source/$(DEPDIR)/amd_la-amd_global.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_global.c' object='Source/amd_la-amd_global.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_global.lo `test -f 'Source/amd_global.c' || echo '$(srcdir)/'`Source/amd_global.c Source/amd_la-amd_postorder.lo: Source/amd_postorder.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_postorder.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_postorder.Tpo -c -o Source/amd_la-amd_postorder.lo `test -f 'Source/amd_postorder.c' || echo '$(srcdir)/'`Source/amd_postorder.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_postorder.Tpo Source/$(DEPDIR)/amd_la-amd_postorder.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_postorder.c' object='Source/amd_la-amd_postorder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_postorder.lo `test -f 'Source/amd_postorder.c' || echo '$(srcdir)/'`Source/amd_postorder.c Source/amd_la-amd_valid.lo: Source/amd_valid.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/amd_la-amd_valid.lo -MD -MP -MF Source/$(DEPDIR)/amd_la-amd_valid.Tpo -c -o Source/amd_la-amd_valid.lo `test -f 'Source/amd_valid.c' || echo '$(srcdir)/'`Source/amd_valid.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/amd_la-amd_valid.Tpo Source/$(DEPDIR)/amd_la-amd_valid.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/amd_valid.c' object='Source/amd_la-amd_valid.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(amd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/amd_la-amd_valid.lo `test -f 'Source/amd_valid.c' || echo '$(srcdir)/'`Source/amd_valid.c .f.o: $(AM_V_F77)$(F77COMPILE) -c -o $@ $< .f.obj: $(AM_V_F77)$(F77COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .f.lo: $(AM_V_F77)$(LTF77COMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf Source/.libs Source/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f Source/$(DEPDIR)/$(am__dirstamp) -rm -f Source/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Source/$(DEPDIR)/amd_la-amd_1.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_2.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_aat.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_control.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_defaults.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_dump.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_global.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_info.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_order.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_post_tree.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_postorder.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_preprocess.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_valid.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Source/$(DEPDIR)/amd_la-amd_1.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_2.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_aat.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_control.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_defaults.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_dump.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_global.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_info.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_order.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_post_tree.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_postorder.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_preprocess.Plo -rm -f Source/$(DEPDIR)/amd_la-amd_valid.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CAMD/0000755000175000017500000000000014400711326014345 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Include/0000755000175000017500000000000014400711326015730 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Include/camd.h0000664000175000017500000004167714224052371016750 00000000000000/* ========================================================================= */ /* === CAMD: approximate minimum degree ordering ========================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD Version 2.4, Copyright (c) 2013 by Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* CAMD finds a symmetric ordering P of a matrix A so that the Cholesky * factorization of P*A*P' has fewer nonzeros and takes less work than the * Cholesky factorization of A. If A is not symmetric, then it performs its * ordering on the matrix A+A'. Two sets of user-callable routines are * provided, one for int integers and the other for SuiteSparse_long integers. * * The method is based on the approximate minimum degree algorithm, discussed * in Amestoy, Davis, and Duff, "An approximate degree ordering algorithm", * SIAM Journal of Matrix Analysis and Applications, vol. 17, no. 4, pp. * 886-905, 1996. */ #ifndef CAMD_H #define CAMD_H /* make it easy for C++ programs to include CAMD */ #ifdef __cplusplus extern "C" { #endif /* get the definition of size_t: */ #include #include "SuiteSparse_config.h" int camd_order /* returns CAMD_OK, CAMD_OK_BUT_JUMBLED, * CAMD_INVALID, or CAMD_OUT_OF_MEMORY */ ( int n, /* A is n-by-n. n must be >= 0. */ const int Ap [ ], /* column pointers for A, of size n+1 */ const int Ai [ ], /* row indices of A, of size nz = Ap [n] */ int P [ ], /* output permutation, of size n */ double Control [ ], /* input Control settings, of size CAMD_CONTROL */ double Info [ ], /* output Info statistics, of size CAMD_INFO */ const int C [ ] /* Constraint set of A, of size n; can be NULL */ ) ; SuiteSparse_long camd_l_order /* see above for description of arguments */ ( SuiteSparse_long n, const SuiteSparse_long Ap [ ], const SuiteSparse_long Ai [ ], SuiteSparse_long P [ ], double Control [ ], double Info [ ], const SuiteSparse_long C [ ] ) ; /* Input arguments (not modified): * * n: the matrix A is n-by-n. * Ap: an int/SuiteSparse_long array of size n+1, containing column * pointers of A. * Ai: an int/SuiteSparse_long array of size nz, containing the row * indices of A, where nz = Ap [n]. * Control: a double array of size CAMD_CONTROL, containing control * parameters. Defaults are used if Control is NULL. * * Output arguments (not defined on input): * * P: an int/SuiteSparse_long array of size n, containing the output * permutation. If row i is the kth pivot row, then P [k] = i. In * MATLAB notation, the reordered matrix is A (P,P). * Info: a double array of size CAMD_INFO, containing statistical * information. Ignored if Info is NULL. * * On input, the matrix A is stored in column-oriented form. The row indices * of nonzero entries in column j are stored in Ai [Ap [j] ... Ap [j+1]-1]. * * If the row indices appear in ascending order in each column, and there * are no duplicate entries, then camd_order is slightly more efficient in * terms of time and memory usage. If this condition does not hold, a copy * of the matrix is created (where these conditions do hold), and the copy is * ordered. * * Row indices must be in the range 0 to * n-1. Ap [0] must be zero, and thus nz = Ap [n] is the number of nonzeros * in A. The array Ap is of size n+1, and the array Ai is of size nz = Ap [n]. * The matrix does not need to be symmetric, and the diagonal does not need to * be present (if diagonal entries are present, they are ignored except for * the output statistic Info [CAMD_NZDIAG]). The arrays Ai and Ap are not * modified. This form of the Ap and Ai arrays to represent the nonzero * pattern of the matrix A is the same as that used internally by MATLAB. * If you wish to use a more flexible input structure, please see the * umfpack_*_triplet_to_col routines in the UMFPACK package, at * http://www.suitesparse.com. * * Restrictions: n >= 0. Ap [0] = 0. Ap [j] <= Ap [j+1] for all j in the * range 0 to n-1. nz = Ap [n] >= 0. Ai [0..nz-1] must be in the range 0 * to n-1. Finally, Ai, Ap, and P must not be NULL. If any of these * restrictions are not met, CAMD returns CAMD_INVALID. * * CAMD returns: * * CAMD_OK if the matrix is valid and sufficient memory can be allocated to * perform the ordering. * * CAMD_OUT_OF_MEMORY if not enough memory can be allocated. * * CAMD_INVALID if the input arguments n, Ap, Ai are invalid, or if P is * NULL. * * CAMD_OK_BUT_JUMBLED if the matrix had unsorted columns, and/or duplicate * entries, but was otherwise valid. * * The CAMD routine first forms the pattern of the matrix A+A', and then * computes a fill-reducing ordering, P. If P [k] = i, then row/column i of * the original is the kth pivotal row. In MATLAB notation, the permuted * matrix is A (P,P), except that 0-based indexing is used instead of the * 1-based indexing in MATLAB. * * The Control array is used to set various parameters for CAMD. If a NULL * pointer is passed, default values are used. The Control array is not * modified. * * Control [CAMD_DENSE]: controls the threshold for "dense" rows/columns. * A dense row/column in A+A' can cause CAMD to spend a lot of time in * ordering the matrix. If Control [CAMD_DENSE] >= 0, rows/columns * with more than Control [CAMD_DENSE] * sqrt (n) entries are ignored * during the ordering, and placed last in the output order. The * default value of Control [CAMD_DENSE] is 10. If negative, no * rows/columns are treated as "dense". Rows/columns with 16 or * fewer off-diagonal entries are never considered "dense". * * Control [CAMD_AGGRESSIVE]: controls whether or not to use aggressive * absorption, in which a prior element is absorbed into the current * element if is a subset of the current element, even if it is not * adjacent to the current pivot element (refer to Amestoy, Davis, * & Duff, 1996, for more details). The default value is nonzero, * which means to perform aggressive absorption. This nearly always * leads to a better ordering (because the approximate degrees are * more accurate) and a lower execution time. There are cases where * it can lead to a slightly worse ordering, however. To turn it off, * set Control [CAMD_AGGRESSIVE] to 0. * * Control [2..4] are not used in the current version, but may be used in * future versions. * * The Info array provides statistics about the ordering on output. If it is * not present, the statistics are not returned. This is not an error * condition. * * Info [CAMD_STATUS]: the return value of CAMD, either CAMD_OK, * CAMD_OK_BUT_JUMBLED, CAMD_OUT_OF_MEMORY, or CAMD_INVALID. * * Info [CAMD_N]: n, the size of the input matrix * * Info [CAMD_NZ]: the number of nonzeros in A, nz = Ap [n] * * Info [CAMD_SYMMETRY]: the symmetry of the matrix A. It is the number * of "matched" off-diagonal entries divided by the total number of * off-diagonal entries. An entry A(i,j) is matched if A(j,i) is also * an entry, for any pair (i,j) for which i != j. In MATLAB notation, * S = spones (A) ; * B = tril (S, -1) + triu (S, 1) ; * symmetry = nnz (B & B') / nnz (B) ; * * Info [CAMD_NZDIAG]: the number of entries on the diagonal of A. * * Info [CAMD_NZ_A_PLUS_AT]: the number of nonzeros in A+A', excluding the * diagonal. If A is perfectly symmetric (Info [CAMD_SYMMETRY] = 1) * with a fully nonzero diagonal, then Info [CAMD_NZ_A_PLUS_AT] = nz-n * (the smallest possible value). If A is perfectly unsymmetric * (Info [CAMD_SYMMETRY] = 0, for an upper triangular matrix, for * example) with no diagonal, then Info [CAMD_NZ_A_PLUS_AT] = 2*nz * (the largest possible value). * * Info [CAMD_NDENSE]: the number of "dense" rows/columns of A+A' that were * removed from A prior to ordering. These are placed last in the * output order P. * * Info [CAMD_MEMORY]: the amount of memory used by CAMD, in bytes. In the * current version, this is 1.2 * Info [CAMD_NZ_A_PLUS_AT] + 9*n * times the size of an integer. This is at most 2.4nz + 9n. This * excludes the size of the input arguments Ai, Ap, and P, which have * a total size of nz + 2*n + 1 integers. * * Info [CAMD_NCMPA]: the number of garbage collections performed. * * Info [CAMD_LNZ]: the number of nonzeros in L (excluding the diagonal). * This is a slight upper bound because mass elimination is combined * with the approximate degree update. It is a rough upper bound if * there are many "dense" rows/columns. The rest of the statistics, * below, are also slight or rough upper bounds, for the same reasons. * The post-ordering of the assembly tree might also not exactly * correspond to a true elimination tree postordering. * * Info [CAMD_NDIV]: the number of divide operations for a subsequent LDL' * or LU factorization of the permuted matrix A (P,P). * * Info [CAMD_NMULTSUBS_LDL]: the number of multiply-subtract pairs for a * subsequent LDL' factorization of A (P,P). * * Info [CAMD_NMULTSUBS_LU]: the number of multiply-subtract pairs for a * subsequent LU factorization of A (P,P), assuming that no numerical * pivoting is required. * * Info [CAMD_DMAX]: the maximum number of nonzeros in any column of L, * including the diagonal. * * Info [14..19] are not used in the current version, but may be used in * future versions. */ /* ------------------------------------------------------------------------- */ /* direct interface to CAMD */ /* ------------------------------------------------------------------------- */ /* camd_2 is the primary CAMD ordering routine. It is not meant to be * user-callable because of its restrictive inputs and because it destroys * the user's input matrix. It does not check its inputs for errors, either. * However, if you can work with these restrictions it can be faster than * camd_order and use less memory (assuming that you can create your own copy * of the matrix for CAMD to destroy). Refer to CAMD/Source/camd_2.c for a * description of each parameter. */ void camd_2 ( int n, int Pe [ ], int Iw [ ], int Len [ ], int iwlen, int pfree, int Nv [ ], int Next [ ], int Last [ ], int Head [ ], int Elen [ ], int Degree [ ], int W [ ], double Control [ ], double Info [ ], const int C [ ], int BucketSet [ ] ) ; void camd_l2 ( SuiteSparse_long n, SuiteSparse_long Pe [ ], SuiteSparse_long Iw [ ], SuiteSparse_long Len [ ], SuiteSparse_long iwlen, SuiteSparse_long pfree, SuiteSparse_long Nv [ ], SuiteSparse_long Next [ ], SuiteSparse_long Last [ ], SuiteSparse_long Head [ ], SuiteSparse_long Elen [ ], SuiteSparse_long Degree [ ], SuiteSparse_long W [ ], double Control [ ], double Info [ ], const SuiteSparse_long C [ ], SuiteSparse_long BucketSet [ ] ) ; /* ------------------------------------------------------------------------- */ /* camd_valid */ /* ------------------------------------------------------------------------- */ /* Returns CAMD_OK or CAMD_OK_BUT_JUMBLED if the matrix is valid as input to * camd_order; the latter is returned if the matrix has unsorted and/or * duplicate row indices in one or more columns. Returns CAMD_INVALID if the * matrix cannot be passed to camd_order. For camd_order, the matrix must also * be square. The first two arguments are the number of rows and the number * of columns of the matrix. For its use in CAMD, these must both equal n. */ int camd_valid ( int n_row, /* # of rows */ int n_col, /* # of columns */ const int Ap [ ], /* column pointers, of size n_col+1 */ const int Ai [ ] /* row indices, of size Ap [n_col] */ ) ; SuiteSparse_long camd_l_valid ( SuiteSparse_long n_row, SuiteSparse_long n_col, const SuiteSparse_long Ap [ ], const SuiteSparse_long Ai [ ] ) ; /* ------------------------------------------------------------------------- */ /* camd_cvalid */ /* ------------------------------------------------------------------------- */ /* Returns TRUE if the constraint set is valid as input to camd_order, * FALSE otherwise. */ int camd_cvalid ( int n, const int C [ ] ) ; SuiteSparse_long camd_l_cvalid ( SuiteSparse_long n, const SuiteSparse_long C [ ] ) ; /* ------------------------------------------------------------------------- */ /* CAMD memory manager and printf routines */ /* ------------------------------------------------------------------------- */ /* moved to SuiteSparse_config.c */ /* ------------------------------------------------------------------------- */ /* CAMD Control and Info arrays */ /* ------------------------------------------------------------------------- */ /* camd_defaults: sets the default control settings */ void camd_defaults (double Control [ ]) ; void camd_l_defaults (double Control [ ]) ; /* camd_control: prints the control settings */ void camd_control (double Control [ ]) ; void camd_l_control (double Control [ ]) ; /* camd_info: prints the statistics */ void camd_info (double Info [ ]) ; void camd_l_info (double Info [ ]) ; #define CAMD_CONTROL 5 /* size of Control array */ #define CAMD_INFO 20 /* size of Info array */ /* contents of Control */ #define CAMD_DENSE 0 /* "dense" if degree > Control [0] * sqrt (n) */ #define CAMD_AGGRESSIVE 1 /* do aggressive absorption if Control [1] != 0 */ /* default Control settings */ #define CAMD_DEFAULT_DENSE 10.0 /* default "dense" degree 10*sqrt(n) */ #define CAMD_DEFAULT_AGGRESSIVE 1 /* do aggressive absorption by default */ /* contents of Info */ #define CAMD_STATUS 0 /* return value of camd_order and camd_l_order */ #define CAMD_N 1 /* A is n-by-n */ #define CAMD_NZ 2 /* number of nonzeros in A */ #define CAMD_SYMMETRY 3 /* symmetry of pattern (1 is sym., 0 is unsym.) */ #define CAMD_NZDIAG 4 /* # of entries on diagonal */ #define CAMD_NZ_A_PLUS_AT 5 /* nz in A+A' */ #define CAMD_NDENSE 6 /* number of "dense" rows/columns in A */ #define CAMD_MEMORY 7 /* amount of memory used by CAMD */ #define CAMD_NCMPA 8 /* number of garbage collections in CAMD */ #define CAMD_LNZ 9 /* approx. nz in L, excluding the diagonal */ #define CAMD_NDIV 10 /* number of fl. point divides for LU and LDL' */ #define CAMD_NMULTSUBS_LDL 11 /* number of fl. point (*,-) pairs for LDL' */ #define CAMD_NMULTSUBS_LU 12 /* number of fl. point (*,-) pairs for LU */ #define CAMD_DMAX 13 /* max nz. in any column of L, incl. diagonal */ /* ------------------------------------------------------------------------- */ /* return values of CAMD */ /* ------------------------------------------------------------------------- */ #define CAMD_OK 0 /* success */ #define CAMD_OUT_OF_MEMORY -1 /* malloc failed, or problem too large */ #define CAMD_INVALID -2 /* input arguments are not valid */ #define CAMD_OK_BUT_JUMBLED 1 /* input matrix is OK for camd_order, but * columns were not sorted, and/or duplicate entries were present. CAMD had * to do extra work before ordering the matrix. This is a warning, not an * error. */ /* ========================================================================== */ /* === CAMD version ========================================================= */ /* ========================================================================== */ /* * As an example, to test if the version you are using is 1.2 or later: * * if (CAMD_VERSION >= CAMD_VERSION_CODE (1,2)) ... * * This also works during compile-time: * * #if (CAMD_VERSION >= CAMD_VERSION_CODE (1,2)) * printf ("This is version 1.2 or later\n") ; * #else * printf ("This is an early version\n") ; * #endif */ #define CAMD_DATE "Feb 1, 2016" #define CAMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define CAMD_MAIN_VERSION 2 #define CAMD_SUB_VERSION 4 #define CAMD_SUBSUB_VERSION 4 #define CAMD_VERSION CAMD_VERSION_CODE(CAMD_MAIN_VERSION,CAMD_SUB_VERSION) #ifdef __cplusplus } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Include/camd_internal.h0000664000175000017500000002007014224052371020624 00000000000000/* ========================================================================= */ /* === camd_internal.h ===================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* This file is for internal use in CAMD itself, and does not normally need to * be included in user code (it is included in UMFPACK, however). All others * should use camd.h instead. */ /* ========================================================================= */ /* === NDEBUG ============================================================== */ /* ========================================================================= */ /* * Turning on debugging takes some work (see below). If you do not edit this * file, then debugging is always turned off, regardless of whether or not * -DNDEBUG is specified in your compiler options. * * If CAMD is being compiled as a mexFunction, then MATLAB_MEX_FILE is defined, * and mxAssert is used instead of assert. If debugging is not enabled, no * MATLAB include files or functions are used. Thus, the CAMD library libcamd.a * can be safely used in either a stand-alone C program or in another * mexFunction, without any change. */ /* CAMD will be exceedingly slow when running in debug mode. The next three lines ensure that debugging is turned off. */ #ifndef NDEBUG #define NDEBUG #endif /* To enable debugging, uncomment the following line: #undef NDEBUG */ /* ------------------------------------------------------------------------- */ /* ANSI include files */ /* ------------------------------------------------------------------------- */ /* from stdlib.h: size_t, malloc, free, realloc, and calloc */ #include #if !defined(NPRINT) || !defined(NDEBUG) /* from stdio.h: printf. Not included if NPRINT is defined at compile time. * fopen and fscanf are used when debugging. */ #include #endif /* from limits.h: INT_MAX and LONG_MAX */ #include /* from math.h: sqrt */ #include /* ------------------------------------------------------------------------- */ /* MATLAB include files (only if being used in or via MATLAB) */ /* ------------------------------------------------------------------------- */ #ifdef MATLAB_MEX_FILE #include "matrix.h" #include "mex.h" #endif /* ------------------------------------------------------------------------- */ /* basic definitions */ /* ------------------------------------------------------------------------- */ #ifdef FLIP #undef FLIP #endif #ifdef MAX #undef MAX #endif #ifdef MIN #undef MIN #endif #ifdef EMPTY #undef EMPTY #endif #ifdef GLOBAL #undef GLOBAL #endif #ifdef PRIVATE #undef PRIVATE #endif /* FLIP is a "negation about -1", and is used to mark an integer i that is * normally non-negative. FLIP (EMPTY) is EMPTY. FLIP of a number > EMPTY * is negative, and FLIP of a number < EMTPY is positive. FLIP (FLIP (i)) = i * for all integers i. UNFLIP (i) is >= EMPTY. */ #define EMPTY (-1) #define FLIP(i) (-(i)-2) #define UNFLIP(i) ((i < EMPTY) ? FLIP (i) : (i)) /* for integer MAX/MIN, or for doubles when we don't care how NaN's behave: */ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) /* logical expression of p implies q: */ #define IMPLIES(p,q) (!(p) || (q)) /* Note that the IBM RS 6000 xlc predefines TRUE and FALSE in . */ /* The Compaq Alpha also predefines TRUE and FALSE. */ #ifdef TRUE #undef TRUE #endif #ifdef FALSE #undef FALSE #endif #define TRUE (1) #define FALSE (0) #define PRIVATE static #define GLOBAL #define EMPTY (-1) /* Note that Linux's gcc 2.96 defines NULL as ((void *) 0), but other */ /* compilers (even gcc 2.95.2 on Solaris) define NULL as 0 or (0). We */ /* need to use the ANSI standard value of 0. */ #ifdef NULL #undef NULL #endif #define NULL 0 /* largest value of size_t */ #ifndef SIZE_T_MAX #ifdef SIZE_MAX /* C99 only */ #define SIZE_T_MAX SIZE_MAX #else #define SIZE_T_MAX ((size_t) (-1)) #endif #endif /* ------------------------------------------------------------------------- */ /* integer type for CAMD: int or SuiteSparse_long */ /* ------------------------------------------------------------------------- */ #include "camd.h" #if defined (DLONG) || defined (ZLONG) #define Int SuiteSparse_long #define ID SuiteSparse_long_id #define Int_MAX SuiteSparse_long_max #define CAMD_order camd_l_order #define CAMD_defaults camd_l_defaults #define CAMD_control camd_l_control #define CAMD_info camd_l_info #define CAMD_1 camd_l1 #define CAMD_2 camd_l2 #define CAMD_valid camd_l_valid #define CAMD_cvalid camd_l_cvalid #define CAMD_aat camd_l_aat #define CAMD_postorder camd_l_postorder #define CAMD_post_tree camd_l_post_tree #define CAMD_dump camd_l_dump #define CAMD_debug camd_l_debug #define CAMD_debug_init camd_l_debug_init #define CAMD_preprocess camd_l_preprocess #else #define Int int #define ID "%d" #define Int_MAX INT_MAX #define CAMD_order camd_order #define CAMD_defaults camd_defaults #define CAMD_control camd_control #define CAMD_info camd_info #define CAMD_1 camd_1 #define CAMD_2 camd_2 #define CAMD_valid camd_valid #define CAMD_cvalid camd_cvalid #define CAMD_aat camd_aat #define CAMD_postorder camd_postorder #define CAMD_post_tree camd_post_tree #define CAMD_dump camd_dump #define CAMD_debug camd_debug #define CAMD_debug_init camd_debug_init #define CAMD_preprocess camd_preprocess #endif /* ------------------------------------------------------------------------- */ /* CAMD routine definitions (not user-callable) */ /* ------------------------------------------------------------------------- */ GLOBAL size_t CAMD_aat ( Int n, const Int Ap [ ], const Int Ai [ ], Int Len [ ], Int Tp [ ], double Info [ ] ) ; GLOBAL void CAMD_1 ( Int n, const Int Ap [ ], const Int Ai [ ], Int P [ ], Int Pinv [ ], Int Len [ ], Int slen, Int S [ ], double Control [ ], double Info [ ], const Int C [ ] ) ; GLOBAL Int CAMD_postorder ( Int j, Int k, Int n, Int head [], Int next [], Int post [], Int stack [] ) ; GLOBAL void CAMD_preprocess ( Int n, const Int Ap [ ], const Int Ai [ ], Int Rp [ ], Int Ri [ ], Int W [ ], Int Flag [ ] ) ; /* ------------------------------------------------------------------------- */ /* debugging definitions */ /* ------------------------------------------------------------------------- */ #ifndef NDEBUG /* from assert.h: assert macro */ #include #ifndef EXTERN #define EXTERN extern #endif EXTERN Int CAMD_debug ; GLOBAL void CAMD_debug_init ( char *s ) ; GLOBAL void CAMD_dump ( Int n, Int Pe [ ], Int Iw [ ], Int Len [ ], Int iwlen, Int pfree, Int Nv [ ], Int Next [ ], Int Last [ ], Int Head [ ], Int Elen [ ], Int Degree [ ], Int W [ ], Int nel, Int BucketSet [], const Int C [], Int Curc ) ; #ifdef ASSERT #undef ASSERT #endif /* Use mxAssert if CAMD is compiled into a mexFunction */ #ifdef MATLAB_MEX_FILE #define ASSERT(expression) (mxAssert ((expression), "")) #else #define ASSERT(expression) (assert (expression)) #endif #define CAMD_DEBUG0(params) { SUITESPARSE_PRINTF (params) ; } #define CAMD_DEBUG1(params) \ { if (CAMD_debug >= 1) SUITESPARSE_PRINTF (params) ; } #define CAMD_DEBUG2(params) \ { if (CAMD_debug >= 2) SUITESPARSE_PRINTF (params) ; } #define CAMD_DEBUG3(params) \ { if (CAMD_debug >= 3) SUITESPARSE_PRINTF (params) ; } #define CAMD_DEBUG4(params) \ { if (CAMD_debug >= 4) SUITESPARSE_PRINTF (params) ; } #else /* no debugging */ #define ASSERT(expression) #define CAMD_DEBUG0(params) #define CAMD_DEBUG1(params) #define CAMD_DEBUG2(params) #define CAMD_DEBUG3(params) #define CAMD_DEBUG4(params) #endif JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/0000755000175000017500000000000014400711326015605 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_1.c0000664000175000017500000001361214224052371017024 00000000000000/* ========================================================================= */ /* === CAMD_1 ============================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* CAMD_1: Construct A+A' for a sparse matrix A and perform the CAMD ordering. * * The n-by-n sparse matrix A can be unsymmetric. It is stored in MATLAB-style * compressed-column form, with sorted row indices in each column, and no * duplicate entries. Diagonal entries may be present, but they are ignored. * Row indices of column j of A are stored in Ai [Ap [j] ... Ap [j+1]-1]. * Ap [0] must be zero, and nz = Ap [n] is the number of entries in A. The * size of the matrix, n, must be greater than or equal to zero. * * This routine must be preceded by a call to CAMD_aat, which computes the * number of entries in each row/column in A+A', excluding the diagonal. * Len [j], on input, is the number of entries in row/column j of A+A'. This * routine constructs the matrix A+A' and then calls CAMD_2. No error checking * is performed (this was done in CAMD_valid). */ #include "camd_internal.h" GLOBAL void CAMD_1 ( Int n, /* n > 0 */ const Int Ap [ ], /* input of size n+1, not modified */ const Int Ai [ ], /* input of size nz = Ap [n], not modified */ Int P [ ], /* size n output permutation */ Int Pinv [ ], /* size n output inverse permutation */ Int Len [ ], /* size n input, undefined on output */ Int slen, /* slen >= sum (Len [0..n-1]) + 7n+2, * ideally slen = 1.2 * sum (Len) + 8n+2 */ Int S [ ], /* size slen workspace */ double Control [ ], /* input array of size CAMD_CONTROL */ double Info [ ], /* output array of size CAMD_INFO */ const Int C [ ] /* Constraint set of size n */ ) { Int i, j, k, p, pfree, iwlen, pj, p1, p2, pj2, *Iw, *Pe, *Nv, *Head, *Elen, *Degree, *s, *W, *Sp, *Tp, *BucketSet ; /* --------------------------------------------------------------------- */ /* construct the matrix for CAMD_2 */ /* --------------------------------------------------------------------- */ ASSERT (n > 0) ; iwlen = slen - (7*n+2) ; /* allocate 7*n+2 workspace from S */ s = S ; Pe = s ; s += n ; Nv = s ; s += n ; Head = s ; s += n+1 ; /* NOTE: was size n in AMD; size n+1 in CAMD */ Elen = s ; s += n ; Degree = s ; s += n ; W = s ; s += n+1 ; /* NOTE: was size n in AMD; size n+1 in CAMD */ BucketSet = s ; s += n ; Iw = s ; s += iwlen ; ASSERT (CAMD_valid (n, n, Ap, Ai) == CAMD_OK) ; ASSERT (CAMD_cvalid (n, C)) ; /* construct the pointers for A+A' */ Sp = Nv ; /* use Nv and W as workspace for Sp and Tp [ */ Tp = W ; pfree = 0 ; for (j = 0 ; j < n ; j++) { Pe [j] = pfree ; Sp [j] = pfree ; pfree += Len [j] ; } /* Note that this restriction on iwlen is slightly more restrictive than * what is strictly required in CAMD_2. CAMD_2 can operate with no elbow * room at all, but it will be very slow. For better performance, at * least size-n elbow room is enforced. */ ASSERT (iwlen >= pfree + n) ; #ifndef NDEBUG for (p = 0 ; p < iwlen ; p++) Iw [p] = EMPTY ; #endif for (k = 0 ; k < n ; k++) { CAMD_DEBUG1 (("Construct row/column k= "ID" of A+A'\n", k)) ; p1 = Ap [k] ; p2 = Ap [k+1] ; /* construct A+A' */ for (p = p1 ; p < p2 ; ) { /* scan the upper triangular part of A */ j = Ai [p] ; ASSERT (j >= 0 && j < n) ; if (j < k) { /* entry A (j,k) in the strictly upper triangular part */ ASSERT (Sp [j] < (j == n-1 ? pfree : Pe [j+1])) ; ASSERT (Sp [k] < (k == n-1 ? pfree : Pe [k+1])) ; Iw [Sp [j]++] = k ; Iw [Sp [k]++] = j ; p++ ; } else if (j == k) { /* skip the diagonal */ p++ ; break ; } else /* j > k */ { /* first entry below the diagonal */ break ; } /* scan lower triangular part of A, in column j until reaching * row k. Start where last scan left off. */ ASSERT (Ap [j] <= Tp [j] && Tp [j] <= Ap [j+1]) ; pj2 = Ap [j+1] ; for (pj = Tp [j] ; pj < pj2 ; ) { i = Ai [pj] ; ASSERT (i >= 0 && i < n) ; if (i < k) { /* A (i,j) is only in the lower part, not in upper */ ASSERT (Sp [i] < (i == n-1 ? pfree : Pe [i+1])) ; ASSERT (Sp [j] < (j == n-1 ? pfree : Pe [j+1])) ; Iw [Sp [i]++] = j ; Iw [Sp [j]++] = i ; pj++ ; } else if (i == k) { /* entry A (k,j) in lower part and A (j,k) in upper */ pj++ ; break ; } else /* i > k */ { /* consider this entry later, when k advances to i */ break ; } } Tp [j] = pj ; } Tp [k] = p ; } /* clean up, for remaining mismatched entries */ for (j = 0 ; j < n ; j++) { for (pj = Tp [j] ; pj < Ap [j+1] ; pj++) { i = Ai [pj] ; ASSERT (i >= 0 && i < n) ; /* A (i,j) is only in the lower part, not in upper */ ASSERT (Sp [i] < (i == n-1 ? pfree : Pe [i+1])) ; ASSERT (Sp [j] < (j == n-1 ? pfree : Pe [j+1])) ; Iw [Sp [i]++] = j ; Iw [Sp [j]++] = i ; } } #ifndef NDEBUG for (j = 0 ; j < n-1 ; j++) ASSERT (Sp [j] == Pe [j+1]) ; ASSERT (Sp [n-1] == pfree) ; #endif /* Tp and Sp no longer needed ] */ /* --------------------------------------------------------------------- */ /* order the matrix */ /* --------------------------------------------------------------------- */ CAMD_2 (n, Pe, Iw, Len, iwlen, pfree, Nv, Pinv, P, Head, Elen, Degree, W, Control, Info, C, BucketSet) ; } JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_2.c0000664000175000017500000021172714224052371017034 00000000000000/* ========================================================================= */ /* === CAMD_2 ============================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* CAMD_2: performs the CAMD ordering on a symmetric sparse matrix A, followed * by a postordering (via depth-first search) of the assembly tree using the * CAMD_postorder routine. */ /* ========================================================================= */ /* === Macros and definitions ============================================== */ /* ========================================================================= */ /* True if node i is in the current Constraint Set */ #define IsInCurrentSet(C,i,curC) ((C == NULL) ? 1 : (C [i] == curC)) /* True if i and j are in the same Constraint Set */ #define InSameConstraintSet(C,i,j) ((C == NULL) ? 1 : (C [i] == C [j])) #include "camd_internal.h" /* ========================================================================= */ /* === clear_flag ========================================================== */ /* ========================================================================= */ static Int clear_flag (Int wflg, Int wbig, Int W [ ], Int n) { Int x ; if (wflg < 2 || wflg >= wbig) { for (x = 0 ; x < n ; x++) { if (W [x] != 0) W [x] = 1 ; } wflg = 2 ; } /* at this point, W [0..n-1] < wflg holds */ return (wflg) ; } /* ========================================================================= */ /* === CAMD_2 ============================================================== */ /* ========================================================================= */ GLOBAL void CAMD_2 ( Int n, /* A is n-by-n, where n > 0 */ Int Pe [ ], /* Pe [0..n-1]: index in Iw of row i on input */ Int Iw [ ], /* workspace of size iwlen. Iw [0..pfree-1] * holds the matrix on input */ Int Len [ ], /* Len [0..n-1]: length for row/column i on input */ Int iwlen, /* length of Iw. iwlen >= pfree + n */ Int pfree, /* Iw [pfree ... iwlen-1] is empty on input */ /* 7 size-n or size-n+1 workspaces, not defined on input: */ Int Nv [ ], /* size n, the size of each supernode on output */ Int Next [ ], /* size n, the output inverse permutation */ Int Last [ ], /* size n, the output permutation */ Int Head [ ], /* size n+1 (Note: it was size n in AMD) */ Int Elen [ ], /* size n, the size columns of L for each supernode */ Int Degree [ ], /* size n */ Int W [ ], /* size n+1 (Note: it was size n in AMD) */ /* control parameters and output statistics */ double Control [ ], /* array of size CAMD_CONTROL */ double Info [ ], /* array of size CAMD_INFO */ /* input, not modified: */ const Int C [ ], /* size n, C [i] is the constraint set of node i */ /* size-n workspace, not defined on input or output: */ Int BucketSet [ ] /* size n */ ) { /* * Given a representation of the nonzero pattern of a symmetric matrix, A, * (excluding the diagonal) perform an approximate minimum (UMFPACK/MA38-style) * degree ordering to compute a pivot order such that the introduction of * nonzeros (fill-in) in the Cholesky factors A = LL' is kept low. At each * step, the pivot selected is the one with the minimum UMFAPACK/MA38-style * upper-bound on the external degree. This routine can optionally perform * aggresive absorption (as done by MC47B in the Harwell Subroutine * Library). * * The approximate degree algorithm implemented here is the symmetric analog of * the degree update algorithm in MA38 and UMFPACK (the Unsymmetric-pattern * MultiFrontal PACKage, both by Davis and Duff). The routine is based on the * MA27 minimum degree ordering algorithm by Iain Duff and John Reid. * * This routine is a translation of the original AMDBAR and MC47B routines, * in Fortran, with the following modifications: * * (1) dense rows/columns are removed prior to ordering the matrix, and placed * last in the output order. The presence of a dense row/column can * increase the ordering time by up to O(n^2), unless they are removed * prior to ordering. * * (2) the minimum degree ordering is followed by a postordering (depth-first * search) of the assembly tree. Note that mass elimination (discussed * below) combined with the approximate degree update can lead to the mass * elimination of nodes with lower exact degree than the current pivot * element. No additional fill-in is caused in the representation of the * Schur complement. The mass-eliminated nodes merge with the current * pivot element. They are ordered prior to the current pivot element. * Because they can have lower exact degree than the current element, the * merger of two or more of these nodes in the current pivot element can * lead to a single element that is not a "fundamental supernode". The * diagonal block can have zeros in it. Thus, the assembly tree used here * is not guaranteed to be the precise supernodal elemination tree (with * "funadmental" supernodes), and the postordering performed by this * routine is not guaranteed to be a precise postordering of the * elimination tree. * * (3) input parameters are added, to control aggressive absorption and the * detection of "dense" rows/columns of A. * * (4) additional statistical information is returned, such as the number of * nonzeros in L, and the flop counts for subsequent LDL' and LU * factorizations. These are slight upper bounds, because of the mass * elimination issue discussed above. * * (5) additional routines are added to interface this routine to MATLAB * to provide a simple C-callable user-interface, to check inputs for * errors, compute the symmetry of the pattern of A and the number of * nonzeros in each row/column of A+A', to compute the pattern of A+A', * to perform the assembly tree postordering, and to provide debugging * ouput. Many of these functions are also provided by the Fortran * Harwell Subroutine Library routine MC47A. * * (6) both "int" and "long" versions are provided. In the descriptions below * and integer is and "int" or "long", depending on which version is * being used. ********************************************************************** ***** CAUTION: ARGUMENTS ARE NOT CHECKED FOR ERRORS ON INPUT. ****** ********************************************************************** ** If you want error checking, a more versatile input format, and a ** ** simpler user interface, use camd_order or camd_l_order instead. ** ** This routine is not meant to be user-callable. ** ********************************************************************** * ---------------------------------------------------------------------------- * References: * ---------------------------------------------------------------------------- * * [1] Timothy A. Davis and Iain Duff, "An unsymmetric-pattern multifrontal * method for sparse LU factorization", SIAM J. Matrix Analysis and * Applications, vol. 18, no. 1, pp. 140-158. Discusses UMFPACK / MA38, * which first introduced the approximate minimum degree used by this * routine. * * [2] Patrick Amestoy, Timothy A. Davis, and Iain S. Duff, "An approximate * minimum degree ordering algorithm," SIAM J. Matrix Analysis and * Applications, vol. 17, no. 4, pp. 886-905, 1996. Discusses AMDBAR and * MC47B, which are the Fortran versions of this routine. * * [3] Alan George and Joseph Liu, "The evolution of the minimum degree * ordering algorithm," SIAM Review, vol. 31, no. 1, pp. 1-19, 1989. * We list below the features mentioned in that paper that this code * includes: * * mass elimination: * Yes. MA27 relied on supervariable detection for mass elimination. * * indistinguishable nodes: * Yes (we call these "supervariables"). This was also in the MA27 * code - although we modified the method of detecting them (the * previous hash was the true degree, which we no longer keep track * of). A supervariable is a set of rows with identical nonzero * pattern. All variables in a supervariable are eliminated together. * Each supervariable has as its numerical name that of one of its * variables (its principal variable). * * quotient graph representation: * Yes. We use the term "element" for the cliques formed during * elimination. This was also in the MA27 code. The algorithm can * operate in place, but it will work more efficiently if given some * "elbow room." * * element absorption: * Yes. This was also in the MA27 code. * * external degree: * Yes. The MA27 code was based on the true degree. * * incomplete degree update and multiple elimination: * No. This was not in MA27, either. Our method of degree update * within MC47B is element-based, not variable-based. It is thus * not well-suited for use with incomplete degree update or multiple * elimination. * * AMD Authors, and Copyright (C) 2004 by: * Timothy A. Davis, Patrick Amestoy, Iain S. Duff, John K. Reid. * Modifications for CAMD authored by Davis and Yanqing "Morris" Chen. * * Acknowledgements: This work (and the UMFPACK package) was supported by the * National Science Foundation (ASC-9111263, DMS-9223088, and CCR-0203270). * The UMFPACK/MA38 approximate degree update algorithm, the unsymmetric analog * which forms the basis of CAMD, was developed while Tim Davis was supported by * CERFACS (Toulouse, France) in a post-doctoral position. This C version, and * the etree postorder, were written while Tim Davis was on sabbatical at * Stanford University and Lawrence Berkeley National Laboratory. * Ordering constraints were added with support from Sandia National Labs (DOE). * ---------------------------------------------------------------------------- * INPUT ARGUMENTS (unaltered): * ---------------------------------------------------------------------------- * n: The matrix order. Restriction: n >= 1. * * iwlen: The size of the Iw array. On input, the matrix is stored in * Iw [0..pfree-1]. However, Iw [0..iwlen-1] should be slightly larger * than what is required to hold the matrix, at least iwlen >= pfree + n. * Otherwise, excessive compressions will take place. The recommended * value of iwlen is 1.2 * pfree + n, which is the value used in the * user-callable interface to this routine (camd_order.c). The algorithm * will not run at all if iwlen < pfree. Restriction: iwlen >= pfree + n. * Note that this is slightly more restrictive than the actual minimum * (iwlen >= pfree), but CAMD_2 will be very slow with no elbow room. * Thus, this routine enforces a bare minimum elbow room of size n. * * pfree: On input the tail end of the array, Iw [pfree..iwlen-1], is empty, * and the matrix is stored in Iw [0..pfree-1]. During execution, * additional data is placed in Iw, and pfree is modified so that * Iw [pfree..iwlen-1] is always the unused part of Iw. * * Control: A double array of size CAMD_CONTROL containing input parameters * that affect how the ordering is computed. If NULL, then default * settings are used. * * Control [CAMD_DENSE] is used to determine whether or not a given input * row is "dense". A row is "dense" if the number of entries in the row * exceeds Control [CAMD_DENSE] times sqrt (n), except that rows with 16 or * fewer entries are never considered "dense". To turn off the detection * of dense rows, set Control [CAMD_DENSE] to a negative number, or to a * number larger than sqrt (n). The default value of Control [CAMD_DENSE] * is CAMD_DEFAULT_DENSE, which is defined in camd.h as 10. * * Control [CAMD_AGGRESSIVE] is used to determine whether or not aggressive * absorption is to be performed. If nonzero, then aggressive absorption * is performed (this is the default). * * C: defines the ordering constraints. s = C [j] gives the constraint set s * that contains the row/column j (Restriction: 0 <= s < n). * In the output row permutation, all rows in set 0 appear first, followed * by all rows in set 1, and so on. If NULL, all rows are treated as if * they were in a single constraint set, and you will obtain a similar * ordering as AMD (slightly different because of the different * postordering used). * ---------------------------------------------------------------------------- * INPUT/OUPUT ARGUMENTS: * ---------------------------------------------------------------------------- * * Pe: An integer array of size n. On input, Pe [i] is the index in Iw of * the start of row i. Pe [i] is ignored if row i has no off-diagonal * entries. Thus Pe [i] must be in the range 0 to pfree-1 for non-empty * rows. * * During execution, it is used for both supervariables and elements: * * Principal supervariable i: index into Iw of the description of * supervariable i. A supervariable represents one or more rows of * the matrix with identical nonzero pattern. In this case, * Pe [i] >= 0. * * Non-principal supervariable i: if i has been absorbed into another * supervariable j, then Pe [i] = FLIP (j), where FLIP (j) is defined * as (-(j)-2). Row j has the same pattern as row i. Note that j * might later be absorbed into another supervariable j2, in which * case Pe [i] is still FLIP (j), and Pe [j] = FLIP (j2) which is * < EMPTY, where EMPTY is defined as (-1) in camd_internal.h. * * Unabsorbed element e: the index into Iw of the description of element * e, if e has not yet been absorbed by a subsequent element. Element * e is created when the supervariable of the same name is selected as * the pivot. In this case, Pe [i] >= 0. * * Absorbed element e: if element e is absorbed into element e2, then * Pe [e] = FLIP (e2). This occurs when the pattern of e (which we * refer to as Le) is found to be a subset of the pattern of e2 (that * is, Le2). In this case, Pe [i] < EMPTY. If element e is "null" * (it has no nonzeros outside its pivot block), then Pe [e] = EMPTY, * and e is the root of an assembly subtree (or the whole tree if * there is just one such root). * * Dense or empty variable i: if i is "dense" or empty (with zero degree), * then Pe [i] = FLIP (n). * * On output, Pe holds the assembly tree/forest, which implicitly * represents a pivot order with identical fill-in as the actual order * (via a depth-first search of the tree), as follows. If Nv [i] > 0, * then i represents a node in the assembly tree, and the parent of i is * Pe [i], or EMPTY if i is a root. If Nv [i] = 0, then (i, Pe [i]) * represents an edge in a subtree, the root of which is a node in the * assembly tree. Note that i refers to a row/column in the original * matrix, not the permuted matrix. * * Info: A double array of size CAMD_INFO. If present, (that is, not NULL), * then statistics about the ordering are returned in the Info array. * See camd.h for a description. * ---------------------------------------------------------------------------- * INPUT/MODIFIED (undefined on output): * ---------------------------------------------------------------------------- * * Len: An integer array of size n. On input, Len [i] holds the number of * entries in row i of the matrix, excluding the diagonal. The contents * of Len are undefined on output. Len also works as a temporary * workspace in post ordering with dense nodes detected. * * Iw: An integer array of size iwlen. On input, Iw [0..pfree-1] holds the * description of each row i in the matrix. The matrix must be symmetric, * and both upper and lower triangular parts must be present. The * diagonal must not be present. Row i is held as follows: * * Len [i]: the length of the row i data structure in the Iw array. * Iw [Pe [i] ... Pe [i] + Len [i] - 1]: * the list of column indices for nonzeros in row i (simple * supervariables), excluding the diagonal. All supervariables * start with one row/column each (supervariable i is just row i). * If Len [i] is zero on input, then Pe [i] is ignored on input. * * Note that the rows need not be in any particular order, and there * may be empty space between the rows. * * During execution, the supervariable i experiences fill-in. This is * represented by placing in i a list of the elements that cause fill-in * in supervariable i: * * Len [i]: the length of supervariable i in the Iw array. * Iw [Pe [i] ... Pe [i] + Elen [i] - 1]: * the list of elements that contain i. This list is kept short * by removing absorbed elements. * Iw [Pe [i] + Elen [i] ... Pe [i] + Len [i] - 1]: * the list of supervariables in i. This list is kept short by * removing nonprincipal variables, and any entry j that is also * contained in at least one of the elements (j in Le) in the list * for i (e in row i). * * When supervariable i is selected as pivot, we create an element e of * the same name (e=i): * * Len [e]: the length of element e in the Iw array. * Iw [Pe [e] ... Pe [e] + Len [e] - 1]: * the list of supervariables in element e. * * An element represents the fill-in that occurs when supervariable i is * selected as pivot (which represents the selection of row i and all * non-principal variables whose principal variable is i). We use the * term Le to denote the set of all supervariables in element e. Absorbed * supervariables and elements are pruned from these lists when * computationally convenient. * * CAUTION: THE INPUT MATRIX IS OVERWRITTEN DURING COMPUTATION. * The contents of Iw are undefined on output. * ---------------------------------------------------------------------------- * OUTPUT (need not be set on input): * ---------------------------------------------------------------------------- * * * Nv: An integer array of size n. During execution, ABS (Nv [i]) is equal to * the number of rows that are represented by the principal supervariable * i. If i is a nonprincipal or dense variable, then Nv [i] = 0. * Initially, Nv [i] = 1 for all i. Nv [i] < 0 signifies that i is a * principal variable in the pattern Lme of the current pivot element me. * After element me is constructed, Nv [i] is set back to a positive * value. * * On output, Nv [i] holds the number of pivots represented by super * row/column i of the original matrix, or Nv [i] = 0 for non-principal * rows/columns. Note that i refers to a row/column in the original * matrix, not the permuted matrix. * * Nv also works as a temporary workspace in initializing the BucketSet * array. * * Elen: An integer array of size n. See the description of Iw above. At the * start of execution, Elen [i] is set to zero for all rows i. During * execution, Elen [i] is the number of elements in the list for * supervariable i. When e becomes an element, Elen [e] = FLIP (esize) is * set, where esize is the size of the element (the number of pivots, plus * the number of nonpivotal entries). Thus Elen [e] < EMPTY. * Elen (i) = EMPTY set when variable i becomes nonprincipal. * * For variables, Elen (i) >= EMPTY holds until just before the * postordering and permutation vectors are computed. For elements, * Elen [e] < EMPTY holds. * * On output, Elen [i] is the degree of the row/column in the Cholesky * factorization of the permuted matrix, corresponding to the original row * i, if i is a super row/column. It is equal to EMPTY if i is * non-principal. Note that i refers to a row/column in the original * matrix, not the permuted matrix. * * Note that the contents of Elen on output differ from the Fortran * version (Elen holds the inverse permutation in the Fortran version, * which is instead returned in the Next array in this C version, * described below). * * Last: In a degree list, Last [i] is the supervariable preceding i, or EMPTY * if i is the head of the list. In a hash bucket, Last [i] is the hash * key for i. * * Last [Head [hash]] is also used as the head of a hash bucket if * Head [hash] contains a degree list (see the description of Head, * below). * * On output, Last [0..n-1] holds the permutation. That is, if * i = Last [k], then row i is the kth pivot row (where k ranges from 0 to * n-1). Row Last [k] of A is the kth row in the permuted matrix, PAP'. * * Next: Next [i] is the supervariable following i in a link list, or EMPTY if * i is the last in the list. Used for two kinds of lists: degree lists * and hash buckets (a supervariable can be in only one kind of list at a * time). * * On output Next [0..n-1] holds the inverse permutation. That is, if * k = Next [i], then row i is the kth pivot row. Row i of A appears as * the (Next[i])-th row in the permuted matrix, PAP'. * * Note that the contents of Next on output differ from the Fortran * version (Next is undefined on output in the Fortran version). * ---------------------------------------------------------------------------- * LOCAL WORKSPACE (not input or output - used only during execution): * ---------------------------------------------------------------------------- * * Degree: An integer array of size n. If i is a supervariable, then * Degree [i] holds the current approximation of the external degree of * row i (an upper bound). The external degree is the number of nonzeros * in row i, minus ABS (Nv [i]), the diagonal part. The bound is equal to * the exact external degree if Elen [i] is less than or equal to two. * * We also use the term "external degree" for elements e to refer to * |Le \ Lme|. If e is an element, then Degree [e] is |Le|, which is the * degree of the off-diagonal part of the element e (not including the * diagonal part). * * Head: An integer array of size n. Head is used for degree lists. * Head [deg] is the first supervariable in a degree list. All * supervariables i in a degree list Head [deg] have the same approximate * degree, namely, deg = Degree [i]. If the list Head [deg] is empty then * Head [deg] = EMPTY. * * During supervariable detection Head [hash] also serves as a pointer to * a hash bucket. If Head [hash] >= 0, there is a degree list of degree * hash. The hash bucket head pointer is Last [Head [hash]]. If * Head [hash] = EMPTY, then the degree list and hash bucket are both * empty. If Head [hash] < EMPTY, then the degree list is empty, and * FLIP (Head [hash]) is the head of the hash bucket. After supervariable * detection is complete, all hash buckets are empty, and the * (Last [Head [hash]] = EMPTY) condition is restored for the non-empty * degree lists. * * Head also workes as a temporary workspace in post ordering with dense * nodes detected. * * W: An integer array of size n. The flag array W determines the status of * elements and variables, and the external degree of elements. * * for elements: * if W [e] = 0, then the element e is absorbed. * if W [e] >= wflg, then W [e] - wflg is the size of the set * |Le \ Lme|, in terms of nonzeros (the sum of ABS (Nv [i]) for * each principal variable i that is both in the pattern of * element e and NOT in the pattern of the current pivot element, * me). * if wflg > W [e] > 0, then e is not absorbed and has not yet been * seen in the scan of the element lists in the computation of * |Le\Lme| in Scan 1 below. * * for variables: * during supervariable detection, if W [j] != wflg then j is * not in the pattern of variable i. * * The W array is initialized by setting W [i] = 1 for all i, and by * setting wflg = 2. It is reinitialized if wflg becomes too large (to * ensure that wflg+n does not cause integer overflow). * * BucketSet: An integer array of size n. * During execution it stores the rows that sorted in the ascending order * based on C []. For instance: if C[]={0,2,1,0,1,0,2,1}, the * Bucketset will be {0,3,5,2,4,7,1,6}. * The elements in Bucketset are then modified, to maintain the order of * roots (Pe[i]=-1) in each Constraint Set. * ---------------------------------------------------------------------------- * LOCAL INTEGERS: * ---------------------------------------------------------------------------- */ Int deg, degme, dext, lemax, e, elenme, eln, i, ilast, inext, j, jlast, k, knt1, knt2, knt3, lenj, ln, me, mindeg, nel, nleft, nvi, nvj, nvpiv, slenme, wbig, we, wflg, wnvi, ok, ndense, ncmpa, nnull, dense, aggressive ; unsigned Int hash ; /* unsigned, so that hash % n is well defined.*/ /* * deg: the degree of a variable or element * degme: size, |Lme|, of the current element, me (= Degree [me]) * dext: external degree, |Le \ Lme|, of some element e * lemax: largest |Le| seen so far (called dmax in Fortran version) * e: an element * elenme: the length, Elen [me], of element list of pivotal variable * eln: the length, Elen [...], of an element list * hash: the computed value of the hash function * i: a supervariable * ilast: the entry in a link list preceding i * inext: the entry in a link list following i * j: a supervariable * jlast: the entry in a link list preceding j * k: the pivot order of an element or variable * knt1: loop counter used during element construction * knt2: loop counter used during element construction * knt3: loop counter used during compression * lenj: Len [j] * ln: length of a supervariable list * me: current supervariable being eliminated, and the current * element created by eliminating that supervariable * mindeg: current minimum degree * nel: number of pivots selected so far * nleft: n - nel, the number of nonpivotal rows/columns remaining * nvi: the number of variables in a supervariable i (= Nv [i]) * nvj: the number of variables in a supervariable j (= Nv [j]) * nvpiv: number of pivots in current element * slenme: number of variables in variable list of pivotal variable * wbig: = INT_MAX - n for the "int" version, LONG_MAX - n for the * "long" version. wflg is not allowed to be >= wbig. * we: W [e] * wflg: used for flagging the W array. See description of Iw. * wnvi: wflg - Nv [i] * x: either a supervariable or an element * * ok: true if supervariable j can be absorbed into i * ndense: number of "dense" rows/columns * nnull: number of empty rows/columns * dense: rows/columns with initial degree > dense are considered "dense" * aggressive: true if aggressive absorption is being performed * ncmpa: number of garbage collections * ---------------------------------------------------------------------------- * LOCAL DOUBLES, used for statistical output only (except for alpha): * ---------------------------------------------------------------------------- */ double f, r, ndiv, s, nms_lu, nms_ldl, dmax, alpha, lnz, lnzme ; /* * f: nvpiv * r: degme + nvpiv * ndiv: number of divisions for LU or LDL' factorizations * s: number of multiply-subtract pairs for LU factorization, for the * current element me * nms_lu number of multiply-subtract pairs for LU factorization * nms_ldl number of multiply-subtract pairs for LDL' factorization * dmax: the largest number of entries in any column of L, including the * diagonal * alpha: "dense" degree ratio * lnz: the number of nonzeros in L (excluding the diagonal) * lnzme: the number of nonzeros in L (excl. the diagonal) for the * current element me * ---------------------------------------------------------------------------- * LOCAL "POINTERS" (indices into the Iw array) * ---------------------------------------------------------------------------- */ Int p, p1, p2, p3, p4, pdst, pend, pj, pme, pme1, pme2, pn, psrc ; /* * Any parameter (Pe [...] or pfree) or local variable starting with "p" (for * Pointer) is an index into Iw, and all indices into Iw use variables starting * with "p." The only exception to this rule is the iwlen input argument. * * p: pointer into lots of things * p1: Pe [i] for some variable i (start of element list) * p2: Pe [i] + Elen [i] - 1 for some variable i * p3: index of first supervariable in clean list * p4: * pdst: destination pointer, for compression * pend: end of memory to compress * pj: pointer into an element or variable * pme: pointer into the current element (pme1...pme2) * pme1: the current element, me, is stored in Iw [pme1...pme2] * pme2: the end of the current element * pn: pointer into a "clean" variable, also used to compress * psrc: source pointer, for compression */ Int curC, pBucket, pBucket2, degreeListCounter, c, cmax = 0, ndense_or_null ; Int *Bucket, *Perm ; /* * curC: the current Constraint Set being ordered * pBucket: pointer into Bucketset[] when building the degreelist for each * Constraint Set * pBucket2: pointer into Bucketset[] to tell the post ordering where to stop * degreeListCounter: number of elements remaining in the * degreelist of current Constraint Set * Bucket: used to construct BucketSet * Perm: permutation */ /* ========================================================================= */ /* INITIALIZATIONS */ /* ========================================================================= */ /* Note that this restriction on iwlen is slightly more restrictive than * what is actually required in CAMD_2. CAMD_2 can operate with no elbow * room at all, but it will be slow. For better performance, at least * size-n elbow room is enforced. */ ASSERT (iwlen >= pfree + n) ; ASSERT (n > 0) ; /* initialize output statistics */ lnz = 0 ; ndiv = 0 ; nms_lu = 0 ; nms_ldl = 0 ; dmax = 1 ; me = EMPTY ; mindeg = 0 ; ncmpa = 0 ; nel = 0 ; lemax = 0 ; curC = 0 ; /* camd work initBucketSet using CountingSort * BucketSort the index Array BucketSet According to Contrains Array C, Using * Nv[] as a temporary workspace * Input: Index Array from 0 to n.(index of rows) * Output: Index Array sorted according to C. worked as a bucket set. * * All the value in C must be 0 <= C[i] <= n-1 * For instance: if C[]={0,2,1,0,1,0,2,1}, the output Bucketset should be * {0,3,5,2,4,7,1,6} */ /* CountingSort BucketSet[] based on C[], It is O(n) linear time */ if (C == NULL) { /* store everything in bucket without changing order */ for (j = 0 ; j < n ; j++) { BucketSet [j] = j ; } } else { Bucket = Nv ; for (i = 0 ; i < n ; i++) { Bucket [i] = 0 ; } cmax = C [0] ; for (j = 0 ; j < n ; j++) { c = C [j] ; CAMD_DEBUG1 (("C [%d] = "ID"\n", j, c)) ; Bucket [c]++ ; cmax = MAX (cmax, c) ; ASSERT (c >= 0 && c < n) ; } CAMD_DEBUG1 (("Max constraint set: "ID"\n", cmax)) ; for (i = 1 ; i < n ; i++) { Bucket [i] += Bucket [i-1] ; } for (j = n-1 ; j >= 0 ; j--) { BucketSet [--Bucket [C [j]]] = j ; } #ifndef NDEBUG CAMD_DEBUG3 (("\nConstraint Set "ID" :", C [BucketSet [0]])); for (i = 0 ; i < n ; i++) { CAMD_DEBUG3 ((ID" ", BucketSet [i])) ; if (i == n-1) { CAMD_DEBUG3 (("\n")) ; break ; } if (C [BucketSet [i+1]] != C [BucketSet [i]]) { CAMD_DEBUG3 (("\nConstraint Set "ID" :", C [BucketSet [i+1]])) ; } } #endif } /* get control parameters */ if (Control != (double *) NULL) { alpha = Control [CAMD_DENSE] ; aggressive = (Control [CAMD_AGGRESSIVE] != 0) ; } else { alpha = CAMD_DEFAULT_DENSE ; aggressive = CAMD_DEFAULT_AGGRESSIVE ; } /* Note: if alpha is NaN, this is undefined: */ if (alpha < 0) { /* only remove completely dense rows/columns */ dense = n-2 ; } else { dense = alpha * sqrt ((double) n) ; } dense = MAX (16, dense) ; dense = MIN (n, dense) ; CAMD_DEBUG1 (("\n\nCAMD (debug), alpha %g, aggr. "ID"\n", alpha, aggressive)) ; for (i = 0 ; i < n ; i++) { Last [i] = EMPTY ; Head [i] = EMPTY ; Next [i] = EMPTY ; /* if separate Hhead array is used for hash buckets: * Hhead [i] = EMPTY ; */ Nv [i] = 1 ; W [i] = 1 ; Elen [i] = 0 ; Degree [i] = Len [i] ; } Head [n] = EMPTY ; /* initialize wflg */ wbig = Int_MAX - n ; wflg = clear_flag (0, wbig, W, n) ; /* --------------------------------------------------------------------- */ /* eliminate dense and empty rows */ /* --------------------------------------------------------------------- */ ndense = 0 ; nnull = 0 ; for (j = 0 ; j < n ; j++) { i = BucketSet [j] ; deg = Degree [i] ; ASSERT (deg >= 0 && deg < n) ; if (deg > dense || deg == 0) { /* ------------------------------------------------------------- * Dense or empty variables are treated as non-principal variables * represented by node n. That is, i is absorbed into n, just like * j is absorbed into i in supervariable detection (see "found it!" * comment, below). * ------------------------------------------------------------- */ if (deg > dense) { CAMD_DEBUG1 (("Dense node "ID" degree "ID" bucket "ID"\n", i, deg, j)) ; ndense++ ; } else { CAMD_DEBUG1 (("Empty node "ID" degree "ID" bucket "ID"\n", i, deg, j)) ; nnull++ ; } Pe [i] = FLIP (n) ; Nv [i] = 0 ; /* do not postorder this node */ Elen [i] = EMPTY ; nel++ ; } } ndense_or_null = ndense + nnull ; pBucket = 0 ; degreeListCounter = 0 ; pBucket2 = 0 ; /* ========================================================================= */ /* WHILE (selecting pivots) DO */ /* ========================================================================= */ while (nel < n) { /* ------------------------------------------------------------------ */ /* if empty, fill the degree list with next non-empty constraint set */ /* ------------------------------------------------------------------ */ while (degreeListCounter == 0) { mindeg = n ; /* determine the new constraint set */ curC = (C == NULL) ? 0 : C [BucketSet [pBucket]] ; for ( ; pBucket < n ; pBucket++) { /* add i to the degree list, unless it's dead or not in curC */ i = BucketSet [pBucket] ; if (!IsInCurrentSet (C, i, curC)) break ; deg = Degree [i] ; ASSERT (deg >= 0 && deg < n) ; if (Pe [i] >= 0) { /* ------------------------------------------------------ * place i in the degree list corresponding to its degree * ------------------------------------------------------ */ inext = Head [deg] ; ASSERT (inext >= EMPTY && inext < n) ; if (inext != EMPTY) Last [inext] = i ; Next [i] = inext ; Head [deg] = i ; degreeListCounter++ ; Last [i] = EMPTY ; mindeg = MIN (mindeg, deg) ; } } } #ifndef NDEBUG CAMD_DEBUG1 (("\n======Nel "ID"\n", nel)) ; if (CAMD_debug >= 2) { CAMD_dump (n, Pe, Iw, Len, iwlen, pfree, Nv, Next, Last, Head, Elen, Degree, W, nel, BucketSet, C, curC) ; } #endif /* ========================================================================= */ /* GET PIVOT OF MINIMUM DEGREE */ /* ========================================================================= */ /* ----------------------------------------------------------------- */ /* find next supervariable for elimination */ /* ----------------------------------------------------------------- */ ASSERT (mindeg >= 0 && mindeg < n) ; for (deg = mindeg ; deg < n ; deg++) { me = Head [deg] ; if (me != EMPTY) break ; } mindeg = deg ; ASSERT (me >= 0 && me < n) ; CAMD_DEBUG1 (("=================me: "ID"\n", me)) ; /* ----------------------------------------------------------------- */ /* remove chosen variable from link list */ /* ----------------------------------------------------------------- */ inext = Next [me] ; ASSERT (inext >= EMPTY && inext < n) ; if (inext != EMPTY) Last [inext] = EMPTY ; Head [deg] = inext ; degreeListCounter-- ; /* ----------------------------------------------------------------- */ /* me represents the elimination of pivots nel to nel+Nv[me]-1. */ /* place me itself as the first in this set. */ /* ----------------------------------------------------------------- */ elenme = Elen [me] ; nvpiv = Nv [me] ; ASSERT (nvpiv > 0) ; nel += nvpiv ; CAMD_DEBUG1 (("nvpiv is initially "ID"\n", nvpiv)) ; /* ========================================================================= */ /* CONSTRUCT NEW ELEMENT */ /* ========================================================================= */ /* ----------------------------------------------------------------- * At this point, me is the pivotal supervariable. It will be * converted into the current element. Scan list of the pivotal * supervariable, me, setting tree pointers and constructing new list * of supervariables for the new element, me. p is a pointer to the * current position in the old list. * ----------------------------------------------------------------- */ /* flag the variable "me" as being in Lme by negating Nv [me] */ Nv [me] = -nvpiv ; degme = 0 ; ASSERT (Pe [me] >= 0 && Pe [me] < iwlen) ; if (elenme == 0) { /* ------------------------------------------------------------- */ /* construct the new element in place */ /* ------------------------------------------------------------- */ pme1 = Pe [me] ; pme2 = pme1 - 1 ; for (p = pme1 ; p <= pme1 + Len [me] - 1 ; p++) { i = Iw [p] ; ASSERT (i >= 0 && i < n && Nv [i] >= 0) ; nvi = Nv [i] ; if (nvi > 0) { /* ----------------------------------------------------- */ /* i is a principal variable not yet placed in Lme. */ /* store i in new list */ /* ----------------------------------------------------- */ /* flag i as being in Lme by negating Nv [i] */ degme += nvi ; Nv [i] = -nvi ; Iw [++pme2] = i ; /* ----------------------------------------------------- */ /* remove variable i from degree list. */ /* ----------------------------------------------------- */ if (IsInCurrentSet (C, i, curC)) { ilast = Last [i] ; inext = Next [i] ; ASSERT (ilast >= EMPTY && ilast < n) ; ASSERT (inext >= EMPTY && inext < n) ; if (inext != EMPTY) Last [inext] = ilast ; if (ilast != EMPTY) { Next [ilast] = inext ; } else { /* i is at the head of the degree list */ ASSERT (Degree [i] >= 0 && Degree [i] < n) ; Head [Degree [i]] = inext ; } degreeListCounter-- ; } } } } else { /* ------------------------------------------------------------- */ /* construct the new element in empty space, Iw [pfree ...] */ /* ------------------------------------------------------------- */ p = Pe [me] ; pme1 = pfree ; slenme = Len [me] - elenme ; for (knt1 = 1 ; knt1 <= elenme + 1 ; knt1++) { if (knt1 > elenme) { /* search the supervariables in me. */ e = me ; pj = p ; ln = slenme ; CAMD_DEBUG2 (("Search sv: "ID" "ID" "ID"\n", me,pj,ln)) ; } else { /* search the elements in me. */ e = Iw [p++] ; ASSERT (e >= 0 && e < n) ; pj = Pe [e] ; ln = Len [e] ; CAMD_DEBUG2 (("Search element e "ID" in me "ID"\n", e,me)) ; ASSERT (Elen [e] < EMPTY && W [e] > 0 && pj >= 0) ; } ASSERT (ln >= 0 && (ln == 0 || (pj >= 0 && pj < iwlen))) ; /* --------------------------------------------------------- * search for different supervariables and add them to the * new list, compressing when necessary. this loop is * executed once for each element in the list and once for * all the supervariables in the list. * --------------------------------------------------------- */ for (knt2 = 1 ; knt2 <= ln ; knt2++) { i = Iw [pj++] ; ASSERT (i >= 0 && i < n && (i == me || Elen [i] >= EMPTY)); nvi = Nv [i] ; CAMD_DEBUG2 ((": "ID" "ID" "ID" "ID"\n", i, Elen [i], Nv [i], wflg)) ; if (nvi > 0) { /* ------------------------------------------------- */ /* compress Iw, if necessary */ /* ------------------------------------------------- */ if (pfree >= iwlen) { CAMD_DEBUG1 (("GARBAGE COLLECTION\n")) ; /* prepare for compressing Iw by adjusting pointers * and lengths so that the lists being searched in * the inner and outer loops contain only the * remaining entries. */ Pe [me] = p ; Len [me] -= knt1 ; /* check if nothing left of supervariable me */ if (Len [me] == 0) Pe [me] = EMPTY ; Pe [e] = pj ; Len [e] = ln - knt2 ; /* nothing left of element e */ if (Len [e] == 0) Pe [e] = EMPTY ; ncmpa++ ; /* one more garbage collection */ /* store first entry of each object in Pe */ /* FLIP the first entry in each object */ for (j = 0 ; j < n ; j++) { pn = Pe [j] ; if (pn >= 0) { ASSERT (pn >= 0 && pn < iwlen) ; Pe [j] = Iw [pn] ; Iw [pn] = FLIP (j) ; } } /* psrc/pdst point to source/destination */ psrc = 0 ; pdst = 0 ; pend = pme1 - 1 ; while (psrc <= pend) { /* search for next FLIP'd entry */ j = FLIP (Iw [psrc++]) ; if (j >= 0) { CAMD_DEBUG2 (("Got object j: "ID"\n", j)) ; Iw [pdst] = Pe [j] ; Pe [j] = pdst++ ; lenj = Len [j] ; /* copy from source to destination */ for (knt3 = 0 ; knt3 <= lenj - 2 ; knt3++) { Iw [pdst++] = Iw [psrc++] ; } } } /* move the new partially-constructed element */ p1 = pdst ; for (psrc = pme1 ; psrc <= pfree-1 ; psrc++) { Iw [pdst++] = Iw [psrc] ; } pme1 = p1 ; pfree = pdst ; pj = Pe [e] ; p = Pe [me] ; } /* ------------------------------------------------- */ /* i is a principal variable not yet placed in Lme */ /* store i in new list */ /* ------------------------------------------------- */ /* flag i as being in Lme by negating Nv [i] */ degme += nvi ; Nv [i] = -nvi ; Iw [pfree++] = i ; CAMD_DEBUG2 ((" s: "ID" nv "ID"\n", i, Nv [i])); /* ------------------------------------------------- */ /* remove variable i from degree link list */ /* ------------------------------------------------- */ if (IsInCurrentSet (C, i, curC)) { ilast = Last [i] ; inext = Next [i] ; ASSERT (ilast >= EMPTY && ilast < n) ; ASSERT (inext >= EMPTY && inext < n) ; if (inext != EMPTY) Last [inext] = ilast ; if (ilast != EMPTY) { Next [ilast] = inext ; } else { /* i is at the head of the degree list */ ASSERT (Degree [i] >= 0 && Degree [i] < n) ; Head [Degree [i]] = inext ; } degreeListCounter-- ; } } } if (e != me) { if (IsInCurrentSet (C, e, curC)) { /* absorb element here if in same bucket */ /* set tree pointer and flag to indicate element e is * absorbed into new element me (the parent of e is me) */ CAMD_DEBUG1 ((" Element "ID" => "ID"\n", e, me)) ; Pe [e] = FLIP (me) ; W [e] = 0 ; } else { /* make element a root; kill it if not in same bucket */ CAMD_DEBUG1 (("2 Element "ID" => "ID"\n", e, me)) ; Pe [e] = EMPTY ; W [e] = 0 ; } } } pme2 = pfree - 1 ; } /* ----------------------------------------------------------------- */ /* me has now been converted into an element in Iw [pme1..pme2] */ /* ----------------------------------------------------------------- */ /* degme holds the external degree of new element */ Degree [me] = degme ; Pe [me] = pme1 ; Len [me] = pme2 - pme1 + 1 ; ASSERT (Pe [me] >= 0 && Pe [me] < iwlen) ; Elen [me] = FLIP (nvpiv + degme) ; /* FLIP (Elen (me)) is now the degree of pivot (including * diagonal part). */ #ifndef NDEBUG CAMD_DEBUG2 (("New element structure: length= "ID"\n", pme2-pme1+1)) ; for (pme = pme1 ; pme <= pme2 ; pme++) CAMD_DEBUG3 ((" "ID"", Iw[pme])); CAMD_DEBUG3 (("\n")) ; #endif /* ----------------------------------------------------------------- */ /* make sure that wflg is not too large. */ /* ----------------------------------------------------------------- */ /* With the current value of wflg, wflg+n must not cause integer * overflow */ wflg = clear_flag (wflg, wbig, W, n) ; /* ========================================================================= */ /* COMPUTE (W [e] - wflg) = |Le\Lme| FOR ALL ELEMENTS */ /* ========================================================================= */ /* ----------------------------------------------------------------- * Scan 1: compute the external degrees of previous elements with * respect to the current element. That is: * (W [e] - wflg) = |Le \ Lme| * for each element e that appears in any supervariable in Lme. The * notation Le refers to the pattern (list of supervariables) of a * previous element e, where e is not yet absorbed, stored in * Iw [Pe [e] + 1 ... Pe [e] + Len [e]]. The notation Lme * refers to the pattern of the current element (stored in * Iw [pme1..pme2]). If aggressive absorption is enabled, and * (W [e] - wflg) becomes zero, then the element e will be absorbed * in Scan 2. * ----------------------------------------------------------------- */ CAMD_DEBUG2 (("me: ")) ; for (pme = pme1 ; pme <= pme2 ; pme++) { i = Iw [pme] ; ASSERT (i >= 0 && i < n) ; eln = Elen [i] ; CAMD_DEBUG3 ((""ID" Elen "ID": \n", i, eln)) ; if (eln > 0) { /* note that Nv [i] has been negated to denote i in Lme: */ nvi = -Nv [i] ; ASSERT (nvi > 0 && Pe [i] >= 0 && Pe [i] < iwlen) ; wnvi = wflg - nvi ; for (p = Pe [i] ; p <= Pe [i] + eln - 1 ; p++) { e = Iw [p] ; ASSERT (e >= 0 && e < n) ; we = W [e] ; CAMD_DEBUG4 ((" e "ID" we "ID" ", e, we)) ; if (we >= wflg) { /* unabsorbed element e has been seen in this loop */ CAMD_DEBUG4 ((" unabsorbed, first time seen")) ; we -= nvi ; } else if (we != 0) { /* e is an unabsorbed element */ /* this is the first we have seen e in all of Scan 1 */ CAMD_DEBUG4 ((" unabsorbed")) ; we = Degree [e] + wnvi ; } CAMD_DEBUG4 (("\n")) ; W [e] = we ; } } } CAMD_DEBUG2 (("\n")) ; /* ========================================================================= */ /* DEGREE UPDATE AND ELEMENT ABSORPTION */ /* ========================================================================= */ /* ----------------------------------------------------------------- * Scan 2: for each i in Lme, sum up the degree of Lme (which is * degme), plus the sum of the external degrees of each Le for the * elements e appearing within i, plus the supervariables in i. * Place i in hash list. * ----------------------------------------------------------------- */ for (pme = pme1 ; pme <= pme2 ; pme++) { i = Iw [pme] ; ASSERT (i >= 0 && i < n && Nv [i] < 0 && Elen [i] >= 0) ; CAMD_DEBUG2 (("Updating: i "ID" "ID" "ID"\n", i, Elen[i], Len [i])); p1 = Pe [i] ; p2 = p1 + Elen [i] - 1 ; pn = p1 ; hash = 0 ; deg = 0 ; ASSERT (p1 >= 0 && p1 < iwlen && p2 >= -1 && p2 < iwlen) ; /* ------------------------------------------------------------- */ /* scan the element list associated with supervariable i */ /* ------------------------------------------------------------- */ /* UMFPACK/MA38-style approximate degree: */ if (aggressive) { for (p = p1 ; p <= p2 ; p++) { e = Iw [p] ; ASSERT (e >= 0 && e < n) ; we = W [e] ; if (we != 0) { /* e is an unabsorbed element */ /* dext = | Le \ Lme | */ dext = we - wflg ; if (dext > 0) { deg += dext ; Iw [pn++] = e ; hash += e ; CAMD_DEBUG4 ((" e: "ID" hash = "ID"\n",e,hash)) ; } else { if (IsInCurrentSet (C, e, curC)) { /* external degree of e is zero and if * C[e] = curC; absorb e into me */ CAMD_DEBUG1 ((" Element "ID" =>"ID" (aggr)\n", e, me)) ; ASSERT (dext == 0) ; Pe [e] = FLIP (me) ; W [e] = 0 ; } else { /* make element a root; kill it if not in same * bucket */ CAMD_DEBUG1 (("2 Element "ID" =>"ID" (aggr)\n", e, me)) ; ASSERT (dext == 0) ; Pe [e] = EMPTY ; W [e] = 0 ; } } } } } else { for (p = p1 ; p <= p2 ; p++) { e = Iw [p] ; ASSERT (e >= 0 && e < n) ; we = W [e] ; if (we != 0) { /* e is an unabsorbed element */ dext = we - wflg ; ASSERT (dext >= 0) ; deg += dext ; Iw [pn++] = e ; hash += e ; CAMD_DEBUG4 ((" e: "ID" hash = "ID"\n",e,hash)) ; } } } /* count the number of elements in i (including me): */ Elen [i] = pn - p1 + 1 ; /* ------------------------------------------------------------- */ /* scan the supervariables in the list associated with i */ /* ------------------------------------------------------------- */ /* The bulk of the CAMD run time is typically spent in this loop, * particularly if the matrix has many dense rows that are not * removed prior to ordering. */ p3 = pn ; p4 = p1 + Len [i] ; for (p = p2 + 1 ; p < p4 ; p++) { j = Iw [p] ; ASSERT (j >= 0 && j < n) ; nvj = Nv [j] ; if (nvj > 0) { /* j is unabsorbed, and not in Lme. */ /* add to degree and add to new list */ deg += nvj ; Iw [pn++] = j ; hash += j ; CAMD_DEBUG4 ((" s: "ID" hash "ID" Nv[j]= "ID"\n", j, hash, nvj)) ; } } /* ------------------------------------------------------------- */ /* update the degree and check for mass elimination */ /* ------------------------------------------------------------- */ /* with aggressive absorption, deg==0 is identical to the * Elen [i] == 1 && p3 == pn test, below. */ ASSERT (IMPLIES (aggressive, (deg==0) == (Elen[i]==1 && p3==pn))) ; if (Elen [i] == 1 && p3 == pn && IsInCurrentSet (C, i, curC)) { /* --------------------------------------------------------- */ /* mass elimination */ /* --------------------------------------------------------- */ /* There is nothing left of this node except for an edge to * the current pivot element. Elen [i] is 1, and there are * no variables adjacent to node i. Absorb i into the * current pivot element, me. Note that if there are two or * more mass eliminations, fillin due to mass elimination is * possible within the nvpiv-by-nvpiv pivot block. It is this * step that causes CAMD's analysis to be an upper bound. * * The reason is that the selected pivot has a lower * approximate degree than the true degree of the two mass * eliminated nodes. There is no edge between the two mass * eliminated nodes. They are merged with the current pivot * anyway. * * No fillin occurs in the Schur complement, in any case, * and this effect does not decrease the quality of the * ordering itself, just the quality of the nonzero and * flop count analysis. It also means that the post-ordering * is not an exact elimination tree post-ordering. */ CAMD_DEBUG1 ((" MASS i "ID" => parent e "ID"\n", i, me)) ; Pe [i] = FLIP (me) ; nvi = -Nv [i] ; degme -= nvi ; nvpiv += nvi ; nel += nvi ; Nv [i] = 0 ; Elen [i] = EMPTY ; } else { /* --------------------------------------------------------- */ /* update the upper-bound degree of i */ /* --------------------------------------------------------- */ /* the following degree does not yet include the size * of the current element, which is added later: */ Degree [i] = MIN (Degree [i], deg) ; /* --------------------------------------------------------- */ /* add me to the list for i */ /* --------------------------------------------------------- */ /* move first supervariable to end of list */ Iw [pn] = Iw [p3] ; /* move first element to end of element part of list */ Iw [p3] = Iw [p1] ; /* add new element, me, to front of list. */ Iw [p1] = me ; /* store the new length of the list in Len [i] */ Len [i] = pn - p1 + 1 ; /* --------------------------------------------------------- */ /* place in hash bucket. Save hash key of i in Last [i]. */ /* --------------------------------------------------------- */ /* NOTE: this can fail if hash is negative, because the ANSI C * standard does not define a % b when a and/or b are negative. * That's why hash is defined as an unsigned Int, to avoid this * problem. */ hash = hash % n ; ASSERT (((Int) hash) >= 0 && ((Int) hash) < n) ; /* if the Hhead array is not used: */ j = Head [hash] ; if (j <= EMPTY) { /* degree list is empty, hash head is FLIP (j) */ Next [i] = FLIP (j) ; Head [hash] = FLIP (i) ; } else { /* degree list is not empty, use Last [Head [hash]] as * hash head. */ Next [i] = Last [j] ; Last [j] = i ; } /* if a separate Hhead array is used: * Next [i] = Hhead [hash] ; Hhead [hash] = i ; */ CAMD_DEBUG4 ((" s: "ID" hash "ID" \n", i, hash)) ; Last [i] = hash ; } } Degree [me] = degme ; /* ----------------------------------------------------------------- */ /* Clear the counter array, W [...], by incrementing wflg. */ /* ----------------------------------------------------------------- */ /* make sure that wflg+n does not cause integer overflow */ lemax = MAX (lemax, degme) ; wflg += lemax ; wflg = clear_flag (wflg, wbig, W, n) ; /* at this point, W [0..n-1] < wflg holds */ /* ========================================================================= */ /* SUPERVARIABLE DETECTION */ /* ========================================================================= */ CAMD_DEBUG1 (("Detecting supervariables:\n")) ; for (pme = pme1 ; pme <= pme2 ; pme++) { i = Iw [pme] ; ASSERT (i >= 0 && i < n) ; CAMD_DEBUG2 (("Consider i "ID" nv "ID"\n", i, Nv [i])) ; if (Nv [i] < 0) { /* i is a principal variable in Lme */ /* --------------------------------------------------------- * examine all hash buckets with 2 or more variables. We do * this by examing all unique hash keys for supervariables in * the pattern Lme of the current element, me * --------------------------------------------------------- */ CAMD_DEBUG2 (("Last: "ID"\n", Last [i])) ; /* let i = head of hash bucket, and empty the hash bucket */ ASSERT (Last [i] >= 0 && Last [i] < n) ; hash = Last [i] ; /* if Hhead array is not used: */ j = Head [hash] ; if (j == EMPTY) { /* hash bucket and degree list are both empty */ i = EMPTY ; } else if (j < EMPTY) { /* degree list is empty */ i = FLIP (j) ; Head [hash] = EMPTY ; } else { /* degree list is not empty, restore Last [j] of head j */ i = Last [j] ; Last [j] = EMPTY ; } /* if separate Hhead array is used: * i = Hhead [hash] ; Hhead [hash] = EMPTY ; */ ASSERT (i >= EMPTY && i < n) ; CAMD_DEBUG2 (("----i "ID" hash "ID"\n", i, hash)) ; while (i != EMPTY && Next [i] != EMPTY) { /* ----------------------------------------------------- * this bucket has one or more variables following i. * scan all of them to see if i can absorb any entries * that follow i in hash bucket. Scatter i into w. * ----------------------------------------------------- */ ln = Len [i] ; eln = Elen [i] ; ASSERT (ln >= 0 && eln >= 0) ; ASSERT (Pe [i] >= 0 && Pe [i] < iwlen) ; /* do not flag the first element in the list (me) */ for (p = Pe [i] + 1 ; p <= Pe [i] + ln - 1 ; p++) { ASSERT (Iw [p] >= 0 && Iw [p] < n) ; W [Iw [p]] = wflg ; } /* ----------------------------------------------------- */ /* scan every other entry j following i in bucket */ /* ----------------------------------------------------- */ jlast = i ; j = Next [i] ; ASSERT (j >= EMPTY && j < n) ; while (j != EMPTY) { /* ------------------------------------------------- */ /* check if j and i have identical nonzero pattern */ /* ------------------------------------------------- */ CAMD_DEBUG3 (("compare i "ID" and j "ID"\n", i,j)) ; /* check if i and j have the same Len and Elen */ /* and are in the same bucket */ ASSERT (Len [j] >= 0 && Elen [j] >= 0) ; ASSERT (Pe [j] >= 0 && Pe [j] < iwlen) ; ok = (Len [j] == ln) && (Elen [j] == eln) ; ok = ok && InSameConstraintSet (C,i,j) ; /* skip the first element in the list (me) */ for (p = Pe [j] + 1 ; ok && p <= Pe [j] + ln - 1 ; p++) { ASSERT (Iw [p] >= 0 && Iw [p] < n) ; if (W [Iw [p]] != wflg) ok = 0 ; } if (ok) { /* --------------------------------------------- */ /* found it! j can be absorbed into i */ /* --------------------------------------------- */ CAMD_DEBUG1 (("found it! j "ID" => i "ID"\n", j,i)); Pe [j] = FLIP (i) ; /* both Nv [i] and Nv [j] are negated since they */ /* are in Lme, and the absolute values of each */ /* are the number of variables in i and j: */ Nv [i] += Nv [j] ; Nv [j] = 0 ; Elen [j] = EMPTY ; /* delete j from hash bucket */ ASSERT (j != Next [j]) ; j = Next [j] ; Next [jlast] = j ; } else { /* j cannot be absorbed into i */ jlast = j ; ASSERT (j != Next [j]) ; j = Next [j] ; } ASSERT (j >= EMPTY && j < n) ; } /* ----------------------------------------------------- * no more variables can be absorbed into i * go to next i in bucket and clear flag array * ----------------------------------------------------- */ wflg++ ; i = Next [i] ; ASSERT (i >= EMPTY && i < n) ; } } } CAMD_DEBUG2 (("detect done\n")) ; /* ========================================================================= */ /* RESTORE DEGREE LISTS AND REMOVE NONPRINCIPAL SUPERVARIABLES FROM ELEMENT */ /* ========================================================================= */ p = pme1 ; nleft = n - nel ; for (pme = pme1 ; pme <= pme2 ; pme++) { i = Iw [pme] ; ASSERT (i >= 0 && i < n) ; nvi = -Nv [i] ; CAMD_DEBUG3 (("Restore i "ID" "ID"\n", i, nvi)) ; if (nvi > 0) { /* i is a principal variable in Lme */ /* restore Nv [i] to signify that i is principal */ Nv [i] = nvi ; /* --------------------------------------------------------- */ /* compute the external degree (add size of current element) */ /* --------------------------------------------------------- */ deg = Degree [i] + degme - nvi ; deg = MIN (deg, nleft - nvi) ; ASSERT (deg >= 0 && deg < n) ; /* --------------------------------------------------------- */ /* place the supervariable at the head of the degree list */ /* --------------------------------------------------------- */ if (IsInCurrentSet (C, i, curC)) { inext = Head [deg] ; ASSERT (inext >= EMPTY && inext < n) ; if (inext != EMPTY) Last [inext] = i ; Next [i] = inext ; Last [i] = EMPTY ; Head [deg] = i ; degreeListCounter++ ; } /* --------------------------------------------------------- */ /* save the new degree, and find the minimum degree */ /* --------------------------------------------------------- */ mindeg = MIN (mindeg, deg) ; Degree [i] = deg ; /* --------------------------------------------------------- */ /* place the supervariable in the element pattern */ /* --------------------------------------------------------- */ Iw [p++] = i ; } } CAMD_DEBUG2 (("restore done\n")) ; /* ========================================================================= */ /* FINALIZE THE NEW ELEMENT */ /* ========================================================================= */ CAMD_DEBUG2 (("ME = "ID" DONE\n", me)) ; Nv [me] = nvpiv ; /* save the length of the list for the new element me */ Len [me] = p - pme1 ; if (Len [me] == 0) { /* there is nothing left of the current pivot element */ /* it is a root of the assembly tree */ Pe [me] = EMPTY ; W [me] = 0 ; } if (elenme != 0) { /* element was not constructed in place: deallocate part of */ /* it since newly nonprincipal variables may have been removed */ pfree = p ; } /* Store the element back into BucketSet. This is the way to maintain * the order of roots (Pe[i]=-1) in each Constraint Set. */ BucketSet [pBucket2++] = me ; /* The new element has nvpiv pivots and the size of the contribution * block for a multifrontal method is degme-by-degme, not including * the "dense" rows/columns. If the "dense" rows/columns are included, * the frontal matrix is no larger than * (degme+ndense)-by-(degme+ndense). */ if (Info != (double *) NULL) { f = nvpiv ; r = degme + ndense ; dmax = MAX (dmax, f + r) ; /* number of nonzeros in L (excluding the diagonal) */ lnzme = f*r + (f-1)*f/2 ; lnz += lnzme ; /* number of divide operations for LDL' and for LU */ ndiv += lnzme ; /* number of multiply-subtract pairs for LU */ s = f*r*r + r*(f-1)*f + (f-1)*f*(2*f-1)/6 ; nms_lu += s ; /* number of multiply-subtract pairs for LDL' */ nms_ldl += (s + lnzme)/2 ; } #ifndef NDEBUG CAMD_DEBUG2 (("finalize done nel "ID" n "ID"\n ::::\n", nel, n)) ; for (pme = Pe [me] ; pme <= Pe [me] + Len [me] - 1 ; pme++) { CAMD_DEBUG3 ((" "ID"", Iw [pme])) ; } CAMD_DEBUG3 (("\n")) ; #endif } /* ========================================================================= */ /* DONE SELECTING PIVOTS */ /* ========================================================================= */ if (Info != (double *) NULL) { /* count the work to factorize the ndense-by-ndense submatrix */ f = ndense ; dmax = MAX (dmax, (double) ndense) ; /* number of nonzeros in L (excluding the diagonal) */ lnzme = (f-1)*f/2 ; lnz += lnzme ; /* number of divide operations for LDL' and for LU */ ndiv += lnzme ; /* number of multiply-subtract pairs for LU */ s = (f-1)*f*(2*f-1)/6 ; nms_lu += s ; /* number of multiply-subtract pairs for LDL' */ nms_ldl += (s + lnzme)/2 ; /* number of nz's in L (excl. diagonal) */ Info [CAMD_LNZ] = lnz ; /* number of divide ops for LU and LDL' */ Info [CAMD_NDIV] = ndiv ; /* number of multiply-subtract pairs for LDL' */ Info [CAMD_NMULTSUBS_LDL] = nms_ldl ; /* number of multiply-subtract pairs for LU */ Info [CAMD_NMULTSUBS_LU] = nms_lu ; /* number of "dense" rows/columns */ Info [CAMD_NDENSE] = ndense ; /* largest front is dmax-by-dmax */ Info [CAMD_DMAX] = dmax ; /* number of garbage collections in CAMD */ Info [CAMD_NCMPA] = ncmpa ; /* successful ordering */ Info [CAMD_STATUS] = CAMD_OK ; } /* ========================================================================= */ /* POST-ORDERING */ /* ========================================================================= */ /* ------------------------------------------------------------------------- * Variables at this point: * * Pe: holds the elimination tree. The parent of j is FLIP (Pe [j]), * or EMPTY if j is a root. The tree holds both elements and * non-principal (unordered) variables absorbed into them. * Dense and empty variables are non-principal and unordered. They are * all represented by the fictitious node n (that is, Pe [i] = FLIP (n) * and Elen [i] = EMPTY if i is a dense or empty node). * * Elen: holds the size of each element, including the diagonal part. * FLIP (Elen [e]) > 0 if e is an element. For unordered * variables i, Elen [i] is EMPTY. * * Nv: Nv [e] > 0 is the number of pivots represented by the element e. * For unordered variables i, Nv [i] is zero. * * BucketSet: BucketSet [0.....pBucket2] holds all * the elements that removed during the elimination, in eliminated order. * * * Contents no longer needed: * W, Iw, Len, Degree, Head, Next, Last. * * The matrix itself has been destroyed. * * n: the size of the matrix. * ndense: the number of "dense" nodes. * nnull: the number of empty nodes (zero degree) * No other scalars needed (pfree, iwlen, etc.) * ------------------------------------------------------------------------- */ /* restore Pe */ for (i = 0 ; i < n ; i++) { Pe [i] = FLIP (Pe [i]) ; } /* restore Elen, for output information only */ for (i = 0 ; i < n ; i++) { Elen [i] = FLIP (Elen [i]) ; } /* Now, Pe [j] is the parent of j, or EMPTY if j is a root. * Pe [j] = n if j is a dense/empty node */ /* place all variables in the list of children of their parents */ for (j = n-1 ; j >= 0 ; j--) { if (Nv [j] > 0) continue ; /* skip if j is an element */ ASSERT (Pe [j] >= 0 && Pe [j] <= n) ; Next [j] = Head [Pe [j]] ; /* place j in list of its parent */ Head [Pe [j]] = j ; } /* place all elements in the list of children of their parents */ for (e = n-1 ; e >= 0 ; e--) { if (Nv [e] <= 0) continue ; /* skip if e is a variable */ if (Pe [e] == EMPTY) continue ; /* skip if e is a root */ Next [e] = Head [Pe [e]] ; /* place e in list of its parent */ Head [Pe [e]] = e ; } /* determine where to put the postordering permutation */ if (C != NULL && ndense_or_null > 0) { /* Perm needs to be computed in a temporary workspace, and then * transformed and copied into the output permutation, in Last */ Perm = Degree ; } else { /* the postorder computes the permutation directly, in Last */ Perm = Last ; } /* postorder the elements and their descendants (both elements and * variables), but not (yet) the dense/empty nodes */ for (k = 0 , i = 0 ; i < pBucket2 ; i++) { j = BucketSet [i] ; ASSERT (j >= 0 && j < n) ; if (Pe [j] == EMPTY) { k = CAMD_postorder (j, k, n, Head, Next, Perm, W) ; } } /* Perm [0..k-1] now contains a list of the nonempty/nondense nodes, * ordered via minimum degree and following the constraints. */ CAMD_DEBUG1 (("before dense/empty, k = "ID"\n", k)) ; fflush (stdout) ; ASSERT (k + ndense_or_null == n) ; if (ndense_or_null > 0) { if (C == NULL) { /* postorder the dense/empty nodes (the parent of all these is n) */ CAMD_postorder (n, k, n, Head, Next, Perm, W) ; } else { /* dense (or empty) nodes exist, AND C also exists. The dense/empty * nodes are a link list whose head is Head[n], and Next[i] gives the * next node after i in the list. They need to be sorted by their * constraints, and then merged with Perm [0..k-1].*/ /* count how many dense/empty nodes are in each constraint set */ Bucket = W ; /* use W as workspace (it has size n+1) */ /* count the number of dense/empty nodes in each constraint set */ for (c = 0 ; c <= cmax ; c++) { Bucket [c] = 0 ; } i = 0 ; for (j = Head [n] ; j != EMPTY ; j = Next [j]) { CAMD_DEBUG1 (("Dense/empty node: "ID" : "ID" "ID"\n", j, Pe [j], Elen [j])) ; fflush (stdout) ; ASSERT (Pe [j] == n && Elen [j] == EMPTY) ; i++ ; Bucket [C [j]]++ ; } ASSERT (i == ndense_or_null) ; /* find the cumulative sum of Bucket */ knt1 = 0 ; for (c = 0 ; c <= cmax ; c++) { i = Bucket [c] ; Bucket [c] = knt1 ; knt1 += i ; } CAMD_DEBUG1 (("knt1 "ID" dense/empty "ID"\n", knt1, ndense_or_null)); ASSERT (knt1 == ndense_or_null) ; /* place dense/empty nodes in BucketSet, in constraint order, * ties in natural order */ for (j = Head [n] ; j != EMPTY ; j = Next [j]) { BucketSet [Bucket [C [j]]++] = j ; } #ifndef NDEBUG /* each set is in monotonically increasing order of constraints */ for (i = 1 ; i < k ; i++) { ASSERT (C [Perm [i]] >= C [Perm [i-1]]) ; } for (i = 1 ; i < ndense_or_null ; i++) { /* in order of constraints, with ties in natural order */ ASSERT ( (C [BucketSet [i]] > C [BucketSet [i-1]]) || (C [BucketSet [i]] == C [BucketSet [i-1]] && (BucketSet [i] > BucketSet [i-1]))) ; } #endif /* merge Perm [0..k-1] and BucketSet [0..ndense+nnull] */ p1 = 0 ; p2 = 0 ; p3 = 0 ; while (p1 < k && p2 < ndense_or_null) { /* place the dense/empty nodes at the end of each constraint * set, after the non-dense/non-empty nodes in the same set */ if (C [Perm [p1]] <= C [BucketSet [p2]]) { /* non-dense/non-empty node */ Last [p3++] = Perm [p1++] ; } else { /* dense/empty node */ Last [p3++] = BucketSet [p2++] ; } } /* wrap up; either Perm[0..k-1] or BucketSet[ ] is used up */ while (p1 < k) { Last [p3++] = Perm [p1++] ; } while (p2 < ndense_or_null) { Last [p3++] = BucketSet [p2++] ; } } } #ifndef NDEBUG CAMD_DEBUG1 (("\nFinal constrained ordering:\n")) ; i = 0 ; CAMD_DEBUG1 (("Last ["ID"] = "ID", C["ID"] = "ID"\n", i, Last [i], Last [i], C [Last [i]])) ; for (i = 1 ; i < n ; i++) { CAMD_DEBUG1 (("Last ["ID"] = "ID", C["ID"] = "ID"\n", i, Last [i], Last [i], C [Last [i]])) ; /* This is the critical assertion. It states that the permutation * satisfies the constraints. */ ASSERT (C [Last [i]] >= C [Last [i-1]]) ; } #endif } JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_aat.c0000664000175000017500000001142514224052371017431 00000000000000/* ========================================================================= */ /* === CAMD_aat ============================================================ */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* CAMD_aat: compute the symmetry of the pattern of A, and count the number of * nonzeros each column of A+A' (excluding the diagonal). Assumes the input * matrix has no errors, with sorted columns and no duplicates * (CAMD_valid (n, n, Ap, Ai) must be CAMD_OK, but this condition is not * checked). */ #include "camd_internal.h" GLOBAL size_t CAMD_aat /* returns nz in A+A' */ ( Int n, const Int Ap [ ], const Int Ai [ ], Int Len [ ], /* Len [j]: length of column j of A+A', excl diagonal*/ Int Tp [ ], /* workspace of size n */ double Info [ ] ) { Int p1, p2, p, i, j, pj, pj2, k, nzdiag, nzboth, nz ; double sym ; size_t nzaat ; #ifndef NDEBUG CAMD_debug_init ("CAMD AAT") ; for (k = 0 ; k < n ; k++) Tp [k] = EMPTY ; ASSERT (CAMD_valid (n, n, Ap, Ai) == CAMD_OK) ; #endif if (Info != (double *) NULL) { /* clear the Info array, if it exists */ for (i = 0 ; i < CAMD_INFO ; i++) { Info [i] = EMPTY ; } Info [CAMD_STATUS] = CAMD_OK ; } for (k = 0 ; k < n ; k++) { Len [k] = 0 ; } nzdiag = 0 ; nzboth = 0 ; nz = Ap [n] ; for (k = 0 ; k < n ; k++) { p1 = Ap [k] ; p2 = Ap [k+1] ; CAMD_DEBUG2 (("\nAAT Column: "ID" p1: "ID" p2: "ID"\n", k, p1, p2)) ; /* construct A+A' */ for (p = p1 ; p < p2 ; ) { /* scan the upper triangular part of A */ j = Ai [p] ; if (j < k) { /* entry A (j,k) is in the strictly upper triangular part, * add both A (j,k) and A (k,j) to the matrix A+A' */ Len [j]++ ; Len [k]++ ; CAMD_DEBUG3 ((" upper ("ID","ID") ("ID","ID")\n", j,k, k,j)); p++ ; } else if (j == k) { /* skip the diagonal */ p++ ; nzdiag++ ; break ; } else /* j > k */ { /* first entry below the diagonal */ break ; } /* scan lower triangular part of A, in column j until reaching * row k. Start where last scan left off. */ ASSERT (Tp [j] != EMPTY) ; ASSERT (Ap [j] <= Tp [j] && Tp [j] <= Ap [j+1]) ; pj2 = Ap [j+1] ; for (pj = Tp [j] ; pj < pj2 ; ) { i = Ai [pj] ; if (i < k) { /* A (i,j) is only in the lower part, not in upper. * add both A (i,j) and A (j,i) to the matrix A+A' */ Len [i]++ ; Len [j]++ ; CAMD_DEBUG3 ((" lower ("ID","ID") ("ID","ID")\n", i,j, j,i)) ; pj++ ; } else if (i == k) { /* entry A (k,j) in lower part and A (j,k) in upper */ pj++ ; nzboth++ ; break ; } else /* i > k */ { /* consider this entry later, when k advances to i */ break ; } } Tp [j] = pj ; } /* Tp [k] points to the entry just below the diagonal in column k */ Tp [k] = p ; } /* clean up, for remaining mismatched entries */ for (j = 0 ; j < n ; j++) { for (pj = Tp [j] ; pj < Ap [j+1] ; pj++) { i = Ai [pj] ; /* A (i,j) is only in the lower part, not in upper. * add both A (i,j) and A (j,i) to the matrix A+A' */ Len [i]++ ; Len [j]++ ; CAMD_DEBUG3 ((" lower cleanup ("ID","ID") ("ID","ID")\n", i,j, j,i)) ; } } /* --------------------------------------------------------------------- */ /* compute the symmetry of the nonzero pattern of A */ /* --------------------------------------------------------------------- */ /* Given a matrix A, the symmetry of A is: * B = tril (spones (A), -1) + triu (spones (A), 1) ; * sym = nnz (B & B') / nnz (B) ; * or 1 if nnz (B) is zero. */ if (nz == nzdiag) { sym = 1 ; } else { sym = (2 * (double) nzboth) / ((double) (nz - nzdiag)) ; } nzaat = 0 ; for (k = 0 ; k < n ; k++) { nzaat += Len [k] ; } CAMD_DEBUG1 (("CAMD nz in A+A', excluding diagonal (nzaat) = %g\n", (double) nzaat)) ; CAMD_DEBUG1 ((" nzboth: "ID" nz: "ID" nzdiag: "ID" symmetry: %g\n", nzboth, nz, nzdiag, sym)) ; if (Info != (double *) NULL) { Info [CAMD_STATUS] = CAMD_OK ; Info [CAMD_N] = n ; Info [CAMD_NZ] = nz ; Info [CAMD_SYMMETRY] = sym ; /* symmetry of pattern of A */ Info [CAMD_NZDIAG] = nzdiag ; /* nonzeros on diagonal of A */ Info [CAMD_NZ_A_PLUS_AT] = nzaat ; /* nonzeros in A+A' */ } return (nzaat) ; } JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_control.c0000664000175000017500000000352014224052371020341 00000000000000/* ========================================================================= */ /* === CAMD_control ======================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* User-callable. Prints the control parameters for CAMD. See camd.h * for details. If the Control array is not present, the defaults are * printed instead. */ #include "camd_internal.h" GLOBAL void CAMD_control ( double Control [ ] ) { double alpha ; Int aggressive ; if (Control != (double *) NULL) { alpha = Control [CAMD_DENSE] ; aggressive = Control [CAMD_AGGRESSIVE] != 0 ; } else { alpha = CAMD_DEFAULT_DENSE ; aggressive = CAMD_DEFAULT_AGGRESSIVE ; } SUITESPARSE_PRINTF (( "\ncamd version %d.%d, %s: approximate minimum degree ordering:\n" " dense row parameter: %g\n", CAMD_MAIN_VERSION, CAMD_SUB_VERSION, CAMD_DATE, alpha)) ; if (alpha < 0) { SUITESPARSE_PRINTF ((" no rows treated as dense\n")) ; } else { SUITESPARSE_PRINTF (( " (rows with more than max (%g * sqrt (n), 16) entries are\n" " considered \"dense\", and placed last in output permutation)\n", alpha)) ; } if (aggressive) { SUITESPARSE_PRINTF ((" aggressive absorption: yes\n")) ; } else { SUITESPARSE_PRINTF ((" aggressive absorption: no\n")) ; } SUITESPARSE_PRINTF ((" size of CAMD integer: %d\n\n", sizeof (Int))) ; } JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_defaults.c0000664000175000017500000000237214224052371020474 00000000000000/* ========================================================================= */ /* === CAMD_defaults ======================================================= */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* User-callable. Sets default control parameters for CAMD. See camd.h * for details. */ #include "camd_internal.h" /* ========================================================================= */ /* === CAMD defaults ======================================================= */ /* ========================================================================= */ GLOBAL void CAMD_defaults ( double Control [ ] ) { Int i ; if (Control != (double *) NULL) { for (i = 0 ; i < CAMD_CONTROL ; i++) { Control [i] = 0 ; } Control [CAMD_DENSE] = CAMD_DEFAULT_DENSE ; Control [CAMD_AGGRESSIVE] = CAMD_DEFAULT_AGGRESSIVE ; } } JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_dump.c0000664000175000017500000001243514224052371017633 00000000000000/* ========================================================================= */ /* === CAMD_dump =========================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* Debugging routines for CAMD. Not used if NDEBUG is not defined at compile- * time (the default). See comments in camd_internal.h on how to enable * debugging. Not user-callable. */ #include "camd_internal.h" #ifndef NDEBUG /* This global variable is present only when debugging */ GLOBAL Int CAMD_debug = -999 ; /* default is no debug printing */ /* ========================================================================= */ /* === CAMD_debug_init ===================================================== */ /* ========================================================================= */ /* Sets the debug print level, by reading the file debug.camd (if it exists) */ GLOBAL void CAMD_debug_init ( char *s ) { FILE *f ; f = fopen ("debug.camd", "r") ; if (f == (FILE *) NULL) { CAMD_debug = -999 ; } else { fscanf (f, ID, &CAMD_debug) ; fclose (f) ; } if (CAMD_debug >= 0) { printf ("%s: CAMD_debug_init, D= "ID"\n", s, CAMD_debug) ; } } /* ========================================================================= */ /* === CAMD_dump =========================================================== */ /* ========================================================================= */ /* Dump CAMD's data structure, except for the hash buckets. This routine * cannot be called when the hash buckets are non-empty. */ GLOBAL void CAMD_dump ( Int n, /* A is n-by-n */ Int Pe [ ], /* pe [0..n-1]: index in iw of start of row i */ Int Iw [ ], /* workspace of size iwlen, iwlen [0..pfree-1] * holds the matrix on input */ Int Len [ ], /* len [0..n-1]: length for row i */ Int iwlen, /* length of iw */ Int pfree, /* iw [pfree ... iwlen-1] is empty on input */ Int Nv [ ], /* nv [0..n-1] */ Int Next [ ], /* next [0..n-1] */ Int Last [ ], /* last [0..n-1] */ Int Head [ ], /* head [0..n-1] */ Int Elen [ ], /* size n */ Int Degree [ ], /* size n */ Int W [ ], /* size n */ Int nel, Int BucketSet [ ], const Int C [ ], Int CurC ) { Int i, pe, elen, nv, len, e, p, k, j, deg, w, cnt, ilast ; if (CAMD_debug < 0) return ; ASSERT (pfree <= iwlen) ; CAMD_DEBUG3 (("\nCAMD dump, pfree: "ID"\n", pfree)) ; for (i = 0 ; i < n ; i++) { pe = Pe [i] ; elen = Elen [i] ; nv = Nv [i] ; len = Len [i] ; w = W [i] ; if (elen >= EMPTY) { if (nv == 0) { CAMD_DEBUG4 (("\nI "ID": nonprincipal: ", i)) ; ASSERT (elen == EMPTY) ; if (pe == FLIP(n)) { CAMD_DEBUG4 ((" dense node\n")) ; ASSERT (w == 1) ; } else { ASSERT (pe < EMPTY) ; CAMD_DEBUG4 ((" i "ID" -> parent "ID"\n", i, FLIP (Pe[i]))); } } else { CAMD_DEBUG4 (("\nI "ID": active principal supervariable:\n",i)); CAMD_DEBUG4 ((" nv(i): "ID" Flag: %d\n", nv, (nv < 0))) ; ASSERT (elen >= 0) ; ASSERT (nv > 0 && pe >= 0) ; p = pe ; CAMD_DEBUG4 ((" e/s: ")) ; if (elen == 0) CAMD_DEBUG4 ((" : ")) ; ASSERT (pe + len <= pfree) ; for (k = 0 ; k < len ; k++) { j = Iw [p] ; CAMD_DEBUG4 ((" "ID"", j)) ; ASSERT (j >= 0 && j < n) ; if (k == elen-1) CAMD_DEBUG4 ((" : ")) ; p++ ; } CAMD_DEBUG4 (("\n")) ; } } else { e = i ; if (w == 0) { CAMD_DEBUG4 (("\nE "ID": absorbed element: w "ID"\n", e, w)) ; ASSERT (nv > 0 && pe < 0) ; CAMD_DEBUG4 ((" e "ID" -> parent "ID"\n", e, FLIP (Pe [e]))) ; } else { CAMD_DEBUG4 (("\nE "ID": unabsorbed element: w "ID"\n", e, w)) ; ASSERT (nv > 0 && pe >= 0) ; p = pe ; CAMD_DEBUG4 ((" : ")) ; ASSERT (pe + len <= pfree) ; for (k = 0 ; k < len ; k++) { j = Iw [p] ; CAMD_DEBUG4 ((" "ID"", j)) ; ASSERT (j >= 0 && j < n) ; p++ ; } CAMD_DEBUG4 (("\n")) ; } } CAMD_DEBUG4 (("C[i] is :"ID"\n", (C == NULL) ? 0 : C [i])); } /* this routine cannot be called when the hash buckets are non-empty */ CAMD_DEBUG4 (("\nDegree lists:\n")) ; if (nel >= 0) { cnt = 0 ; for (deg = 0 ; deg < n ; deg++) { if (Head [deg] == EMPTY) continue ; ilast = EMPTY ; CAMD_DEBUG4 ((ID": \n", deg)) ; for (i = Head [deg] ; i != EMPTY ; i = Next [i]) { CAMD_DEBUG4 ((" "ID" : next "ID" last "ID" deg "ID"\n", i, Next [i], Last [i], Degree [i])) ; ASSERT (i >= 0 && i < n && ilast == Last [i] && deg == Degree [i]) ; cnt += Nv [i] ; ilast = i ; } CAMD_DEBUG4 (("\n")) ; } } CAMD_DEBUG4(("\nCurrent C[i] is "ID". current Buckets are:\n", CurC)) ; for (i = 0 ; i < n ; i++) { if ((C == NULL) ? 1 : (C [BucketSet [i]] <= CurC)) CAMD_DEBUG4((ID",",BucketSet [i])); } CAMD_DEBUG4 (("\n")) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_global.c0000664000175000017500000000153014224052371020120 00000000000000/* ========================================================================= */ /* === camd_global ========================================================= */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* In prior versions of CAMD, this file declared the camd_malloc, camd_free, camd_realloc, camd_calloc, and camd_printf functions. They are now replaced by functions defined in SuiteSparse_config/SuiteSparse_config.c. */ JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_info.c0000664000175000017500000001036214224052371017616 00000000000000/* ========================================================================= */ /* === CAMD_info =========================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* User-callable. Prints the output statistics for CAMD. See camd.h * for details. If the Info array is not present, nothing is printed. */ #include "camd_internal.h" #define PRI(format,x) { if (x >= 0) { SUITESPARSE_PRINTF ((format, x)) ; }} GLOBAL void CAMD_info ( double Info [ ] ) { double n, ndiv, nmultsubs_ldl, nmultsubs_lu, lnz, lnzd ; SUITESPARSE_PRINTF (("\nCAMD version %d.%d.%d, %s, results:\n", CAMD_MAIN_VERSION, CAMD_SUB_VERSION, CAMD_SUBSUB_VERSION, CAMD_DATE)) ; if (!Info) { return ; } n = Info [CAMD_N] ; ndiv = Info [CAMD_NDIV] ; nmultsubs_ldl = Info [CAMD_NMULTSUBS_LDL] ; nmultsubs_lu = Info [CAMD_NMULTSUBS_LU] ; lnz = Info [CAMD_LNZ] ; lnzd = (n >= 0 && lnz >= 0) ? (n + lnz) : (-1) ; /* CAMD return status */ SUITESPARSE_PRINTF ((" status: ")) ; if (Info [CAMD_STATUS] == CAMD_OK) { SUITESPARSE_PRINTF (("OK\n")) ; } else if (Info [CAMD_STATUS] == CAMD_OUT_OF_MEMORY) { SUITESPARSE_PRINTF (("out of memory\n")) ; } else if (Info [CAMD_STATUS] == CAMD_INVALID) { SUITESPARSE_PRINTF (("invalid matrix\n")) ; } else if (Info [CAMD_STATUS] == CAMD_OK_BUT_JUMBLED) { SUITESPARSE_PRINTF (("OK, but jumbled\n")) ; } else { SUITESPARSE_PRINTF (("unknown\n")) ; } /* statistics about the input matrix */ PRI (" n, dimension of A: %.20g\n", n); PRI (" nz, number of nonzeros in A: %.20g\n", Info [CAMD_NZ]) ; PRI (" symmetry of A: %.4f\n", Info [CAMD_SYMMETRY]) ; PRI (" number of nonzeros on diagonal: %.20g\n", Info [CAMD_NZDIAG]) ; PRI (" nonzeros in pattern of A+A' (excl. diagonal): %.20g\n", Info [CAMD_NZ_A_PLUS_AT]) ; PRI (" # dense rows/columns of A+A': %.20g\n", Info [CAMD_NDENSE]) ; /* statistics about CAMD's behavior */ PRI (" memory used, in bytes: %.20g\n", Info [CAMD_MEMORY]) ; PRI (" # of memory compactions: %.20g\n", Info [CAMD_NCMPA]) ; /* statistics about the ordering quality */ SUITESPARSE_PRINTF (("\n" " The following approximate statistics are for a subsequent\n" " factorization of A(P,P) + A(P,P)'. They are slight upper\n" " bounds if there are no dense rows/columns in A+A', and become\n" " looser if dense rows/columns exist.\n\n")) ; PRI (" nonzeros in L (excluding diagonal): %.20g\n", lnz) ; PRI (" nonzeros in L (including diagonal): %.20g\n", lnzd) ; PRI (" # divide operations for LDL' or LU: %.20g\n", ndiv) ; PRI (" # multiply-subtract operations for LDL': %.20g\n", nmultsubs_ldl) ; PRI (" # multiply-subtract operations for LU: %.20g\n", nmultsubs_lu) ; PRI (" max nz. in any column of L (incl. diagonal): %.20g\n", Info [CAMD_DMAX]) ; /* total flop counts for various factorizations */ if (n >= 0 && ndiv >= 0 && nmultsubs_ldl >= 0 && nmultsubs_lu >= 0) { SUITESPARSE_PRINTF (("\n" " chol flop count for real A, sqrt counted as 1 flop: %.20g\n" " LDL' flop count for real A: %.20g\n" " LDL' flop count for complex A: %.20g\n" " LU flop count for real A (with no pivoting): %.20g\n" " LU flop count for complex A (with no pivoting): %.20g\n\n", n + ndiv + 2*nmultsubs_ldl, ndiv + 2*nmultsubs_ldl, 9*ndiv + 8*nmultsubs_ldl, ndiv + 2*nmultsubs_lu, 9*ndiv + 8*nmultsubs_lu)) ; } } JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_order.c0000664000175000017500000001375514224052371020007 00000000000000/* ========================================================================= */ /* === CAMD_order ========================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* User-callable CAMD minimum degree ordering routine. See camd.h for * documentation. */ #include "camd_internal.h" /* ========================================================================= */ /* === CAMD_order ========================================================== */ /* ========================================================================= */ GLOBAL Int CAMD_order ( Int n, const Int Ap [ ], const Int Ai [ ], Int P [ ], double Control [ ], double Info [ ], const Int C [ ] ) { Int *Len, *S, nz, i, *Pinv, info, status, *Rp, *Ri, *Cp, *Ci, ok ; size_t nzaat, slen ; double mem = 0 ; #ifndef NDEBUG CAMD_debug_init ("camd") ; #endif /* clear the Info array, if it exists */ info = Info != (double *) NULL ; if (info) { for (i = 0 ; i < CAMD_INFO ; i++) { Info [i] = EMPTY ; } Info [CAMD_N] = n ; Info [CAMD_STATUS] = CAMD_OK ; } /* make sure inputs exist and n is >= 0 */ if (Ai == (Int *) NULL || Ap == (Int *) NULL || P == (Int *) NULL || n < 0) { if (info) Info [CAMD_STATUS] = CAMD_INVALID ; return (CAMD_INVALID) ; /* arguments are invalid */ } if (n == 0) { return (CAMD_OK) ; /* n is 0 so there's nothing to do */ } nz = Ap [n] ; if (info) { Info [CAMD_NZ] = nz ; } if (nz < 0) { if (info) Info [CAMD_STATUS] = CAMD_INVALID ; return (CAMD_INVALID) ; } /* check if n or nz will cause size_t overflow */ if ((size_t) n >= SIZE_T_MAX / sizeof (Int) || (size_t) nz >= SIZE_T_MAX / sizeof (Int)) { if (info) Info [CAMD_STATUS] = CAMD_OUT_OF_MEMORY ; return (CAMD_OUT_OF_MEMORY) ; /* problem too large */ } /* check the input matrix: CAMD_OK, CAMD_INVALID, or CAMD_OK_BUT_JUMBLED */ status = CAMD_valid (n, n, Ap, Ai) ; if (status == CAMD_INVALID) { if (info) Info [CAMD_STATUS] = CAMD_INVALID ; return (CAMD_INVALID) ; /* matrix is invalid */ } /* allocate two size-n integer workspaces */ Len = SuiteSparse_malloc (n, sizeof (Int)) ; Pinv = SuiteSparse_malloc (n, sizeof (Int)) ; mem += n ; mem += n ; if (!Len || !Pinv) { /* :: out of memory :: */ SuiteSparse_free (Len) ; SuiteSparse_free (Pinv) ; if (info) Info [CAMD_STATUS] = CAMD_OUT_OF_MEMORY ; return (CAMD_OUT_OF_MEMORY) ; } if (status == CAMD_OK_BUT_JUMBLED) { /* sort the input matrix and remove duplicate entries */ CAMD_DEBUG1 (("Matrix is jumbled\n")) ; Rp = SuiteSparse_malloc (n+1, sizeof (Int)) ; Ri = SuiteSparse_malloc (nz, sizeof (Int)) ; mem += (n+1) ; mem += MAX (nz,1) ; if (!Rp || !Ri) { /* :: out of memory :: */ SuiteSparse_free (Rp) ; SuiteSparse_free (Ri) ; SuiteSparse_free (Len) ; SuiteSparse_free (Pinv) ; if (info) Info [CAMD_STATUS] = CAMD_OUT_OF_MEMORY ; return (CAMD_OUT_OF_MEMORY) ; } /* use Len and Pinv as workspace to create R = A' */ CAMD_preprocess (n, Ap, Ai, Rp, Ri, Len, Pinv) ; Cp = Rp ; Ci = Ri ; } else { /* order the input matrix as-is. No need to compute R = A' first */ Rp = NULL ; Ri = NULL ; Cp = (Int *) Ap ; Ci = (Int *) Ai ; } /* --------------------------------------------------------------------- */ /* determine the symmetry and count off-diagonal nonzeros in A+A' */ /* --------------------------------------------------------------------- */ nzaat = CAMD_aat (n, Cp, Ci, Len, P, Info) ; CAMD_DEBUG1 (("nzaat: %g\n", (double) nzaat)) ; ASSERT ((MAX (nz-n, 0) <= nzaat) && (nzaat <= 2 * (size_t) nz)) ; /* --------------------------------------------------------------------- */ /* allocate workspace for matrix, elbow room, and 7 size-n vectors */ /* --------------------------------------------------------------------- */ S = NULL ; slen = nzaat ; /* space for matrix */ ok = ((slen + nzaat/5) >= slen) ; /* check for size_t overflow */ slen += nzaat/5 ; /* add elbow room */ for (i = 0 ; ok && i < 8 ; i++) { ok = ((slen + n+1) > slen) ; /* check for size_t overflow */ slen += (n+1) ; /* size-n elbow room, 7 size-(n+1) workspace */ } mem += slen ; ok = ok && (slen < SIZE_T_MAX / sizeof (Int)) ; /* check for overflow */ ok = ok && (slen < Int_MAX) ; /* S[i] for Int i must be OK */ if (ok) { S = SuiteSparse_malloc (slen, sizeof (Int)) ; } CAMD_DEBUG1 (("slen %g\n", (double) slen)) ; if (!S) { /* :: out of memory :: (or problem too large) */ SuiteSparse_free (Rp) ; SuiteSparse_free (Ri) ; SuiteSparse_free (Len) ; SuiteSparse_free (Pinv) ; if (info) Info [CAMD_STATUS] = CAMD_OUT_OF_MEMORY ; return (CAMD_OUT_OF_MEMORY) ; } if (info) { /* memory usage, in bytes. */ Info [CAMD_MEMORY] = mem * sizeof (Int) ; } /* --------------------------------------------------------------------- */ /* order the matrix */ /* --------------------------------------------------------------------- */ CAMD_1 (n, Cp, Ci, P, Pinv, Len, slen, S, Control, Info, C) ; /* --------------------------------------------------------------------- */ /* free the workspace */ /* --------------------------------------------------------------------- */ SuiteSparse_free (Rp) ; SuiteSparse_free (Ri) ; SuiteSparse_free (Len) ; SuiteSparse_free (Pinv) ; SuiteSparse_free (S) ; if (info) Info [CAMD_STATUS] = status ; return (status) ; /* successful ordering */ } JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_postorder.c0000664000175000017500000000356514224052371020713 00000000000000/* ========================================================================= */ /* === CAMD_postorder ====================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* Perform a postordering (via depth-first search) of an assembly tree. */ #include "camd_internal.h" GLOBAL Int CAMD_postorder ( Int j, /* start at node j, a root of the assembly tree */ Int k, /* on input, next node is the kth node */ Int n, /* normal nodes 0 to n-1, place-holder node n */ Int head [], /* head of link list of children of each node */ Int next [], /* next[i] is the next child after i in link list */ Int post [], /* postordering, post [k] = p if p is the kth node */ Int stack [] /* recursion stack */ ) { int i, p, top = 0 ; stack [0] = j ; /* place j on the stack, maybe place-holder node n */ while (top >= 0) /* while (stack is not empty) */ { p = stack [top] ; /* p = top of stack */ i = head [p] ; /* i = youngest child of p */ if (i == -1) { top-- ; /* p has no unordered children left */ if (p != n) { /* node p is the kth postordered node. Do not postorder the * place-holder node n, which is the root of a subtree * containing all dense and empty nodes. */ post [k++] = p ; } } else { head [p] = next [i] ; /* remove i from children of p */ stack [++top] = i ; /* start dfs on child node i */ } } return (k) ; } JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_preprocess.c0000664000175000017500000000737014224052371021055 00000000000000/* ========================================================================= */ /* === CAMD_preprocess ===================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* Sorts, removes duplicate entries, and transposes from the nonzero pattern of * a column-form matrix A, to obtain the matrix R. The input matrix can have * duplicate entries and/or unsorted columns (CAMD_valid (n,Ap,Ai) must not be * CAMD_INVALID). * * This input condition is NOT checked. This routine is not user-callable. */ #include "camd_internal.h" /* ========================================================================= */ /* === CAMD_preprocess ===================================================== */ /* ========================================================================= */ /* CAMD_preprocess does not check its input for errors or allocate workspace. * On input, the condition (CAMD_valid (n,n,Ap,Ai) != CAMD_INVALID) must hold. */ GLOBAL void CAMD_preprocess ( Int n, /* input matrix: A is n-by-n */ const Int Ap [ ], /* size n+1 */ const Int Ai [ ], /* size nz = Ap [n] */ /* output matrix R: */ Int Rp [ ], /* size n+1 */ Int Ri [ ], /* size nz (or less, if duplicates present) */ Int W [ ], /* workspace of size n */ Int Flag [ ] /* workspace of size n */ ) { /* --------------------------------------------------------------------- */ /* local variables */ /* --------------------------------------------------------------------- */ Int i, j, p, p2 ; ASSERT (CAMD_valid (n, n, Ap, Ai) != CAMD_INVALID) ; /* --------------------------------------------------------------------- */ /* count the entries in each row of A (excluding duplicates) */ /* --------------------------------------------------------------------- */ for (i = 0 ; i < n ; i++) { W [i] = 0 ; /* # of nonzeros in row i (excl duplicates) */ Flag [i] = EMPTY ; /* Flag [i] = j if i appears in column j */ } for (j = 0 ; j < n ; j++) { p2 = Ap [j+1] ; for (p = Ap [j] ; p < p2 ; p++) { i = Ai [p] ; if (Flag [i] != j) { /* row index i has not yet appeared in column j */ W [i]++ ; /* one more entry in row i */ Flag [i] = j ; /* flag row index i as appearing in col j*/ } } } /* --------------------------------------------------------------------- */ /* compute the row pointers for R */ /* --------------------------------------------------------------------- */ Rp [0] = 0 ; for (i = 0 ; i < n ; i++) { Rp [i+1] = Rp [i] + W [i] ; } for (i = 0 ; i < n ; i++) { W [i] = Rp [i] ; Flag [i] = EMPTY ; } /* --------------------------------------------------------------------- */ /* construct the row form matrix R */ /* --------------------------------------------------------------------- */ /* R = row form of pattern of A */ for (j = 0 ; j < n ; j++) { p2 = Ap [j+1] ; for (p = Ap [j] ; p < p2 ; p++) { i = Ai [p] ; if (Flag [i] != j) { /* row index i has not yet appeared in column j */ Ri [W [i]++] = j ; /* put col j in row i */ Flag [i] = j ; /* flag row index i as appearing in col j*/ } } } #ifndef NDEBUG ASSERT (CAMD_valid (n, n, Rp, Ri) == CAMD_OK) ; for (j = 0 ; j < n ; j++) { ASSERT (W [j] == Rp [j+1]) ; } #endif } JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Source/camd_valid.c0000664000175000017500000000633514224052371017767 00000000000000/* ========================================================================= */ /* === CAMD_valid ========================================================== */ /* ========================================================================= */ /* ------------------------------------------------------------------------- */ /* CAMD, Copyright (c) Timothy A. Davis, Yanqing Chen, */ /* Patrick R. Amestoy, and Iain S. Duff. See ../README.txt for License. */ /* email: DrTimothyAldenDavis@gmail.com */ /* ------------------------------------------------------------------------- */ /* Check if a column-form matrix is valid or not. The matrix A is * n_row-by-n_col. The row indices of entries in column j are in * Ai [Ap [j] ... Ap [j+1]-1]. Required conditions are: * * n_row >= 0 * n_col >= 0 * nz = Ap [n_col] >= 0 number of entries in the matrix * Ap [0] == 0 * Ap [j] <= Ap [j+1] for all j in the range 0 to n_col. * Ai [0 ... nz-1] must be in the range 0 to n_row-1. * * If any of the above conditions hold, CAMD_INVALID is returned. If the * following condition holds, CAMD_OK_BUT_JUMBLED is returned (a warning, * not an error): * * row indices in Ai [Ap [j] ... Ap [j+1]-1] are not sorted in ascending * order, and/or duplicate entries exist. * * Otherwise, CAMD_OK is returned. */ #include "camd_internal.h" GLOBAL Int CAMD_valid ( /* inputs, not modified on output: */ Int n_row, /* A is n_row-by-n_col */ Int n_col, const Int Ap [ ], /* column pointers of A, of size n_col+1 */ const Int Ai [ ] /* row indices of A, of size nz = Ap [n_col] */ ) { Int nz, j, p1, p2, ilast, i, p, result = CAMD_OK ; if (n_row < 0 || n_col < 0 || Ap == NULL || Ai == NULL) { return (CAMD_INVALID) ; } nz = Ap [n_col] ; if (Ap [0] != 0 || nz < 0) { /* column pointers must start at Ap [0] = 0, and Ap [n] must be >= 0 */ CAMD_DEBUG0 (("column 0 pointer bad or nz < 0\n")) ; return (CAMD_INVALID) ; } for (j = 0 ; j < n_col ; j++) { p1 = Ap [j] ; p2 = Ap [j+1] ; CAMD_DEBUG2 (("\nColumn: "ID" p1: "ID" p2: "ID"\n", j, p1, p2)) ; if (p1 > p2) { /* column pointers must be ascending */ CAMD_DEBUG0 (("column "ID" pointer bad\n", j)) ; return (CAMD_INVALID) ; } ilast = EMPTY ; for (p = p1 ; p < p2 ; p++) { i = Ai [p] ; CAMD_DEBUG3 (("row: "ID"\n", i)) ; if (i < 0 || i >= n_row) { /* row index out of range */ CAMD_DEBUG0 (("index out of range, col "ID" row "ID"\n", j, i)); return (CAMD_INVALID) ; } if (i <= ilast) { /* row index unsorted, or duplicate entry present */ CAMD_DEBUG1 (("index unsorted/dupl col "ID" row "ID"\n", j, i)); result = CAMD_OK_BUT_JUMBLED ; } ilast = i ; } } return (result) ; } GLOBAL Int CAMD_cvalid /* return TRUE if the Constraint set is valid, * FALSE otherwise */ ( /* inputs, not modified on output: */ Int n, /* the length of constraint set */ const Int C [ ] /* constraint set */ ) { Int i ; if (C != NULL) { for (i = 0 ; i < n ; i++) { if (C [i] < 0 || C [i] > n - 1) { CAMD_DEBUG0 (("C["ID"] = "ID" invalid\n", i, C [i])) ; return (FALSE) ; } } } return (TRUE) ; } JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Makefile.am0000664000175000017500000000110314224052371016320 00000000000000noinst_LTLIBRARIES = camd.la camd_la_SOURCES = \ Source/camd_1.c \ Source/camd_2.c \ Source/camd_aat.c \ Source/camd_control.c \ Source/camd_defaults.c \ Source/camd_dump.c \ Source/camd_global.c \ Source/camd_info.c \ Source/camd_order.c \ Source/camd_postorder.c \ Source/camd_preprocess.c \ Source/camd_valid.c camd_la_CPPFLAGS = -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CAMD/Include noinst_HEADERS = \ Include/camd.h \ Include/camd_internal.h camd_la_LDFLAGS = -no-undefined -module -avoid-version DIST_EXTRA = README.txt JAGS-4.3.2/src/modules/glm/SSparse/CAMD/Makefile.in0000644000175000017500000011251514400675236016350 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/CAMD ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) camd_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_camd_la_OBJECTS = Source/camd_la-camd_1.lo Source/camd_la-camd_2.lo \ Source/camd_la-camd_aat.lo Source/camd_la-camd_control.lo \ Source/camd_la-camd_defaults.lo Source/camd_la-camd_dump.lo \ Source/camd_la-camd_global.lo Source/camd_la-camd_info.lo \ Source/camd_la-camd_order.lo Source/camd_la-camd_postorder.lo \ Source/camd_la-camd_preprocess.lo Source/camd_la-camd_valid.lo camd_la_OBJECTS = $(am_camd_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = camd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(camd_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = Source/$(DEPDIR)/camd_la-camd_1.Plo \ Source/$(DEPDIR)/camd_la-camd_2.Plo \ Source/$(DEPDIR)/camd_la-camd_aat.Plo \ Source/$(DEPDIR)/camd_la-camd_control.Plo \ Source/$(DEPDIR)/camd_la-camd_defaults.Plo \ Source/$(DEPDIR)/camd_la-camd_dump.Plo \ Source/$(DEPDIR)/camd_la-camd_global.Plo \ Source/$(DEPDIR)/camd_la-camd_info.Plo \ Source/$(DEPDIR)/camd_la-camd_order.Plo \ Source/$(DEPDIR)/camd_la-camd_postorder.Plo \ Source/$(DEPDIR)/camd_la-camd_preprocess.Plo \ Source/$(DEPDIR)/camd_la-camd_valid.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(camd_la_SOURCES) DIST_SOURCES = $(camd_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = camd.la camd_la_SOURCES = \ Source/camd_1.c \ Source/camd_2.c \ Source/camd_aat.c \ Source/camd_control.c \ Source/camd_defaults.c \ Source/camd_dump.c \ Source/camd_global.c \ Source/camd_info.c \ Source/camd_order.c \ Source/camd_postorder.c \ Source/camd_preprocess.c \ Source/camd_valid.c camd_la_CPPFLAGS = -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CAMD/Include noinst_HEADERS = \ Include/camd.h \ Include/camd_internal.h camd_la_LDFLAGS = -no-undefined -module -avoid-version DIST_EXTRA = README.txt all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/CAMD/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/CAMD/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } Source/$(am__dirstamp): @$(MKDIR_P) Source @: > Source/$(am__dirstamp) Source/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) Source/$(DEPDIR) @: > Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_1.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_2.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_aat.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_control.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_defaults.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_dump.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_global.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_info.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_order.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_postorder.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_preprocess.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/camd_la-camd_valid.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) camd.la: $(camd_la_OBJECTS) $(camd_la_DEPENDENCIES) $(EXTRA_camd_la_DEPENDENCIES) $(AM_V_CCLD)$(camd_la_LINK) $(camd_la_OBJECTS) $(camd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f Source/*.$(OBJEXT) -rm -f Source/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_1.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_aat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_control.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_defaults.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_dump.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_global.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_info.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_order.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_postorder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_preprocess.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/camd_la-camd_valid.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< Source/camd_la-camd_1.lo: Source/camd_1.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_1.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_1.Tpo -c -o Source/camd_la-camd_1.lo `test -f 'Source/camd_1.c' || echo '$(srcdir)/'`Source/camd_1.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_1.Tpo Source/$(DEPDIR)/camd_la-camd_1.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_1.c' object='Source/camd_la-camd_1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_1.lo `test -f 'Source/camd_1.c' || echo '$(srcdir)/'`Source/camd_1.c Source/camd_la-camd_2.lo: Source/camd_2.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_2.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_2.Tpo -c -o Source/camd_la-camd_2.lo `test -f 'Source/camd_2.c' || echo '$(srcdir)/'`Source/camd_2.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_2.Tpo Source/$(DEPDIR)/camd_la-camd_2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_2.c' object='Source/camd_la-camd_2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_2.lo `test -f 'Source/camd_2.c' || echo '$(srcdir)/'`Source/camd_2.c Source/camd_la-camd_aat.lo: Source/camd_aat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_aat.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_aat.Tpo -c -o Source/camd_la-camd_aat.lo `test -f 'Source/camd_aat.c' || echo '$(srcdir)/'`Source/camd_aat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_aat.Tpo Source/$(DEPDIR)/camd_la-camd_aat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_aat.c' object='Source/camd_la-camd_aat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_aat.lo `test -f 'Source/camd_aat.c' || echo '$(srcdir)/'`Source/camd_aat.c Source/camd_la-camd_control.lo: Source/camd_control.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_control.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_control.Tpo -c -o Source/camd_la-camd_control.lo `test -f 'Source/camd_control.c' || echo '$(srcdir)/'`Source/camd_control.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_control.Tpo Source/$(DEPDIR)/camd_la-camd_control.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_control.c' object='Source/camd_la-camd_control.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_control.lo `test -f 'Source/camd_control.c' || echo '$(srcdir)/'`Source/camd_control.c Source/camd_la-camd_defaults.lo: Source/camd_defaults.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_defaults.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_defaults.Tpo -c -o Source/camd_la-camd_defaults.lo `test -f 'Source/camd_defaults.c' || echo '$(srcdir)/'`Source/camd_defaults.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_defaults.Tpo Source/$(DEPDIR)/camd_la-camd_defaults.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_defaults.c' object='Source/camd_la-camd_defaults.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_defaults.lo `test -f 'Source/camd_defaults.c' || echo '$(srcdir)/'`Source/camd_defaults.c Source/camd_la-camd_dump.lo: Source/camd_dump.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_dump.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_dump.Tpo -c -o Source/camd_la-camd_dump.lo `test -f 'Source/camd_dump.c' || echo '$(srcdir)/'`Source/camd_dump.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_dump.Tpo Source/$(DEPDIR)/camd_la-camd_dump.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_dump.c' object='Source/camd_la-camd_dump.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_dump.lo `test -f 'Source/camd_dump.c' || echo '$(srcdir)/'`Source/camd_dump.c Source/camd_la-camd_global.lo: Source/camd_global.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_global.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_global.Tpo -c -o Source/camd_la-camd_global.lo `test -f 'Source/camd_global.c' || echo '$(srcdir)/'`Source/camd_global.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_global.Tpo Source/$(DEPDIR)/camd_la-camd_global.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_global.c' object='Source/camd_la-camd_global.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_global.lo `test -f 'Source/camd_global.c' || echo '$(srcdir)/'`Source/camd_global.c Source/camd_la-camd_info.lo: Source/camd_info.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_info.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_info.Tpo -c -o Source/camd_la-camd_info.lo `test -f 'Source/camd_info.c' || echo '$(srcdir)/'`Source/camd_info.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_info.Tpo Source/$(DEPDIR)/camd_la-camd_info.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_info.c' object='Source/camd_la-camd_info.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_info.lo `test -f 'Source/camd_info.c' || echo '$(srcdir)/'`Source/camd_info.c Source/camd_la-camd_order.lo: Source/camd_order.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_order.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_order.Tpo -c -o Source/camd_la-camd_order.lo `test -f 'Source/camd_order.c' || echo '$(srcdir)/'`Source/camd_order.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_order.Tpo Source/$(DEPDIR)/camd_la-camd_order.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_order.c' object='Source/camd_la-camd_order.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_order.lo `test -f 'Source/camd_order.c' || echo '$(srcdir)/'`Source/camd_order.c Source/camd_la-camd_postorder.lo: Source/camd_postorder.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_postorder.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_postorder.Tpo -c -o Source/camd_la-camd_postorder.lo `test -f 'Source/camd_postorder.c' || echo '$(srcdir)/'`Source/camd_postorder.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_postorder.Tpo Source/$(DEPDIR)/camd_la-camd_postorder.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_postorder.c' object='Source/camd_la-camd_postorder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_postorder.lo `test -f 'Source/camd_postorder.c' || echo '$(srcdir)/'`Source/camd_postorder.c Source/camd_la-camd_preprocess.lo: Source/camd_preprocess.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_preprocess.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_preprocess.Tpo -c -o Source/camd_la-camd_preprocess.lo `test -f 'Source/camd_preprocess.c' || echo '$(srcdir)/'`Source/camd_preprocess.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_preprocess.Tpo Source/$(DEPDIR)/camd_la-camd_preprocess.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_preprocess.c' object='Source/camd_la-camd_preprocess.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_preprocess.lo `test -f 'Source/camd_preprocess.c' || echo '$(srcdir)/'`Source/camd_preprocess.c Source/camd_la-camd_valid.lo: Source/camd_valid.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/camd_la-camd_valid.lo -MD -MP -MF Source/$(DEPDIR)/camd_la-camd_valid.Tpo -c -o Source/camd_la-camd_valid.lo `test -f 'Source/camd_valid.c' || echo '$(srcdir)/'`Source/camd_valid.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/camd_la-camd_valid.Tpo Source/$(DEPDIR)/camd_la-camd_valid.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/camd_valid.c' object='Source/camd_la-camd_valid.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(camd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/camd_la-camd_valid.lo `test -f 'Source/camd_valid.c' || echo '$(srcdir)/'`Source/camd_valid.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf Source/.libs Source/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f Source/$(DEPDIR)/$(am__dirstamp) -rm -f Source/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Source/$(DEPDIR)/camd_la-camd_1.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_2.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_aat.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_control.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_defaults.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_dump.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_global.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_info.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_order.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_postorder.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_preprocess.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_valid.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Source/$(DEPDIR)/camd_la-camd_1.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_2.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_aat.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_control.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_defaults.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_dump.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_global.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_info.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_order.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_postorder.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_preprocess.Plo -rm -f Source/$(DEPDIR)/camd_la-camd_valid.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CCOLAMD/0000755000175000017500000000000014400711326014703 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CCOLAMD/Include/0000755000175000017500000000000014400711326016266 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CCOLAMD/Include/ccolamd.h0000664000175000017500000002560214224052371017772 00000000000000/* ========================================================================== */ /* === CCOLAMD/ccolamd.h ==================================================== */ /* ========================================================================== */ /* ---------------------------------------------------------------------------- * CCOLAMD Copyright (C), Univ. of Florida. Authors: Timothy A. Davis, * Sivasankaran Rajamanickam, and Stefan Larimore * See License.txt for the Version 2.1 of the GNU Lesser General Public License * -------------------------------------------------------------------------- */ /* * You must include this file (ccolamd.h) in any routine that uses ccolamd, * csymamd, or the related macros and definitions. */ #ifndef CCOLAMD_H #define CCOLAMD_H /* make it easy for C++ programs to include CCOLAMD */ #ifdef __cplusplus extern "C" { #endif /* for size_t definition: */ #include /* ========================================================================== */ /* === CCOLAMD version ====================================================== */ /* ========================================================================== */ /* All versions of CCOLAMD will include the following definitions. * As an example, to test if the version you are using is 1.3 or later: * * if (CCOLAMD_VERSION >= CCOLAMD_VERSION_CODE (1,3)) ... * * This also works during compile-time: * * #if CCOLAMD_VERSION >= CCOLAMD_VERSION_CODE (1,3) * printf ("This is version 1.3 or later\n") ; * #else * printf ("This is an early version\n") ; * #endif */ #define CCOLAMD_DATE "Feb 1, 2016" #define CCOLAMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define CCOLAMD_MAIN_VERSION 2 #define CCOLAMD_SUB_VERSION 9 #define CCOLAMD_SUBSUB_VERSION 4 #define CCOLAMD_VERSION \ CCOLAMD_VERSION_CODE(CCOLAMD_MAIN_VERSION,CCOLAMD_SUB_VERSION) /* ========================================================================== */ /* === Knob and statistics definitions ====================================== */ /* ========================================================================== */ /* size of the knobs [ ] array. Only knobs [0..3] are currently used. */ #define CCOLAMD_KNOBS 20 /* number of output statistics. Only stats [0..10] are currently used. */ #define CCOLAMD_STATS 20 /* knobs [0] and stats [0]: dense row knob and output statistic. */ #define CCOLAMD_DENSE_ROW 0 /* knobs [1] and stats [1]: dense column knob and output statistic. */ #define CCOLAMD_DENSE_COL 1 /* knobs [2]: aggressive absorption option */ #define CCOLAMD_AGGRESSIVE 2 /* knobs [3]: LU or Cholesky factorization option */ #define CCOLAMD_LU 3 /* stats [2]: memory defragmentation count output statistic */ #define CCOLAMD_DEFRAG_COUNT 2 /* stats [3]: ccolamd status: zero OK, > 0 warning or notice, < 0 error */ #define CCOLAMD_STATUS 3 /* stats [4..6]: error info, or info on jumbled columns */ #define CCOLAMD_INFO1 4 #define CCOLAMD_INFO2 5 #define CCOLAMD_INFO3 6 /* stats [7]: number of originally empty rows */ #define CCOLAMD_EMPTY_ROW 7 /* stats [8]: number of originally empty cols */ #define CCOLAMD_EMPTY_COL 8 /* stats [9]: number of rows with entries only in dense cols */ #define CCOLAMD_NEWLY_EMPTY_ROW 9 /* stats [10]: number of cols with entries only in dense rows */ #define CCOLAMD_NEWLY_EMPTY_COL 10 /* error codes returned in stats [3]: */ #define CCOLAMD_OK (0) #define CCOLAMD_OK_BUT_JUMBLED (1) #define CCOLAMD_ERROR_A_not_present (-1) #define CCOLAMD_ERROR_p_not_present (-2) #define CCOLAMD_ERROR_nrow_negative (-3) #define CCOLAMD_ERROR_ncol_negative (-4) #define CCOLAMD_ERROR_nnz_negative (-5) #define CCOLAMD_ERROR_p0_nonzero (-6) #define CCOLAMD_ERROR_A_too_small (-7) #define CCOLAMD_ERROR_col_length_negative (-8) #define CCOLAMD_ERROR_row_index_out_of_bounds (-9) #define CCOLAMD_ERROR_out_of_memory (-10) #define CCOLAMD_ERROR_invalid_cmember (-11) #define CCOLAMD_ERROR_internal_error (-999) /* ========================================================================== */ /* === Prototypes of user-callable routines ================================= */ /* ========================================================================== */ #include "SuiteSparse_config.h" size_t ccolamd_recommended /* returns recommended value of Alen, */ /* or 0 if input arguments are erroneous */ ( int nnz, /* nonzeros in A */ int n_row, /* number of rows in A */ int n_col /* number of columns in A */ ) ; size_t ccolamd_l_recommended /* returns recommended value of Alen, */ /* or 0 if input arguments are erroneous */ ( SuiteSparse_long nnz, /* nonzeros in A */ SuiteSparse_long n_row, /* number of rows in A */ SuiteSparse_long n_col /* number of columns in A */ ) ; void ccolamd_set_defaults /* sets default parameters */ ( /* knobs argument is modified on output */ double knobs [CCOLAMD_KNOBS] /* parameter settings for ccolamd */ ) ; void ccolamd_l_set_defaults /* sets default parameters */ ( /* knobs argument is modified on output */ double knobs [CCOLAMD_KNOBS] /* parameter settings for ccolamd */ ) ; int ccolamd /* returns (1) if successful, (0) otherwise*/ ( /* A and p arguments are modified on output */ int n_row, /* number of rows in A */ int n_col, /* number of columns in A */ int Alen, /* size of the array A */ int A [ ], /* row indices of A, of size Alen */ int p [ ], /* column pointers of A, of size n_col+1 */ double knobs [CCOLAMD_KNOBS],/* parameter settings for ccolamd */ int stats [CCOLAMD_STATS], /* ccolamd output statistics and error codes */ int cmember [ ] /* Constraint set of A, of size n_col */ ) ; SuiteSparse_long ccolamd_l /* as ccolamd w/ SuiteSparse_long integers */ ( SuiteSparse_long n_row, SuiteSparse_long n_col, SuiteSparse_long Alen, SuiteSparse_long A [ ], SuiteSparse_long p [ ], double knobs [CCOLAMD_KNOBS], SuiteSparse_long stats [CCOLAMD_STATS], SuiteSparse_long cmember [ ] ) ; int csymamd /* return (1) if OK, (0) otherwise */ ( int n, /* number of rows and columns of A */ int A [ ], /* row indices of A */ int p [ ], /* column pointers of A */ int perm [ ], /* output permutation, size n_col+1 */ double knobs [CCOLAMD_KNOBS],/* parameters (uses defaults if NULL) */ int stats [CCOLAMD_STATS], /* output statistics and error codes */ void * (*allocate) (size_t, size_t), /* pointer to calloc (ANSI C) or */ /* mxCalloc (for MATLAB mexFunction) */ void (*release) (void *), /* pointer to free (ANSI C) or */ /* mxFree (for MATLAB mexFunction) */ int cmember [ ], /* Constraint set of A */ int stype /* 0: use both parts, >0: upper, <0: lower */ ) ; SuiteSparse_long csymamd_l /* as csymamd, w/ SuiteSparse_long integers */ ( SuiteSparse_long n, SuiteSparse_long A [ ], SuiteSparse_long p [ ], SuiteSparse_long perm [ ], double knobs [CCOLAMD_KNOBS], SuiteSparse_long stats [CCOLAMD_STATS], void * (*allocate) (size_t, size_t), void (*release) (void *), SuiteSparse_long cmember [ ], SuiteSparse_long stype ) ; void ccolamd_report ( int stats [CCOLAMD_STATS] ) ; void ccolamd_l_report ( SuiteSparse_long stats [CCOLAMD_STATS] ) ; void csymamd_report ( int stats [CCOLAMD_STATS] ) ; void csymamd_l_report ( SuiteSparse_long stats [CCOLAMD_STATS] ) ; /* ========================================================================== */ /* === Prototypes of "expert" routines ====================================== */ /* ========================================================================== */ /* These routines are meant to be used internally, or in a future version of * UMFPACK. They appear here so that UMFPACK can use them, but they should not * be called directly by the user. */ int ccolamd2 ( /* A and p arguments are modified on output */ int n_row, /* number of rows in A */ int n_col, /* number of columns in A */ int Alen, /* size of the array A */ int A [ ], /* row indices of A, of size Alen */ int p [ ], /* column pointers of A, of size n_col+1 */ double knobs [CCOLAMD_KNOBS],/* parameter settings for ccolamd */ int stats [CCOLAMD_STATS], /* ccolamd output statistics and error codes */ /* each Front_ array is of size n_col+1: */ int Front_npivcol [ ], /* # pivot cols in each front */ int Front_nrows [ ], /* # of rows in each front (incl. pivot rows) */ int Front_ncols [ ], /* # of cols in each front (incl. pivot cols) */ int Front_parent [ ], /* parent of each front */ int Front_cols [ ], /* link list of pivot columns for each front */ int *p_nfr, /* total number of frontal matrices */ int InFront [ ], /* InFront [row] = f if row in front f */ int cmember [ ] /* Constraint set of A */ ) ; SuiteSparse_long ccolamd2_l /* as ccolamd2, w/ SuiteSparse_long integers */ ( SuiteSparse_long n_row, SuiteSparse_long n_col, SuiteSparse_long Alen, SuiteSparse_long A [ ], SuiteSparse_long p [ ], double knobs [CCOLAMD_KNOBS], SuiteSparse_long stats [CCOLAMD_STATS], SuiteSparse_long Front_npivcol [ ], SuiteSparse_long Front_nrows [ ], SuiteSparse_long Front_ncols [ ], SuiteSparse_long Front_parent [ ], SuiteSparse_long Front_cols [ ], SuiteSparse_long *p_nfr, SuiteSparse_long InFront [ ], SuiteSparse_long cmember [ ] ) ; void ccolamd_apply_order ( int Front [ ], const int Order [ ], int Temp [ ], int nn, int nfr ) ; void ccolamd_l_apply_order ( SuiteSparse_long Front [ ], const SuiteSparse_long Order [ ], SuiteSparse_long Temp [ ], SuiteSparse_long nn, SuiteSparse_long nfr ) ; void ccolamd_fsize ( int nn, int MaxFsize [ ], int Fnrows [ ], int Fncols [ ], int Parent [ ], int Npiv [ ] ) ; void ccolamd_l_fsize ( SuiteSparse_long nn, SuiteSparse_long MaxFsize [ ], SuiteSparse_long Fnrows [ ], SuiteSparse_long Fncols [ ], SuiteSparse_long Parent [ ], SuiteSparse_long Npiv [ ] ) ; void ccolamd_postorder ( int nn, int Parent [ ], int Npiv [ ], int Fsize [ ], int Order [ ], int Child [ ], int Sibling [ ], int Stack [ ], int Front_cols [ ], int cmember [ ] ) ; void ccolamd_l_postorder ( SuiteSparse_long nn, SuiteSparse_long Parent [ ], SuiteSparse_long Npiv [ ], SuiteSparse_long Fsize [ ], SuiteSparse_long Order [ ], SuiteSparse_long Child [ ], SuiteSparse_long Sibling [ ], SuiteSparse_long Stack [ ], SuiteSparse_long Front_cols [ ], SuiteSparse_long cmember [ ] ) ; int ccolamd_post_tree ( int root, int k, int Child [ ], const int Sibling [ ], int Order [ ], int Stack [ ] ) ; SuiteSparse_long ccolamd_l_post_tree ( SuiteSparse_long root, SuiteSparse_long k, SuiteSparse_long Child [ ], const SuiteSparse_long Sibling [ ], SuiteSparse_long Order [ ], SuiteSparse_long Stack [ ] ) ; #ifdef __cplusplus } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CCOLAMD/Source/0000755000175000017500000000000014400711326016143 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CCOLAMD/Source/ccolamd.c0000664000175000017500000042337214224052371017650 00000000000000/* ========================================================================== */ /* === CCOLAMD/CSYMAMD - a constrained column ordering algorithm ============ */ /* ========================================================================== */ /* ---------------------------------------------------------------------------- * CCOLAMD, Copyright (C) Univ. of Florida. Authors: Timothy A. Davis, * Sivasankaran Rajamanickam, and Stefan Larimore * See License.txt for the Version 2.1 of the GNU Lesser General Public License * -------------------------------------------------------------------------- */ /* * ccolamd: a constrained approximate minimum degree column ordering * algorithm, LU factorization of symmetric or unsymmetric matrices, * QR factorization, least squares, interior point methods for * linear programming problems, and other related problems. * * csymamd: a constrained approximate minimum degree ordering algorithm for * Cholesky factorization of symmetric matrices. * * Purpose: * * CCOLAMD computes a permutation Q such that the Cholesky factorization of * (AQ)'(AQ) has less fill-in and requires fewer floating point operations * than A'A. This also provides a good ordering for sparse partial * pivoting methods, P(AQ) = LU, where Q is computed prior to numerical * factorization, and P is computed during numerical factorization via * conventional partial pivoting with row interchanges. CCOLAMD is an * extension of COLAMD, available as built-in function in MATLAB Version 6, * available from MathWorks, Inc. (http://www.mathworks.com). This * routine can be used in place of COLAMD in MATLAB. * * CSYMAMD computes a permutation P of a symmetric matrix A such that the * Cholesky factorization of PAP' has less fill-in and requires fewer * floating point operations than A. CSYMAMD constructs a matrix M such * that M'M has the same nonzero pattern of A, and then orders the columns * of M using colmmd. The column ordering of M is then returned as the * row and column ordering P of A. CSYMAMD is an extension of SYMAMD. * * Authors: * * Timothy A. Davis and S. Rajamanickam wrote CCOLAMD, based directly on * COLAMD by Stefan I. Larimore and Timothy A. Davis, University of * Florida. The algorithm was developed in collaboration with John * Gilbert, (UCSB, then at Xerox PARC), and Esmond Ng, (Lawrence Berkeley * National Lab, then at Oak Ridge National Laboratory). * * Acknowledgements: * * This work was supported by the National Science Foundation, under * grants DMS-9504974 and DMS-9803599, CCR-0203270, and a grant from the * Sandia National Laboratory (Dept. of Energy). * * Copyright and License: * * Copyright (c) 1998-2005 by the University of Florida. * All Rights Reserved. * COLAMD is also available under alternate licenses, contact T. Davis * for details. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 * USA * * Permission is hereby granted to use or copy this program under the * terms of the GNU LGPL, provided that the Copyright, this License, * and the Availability of the original version is retained on all copies. * User documentation of any code that uses this code or any modified * version of this code must cite the Copyright, this License, the * Availability note, and "Used by permission." Permission to modify * the code and to distribute modified code is granted, provided the * Copyright, this License, and the Availability note are retained, * and a notice that the code was modified is included. * * Availability: * * The CCOLAMD/CSYMAMD library is available at * * http://www.suitesparse.com * * See the ChangeLog file for changes since Version 1.0. */ /* ========================================================================== */ /* === Description of user-callable routines ================================ */ /* ========================================================================== */ /* CCOLAMD includes both int and SuiteSparse_long versions of all its routines. * The description below is for the int version. For SuiteSparse_long, all * int arguments become SuiteSparse_long integers. SuiteSparse_long is * normally defined as long, except for WIN64 */ /* ---------------------------------------------------------------------------- * ccolamd_recommended: * ---------------------------------------------------------------------------- * * C syntax: * * #include "ccolamd.h" * size_t ccolamd_recommended (int nnz, int n_row, int n_col) ; * size_t ccolamd_l_recommended (SuiteSparse_long nnz, * SuiteSparse_long n_row, SuiteSparse_long n_col) ; * * Purpose: * * Returns recommended value of Alen for use by ccolamd. Returns 0 * if any input argument is negative. The use of this routine * is optional. Not needed for csymamd, which dynamically allocates * its own memory. * * Arguments (all input arguments): * * int nnz ; Number of nonzeros in the matrix A. This must * be the same value as p [n_col] in the call to * ccolamd - otherwise you will get a wrong value * of the recommended memory to use. * * int n_row ; Number of rows in the matrix A. * * int n_col ; Number of columns in the matrix A. * * ---------------------------------------------------------------------------- * ccolamd_set_defaults: * ---------------------------------------------------------------------------- * * C syntax: * * #include "ccolamd.h" * ccolamd_set_defaults (double knobs [CCOLAMD_KNOBS]) ; * ccolamd_l_set_defaults (double knobs [CCOLAMD_KNOBS]) ; * * Purpose: * * Sets the default parameters. The use of this routine is optional. * Passing a (double *) NULL pointer for the knobs results in the * default parameter settings. * * Arguments: * * double knobs [CCOLAMD_KNOBS] ; Output only. * * knobs [0] and knobs [1] behave differently than they did in COLAMD. * The other knobs are new to CCOLAMD. * * knobs [0]: dense row control * * For CCOLAMD, rows with more than * max (16, knobs [CCOLAMD_DENSE_ROW] * sqrt (n_col)) * entries are removed prior to ordering. * * For CSYMAMD, rows and columns with more than * max (16, knobs [CCOLAMD_DENSE_ROW] * sqrt (n)) * entries are removed prior to ordering, and placed last in the * output ordering (subject to the constraints). * * If negative, only completely dense rows are removed. If you * intend to use CCOLAMD for a Cholesky factorization of A*A', set * knobs [CCOLAMD_DENSE_ROW] to -1, which is more appropriate for * that case. * * Default: 10. * * knobs [1]: dense column control * * For CCOLAMD, columns with more than * max (16, knobs [CCOLAMD_DENSE_COL] * sqrt (MIN (n_row,n_col))) * entries are removed prior to ordering, and placed last in the * output column ordering (subject to the constraints). * Not used by CSYMAMD. If negative, only completely dense * columns are removed. Default: 10. * * knobs [2]: aggressive absorption * * knobs [CCOLAMD_AGGRESSIVE] controls whether or not to do * aggressive absorption during the ordering. Default is TRUE * (nonzero). If zero, no aggressive absorption is performed. * * knobs [3]: optimize ordering for LU or Cholesky * * knobs [CCOLAMD_LU] controls an option that optimizes the * ordering for the LU of A or the Cholesky factorization of A'A. * If TRUE (nonzero), an ordering optimized for LU is performed. * If FALSE (zero), an ordering for Cholesky is performed. * Default is FALSE. CSYMAMD ignores this parameter; it always * orders for Cholesky. * * ---------------------------------------------------------------------------- * ccolamd: * ---------------------------------------------------------------------------- * * C syntax: * * #include "ccolamd.h" * int ccolamd (int n_row, int n_col, int Alen, int *A, int *p, * double knobs [CCOLAMD_KNOBS], int stats [CCOLAMD_STATS], * int *cmember) ; * * SuiteSparse_long ccolamd_l (SuiteSparse_long n_row, * SuiteSparse_long n_col, SuiteSparse_long Alen, * SuiteSparse_long *A, SuiteSparse_long *p, * double knobs [CCOLAMD_KNOBS], * SuiteSparse_long stats [CCOLAMD_STATS], * SuiteSparse_long *cmember) ; * * Purpose: * * Computes a column ordering (Q) of A such that P(AQ)=LU or * (AQ)'AQ=LL' have less fill-in and require fewer floating point * operations than factorizing the unpermuted matrix A or A'A, * respectively. * * Returns: * * TRUE (1) if successful, FALSE (0) otherwise. * * Arguments (for int version): * * int n_row ; Input argument. * * Number of rows in the matrix A. * Restriction: n_row >= 0. * ccolamd returns FALSE if n_row is negative. * * int n_col ; Input argument. * * Number of columns in the matrix A. * Restriction: n_col >= 0. * ccolamd returns FALSE if n_col is negative. * * int Alen ; Input argument. * * Restriction (see note): * Alen >= MAX (2*nnz, 4*n_col) + 17*n_col + 7*n_row + 7, where * nnz = p [n_col]. ccolamd returns FALSE if this condition is * not met. We recommend about nnz/5 more space for better * efficiency. This restriction makes an modest assumption * regarding the size of two typedef'd structures in ccolamd.h. * We do, however, guarantee that * * Alen >= ccolamd_recommended (nnz, n_row, n_col) * * will work efficiently. * * int A [Alen] ; Input argument, undefined on output. * * A is an integer array of size Alen. Alen must be at least as * large as the bare minimum value given above, but this is very * low, and can result in excessive run time. For best * performance, we recommend that Alen be greater than or equal to * ccolamd_recommended (nnz, n_row, n_col), which adds * nnz/5 to the bare minimum value given above. * * On input, the row indices of the entries in column c of the * matrix are held in A [(p [c]) ... (p [c+1]-1)]. The row indices * in a given column c need not be in ascending order, and * duplicate row indices may be be present. However, ccolamd will * work a little faster if both of these conditions are met * (ccolamd puts the matrix into this format, if it finds that the * the conditions are not met). * * The matrix is 0-based. That is, rows are in the range 0 to * n_row-1, and columns are in the range 0 to n_col-1. ccolamd * returns FALSE if any row index is out of range. * * The contents of A are modified during ordering, and are * undefined on output. * * int p [n_col+1] ; Both input and output argument. * * p is an integer array of size n_col+1. On input, it holds the * "pointers" for the column form of the matrix A. Column c of * the matrix A is held in A [(p [c]) ... (p [c+1]-1)]. The first * entry, p [0], must be zero, and p [c] <= p [c+1] must hold * for all c in the range 0 to n_col-1. The value nnz = p [n_col] * is thus the total number of entries in the pattern of the * matrix A. ccolamd returns FALSE if these conditions are not * met. * * On output, if ccolamd returns TRUE, the array p holds the column * permutation (Q, for P(AQ)=LU or (AQ)'(AQ)=LL'), where p [0] is * the first column index in the new ordering, and p [n_col-1] is * the last. That is, p [k] = j means that column j of A is the * kth pivot column, in AQ, where k is in the range 0 to n_col-1 * (p [0] = j means that column j of A is the first column in AQ). * * If ccolamd returns FALSE, then no permutation is returned, and * p is undefined on output. * * double knobs [CCOLAMD_KNOBS] ; Input argument. * * See ccolamd_set_defaults for a description. * * int stats [CCOLAMD_STATS] ; Output argument. * * Statistics on the ordering, and error status. * See ccolamd.h for related definitions. * ccolamd returns FALSE if stats is not present. * * stats [0]: number of dense or empty rows ignored. * * stats [1]: number of dense or empty columns ignored (and * ordered last in the output permutation p, subject to the * constraints). Note that a row can become "empty" if it * contains only "dense" and/or "empty" columns, and similarly * a column can become "empty" if it only contains "dense" * and/or "empty" rows. * * stats [2]: number of garbage collections performed. This can * be excessively high if Alen is close to the minimum * required value. * * stats [3]: status code. < 0 is an error code. * > 1 is a warning or notice. * * 0 OK. Each column of the input matrix contained row * indices in increasing order, with no duplicates. * * 1 OK, but columns of input matrix were jumbled (unsorted * columns or duplicate entries). CCOLAMD had to do some * extra work to sort the matrix first and remove * duplicate entries, but it still was able to return a * valid permutation (return value of ccolamd was TRUE). * * stats [4]: highest column index of jumbled columns * stats [5]: last seen duplicate or unsorted row index * stats [6]: number of duplicate or unsorted row indices * * -1 A is a null pointer * * -2 p is a null pointer * * -3 n_row is negative. stats [4]: n_row * * -4 n_col is negative. stats [4]: n_col * * -5 number of nonzeros in matrix is negative * * stats [4]: number of nonzeros, p [n_col] * * -6 p [0] is nonzero * * stats [4]: p [0] * * -7 A is too small * * stats [4]: required size * stats [5]: actual size (Alen) * * -8 a column has a negative number of entries * * stats [4]: column with < 0 entries * stats [5]: number of entries in col * * -9 a row index is out of bounds * * stats [4]: column with bad row index * stats [5]: bad row index * stats [6]: n_row, # of rows of matrx * * -10 (unused; see csymamd) * * int cmember [n_col] ; Input argument. * * cmember is new to CCOLAMD. It did not appear in COLAMD. * It places contraints on the output ordering. s = cmember [j] * gives the constraint set s that contains the column j * (Restriction: 0 <= s < n_col). In the output column * permutation, all columns in set 0 appear first, followed by * all columns in set 1, and so on. If NULL, all columns are * treated as if they were in a single constraint set, and you * will obtain the same ordering as COLAMD (with one exception: * the dense row/column threshold and other default knobs in * CCOLAMD and COLAMD are different). * * Example: * * See ccolamd_example.c for a complete example. * * To order the columns of a 5-by-4 matrix with 11 nonzero entries in * the following nonzero pattern * * x 0 x 0 * x 0 x x * 0 x x 0 * 0 0 x x * x x 0 0 * * with default knobs, no output statistics, and no ordering * constraints, do the following: * * #include "ccolamd.h" * #define ALEN 144 * int A [ALEN] = {0, 1, 4, 2, 4, 0, 1, 2, 3, 1, 3} ; * int p [ ] = {0, 3, 5, 9, 11} ; * int stats [CCOLAMD_STATS] ; * ccolamd (5, 4, ALEN, A, p, (double *) NULL, stats, NULL) ; * * The permutation is returned in the array p, and A is destroyed. * * ---------------------------------------------------------------------------- * csymamd: * ---------------------------------------------------------------------------- * * C syntax: * * #include "ccolamd.h" * * int csymamd (int n, int *A, int *p, int *perm, * double knobs [CCOLAMD_KNOBS], int stats [CCOLAMD_STATS], * void (*allocate) (size_t, size_t), void (*release) (void *), * int *cmember, int stype) ; * * SuiteSparse_long csymamd_l (SuiteSparse_long n, * SuiteSparse_long *A, SuiteSparse_long *p, * SuiteSparse_long *perm, double knobs [CCOLAMD_KNOBS], * SuiteSparse_long stats [CCOLAMD_STATS], void (*allocate) * (size_t, size_t), void (*release) (void *), * SuiteSparse_long *cmember, SuiteSparse_long stype) ; * * Purpose: * * The csymamd routine computes an ordering P of a symmetric sparse * matrix A such that the Cholesky factorization PAP' = LL' remains * sparse. It is based on a column ordering of a matrix M constructed * so that the nonzero pattern of M'M is the same as A. Either the * lower or upper triangular part of A can be used, or the pattern * A+A' can be used. You must pass your selected memory allocator * (usually calloc/free or mxCalloc/mxFree) to csymamd, for it to * allocate memory for the temporary matrix M. * * Returns: * * TRUE (1) if successful, FALSE (0) otherwise. * * Arguments: * * int n ; Input argument. * * Number of rows and columns in the symmetrix matrix A. * Restriction: n >= 0. * csymamd returns FALSE if n is negative. * * int A [nnz] ; Input argument. * * A is an integer array of size nnz, where nnz = p [n]. * * The row indices of the entries in column c of the matrix are * held in A [(p [c]) ... (p [c+1]-1)]. The row indices in a * given column c need not be in ascending order, and duplicate * row indices may be present. However, csymamd will run faster * if the columns are in sorted order with no duplicate entries. * * The matrix is 0-based. That is, rows are in the range 0 to * n-1, and columns are in the range 0 to n-1. csymamd * returns FALSE if any row index is out of range. * * The contents of A are not modified. * * int p [n+1] ; Input argument. * * p is an integer array of size n+1. On input, it holds the * "pointers" for the column form of the matrix A. Column c of * the matrix A is held in A [(p [c]) ... (p [c+1]-1)]. The first * entry, p [0], must be zero, and p [c] <= p [c+1] must hold * for all c in the range 0 to n-1. The value p [n] is * thus the total number of entries in the pattern of the matrix A. * csymamd returns FALSE if these conditions are not met. * * The contents of p are not modified. * * int perm [n+1] ; Output argument. * * On output, if csymamd returns TRUE, the array perm holds the * permutation P, where perm [0] is the first index in the new * ordering, and perm [n-1] is the last. That is, perm [k] = j * means that row and column j of A is the kth column in PAP', * where k is in the range 0 to n-1 (perm [0] = j means * that row and column j of A are the first row and column in * PAP'). The array is used as a workspace during the ordering, * which is why it must be of length n+1, not just n. * * double knobs [CCOLAMD_KNOBS] ; Input argument. * * See colamd_set_defaults for a description. * * int stats [CCOLAMD_STATS] ; Output argument. * * Statistics on the ordering, and error status. * See ccolamd.h for related definitions. * csymand returns FALSE if stats is not present. * * stats [0]: number of dense or empty row and columns ignored * (and ordered last in the output permutation perm, subject * to the constraints). Note that a row/column can become * "empty" if it contains only "dense" and/or "empty" * columns/rows. * * stats [1]: (same as stats [0]) * * stats [2]: number of garbage collections performed. * * stats [3]: status code. < 0 is an error code. * > 1 is a warning or notice. * * 0 to -9: same as ccolamd, with n replacing n_col and n_row, * and -3 and -7 are unused. * * -10 out of memory (unable to allocate temporary workspace * for M or count arrays using the "allocate" routine * passed into csymamd). * * void * (*allocate) (size_t, size_t) * * A pointer to a function providing memory allocation. The * allocated memory must be returned initialized to zero. For a * C application, this argument should normally be a pointer to * calloc. For a MATLAB mexFunction, the routine mxCalloc is * passed instead. * * void (*release) (size_t, size_t) * * A pointer to a function that frees memory allocated by the * memory allocation routine above. For a C application, this * argument should normally be a pointer to free. For a MATLAB * mexFunction, the routine mxFree is passed instead. * * int cmember [n] ; Input argument. * * Same as ccolamd, except that cmember is of size n, and it places * contraints symmetrically, on both the row and column ordering. * Entries in cmember must be in the range 0 to n-1. * * int stype ; Input argument. * * If stype < 0, then only the strictly lower triangular part of * A is accessed. The upper triangular part is assumed to be the * transpose of the lower triangular part. This is the same as * SYMAMD, which did not have an stype parameter. * * If stype > 0, only the strictly upper triangular part of A is * accessed. The lower triangular part is assumed to be the * transpose of the upper triangular part. * * If stype == 0, then the nonzero pattern of A+A' is ordered. * * ---------------------------------------------------------------------------- * ccolamd_report: * ---------------------------------------------------------------------------- * * C syntax: * * #include "ccolamd.h" * ccolamd_report (int stats [CCOLAMD_STATS]) ; * ccolamd_l_report (SuiteSparse_long stats [CCOLAMD_STATS]) ; * * Purpose: * * Prints the error status and statistics recorded in the stats * array on the standard error output (for a standard C routine) * or on the MATLAB output (for a mexFunction). * * Arguments: * * int stats [CCOLAMD_STATS] ; Input only. Statistics from ccolamd. * * * ---------------------------------------------------------------------------- * csymamd_report: * ---------------------------------------------------------------------------- * * C syntax: * * #include "ccolamd.h" * csymamd_report (int stats [CCOLAMD_STATS]) ; * csymamd_l_report (SuiteSparse_long stats [CCOLAMD_STATS]) ; * * Purpose: * * Prints the error status and statistics recorded in the stats * array on the standard error output (for a standard C routine) * or on the MATLAB output (for a mexFunction). * * Arguments: * * int stats [CCOLAMD_STATS] ; Input only. Statistics from csymamd. * */ /* ========================================================================== */ /* === Scaffolding code definitions ======================================== */ /* ========================================================================== */ /* Ensure that debugging is turned off: */ #ifndef NDEBUG #define NDEBUG #endif /* turn on debugging by uncommenting the following line #undef NDEBUG */ /* ========================================================================== */ /* === Include files ======================================================== */ /* ========================================================================== */ #include "ccolamd.h" #include #include #include #ifdef MATLAB_MEX_FILE #include "mex.h" #include "matrix.h" #endif #if !defined (NPRINT) || !defined (NDEBUG) #include #endif #ifndef NULL #define NULL ((void *) 0) #endif /* ========================================================================== */ /* === int or SuiteSparse_long ============================================== */ /* ========================================================================== */ #ifdef DLONG #define Int SuiteSparse_long #define ID SuiteSparse_long_id #define Int_MAX SuiteSparse_long_max #define CCOLAMD_recommended ccolamd_l_recommended #define CCOLAMD_set_defaults ccolamd_l_set_defaults #define CCOLAMD_2 ccolamd2_l #define CCOLAMD_MAIN ccolamd_l #define CCOLAMD_apply_order ccolamd_l_apply_order #define CCOLAMD_postorder ccolamd_l_postorder #define CCOLAMD_post_tree ccolamd_l_post_tree #define CCOLAMD_fsize ccolamd_l_fsize #define CSYMAMD_MAIN csymamd_l #define CCOLAMD_report ccolamd_l_report #define CSYMAMD_report csymamd_l_report #else #define Int int #define ID "%d" #define Int_MAX INT_MAX #define CCOLAMD_recommended ccolamd_recommended #define CCOLAMD_set_defaults ccolamd_set_defaults #define CCOLAMD_2 ccolamd2 #define CCOLAMD_MAIN ccolamd #define CCOLAMD_apply_order ccolamd_apply_order #define CCOLAMD_postorder ccolamd_postorder #define CCOLAMD_post_tree ccolamd_post_tree #define CCOLAMD_fsize ccolamd_fsize #define CSYMAMD_MAIN csymamd #define CCOLAMD_report ccolamd_report #define CSYMAMD_report csymamd_report #endif /* ========================================================================== */ /* === Row and Column structures ============================================ */ /* ========================================================================== */ typedef struct CColamd_Col_struct { /* size of this struct is 8 integers if no padding occurs */ Int start ; /* index for A of first row in this column, or DEAD */ /* if column is dead */ Int length ; /* number of rows in this column */ union { Int thickness ; /* number of original columns represented by this */ /* col, if the column is alive */ Int parent ; /* parent in parent tree super-column structure, if */ /* the column is dead */ } shared1 ; union { Int score ; Int order ; } shared2 ; union { Int headhash ; /* head of a hash bucket, if col is at the head of */ /* a degree list */ Int hash ; /* hash value, if col is not in a degree list */ Int prev ; /* previous column in degree list, if col is in a */ /* degree list (but not at the head of a degree list) */ } shared3 ; union { Int degree_next ; /* next column, if col is in a degree list */ Int hash_next ; /* next column, if col is in a hash list */ } shared4 ; Int nextcol ; /* next column in this supercolumn */ Int lastcol ; /* last column in this supercolumn */ } CColamd_Col ; typedef struct CColamd_Row_struct { /* size of this struct is 6 integers if no padding occurs */ Int start ; /* index for A of first col in this row */ Int length ; /* number of principal columns in this row */ union { Int degree ; /* number of principal & non-principal columns in row */ Int p ; /* used as a row pointer in init_rows_cols () */ } shared1 ; union { Int mark ; /* for computing set differences and marking dead rows*/ Int first_column ;/* first column in row (used in garbage collection) */ } shared2 ; Int thickness ; /* number of original rows represented by this row */ /* that are not yet pivotal */ Int front ; /* -1 if an original row */ /* k if this row represents the kth frontal matrix */ /* where k goes from 0 to at most n_col-1 */ } CColamd_Row ; /* ========================================================================== */ /* === basic definitions ==================================================== */ /* ========================================================================== */ #define EMPTY (-1) #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) /* Routines are either PUBLIC (user-callable) or PRIVATE (not user-callable) */ #define GLOBAL #define PUBLIC #define PRIVATE static #define DENSE_DEGREE(alpha,n) \ ((Int) MAX (16.0, (alpha) * sqrt ((double) (n)))) #define CMEMBER(c) ((cmember == (Int *) NULL) ? (0) : (cmember [c])) /* True if x is NaN */ #define SCALAR_IS_NAN(x) ((x) != (x)) /* true if an integer (stored in double x) would overflow (or if x is NaN) */ #define INT_OVERFLOW(x) ((!((x) * (1.0+1e-8) <= (double) Int_MAX)) \ || SCALAR_IS_NAN (x)) #define ONES_COMPLEMENT(r) (-(r)-1) #undef TRUE #undef FALSE #define TRUE (1) #define FALSE (0) /* Row and column status */ #define ALIVE (0) #define DEAD (-1) /* Column status */ #define DEAD_PRINCIPAL (-1) #define DEAD_NON_PRINCIPAL (-2) /* Macros for row and column status update and checking. */ #define ROW_IS_DEAD(r) ROW_IS_MARKED_DEAD (Row[r].shared2.mark) #define ROW_IS_MARKED_DEAD(row_mark) (row_mark < ALIVE) #define ROW_IS_ALIVE(r) (Row [r].shared2.mark >= ALIVE) #define COL_IS_DEAD(c) (Col [c].start < ALIVE) #define COL_IS_ALIVE(c) (Col [c].start >= ALIVE) #define COL_IS_DEAD_PRINCIPAL(c) (Col [c].start == DEAD_PRINCIPAL) #define KILL_ROW(r) { Row [r].shared2.mark = DEAD ; } #define KILL_PRINCIPAL_COL(c) { Col [c].start = DEAD_PRINCIPAL ; } #define KILL_NON_PRINCIPAL_COL(c) { Col [c].start = DEAD_NON_PRINCIPAL ; } /* ========================================================================== */ /* === ccolamd reporting mechanism ========================================== */ /* ========================================================================== */ #if defined (MATLAB_MEX_FILE) || defined (MATHWORKS) /* In MATLAB, matrices are 1-based to the user, but 0-based internally */ #define INDEX(i) ((i)+1) #else /* In C, matrices are 0-based and indices are reported as such in *_report */ #define INDEX(i) (i) #endif /* ========================================================================== */ /* === Debugging prototypes and definitions ================================= */ /* ========================================================================== */ #ifndef NDEBUG #include /* debug print level, present only when debugging */ PRIVATE Int ccolamd_debug ; /* debug print statements */ #define DEBUG0(params) { SUITESPARSE_PRINTF (params) ; } #define DEBUG1(params) { if (ccolamd_debug >= 1) SUITESPARSE_PRINTF (params) ; } #define DEBUG2(params) { if (ccolamd_debug >= 2) SUITESPARSE_PRINTF (params) ; } #define DEBUG3(params) { if (ccolamd_debug >= 3) SUITESPARSE_PRINTF (params) ; } #define DEBUG4(params) { if (ccolamd_debug >= 4) SUITESPARSE_PRINTF (params) ; } #ifdef MATLAB_MEX_FILE #define ASSERT(expression) (mxAssert ((expression), "")) #else #define ASSERT(expression) (assert (expression)) #endif PRIVATE void ccolamd_get_debug ( char *method ) ; PRIVATE void debug_mark ( Int n_row, CColamd_Row Row [], Int tag_mark, Int max_mark ) ; PRIVATE void debug_matrix ( Int n_row, Int n_col, CColamd_Row Row [], CColamd_Col Col [], Int A [] ) ; PRIVATE void debug_structures ( Int n_row, Int n_col, CColamd_Row Row [], CColamd_Col Col [], Int A [], Int in_cset [], Int cset_start [] ) ; PRIVATE void dump_super ( Int super_c, CColamd_Col Col [], Int n_col ) ; PRIVATE void debug_deg_lists ( Int n_row, Int n_col, CColamd_Row Row [ ], CColamd_Col Col [ ], Int head [ ], Int min_score, Int should, Int max_deg ) ; #else /* === No debugging ========================================================= */ #define DEBUG0(params) ; #define DEBUG1(params) ; #define DEBUG2(params) ; #define DEBUG3(params) ; #define DEBUG4(params) ; #define ASSERT(expression) #endif /* ========================================================================== */ /* === Prototypes of PRIVATE routines ======================================= */ /* ========================================================================== */ PRIVATE Int init_rows_cols ( Int n_row, Int n_col, CColamd_Row Row [ ], CColamd_Col Col [ ], Int A [ ], Int p [ ], Int stats [CCOLAMD_STATS] ) ; PRIVATE void init_scoring ( Int n_row, Int n_col, CColamd_Row Row [ ], CColamd_Col Col [ ], Int A [ ], Int head [ ], double knobs [CCOLAMD_KNOBS], Int *p_n_row2, Int *p_n_col2, Int *p_max_deg, Int cmember [ ], Int n_cset, Int cset_start [ ], Int dead_cols [ ], Int *p_ndense_row, /* number of dense rows */ Int *p_nempty_row, /* number of original empty rows */ Int *p_nnewlyempty_row, /* number of newly empty rows */ Int *p_ndense_col, /* number of dense cols (excl "empty" cols) */ Int *p_nempty_col, /* number of original empty cols */ Int *p_nnewlyempty_col /* number of newly empty cols */ ) ; PRIVATE Int find_ordering ( Int n_row, Int n_col, Int Alen, CColamd_Row Row [ ], CColamd_Col Col [ ], Int A [ ], Int head [ ], #ifndef NDEBUG Int n_col2, #endif Int max_deg, Int pfree, Int cset [ ], Int cset_start [ ], #ifndef NDEBUG Int n_cset, #endif Int cmember [ ], Int Front_npivcol [ ], Int Front_nrows [ ], Int Front_ncols [ ], Int Front_parent [ ], Int Front_cols [ ], Int *p_nfr, Int aggressive, Int InFront [ ], Int order_for_lu ) ; PRIVATE void detect_super_cols ( #ifndef NDEBUG Int n_col, CColamd_Row Row [ ], #endif CColamd_Col Col [ ], Int A [ ], Int head [ ], Int row_start, Int row_length, Int in_set [ ] ) ; PRIVATE Int garbage_collection ( Int n_row, Int n_col, CColamd_Row Row [ ], CColamd_Col Col [ ], Int A [ ], Int *pfree ) ; PRIVATE Int clear_mark ( Int tag_mark, Int max_mark, Int n_row, CColamd_Row Row [ ] ) ; PRIVATE void print_report ( char *method, Int stats [CCOLAMD_STATS] ) ; /* ========================================================================== */ /* === USER-CALLABLE ROUTINES: ============================================== */ /* ========================================================================== */ /* ========================================================================== */ /* === ccolamd_recommended ================================================== */ /* ========================================================================== */ /* * The ccolamd_recommended routine returns the suggested size for Alen. This * value has been determined to provide good balance between the number of * garbage collections and the memory requirements for ccolamd. If any * argument is negative, or if integer overflow occurs, a 0 is returned as * an error condition. * * 2*nnz space is required for the row and column indices of the matrix * (or 4*n_col, which ever is larger). * * CCOLAMD_C (n_col) + CCOLAMD_R (n_row) space is required for the Col and Row * arrays, respectively, which are internal to ccolamd. This is equal to * 8*n_col + 6*n_row if the structures are not padded. * * An additional n_col space is the minimal amount of "elbow room", * and nnz/5 more space is recommended for run time efficiency. * * The remaining (((3 * n_col) + 1) + 5 * (n_col + 1) + n_row) space is * for other workspace used in ccolamd which did not appear in colamd. */ /* add two values of type size_t, and check for integer overflow */ static size_t t_add (size_t a, size_t b, int *ok) { (*ok) = (*ok) && ((a + b) >= MAX (a,b)) ; return ((*ok) ? (a + b) : 0) ; } /* compute a*k where k is a small integer, and check for integer overflow */ static size_t t_mult (size_t a, size_t k, int *ok) { size_t i, s = 0 ; for (i = 0 ; i < k ; i++) { s = t_add (s, a, ok) ; } return (s) ; } /* size of the Col and Row structures */ #define CCOLAMD_C(n_col,ok) \ ((t_mult (t_add (n_col, 1, ok), sizeof (CColamd_Col), ok) / sizeof (Int))) #define CCOLAMD_R(n_row,ok) \ ((t_mult (t_add (n_row, 1, ok), sizeof (CColamd_Row), ok) / sizeof (Int))) /* #define CCOLAMD_RECOMMENDED(nnz, n_row, n_col) \ MAX (2 * nnz, 4 * n_col) + \ CCOLAMD_C (n_col) + CCOLAMD_R (n_row) + n_col + (nnz / 5) \ + ((3 * n_col) + 1) + 5 * (n_col + 1) + n_row */ static size_t ccolamd_need (Int nnz, Int n_row, Int n_col, int *ok) { /* ccolamd_need, compute the following, and check for integer overflow: need = MAX (2*nnz, 4*n_col) + n_col + Col_size + Row_size + (3*n_col+1) + (5*(n_col+1)) + n_row ; */ size_t s, c, r, t ; /* MAX (2*nnz, 4*n_col) */ s = t_mult (nnz, 2, ok) ; /* 2*nnz */ t = t_mult (n_col, 4, ok) ; /* 4*n_col */ s = MAX (s,t) ; s = t_add (s, n_col, ok) ; /* bare minimum elbow room */ /* Col and Row arrays */ c = CCOLAMD_C (n_col, ok) ; /* size of column structures */ r = CCOLAMD_R (n_row, ok) ; /* size of row structures */ s = t_add (s, c, ok) ; s = t_add (s, r, ok) ; c = t_mult (n_col, 3, ok) ; /* 3*n_col + 1 */ c = t_add (c, 1, ok) ; s = t_add (s, c, ok) ; c = t_add (n_col, 1, ok) ; /* 5 * (n_col + 1) */ c = t_mult (c, 5, ok) ; s = t_add (s, c, ok) ; s = t_add (s, n_row, ok) ; /* n_row */ return (ok ? s : 0) ; } PUBLIC size_t CCOLAMD_recommended /* returns recommended value of Alen. */ ( /* === Parameters ======================================================= */ Int nnz, /* number of nonzeros in A */ Int n_row, /* number of rows in A */ Int n_col /* number of columns in A */ ) { size_t s ; int ok = TRUE ; if (nnz < 0 || n_row < 0 || n_col < 0) { return (0) ; } s = ccolamd_need (nnz, n_row, n_col, &ok) ; /* bare minimum needed */ s = t_add (s, nnz/5, &ok) ; /* extra elbow room */ ok = ok && (s < Int_MAX) ; return (ok ? s : 0) ; } /* ========================================================================== */ /* === ccolamd_set_defaults ================================================= */ /* ========================================================================== */ /* * The ccolamd_set_defaults routine sets the default values of the user- * controllable parameters for ccolamd. */ PUBLIC void CCOLAMD_set_defaults ( /* === Parameters ======================================================= */ double knobs [CCOLAMD_KNOBS] /* knob array */ ) { /* === Local variables ================================================== */ Int i ; if (!knobs) { return ; /* no knobs to initialize */ } for (i = 0 ; i < CCOLAMD_KNOBS ; i++) { knobs [i] = 0 ; } knobs [CCOLAMD_DENSE_ROW] = 10 ; knobs [CCOLAMD_DENSE_COL] = 10 ; knobs [CCOLAMD_AGGRESSIVE] = TRUE ; /* default: do aggressive absorption*/ knobs [CCOLAMD_LU] = FALSE ; /* default: order for Cholesky */ } /* ========================================================================== */ /* === symamd =============================================================== */ /* ========================================================================== */ PUBLIC Int CSYMAMD_MAIN /* return TRUE if OK, FALSE otherwise */ ( /* === Parameters ======================================================= */ Int n, /* number of rows and columns of A */ Int A [ ], /* row indices of A */ Int p [ ], /* column pointers of A */ Int perm [ ], /* output permutation, size n+1 */ double knobs [CCOLAMD_KNOBS], /* parameters (uses defaults if NULL) */ Int stats [CCOLAMD_STATS], /* output statistics and error codes */ void * (*allocate) (size_t, size_t),/* pointer to calloc (ANSI C) or */ /* mxCalloc (for MATLAB mexFunction) */ void (*release) (void *), /* pointer to free (ANSI C) or */ /* mxFree (for MATLAB mexFunction) */ Int cmember [ ], /* constraint set */ Int stype /* stype of A */ ) { /* === Local variables ================================================== */ double cknobs [CCOLAMD_KNOBS] ; double default_knobs [CCOLAMD_KNOBS] ; Int *count ; /* length of each column of M, and col pointer*/ Int *mark ; /* mark array for finding duplicate entries */ Int *M ; /* row indices of matrix M */ size_t Mlen ; /* length of M */ Int n_row ; /* number of rows in M */ Int nnz ; /* number of entries in A */ Int i ; /* row index of A */ Int j ; /* column index of A */ Int k ; /* row index of M */ Int mnz ; /* number of nonzeros in M */ Int pp ; /* index into a column of A */ Int last_row ; /* last row seen in the current column */ Int length ; /* number of nonzeros in a column */ Int both ; /* TRUE if ordering A+A' */ Int upper ; /* TRUE if ordering triu(A)+triu(A)' */ Int lower ; /* TRUE if ordering tril(A)+tril(A)' */ #ifndef NDEBUG ccolamd_get_debug ("csymamd") ; #endif both = (stype == 0) ; upper = (stype > 0) ; lower = (stype < 0) ; /* === Check the input arguments ======================================== */ if (!stats) { DEBUG1 (("csymamd: stats not present\n")) ; return (FALSE) ; } for (i = 0 ; i < CCOLAMD_STATS ; i++) { stats [i] = 0 ; } stats [CCOLAMD_STATUS] = CCOLAMD_OK ; stats [CCOLAMD_INFO1] = -1 ; stats [CCOLAMD_INFO2] = -1 ; if (!A) { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_A_not_present ; DEBUG1 (("csymamd: A not present\n")) ; return (FALSE) ; } if (!p) /* p is not present */ { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_p_not_present ; DEBUG1 (("csymamd: p not present\n")) ; return (FALSE) ; } if (n < 0) /* n must be >= 0 */ { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_ncol_negative ; stats [CCOLAMD_INFO1] = n ; DEBUG1 (("csymamd: n negative "ID" \n", n)) ; return (FALSE) ; } nnz = p [n] ; if (nnz < 0) /* nnz must be >= 0 */ { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_nnz_negative ; stats [CCOLAMD_INFO1] = nnz ; DEBUG1 (("csymamd: number of entries negative "ID" \n", nnz)) ; return (FALSE) ; } if (p [0] != 0) { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_p0_nonzero ; stats [CCOLAMD_INFO1] = p [0] ; DEBUG1 (("csymamd: p[0] not zero "ID"\n", p [0])) ; return (FALSE) ; } /* === If no knobs, set default knobs =================================== */ if (!knobs) { CCOLAMD_set_defaults (default_knobs) ; knobs = default_knobs ; } /* === Allocate count and mark ========================================== */ count = (Int *) ((*allocate) (n+1, sizeof (Int))) ; if (!count) { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_out_of_memory ; DEBUG1 (("csymamd: allocate count (size "ID") failed\n", n+1)) ; return (FALSE) ; } mark = (Int *) ((*allocate) (n+1, sizeof (Int))) ; if (!mark) { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_out_of_memory ; (*release) ((void *) count) ; DEBUG1 (("csymamd: allocate mark (size "ID") failed\n", n+1)) ; return (FALSE) ; } /* === Compute column counts of M, check if A is valid ================== */ stats [CCOLAMD_INFO3] = 0 ; /* number of duplicate or unsorted row indices*/ for (i = 0 ; i < n ; i++) { mark [i] = -1 ; } for (j = 0 ; j < n ; j++) { last_row = -1 ; length = p [j+1] - p [j] ; if (length < 0) { /* column pointers must be non-decreasing */ stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_col_length_negative ; stats [CCOLAMD_INFO1] = j ; stats [CCOLAMD_INFO2] = length ; (*release) ((void *) count) ; (*release) ((void *) mark) ; DEBUG1 (("csymamd: col "ID" negative length "ID"\n", j, length)) ; return (FALSE) ; } for (pp = p [j] ; pp < p [j+1] ; pp++) { i = A [pp] ; if (i < 0 || i >= n) { /* row index i, in column j, is out of bounds */ stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_row_index_out_of_bounds ; stats [CCOLAMD_INFO1] = j ; stats [CCOLAMD_INFO2] = i ; stats [CCOLAMD_INFO3] = n ; (*release) ((void *) count) ; (*release) ((void *) mark) ; DEBUG1 (("csymamd: row "ID" col "ID" out of bounds\n", i, j)) ; return (FALSE) ; } if (i <= last_row || mark [i] == j) { /* row index is unsorted or repeated (or both), thus col */ /* is jumbled. This is a notice, not an error condition. */ stats [CCOLAMD_STATUS] = CCOLAMD_OK_BUT_JUMBLED ; stats [CCOLAMD_INFO1] = j ; stats [CCOLAMD_INFO2] = i ; (stats [CCOLAMD_INFO3]) ++ ; DEBUG1 (("csymamd: row "ID" col "ID" unsorted/dupl.\n", i, j)) ; } if (mark [i] != j) { if ((both && i != j) || (lower && i > j) || (upper && i < j)) { /* row k of M will contain column indices i and j */ count [i]++ ; count [j]++ ; } } /* mark the row as having been seen in this column */ mark [i] = j ; last_row = i ; } } /* === Compute column pointers of M ===================================== */ /* use output permutation, perm, for column pointers of M */ perm [0] = 0 ; for (j = 1 ; j <= n ; j++) { perm [j] = perm [j-1] + count [j-1] ; } for (j = 0 ; j < n ; j++) { count [j] = perm [j] ; } /* === Construct M ====================================================== */ mnz = perm [n] ; n_row = mnz / 2 ; Mlen = CCOLAMD_recommended (mnz, n_row, n) ; M = (Int *) ((*allocate) (Mlen, sizeof (Int))) ; DEBUG1 (("csymamd: M is "ID"-by-"ID" with "ID" entries, Mlen = %g\n", n_row, n, mnz, (double) Mlen)) ; if (!M) { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_out_of_memory ; (*release) ((void *) count) ; (*release) ((void *) mark) ; DEBUG1 (("csymamd: allocate M (size %g) failed\n", (double) Mlen)) ; return (FALSE) ; } k = 0 ; if (stats [CCOLAMD_STATUS] == CCOLAMD_OK) { /* Matrix is OK */ for (j = 0 ; j < n ; j++) { ASSERT (p [j+1] - p [j] >= 0) ; for (pp = p [j] ; pp < p [j+1] ; pp++) { i = A [pp] ; ASSERT (i >= 0 && i < n) ; if ((both && i != j) || (lower && i > j) || (upper && i < j)) { /* row k of M contains column indices i and j */ M [count [i]++] = k ; M [count [j]++] = k ; k++ ; } } } } else { /* Matrix is jumbled. Do not add duplicates to M. Unsorted cols OK. */ DEBUG1 (("csymamd: Duplicates in A.\n")) ; for (i = 0 ; i < n ; i++) { mark [i] = -1 ; } for (j = 0 ; j < n ; j++) { ASSERT (p [j+1] - p [j] >= 0) ; for (pp = p [j] ; pp < p [j+1] ; pp++) { i = A [pp] ; ASSERT (i >= 0 && i < n) ; if (mark [i] != j) { if ((both && i != j) || (lower && i > j) || (upper && i= 0 */ { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_nrow_negative ; stats [CCOLAMD_INFO1] = n_row ; DEBUG1 (("ccolamd: nrow negative "ID"\n", n_row)) ; return (FALSE) ; } if (n_col < 0) /* n_col must be >= 0 */ { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_ncol_negative ; stats [CCOLAMD_INFO1] = n_col ; DEBUG1 (("ccolamd: ncol negative "ID"\n", n_col)) ; return (FALSE) ; } nnz = p [n_col] ; if (nnz < 0) /* nnz must be >= 0 */ { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_nnz_negative ; stats [CCOLAMD_INFO1] = nnz ; DEBUG1 (("ccolamd: number of entries negative "ID"\n", nnz)) ; return (FALSE) ; } if (p [0] != 0) { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_p0_nonzero ; stats [CCOLAMD_INFO1] = p [0] ; DEBUG1 (("ccolamd: p[0] not zero "ID"\n", p [0])) ; return (FALSE) ; } /* === If no knobs, set default knobs =================================== */ if (!knobs) { CCOLAMD_set_defaults (default_knobs) ; knobs = default_knobs ; } aggressive = (knobs [CCOLAMD_AGGRESSIVE] != FALSE) ; order_for_lu = (knobs [CCOLAMD_LU] != FALSE) ; /* === Allocate workspace from array A ================================== */ ok = TRUE ; Col_size = CCOLAMD_C (n_col, &ok) ; Row_size = CCOLAMD_R (n_row, &ok) ; /* min size of A is 2nnz+ncol. cset and cset_start are of size 2ncol+1 */ /* Each of the 5 fronts is of size n_col + 1. InFront is of size nrow. */ /* need = MAX (2*nnz, 4*n_col) + n_col + Col_size + Row_size + (3*n_col+1) + (5*(n_col+1)) + n_row ; */ need = ccolamd_need (nnz, n_row, n_col, &ok) ; if (!ok || need > (size_t) Alen || need > Int_MAX) { /* not enough space in array A to perform the ordering */ stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_A_too_small ; stats [CCOLAMD_INFO1] = need ; stats [CCOLAMD_INFO2] = Alen ; DEBUG1 (("ccolamd: Need Alen >= "ID", given "ID"\n", need, Alen)) ; return (FALSE) ; } /* since integer overflow has been check, the following cannot overflow: */ Alen -= Col_size + Row_size + (3*n_col + 1) + 5*(n_col+1) + n_row ; /* Size of A is now Alen >= MAX (2*nnz, 4*n_col) + n_col. The ordering * requires Alen >= 2*nnz + n_col, and the postorder requires * Alen >= 5*n_col. */ ap = Alen ; /* Front array workspace: 5*(n_col+1) + n_row */ if (!Front_npivcol || !Front_nrows || !Front_ncols || !Front_parent || !Front_cols || !Front_cols || !InFront) { Front_npivcol = &A [ap] ; ap += (n_col + 1) ; Front_nrows = &A [ap] ; ap += (n_col + 1) ; Front_ncols = &A [ap] ; ap += (n_col + 1) ; Front_parent = &A [ap] ; ap += (n_col + 1) ; Front_cols = &A [ap] ; ap += (n_col + 1) ; InFront = &A [ap] ; ap += (n_row) ; } else { /* Fronts are present. Leave the additional space as elbow room. */ ap += 5*(n_col+1) + n_row ; ap = Alen ; } /* Workspace for cset management: 3*n_col+1 */ /* cset_start is of size n_col + 1 */ cset_start = &A [ap] ; ap += n_col + 1 ; /* dead_col is of size n_col */ dead_cols = &A [ap] ; ap += n_col ; /* cset is of size n_col */ cset = &A [ap] ; ap += n_col ; /* Col is of size Col_size. The space is shared by temp_cstart and csize */ Col = (CColamd_Col *) &A [ap] ; temp_cstart = (Int *) Col ; /* [ temp_cstart is of size n_col+1 */ csize = temp_cstart + (n_col+1) ; /* csize is of size n_col+1 */ ap += Col_size ; ASSERT (Col_size >= 2*n_col+1) ; /* Row is of size Row_size */ Row = (CColamd_Row *) &A [ap] ; ap += Row_size ; /* Initialize csize & dead_cols to zero */ for (i = 0 ; i < n_col ; i++) { csize [i] = 0 ; dead_cols [i] = 0 ; } /* === Construct the constraint set ===================================== */ if (n_col == 0) { n_cset = 0 ; } else if (cmember == (Int *) NULL) { /* no constraint set; all columns belong to set zero */ n_cset = 1 ; csize [0] = n_col ; DEBUG1 (("no cmember present\n")) ; } else { n_cset = 0 ; for (i = 0 ; i < n_col ; i++) { if (cmember [i] < 0 || cmember [i] > n_col) { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_invalid_cmember ; DEBUG1 (("ccolamd: malformed cmember \n")) ; return (FALSE) ; } n_cset = MAX (n_cset, cmember [i]) ; csize [cmember [i]]++ ; } /* cset is zero based */ n_cset++ ; } ASSERT ((n_cset >= 0) && (n_cset <= n_col)) ; cset_start [0] = temp_cstart [0] = 0 ; for (i = 1 ; i <= n_cset ; i++) { cset_start [i] = cset_start [i-1] + csize [i-1] ; DEBUG4 ((" cset_start ["ID"] = "ID" \n", i , cset_start [i])) ; temp_cstart [i] = cset_start [i] ; } /* do in reverse order to encourage natural tie-breaking */ if (cmember == (Int *) NULL) { for (i = n_col-1 ; i >= 0 ; i--) { cset [temp_cstart [0]++] = i ; } } else { for (i = n_col-1 ; i >= 0 ; i--) { cset [temp_cstart [cmember [i]]++] = i ; } } /* ] temp_cstart and csize are no longer used */ /* === Construct the row and column data structures ===================== */ if (!init_rows_cols (n_row, n_col, Row, Col, A, p, stats)) { /* input matrix is invalid */ DEBUG1 (("ccolamd: Matrix invalid\n")) ; return (FALSE) ; } /* === Initialize front info ============================================ */ for (col = 0 ; col < n_col ; col++) { Front_npivcol [col] = 0 ; Front_nrows [col] = 0 ; Front_ncols [col] = 0 ; Front_parent [col] = EMPTY ; Front_cols [col] = EMPTY ; } /* === Initialize scores, kill dense rows/columns ======================= */ init_scoring (n_row, n_col, Row, Col, A, p, knobs, &n_row2, &n_col2, &max_deg, cmember, n_cset, cset_start, dead_cols, &ndense_row, &nempty_row, &nnewlyempty_row, &ndense_col, &nempty_col, &nnewlyempty_col) ; ASSERT (n_row2 == n_row - nempty_row - nnewlyempty_row - ndense_row) ; ASSERT (n_col2 == n_col - nempty_col - nnewlyempty_col - ndense_col) ; DEBUG1 (("# dense rows "ID" cols "ID"\n", ndense_row, ndense_col)) ; /* === Order the supercolumns =========================================== */ ngarbage = find_ordering (n_row, n_col, Alen, Row, Col, A, p, #ifndef NDEBUG n_col2, #endif max_deg, 2*nnz, cset, cset_start, #ifndef NDEBUG n_cset, #endif cmember, Front_npivcol, Front_nrows, Front_ncols, Front_parent, Front_cols, &nfr, aggressive, InFront, order_for_lu) ; ASSERT (Alen >= 5*n_col) ; /* === Postorder ======================================================== */ /* A is no longer needed, so use A [0..5*nfr-1] as workspace [ [ */ /* This step requires Alen >= 5*n_col */ Front_child = A ; Front_sibling = Front_child + nfr ; Front_stack = Front_sibling + nfr ; Front_order = Front_stack + nfr ; Front_size = Front_order + nfr ; CCOLAMD_fsize (nfr, Front_size, Front_nrows, Front_ncols, Front_parent, Front_npivcol) ; CCOLAMD_postorder (nfr, Front_parent, Front_npivcol, Front_size, Front_order, Front_child, Front_sibling, Front_stack, Front_cols, cmember) ; /* Front_size, Front_stack, Front_child, Front_sibling no longer needed ] */ /* use A [0..nfr-1] as workspace */ CCOLAMD_apply_order (Front_npivcol, Front_order, A, nfr, nfr) ; CCOLAMD_apply_order (Front_nrows, Front_order, A, nfr, nfr) ; CCOLAMD_apply_order (Front_ncols, Front_order, A, nfr, nfr) ; CCOLAMD_apply_order (Front_parent, Front_order, A, nfr, nfr) ; CCOLAMD_apply_order (Front_cols, Front_order, A, nfr, nfr) ; /* fix the parent to refer to the new numbering */ for (i = 0 ; i < nfr ; i++) { parent = Front_parent [i] ; if (parent != EMPTY) { Front_parent [i] = Front_order [parent] ; } } /* fix InFront to refer to the new numbering */ for (row = 0 ; row < n_row ; row++) { i = InFront [row] ; ASSERT (i >= EMPTY && i < nfr) ; if (i != EMPTY) { InFront [row] = Front_order [i] ; } } /* Front_order longer needed ] */ /* === Order the columns in the fronts ================================== */ /* use A [0..n_col-1] as inverse permutation */ for (i = 0 ; i < n_col ; i++) { A [i] = EMPTY ; } k = 0 ; set1 = 0 ; for (i = 0 ; i < nfr ; i++) { ASSERT (Front_npivcol [i] > 0) ; set2 = CMEMBER (Front_cols [i]) ; while (set1 < set2) { k += dead_cols [set1] ; DEBUG3 (("Skip null/dense columns of set "ID"\n",set1)) ; set1++ ; } set1 = set2 ; for (col = Front_cols [i] ; col != EMPTY ; col = Col [col].nextcol) { ASSERT (col >= 0 && col < n_col) ; DEBUG1 (("ccolamd output ordering: k "ID" col "ID"\n", k, col)) ; p [k] = col ; ASSERT (A [col] == EMPTY) ; cs = CMEMBER (col) ; ASSERT (k >= cset_start [cs] && k < cset_start [cs+1]) ; A [col] = k ; k++ ; } } /* === Order the "dense" and null columns =============================== */ if (n_col2 < n_col) { for (col = 0 ; col < n_col ; col++) { if (A [col] == EMPTY) { k = Col [col].shared2.order ; cs = CMEMBER (col) ; #ifndef NDEBUG dead_cols [cs]-- ; #endif ASSERT (k >= cset_start [cs] && k < cset_start [cs+1]) ; DEBUG1 (("ccolamd output ordering: k "ID" col "ID " (dense or null col)\n", k, col)) ; p [k] = col ; A [col] = k ; } } } #ifndef NDEBUG for (i = 0 ; i < n_cset ; i++) { ASSERT (dead_cols [i] == 0) ; } #endif /* === Return statistics in stats ======================================= */ stats [CCOLAMD_DENSE_ROW] = ndense_row ; stats [CCOLAMD_EMPTY_ROW] = nempty_row ; /* fixed in 2.7.3 */ stats [CCOLAMD_NEWLY_EMPTY_ROW] = nnewlyempty_row ; stats [CCOLAMD_DENSE_COL] = ndense_col ; stats [CCOLAMD_EMPTY_COL] = nempty_col ; stats [CCOLAMD_NEWLY_EMPTY_COL] = nnewlyempty_col ; ASSERT (ndense_col + nempty_col + nnewlyempty_col == n_col - n_col2) ; if (p_nfr) { *p_nfr = nfr ; } stats [CCOLAMD_DEFRAG_COUNT] = ngarbage ; DEBUG1 (("ccolamd: done.\n")) ; return (TRUE) ; } /* ========================================================================== */ /* === colamd_report ======================================================== */ /* ========================================================================== */ PUBLIC void CCOLAMD_report ( Int stats [CCOLAMD_STATS] ) { print_report ("ccolamd", stats) ; } /* ========================================================================== */ /* === symamd_report ======================================================== */ /* ========================================================================== */ PUBLIC void CSYMAMD_report ( Int stats [CCOLAMD_STATS] ) { print_report ("csymamd", stats) ; } /* ========================================================================== */ /* === NON-USER-CALLABLE ROUTINES: ========================================== */ /* ========================================================================== */ /* There are no user-callable routines beyond this point in the file */ /* ========================================================================== */ /* === init_rows_cols ======================================================= */ /* ========================================================================== */ /* Takes the column form of the matrix in A and creates the row form of the matrix. Also, row and column attributes are stored in the Col and Row structs. If the columns are un-sorted or contain duplicate row indices, this routine will also sort and remove duplicate row indices from the column form of the matrix. Returns FALSE if the matrix is invalid, TRUE otherwise. Not user-callable. */ PRIVATE Int init_rows_cols /* returns TRUE if OK, or FALSE otherwise */ ( /* === Parameters ======================================================= */ Int n_row, /* number of rows of A */ Int n_col, /* number of columns of A */ CColamd_Row Row [ ], /* of size n_row+1 */ CColamd_Col Col [ ], /* of size n_col+1 */ Int A [ ], /* row indices of A, of size Alen */ Int p [ ], /* pointers to columns in A, of size n_col+1 */ Int stats [CCOLAMD_STATS] /* colamd statistics */ ) { /* === Local variables ================================================== */ Int col ; /* a column index */ Int row ; /* a row index */ Int *cp ; /* a column pointer */ Int *cp_end ; /* a pointer to the end of a column */ Int *rp ; /* a row pointer */ Int *rp_end ; /* a pointer to the end of a row */ Int last_row ; /* previous row */ /* === Initialize columns, and check column pointers ==================== */ for (col = 0 ; col < n_col ; col++) { Col [col].start = p [col] ; Col [col].length = p [col+1] - p [col] ; if (Col [col].length < 0) { /* column pointers must be non-decreasing */ stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_col_length_negative ; stats [CCOLAMD_INFO1] = col ; stats [CCOLAMD_INFO2] = Col [col].length ; DEBUG1 (("ccolamd: col "ID" length "ID" < 0\n", col, Col [col].length)) ; return (FALSE) ; } Col [col].shared1.thickness = 1 ; Col [col].shared2.score = 0 ; Col [col].shared3.prev = EMPTY ; Col [col].shared4.degree_next = EMPTY ; Col [col].nextcol = EMPTY ; Col [col].lastcol = col ; } /* p [0..n_col] no longer needed, used as "head" in subsequent routines */ /* === Scan columns, compute row degrees, and check row indices ========= */ stats [CCOLAMD_INFO3] = 0 ; /* number of duplicate or unsorted row indices*/ for (row = 0 ; row < n_row ; row++) { Row [row].length = 0 ; Row [row].shared2.mark = -1 ; Row [row].thickness = 1 ; Row [row].front = EMPTY ; } for (col = 0 ; col < n_col ; col++) { DEBUG1 (("\nCcolamd input column "ID":\n", col)) ; last_row = -1 ; cp = &A [p [col]] ; cp_end = &A [p [col+1]] ; while (cp < cp_end) { row = *cp++ ; DEBUG1 (("row: "ID"\n", row)) ; /* make sure row indices within range */ if (row < 0 || row >= n_row) { stats [CCOLAMD_STATUS] = CCOLAMD_ERROR_row_index_out_of_bounds ; stats [CCOLAMD_INFO1] = col ; stats [CCOLAMD_INFO2] = row ; stats [CCOLAMD_INFO3] = n_row ; DEBUG1 (("row "ID" col "ID" out of bounds\n", row, col)) ; return (FALSE) ; } if (row <= last_row || Row [row].shared2.mark == col) { /* row index are unsorted or repeated (or both), thus col */ /* is jumbled. This is a notice, not an error condition. */ stats [CCOLAMD_STATUS] = CCOLAMD_OK_BUT_JUMBLED ; stats [CCOLAMD_INFO1] = col ; stats [CCOLAMD_INFO2] = row ; (stats [CCOLAMD_INFO3]) ++ ; DEBUG1 (("row "ID" col "ID" unsorted/duplicate\n", row, col)) ; } if (Row [row].shared2.mark != col) { Row [row].length++ ; } else { /* this is a repeated entry in the column, */ /* it will be removed */ Col [col].length-- ; } /* mark the row as having been seen in this column */ Row [row].shared2.mark = col ; last_row = row ; } } /* === Compute row pointers ============================================= */ /* row form of the matrix starts directly after the column */ /* form of matrix in A */ Row [0].start = p [n_col] ; Row [0].shared1.p = Row [0].start ; Row [0].shared2.mark = -1 ; for (row = 1 ; row < n_row ; row++) { Row [row].start = Row [row-1].start + Row [row-1].length ; Row [row].shared1.p = Row [row].start ; Row [row].shared2.mark = -1 ; } /* === Create row form ================================================== */ if (stats [CCOLAMD_STATUS] == CCOLAMD_OK_BUT_JUMBLED) { /* if cols jumbled, watch for repeated row indices */ for (col = 0 ; col < n_col ; col++) { cp = &A [p [col]] ; cp_end = &A [p [col+1]] ; while (cp < cp_end) { row = *cp++ ; if (Row [row].shared2.mark != col) { A [(Row [row].shared1.p)++] = col ; Row [row].shared2.mark = col ; } } } } else { /* if cols not jumbled, we don't need the mark (this is faster) */ for (col = 0 ; col < n_col ; col++) { cp = &A [p [col]] ; cp_end = &A [p [col+1]] ; while (cp < cp_end) { A [(Row [*cp++].shared1.p)++] = col ; } } } /* === Clear the row marks and set row degrees ========================== */ for (row = 0 ; row < n_row ; row++) { Row [row].shared2.mark = 0 ; Row [row].shared1.degree = Row [row].length ; } /* === See if we need to re-create columns ============================== */ if (stats [CCOLAMD_STATUS] == CCOLAMD_OK_BUT_JUMBLED) { DEBUG1 (("ccolamd: reconstructing column form, matrix jumbled\n")) ; #ifndef NDEBUG /* make sure column lengths are correct */ for (col = 0 ; col < n_col ; col++) { p [col] = Col [col].length ; } for (row = 0 ; row < n_row ; row++) { rp = &A [Row [row].start] ; rp_end = rp + Row [row].length ; while (rp < rp_end) { p [*rp++]-- ; } } for (col = 0 ; col < n_col ; col++) { ASSERT (p [col] == 0) ; } /* now p is all zero (different than when debugging is turned off) */ #endif /* === Compute col pointers ========================================= */ /* col form of the matrix starts at A [0]. */ /* Note, we may have a gap between the col form and the row */ /* form if there were duplicate entries, if so, it will be */ /* removed upon the first garbage collection */ Col [0].start = 0 ; p [0] = Col [0].start ; for (col = 1 ; col < n_col ; col++) { /* note that the lengths here are for pruned columns, i.e. */ /* no duplicate row indices will exist for these columns */ Col [col].start = Col [col-1].start + Col [col-1].length ; p [col] = Col [col].start ; } /* === Re-create col form =========================================== */ for (row = 0 ; row < n_row ; row++) { rp = &A [Row [row].start] ; rp_end = rp + Row [row].length ; while (rp < rp_end) { A [(p [*rp++])++] = row ; } } } /* === Done. Matrix is not (or no longer) jumbled ====================== */ return (TRUE) ; } /* ========================================================================== */ /* === init_scoring ========================================================= */ /* ========================================================================== */ /* Kills dense or empty columns and rows, calculates an initial score for each column, and places all columns in the degree lists. Not user-callable. */ PRIVATE void init_scoring ( /* === Parameters ======================================================= */ Int n_row, /* number of rows of A */ Int n_col, /* number of columns of A */ CColamd_Row Row [ ], /* of size n_row+1 */ CColamd_Col Col [ ], /* of size n_col+1 */ Int A [ ], /* column form and row form of A */ Int head [ ], /* of size n_col+1 */ double knobs [CCOLAMD_KNOBS],/* parameters */ Int *p_n_row2, /* number of non-dense, non-empty rows */ Int *p_n_col2, /* number of non-dense, non-empty columns */ Int *p_max_deg, /* maximum row degree */ Int cmember [ ], Int n_cset, Int cset_start [ ], Int dead_cols [ ], Int *p_ndense_row, /* number of dense rows */ Int *p_nempty_row, /* number of original empty rows */ Int *p_nnewlyempty_row, /* number of newly empty rows */ Int *p_ndense_col, /* number of dense cols (excl "empty" cols) */ Int *p_nempty_col, /* number of original empty cols */ Int *p_nnewlyempty_col /* number of newly empty cols */ ) { /* === Local variables ================================================== */ Int c ; /* a column index */ Int r, row ; /* a row index */ Int *cp ; /* a column pointer */ Int deg ; /* degree of a row or column */ Int *cp_end ; /* a pointer to the end of a column */ Int *new_cp ; /* new column pointer */ Int col_length ; /* length of pruned column */ Int score ; /* current column score */ Int n_col2 ; /* number of non-dense, non-empty columns */ Int n_row2 ; /* number of non-dense, non-empty rows */ Int dense_row_count ; /* remove rows with more entries than this */ Int dense_col_count ; /* remove cols with more entries than this */ Int max_deg ; /* maximum row degree */ Int s ; /* a cset index */ Int ndense_row ; /* number of dense rows */ Int nempty_row ; /* number of empty rows */ Int nnewlyempty_row ; /* number of newly empty rows */ Int ndense_col ; /* number of dense cols (excl "empty" cols) */ Int nempty_col ; /* number of original empty cols */ Int nnewlyempty_col ; /* number of newly empty cols */ Int ne ; #ifndef NDEBUG Int debug_count ; /* debug only. */ #endif /* === Extract knobs ==================================================== */ /* Note: if knobs contains a NaN, this is undefined: */ if (knobs [CCOLAMD_DENSE_ROW] < 0) { /* only remove completely dense rows */ dense_row_count = n_col-1 ; } else { dense_row_count = DENSE_DEGREE (knobs [CCOLAMD_DENSE_ROW], n_col) ; } if (knobs [CCOLAMD_DENSE_COL] < 0) { /* only remove completely dense columns */ dense_col_count = n_row-1 ; } else { dense_col_count = DENSE_DEGREE (knobs [CCOLAMD_DENSE_COL], MIN (n_row, n_col)) ; } DEBUG1 (("densecount: "ID" "ID"\n", dense_row_count, dense_col_count)) ; max_deg = 0 ; n_col2 = n_col ; n_row2 = n_row ; /* Set the head array for bookkeeping of dense and empty columns. */ /* This will be used as hash buckets later. */ for (s = 0 ; s < n_cset ; s++) { head [s] = cset_start [s+1] ; } ndense_col = 0 ; nempty_col = 0 ; nnewlyempty_col = 0 ; ndense_row = 0 ; nempty_row = 0 ; nnewlyempty_row = 0 ; /* === Kill empty columns =============================================== */ /* Put the empty columns at the end in their natural order, so that LU */ /* factorization can proceed as far as possible. */ for (c = n_col-1 ; c >= 0 ; c--) { deg = Col [c].length ; if (deg == 0) { /* this is a empty column, kill and order it last of its cset */ Col [c].shared2.order = --head [CMEMBER (c)] ; --n_col2 ; dead_cols [CMEMBER (c)] ++ ; nempty_col++ ; KILL_PRINCIPAL_COL (c) ; } } DEBUG1 (("ccolamd: null columns killed: "ID"\n", n_col - n_col2)) ; /* === Kill dense columns =============================================== */ /* Put the dense columns at the end, in their natural order */ for (c = n_col-1 ; c >= 0 ; c--) { /* skip any dead columns */ if (COL_IS_DEAD (c)) { continue ; } deg = Col [c].length ; if (deg > dense_col_count) { /* this is a dense column, kill and order it last of its cset */ Col [c].shared2.order = --head [CMEMBER (c)] ; --n_col2 ; dead_cols [CMEMBER (c)] ++ ; ndense_col++ ; /* decrement the row degrees */ cp = &A [Col [c].start] ; cp_end = cp + Col [c].length ; while (cp < cp_end) { Row [*cp++].shared1.degree-- ; } KILL_PRINCIPAL_COL (c) ; } } DEBUG1 (("Dense and null columns killed: "ID"\n", n_col - n_col2)) ; /* === Kill dense and empty rows ======================================== */ /* Note that there can now be empty rows, since dense columns have * been deleted. These are "newly" empty rows. */ ne = 0 ; for (r = 0 ; r < n_row ; r++) { deg = Row [r].shared1.degree ; ASSERT (deg >= 0 && deg <= n_col) ; if (deg > dense_row_count) { /* There is at least one dense row. Continue ordering, but */ /* symbolic factorization will be redone after ccolamd is done.*/ ndense_row++ ; } if (deg == 0) { /* this is a newly empty row, or original empty row */ ne++ ; } if (deg > dense_row_count || deg == 0) { /* kill a dense or empty row */ KILL_ROW (r) ; Row [r].thickness = 0 ; --n_row2 ; } else { /* keep track of max degree of remaining rows */ max_deg = MAX (max_deg, deg) ; } } nnewlyempty_row = ne - nempty_row ; DEBUG1 (("ccolamd: Dense and null rows killed: "ID"\n", n_row - n_row2)) ; /* === Compute initial column scores ==================================== */ /* At this point the row degrees are accurate. They reflect the number */ /* of "live" (non-dense) columns in each row. No empty rows exist. */ /* Some "live" columns may contain only dead rows, however. These are */ /* pruned in the code below. */ /* now find the initial COLMMD score for each column */ for (c = n_col-1 ; c >= 0 ; c--) { /* skip dead column */ if (COL_IS_DEAD (c)) { continue ; } score = 0 ; cp = &A [Col [c].start] ; new_cp = cp ; cp_end = cp + Col [c].length ; while (cp < cp_end) { /* get a row */ row = *cp++ ; /* skip if dead */ if (ROW_IS_DEAD (row)) { continue ; } /* compact the column */ *new_cp++ = row ; /* add row's external degree */ score += Row [row].shared1.degree - 1 ; /* guard against integer overflow */ score = MIN (score, n_col) ; } /* determine pruned column length */ col_length = (Int) (new_cp - &A [Col [c].start]) ; if (col_length == 0) { /* a newly-made null column (all rows in this col are "dense" */ /* and have already been killed) */ DEBUG1 (("Newly null killed: "ID"\n", c)) ; Col [c].shared2.order = -- head [CMEMBER (c)] ; --n_col2 ; dead_cols [CMEMBER (c)] ++ ; nnewlyempty_col++ ; KILL_PRINCIPAL_COL (c) ; } else { /* set column length and set score */ ASSERT (score >= 0) ; ASSERT (score <= n_col) ; Col [c].length = col_length ; Col [c].shared2.score = score ; } } DEBUG1 (("ccolamd: Dense, null, and newly-null columns killed: "ID"\n", n_col-n_col2)) ; /* At this point, all empty rows and columns are dead. All live columns */ /* are "clean" (containing no dead rows) and simplicial (no supercolumns */ /* yet). Rows may contain dead columns, but all live rows contain at */ /* least one live column. */ #ifndef NDEBUG debug_count = 0 ; #endif /* clear the hash buckets */ for (c = 0 ; c <= n_col ; c++) { head [c] = EMPTY ; } #ifndef NDEBUG debug_structures (n_row, n_col, Row, Col, A, cmember, cset_start) ; #endif /* === Return number of remaining columns, and max row degree =========== */ *p_n_col2 = n_col2 ; *p_n_row2 = n_row2 ; *p_max_deg = max_deg ; *p_ndense_row = ndense_row ; *p_nempty_row = nempty_row ; /* original empty rows */ *p_nnewlyempty_row = nnewlyempty_row ; *p_ndense_col = ndense_col ; *p_nempty_col = nempty_col ; /* original empty cols */ *p_nnewlyempty_col = nnewlyempty_col ; } /* ========================================================================== */ /* === find_ordering ======================================================== */ /* ========================================================================== */ /* * Order the principal columns of the supercolumn form of the matrix * (no supercolumns on input). Uses a minimum approximate column minimum * degree ordering method. Not user-callable. */ PRIVATE Int find_ordering /* return the number of garbage collections */ ( /* === Parameters ======================================================= */ Int n_row, /* number of rows of A */ Int n_col, /* number of columns of A */ Int Alen, /* size of A, 2*nnz + n_col or larger */ CColamd_Row Row [ ], /* of size n_row+1 */ CColamd_Col Col [ ], /* of size n_col+1 */ Int A [ ], /* column form and row form of A */ Int head [ ], /* of size n_col+1 */ #ifndef NDEBUG Int n_col2, /* Remaining columns to order */ #endif Int max_deg, /* Maximum row degree */ Int pfree, /* index of first free slot (2*nnz on entry) */ Int cset [ ], /* constraint set of A */ Int cset_start [ ], /* pointer to the start of every cset */ #ifndef NDEBUG Int n_cset, /* number of csets */ #endif Int cmember [ ], /* col -> cset mapping */ Int Front_npivcol [ ], Int Front_nrows [ ], Int Front_ncols [ ], Int Front_parent [ ], Int Front_cols [ ], Int *p_nfr, /* number of fronts */ Int aggressive, Int InFront [ ], Int order_for_lu ) { /* === Local variables ================================================== */ Int k ; /* current pivot ordering step */ Int pivot_col ; /* current pivot column */ Int *cp ; /* a column pointer */ Int *rp ; /* a row pointer */ Int pivot_row ; /* current pivot row */ Int *new_cp ; /* modified column pointer */ Int *new_rp ; /* modified row pointer */ Int pivot_row_start ; /* pointer to start of pivot row */ Int pivot_row_degree ; /* number of columns in pivot row */ Int pivot_row_length ; /* number of supercolumns in pivot row */ Int pivot_col_score ; /* score of pivot column */ Int needed_memory ; /* free space needed for pivot row */ Int *cp_end ; /* pointer to the end of a column */ Int *rp_end ; /* pointer to the end of a row */ Int row ; /* a row index */ Int col ; /* a column index */ Int max_score ; /* maximum possible score */ Int cur_score ; /* score of current column */ unsigned Int hash ; /* hash value for supernode detection */ Int head_column ; /* head of hash bucket */ Int first_col ; /* first column in hash bucket */ Int tag_mark ; /* marker value for mark array */ Int row_mark ; /* Row [row].shared2.mark */ Int set_difference ; /* set difference size of row with pivot row */ Int min_score ; /* smallest column score */ Int col_thickness ; /* "thickness" (no. of columns in a supercol) */ Int max_mark ; /* maximum value of tag_mark */ Int pivot_col_thickness ; /* number of columns represented by pivot col */ Int prev_col ; /* Used by Dlist operations. */ Int next_col ; /* Used by Dlist operations. */ Int ngarbage ; /* number of garbage collections performed */ Int current_set ; /* consraint set that is being ordered */ Int score ; /* score of a column */ Int colstart ; /* pointer to first column in current cset */ Int colend ; /* pointer to last column in current cset */ Int deadcol ; /* number of dense & null columns in a cset */ #ifndef NDEBUG Int debug_d ; /* debug loop counter */ Int debug_step = 0 ; /* debug loop counter */ Int cols_thickness = 0 ; /* the thickness of the columns in current */ /* cset degreelist and in pivot row pattern. */ #endif Int pivot_row_thickness ; /* number of rows represented by pivot row */ Int nfr = 0 ; /* number of fronts */ Int child ; /* === Initialization and clear mark ==================================== */ max_mark = Int_MAX - n_col ; /* Int_MAX defined in */ tag_mark = clear_mark (0, max_mark, n_row, Row) ; min_score = 0 ; ngarbage = 0 ; current_set = -1 ; deadcol = 0 ; DEBUG1 (("ccolamd: Ordering, n_col2="ID"\n", n_col2)) ; for (row = 0 ; row < n_row ; row++) { InFront [row] = EMPTY ; } /* === Order the columns ================================================ */ for (k = 0 ; k < n_col ; /* 'k' is incremented below */) { /* make sure degree list isn't empty */ ASSERT (min_score >= 0) ; ASSERT (min_score <= n_col) ; ASSERT (head [min_score] >= EMPTY) ; #ifndef NDEBUG for (debug_d = 0 ; debug_d < min_score ; debug_d++) { ASSERT (head [debug_d] == EMPTY) ; } #endif /* Initialize the degree list with columns from next non-empty cset */ while ((k+deadcol) == cset_start [current_set+1]) { current_set++ ; DEBUG1 (("\n\n\n============ CSET: "ID"\n", current_set)) ; k += deadcol ; /* jump to start of next cset */ deadcol = 0 ; /* reset dead column count */ ASSERT ((current_set == n_cset) == (k == n_col)) ; /* return if all columns are ordered. */ if (k == n_col) { *p_nfr = nfr ; return (ngarbage) ; } #ifndef NDEBUG for (col = 0 ; col <= n_col ; col++) { ASSERT (head [col] == EMPTY) ; } #endif min_score = n_col ; colstart = cset_start [current_set] ; colend = cset_start [current_set+1] ; while (colstart < colend) { col = cset [colstart++] ; if (COL_IS_DEAD(col)) { DEBUG1 (("Column "ID" is dead\n", col)) ; /* count dense and null columns */ if (Col [col].shared2.order != EMPTY) { deadcol++ ; } continue ; } /* only add principal columns in current set to degree lists */ ASSERT (CMEMBER (col) == current_set) ; score = Col [col].shared2.score ; DEBUG1 (("Column "ID" is alive, score "ID"\n", col, score)) ; ASSERT (min_score >= 0) ; ASSERT (min_score <= n_col) ; ASSERT (score >= 0) ; ASSERT (score <= n_col) ; ASSERT (head [score] >= EMPTY) ; /* now add this column to dList at proper score location */ next_col = head [score] ; Col [col].shared3.prev = EMPTY ; Col [col].shared4.degree_next = next_col ; /* if there already was a column with the same score, set its */ /* previous pointer to this new column */ if (next_col != EMPTY) { Col [next_col].shared3.prev = col ; } head [score] = col ; /* see if this score is less than current min */ min_score = MIN (min_score, score) ; } #ifndef NDEBUG DEBUG1 (("degree lists initialized \n")) ; debug_deg_lists (n_row, n_col, Row, Col, head, min_score, ((cset_start [current_set+1]-cset_start [current_set])-deadcol), max_deg) ; #endif } #ifndef NDEBUG if (debug_step % 100 == 0) { DEBUG2 (("\n... Step k: "ID" out of n_col2: "ID"\n", k, n_col2)) ; } else { DEBUG3 (("\n------Step k: "ID" out of n_col2: "ID"\n", k, n_col2)) ; } debug_step++ ; DEBUG1 (("start of step k="ID": ", k)) ; debug_deg_lists (n_row, n_col, Row, Col, head, min_score, cset_start [current_set+1]-(k+deadcol), max_deg) ; debug_matrix (n_row, n_col, Row, Col, A) ; #endif /* === Select pivot column, and order it ============================ */ while (head [min_score] == EMPTY && min_score < n_col) { min_score++ ; } pivot_col = head [min_score] ; ASSERT (pivot_col >= 0 && pivot_col <= n_col) ; next_col = Col [pivot_col].shared4.degree_next ; head [min_score] = next_col ; if (next_col != EMPTY) { Col [next_col].shared3.prev = EMPTY ; } ASSERT (COL_IS_ALIVE (pivot_col)) ; /* remember score for defrag check */ pivot_col_score = Col [pivot_col].shared2.score ; /* the pivot column is the kth column in the pivot order */ Col [pivot_col].shared2.order = k ; /* increment order count by column thickness */ pivot_col_thickness = Col [pivot_col].shared1.thickness ; k += pivot_col_thickness ; ASSERT (pivot_col_thickness > 0) ; DEBUG3 (("Pivot col: "ID" thick "ID"\n", pivot_col, pivot_col_thickness)) ; /* === Garbage_collection, if necessary ============================= */ needed_memory = MIN (pivot_col_score, n_col - k) ; if (pfree + needed_memory >= Alen) { pfree = garbage_collection (n_row, n_col, Row, Col, A, &A [pfree]) ; ngarbage++ ; /* after garbage collection we will have enough */ ASSERT (pfree + needed_memory < Alen) ; /* garbage collection has wiped out Row [ ].shared2.mark array */ tag_mark = clear_mark (0, max_mark, n_row, Row) ; #ifndef NDEBUG debug_matrix (n_row, n_col, Row, Col, A) ; #endif } /* === Compute pivot row pattern ==================================== */ /* get starting location for this new merged row */ pivot_row_start = pfree ; /* initialize new row counts to zero */ pivot_row_degree = 0 ; pivot_row_thickness = 0 ; /* tag pivot column as having been visited so it isn't included */ /* in merged pivot row */ Col [pivot_col].shared1.thickness = -pivot_col_thickness ; /* pivot row is the union of all rows in the pivot column pattern */ cp = &A [Col [pivot_col].start] ; cp_end = cp + Col [pivot_col].length ; while (cp < cp_end) { /* get a row */ row = *cp++ ; ASSERT (row >= 0 && row < n_row) ; DEBUG4 (("Pivcol pattern "ID" "ID"\n", ROW_IS_ALIVE (row), row)) ; /* skip if row is dead */ if (ROW_IS_ALIVE (row)) { /* sum the thicknesses of all the rows */ pivot_row_thickness += Row [row].thickness ; rp = &A [Row [row].start] ; rp_end = rp + Row [row].length ; while (rp < rp_end) { /* get a column */ col = *rp++ ; /* add the column, if alive and untagged */ col_thickness = Col [col].shared1.thickness ; if (col_thickness > 0 && COL_IS_ALIVE (col)) { /* tag column in pivot row */ Col [col].shared1.thickness = -col_thickness ; ASSERT (pfree < Alen) ; /* place column in pivot row */ A [pfree++] = col ; pivot_row_degree += col_thickness ; DEBUG4 (("\t\t\tNew live col in pivrow: "ID"\n",col)) ; } #ifndef NDEBUG if (col_thickness < 0 && COL_IS_ALIVE (col)) { DEBUG4 (("\t\t\tOld live col in pivrow: "ID"\n",col)) ; } #endif } } } /* pivot_row_thickness is the number of rows in frontal matrix */ /* including both pivotal rows and nonpivotal rows */ /* clear tag on pivot column */ Col [pivot_col].shared1.thickness = pivot_col_thickness ; max_deg = MAX (max_deg, pivot_row_degree) ; #ifndef NDEBUG DEBUG3 (("check2\n")) ; debug_mark (n_row, Row, tag_mark, max_mark) ; #endif /* === Kill all rows used to construct pivot row ==================== */ /* also kill pivot row, temporarily */ cp = &A [Col [pivot_col].start] ; cp_end = cp + Col [pivot_col].length ; while (cp < cp_end) { /* may be killing an already dead row */ row = *cp++ ; DEBUG3 (("Kill row in pivot col: "ID"\n", row)) ; ASSERT (row >= 0 && row < n_row) ; if (ROW_IS_ALIVE (row)) { if (Row [row].front != EMPTY) { /* This row represents a frontal matrix. */ /* Row [row].front is a child of current front */ child = Row [row].front ; Front_parent [child] = nfr ; DEBUG1 (("Front "ID" => front "ID", normal\n", child, nfr)); } else { /* This is an original row. Keep track of which front * is its parent in the row-merge tree. */ InFront [row] = nfr ; DEBUG1 (("Row "ID" => front "ID", normal\n", row, nfr)) ; } } KILL_ROW (row) ; Row [row].thickness = 0 ; } /* === Select a row index to use as the new pivot row =============== */ pivot_row_length = pfree - pivot_row_start ; if (pivot_row_length > 0) { /* pick the "pivot" row arbitrarily (first row in col) */ pivot_row = A [Col [pivot_col].start] ; DEBUG3 (("Pivotal row is "ID"\n", pivot_row)) ; } else { /* there is no pivot row, since it is of zero length */ pivot_row = EMPTY ; ASSERT (pivot_row_length == 0) ; } ASSERT (Col [pivot_col].length > 0 || pivot_row_length == 0) ; /* === Approximate degree computation =============================== */ /* Here begins the computation of the approximate degree. The column */ /* score is the sum of the pivot row "length", plus the size of the */ /* set differences of each row in the column minus the pattern of the */ /* pivot row itself. The column ("thickness") itself is also */ /* excluded from the column score (we thus use an approximate */ /* external degree). */ /* The time taken by the following code (compute set differences, and */ /* add them up) is proportional to the size of the data structure */ /* being scanned - that is, the sum of the sizes of each column in */ /* the pivot row. Thus, the amortized time to compute a column score */ /* is proportional to the size of that column (where size, in this */ /* context, is the column "length", or the number of row indices */ /* in that column). The number of row indices in a column is */ /* monotonically non-decreasing, from the length of the original */ /* column on input to colamd. */ /* === Compute set differences ====================================== */ DEBUG3 (("** Computing set differences phase. **\n")) ; /* pivot row is currently dead - it will be revived later. */ DEBUG3 (("Pivot row: ")) ; /* for each column in pivot row */ rp = &A [pivot_row_start] ; rp_end = rp + pivot_row_length ; while (rp < rp_end) { col = *rp++ ; ASSERT (COL_IS_ALIVE (col) && col != pivot_col) ; DEBUG3 (("Col: "ID"\n", col)) ; /* clear tags used to construct pivot row pattern */ col_thickness = -Col [col].shared1.thickness ; ASSERT (col_thickness > 0) ; Col [col].shared1.thickness = col_thickness ; /* === Remove column from degree list =========================== */ /* only columns in current_set will be in degree list */ if (CMEMBER (col) == current_set) { #ifndef NDEBUG cols_thickness += col_thickness ; #endif cur_score = Col [col].shared2.score ; prev_col = Col [col].shared3.prev ; next_col = Col [col].shared4.degree_next ; DEBUG3 ((" cur_score "ID" prev_col "ID" next_col "ID"\n", cur_score, prev_col, next_col)) ; ASSERT (cur_score >= 0) ; ASSERT (cur_score <= n_col) ; ASSERT (cur_score >= EMPTY) ; if (prev_col == EMPTY) { head [cur_score] = next_col ; } else { Col [prev_col].shared4.degree_next = next_col ; } if (next_col != EMPTY) { Col [next_col].shared3.prev = prev_col ; } } /* === Scan the column ========================================== */ cp = &A [Col [col].start] ; cp_end = cp + Col [col].length ; while (cp < cp_end) { /* get a row */ row = *cp++ ; row_mark = Row [row].shared2.mark ; /* skip if dead */ if (ROW_IS_MARKED_DEAD (row_mark)) { continue ; } ASSERT (row != pivot_row) ; set_difference = row_mark - tag_mark ; /* check if the row has been seen yet */ if (set_difference < 0) { ASSERT (Row [row].shared1.degree <= max_deg) ; set_difference = Row [row].shared1.degree ; } /* subtract column thickness from this row's set difference */ set_difference -= col_thickness ; ASSERT (set_difference >= 0) ; /* absorb this row if the set difference becomes zero */ if (set_difference == 0 && aggressive) { DEBUG3 (("aggressive absorption. Row: "ID"\n", row)) ; if (Row [row].front != EMPTY) { /* Row [row].front is a child of current front. */ child = Row [row].front ; Front_parent [child] = nfr ; DEBUG1 (("Front "ID" => front "ID", aggressive\n", child, nfr)) ; } else { /* this is an original row. Keep track of which front * assembles it, for the row-merge tree */ InFront [row] = nfr ; DEBUG1 (("Row "ID" => front "ID", aggressive\n", row, nfr)) ; } KILL_ROW (row) ; /* sum the thicknesses of all the rows */ pivot_row_thickness += Row [row].thickness ; Row [row].thickness = 0 ; } else { /* save the new mark */ Row [row].shared2.mark = set_difference + tag_mark ; } } } #ifndef NDEBUG debug_deg_lists (n_row, n_col, Row, Col, head, min_score, cset_start [current_set+1]-(k+deadcol)-(cols_thickness), max_deg) ; cols_thickness = 0 ; #endif /* === Add up set differences for each column ======================= */ DEBUG3 (("** Adding set differences phase. **\n")) ; /* for each column in pivot row */ rp = &A [pivot_row_start] ; rp_end = rp + pivot_row_length ; while (rp < rp_end) { /* get a column */ col = *rp++ ; ASSERT (COL_IS_ALIVE (col) && col != pivot_col) ; hash = 0 ; cur_score = 0 ; cp = &A [Col [col].start] ; /* compact the column */ new_cp = cp ; cp_end = cp + Col [col].length ; DEBUG4 (("Adding set diffs for Col: "ID".\n", col)) ; while (cp < cp_end) { /* get a row */ row = *cp++ ; ASSERT (row >= 0 && row < n_row) ; row_mark = Row [row].shared2.mark ; /* skip if dead */ if (ROW_IS_MARKED_DEAD (row_mark)) { DEBUG4 ((" Row "ID", dead\n", row)) ; continue ; } DEBUG4 ((" Row "ID", set diff "ID"\n", row, row_mark-tag_mark)); ASSERT (row_mark >= tag_mark) ; /* compact the column */ *new_cp++ = row ; /* compute hash function */ hash += row ; /* add set difference */ cur_score += row_mark - tag_mark ; /* integer overflow... */ cur_score = MIN (cur_score, n_col) ; } /* recompute the column's length */ Col [col].length = (Int) (new_cp - &A [Col [col].start]) ; /* === Further mass elimination ================================= */ if (Col [col].length == 0 && CMEMBER (col) == current_set) { DEBUG4 (("further mass elimination. Col: "ID"\n", col)) ; /* nothing left but the pivot row in this column */ KILL_PRINCIPAL_COL (col) ; pivot_row_degree -= Col [col].shared1.thickness ; ASSERT (pivot_row_degree >= 0) ; /* order it */ Col [col].shared2.order = k ; /* increment order count by column thickness */ k += Col [col].shared1.thickness ; pivot_col_thickness += Col [col].shared1.thickness ; /* add to column list of front */ #ifndef NDEBUG DEBUG1 (("Mass")) ; dump_super (col, Col, n_col) ; #endif Col [Col [col].lastcol].nextcol = Front_cols [nfr] ; Front_cols [nfr] = col ; } else { /* === Prepare for supercolumn detection ==================== */ DEBUG4 (("Preparing supercol detection for Col: "ID".\n", col)); /* save score so far */ Col [col].shared2.score = cur_score ; /* add column to hash table, for supercolumn detection */ hash %= n_col + 1 ; DEBUG4 ((" Hash = "ID", n_col = "ID".\n", hash, n_col)) ; ASSERT (((Int) hash) <= n_col) ; head_column = head [hash] ; if (head_column > EMPTY) { /* degree list "hash" is non-empty, use prev (shared3) of */ /* first column in degree list as head of hash bucket */ first_col = Col [head_column].shared3.headhash ; Col [head_column].shared3.headhash = col ; } else { /* degree list "hash" is empty, use head as hash bucket */ first_col = - (head_column + 2) ; head [hash] = - (col + 2) ; } Col [col].shared4.hash_next = first_col ; /* save hash function in Col [col].shared3.hash */ Col [col].shared3.hash = (Int) hash ; ASSERT (COL_IS_ALIVE (col)) ; } } /* The approximate external column degree is now computed. */ /* === Supercolumn detection ======================================== */ DEBUG3 (("** Supercolumn detection phase. **\n")) ; detect_super_cols ( #ifndef NDEBUG n_col, Row, #endif Col, A, head, pivot_row_start, pivot_row_length, cmember) ; /* === Kill the pivotal column ====================================== */ DEBUG1 ((" KILLING column detect supercols "ID" \n", pivot_col)) ; KILL_PRINCIPAL_COL (pivot_col) ; /* add columns to column list of front */ #ifndef NDEBUG DEBUG1 (("Pivot")) ; dump_super (pivot_col, Col, n_col) ; #endif Col [Col [pivot_col].lastcol].nextcol = Front_cols [nfr] ; Front_cols [nfr] = pivot_col ; /* === Clear mark =================================================== */ tag_mark = clear_mark (tag_mark+max_deg+1, max_mark, n_row, Row) ; #ifndef NDEBUG DEBUG3 (("check3\n")) ; debug_mark (n_row, Row, tag_mark, max_mark) ; #endif /* === Finalize the new pivot row, and column scores ================ */ DEBUG3 (("** Finalize scores phase. **\n")) ; /* for each column in pivot row */ rp = &A [pivot_row_start] ; /* compact the pivot row */ new_rp = rp ; rp_end = rp + pivot_row_length ; while (rp < rp_end) { col = *rp++ ; /* skip dead columns */ if (COL_IS_DEAD (col)) { continue ; } *new_rp++ = col ; /* add new pivot row to column */ A [Col [col].start + (Col [col].length++)] = pivot_row ; /* retrieve score so far and add on pivot row's degree. */ /* (we wait until here for this in case the pivot */ /* row's degree was reduced due to mass elimination). */ cur_score = Col [col].shared2.score + pivot_row_degree ; /* calculate the max possible score as the number of */ /* external columns minus the 'k' value minus the */ /* columns thickness */ max_score = n_col - k - Col [col].shared1.thickness ; /* make the score the external degree of the union-of-rows */ cur_score -= Col [col].shared1.thickness ; /* make sure score is less or equal than the max score */ cur_score = MIN (cur_score, max_score) ; ASSERT (cur_score >= 0) ; /* store updated score */ Col [col].shared2.score = cur_score ; /* === Place column back in degree list ========================= */ if (CMEMBER (col) == current_set) { ASSERT (min_score >= 0) ; ASSERT (min_score <= n_col) ; ASSERT (cur_score >= 0) ; ASSERT (cur_score <= n_col) ; ASSERT (head [cur_score] >= EMPTY) ; next_col = head [cur_score] ; Col [col].shared4.degree_next = next_col ; Col [col].shared3.prev = EMPTY ; if (next_col != EMPTY) { Col [next_col].shared3.prev = col ; } head [cur_score] = col ; /* see if this score is less than current min */ min_score = MIN (min_score, cur_score) ; } else { Col [col].shared4.degree_next = EMPTY ; Col [col].shared3.prev = EMPTY ; } } #ifndef NDEBUG debug_deg_lists (n_row, n_col, Row, Col, head, min_score, cset_start [current_set+1]-(k+deadcol), max_deg) ; #endif /* frontal matrix can have more pivot cols than pivot rows for */ /* singular matrices. */ /* number of candidate pivot columns */ Front_npivcol [nfr] = pivot_col_thickness ; /* all rows (not just size of contrib. block) */ Front_nrows [nfr] = pivot_row_thickness ; /* all cols */ Front_ncols [nfr] = pivot_col_thickness + pivot_row_degree ; Front_parent [nfr] = EMPTY ; pivot_row_thickness -= pivot_col_thickness ; DEBUG1 (("Front "ID" Pivot_row_thickness after pivot cols elim: "ID"\n", nfr, pivot_row_thickness)) ; pivot_row_thickness = MAX (0, pivot_row_thickness) ; /* === Resurrect the new pivot row ================================== */ if ((pivot_row_degree > 0 && pivot_row_thickness > 0 && (order_for_lu)) || (pivot_row_degree > 0 && (!order_for_lu))) { /* update pivot row length to reflect any cols that were killed */ /* during super-col detection and mass elimination */ Row [pivot_row].start = pivot_row_start ; Row [pivot_row].length = (Int) (new_rp - &A[pivot_row_start]) ; Row [pivot_row].shared1.degree = pivot_row_degree ; Row [pivot_row].shared2.mark = 0 ; Row [pivot_row].thickness = pivot_row_thickness ; Row [pivot_row].front = nfr ; /* pivot row is no longer dead */ DEBUG1 (("Resurrect Pivot_row "ID" deg: "ID"\n", pivot_row, pivot_row_degree)) ; } #ifndef NDEBUG DEBUG1 (("Front "ID" : "ID" "ID" "ID" ", nfr, Front_npivcol [nfr], Front_nrows [nfr], Front_ncols [nfr])) ; DEBUG1 ((" cols:[ ")) ; debug_d = 0 ; for (col = Front_cols [nfr] ; col != EMPTY ; col = Col [col].nextcol) { DEBUG1 ((" "ID, col)) ; ASSERT (col >= 0 && col < n_col) ; ASSERT (COL_IS_DEAD (col)) ; debug_d++ ; ASSERT (debug_d <= pivot_col_thickness) ; } ASSERT (debug_d == pivot_col_thickness) ; DEBUG1 ((" ]\n ")) ; #endif nfr++ ; /* one more front */ } /* === All principal columns have now been ordered ====================== */ *p_nfr = nfr ; return (ngarbage) ; } /* ========================================================================== */ /* === detect_super_cols ==================================================== */ /* ========================================================================== */ /* * Detects supercolumns by finding matches between columns in the hash buckets. * Check amongst columns in the set A [row_start ... row_start + row_length-1]. * The columns under consideration are currently *not* in the degree lists, * and have already been placed in the hash buckets. * * The hash bucket for columns whose hash function is equal to h is stored * as follows: * * if head [h] is >= 0, then head [h] contains a degree list, so: * * head [h] is the first column in degree bucket h. * Col [head [h]].headhash gives the first column in hash bucket h. * * otherwise, the degree list is empty, and: * * -(head [h] + 2) is the first column in hash bucket h. * * For a column c in a hash bucket, Col [c].shared3.prev is NOT a "previous * column" pointer. Col [c].shared3.hash is used instead as the hash number * for that column. The value of Col [c].shared4.hash_next is the next column * in the same hash bucket. * * Assuming no, or "few" hash collisions, the time taken by this routine is * linear in the sum of the sizes (lengths) of each column whose score has * just been computed in the approximate degree computation. * Not user-callable. */ PRIVATE void detect_super_cols ( /* === Parameters ======================================================= */ #ifndef NDEBUG /* these two parameters are only needed when debugging is enabled: */ Int n_col, /* number of columns of A */ CColamd_Row Row [ ], /* of size n_row+1 */ #endif CColamd_Col Col [ ], /* of size n_col+1 */ Int A [ ], /* row indices of A */ Int head [ ], /* head of degree lists and hash buckets */ Int row_start, /* pointer to set of columns to check */ Int row_length, /* number of columns to check */ Int cmember [ ] /* col -> cset mapping */ ) { /* === Local variables ================================================== */ Int hash ; /* hash value for a column */ Int *rp ; /* pointer to a row */ Int c ; /* a column index */ Int super_c ; /* column index of the column to absorb into */ Int *cp1 ; /* column pointer for column super_c */ Int *cp2 ; /* column pointer for column c */ Int length ; /* length of column super_c */ Int prev_c ; /* column preceding c in hash bucket */ Int i ; /* loop counter */ Int *rp_end ; /* pointer to the end of the row */ Int col ; /* a column index in the row to check */ Int head_column ; /* first column in hash bucket or degree list */ Int first_col ; /* first column in hash bucket */ /* === Consider each column in the row ================================== */ rp = &A [row_start] ; rp_end = rp + row_length ; while (rp < rp_end) { col = *rp++ ; if (COL_IS_DEAD (col)) { continue ; } /* get hash number for this column */ hash = Col [col].shared3.hash ; ASSERT (hash <= n_col) ; /* === Get the first column in this hash bucket ===================== */ head_column = head [hash] ; if (head_column > EMPTY) { first_col = Col [head_column].shared3.headhash ; } else { first_col = - (head_column + 2) ; } /* === Consider each column in the hash bucket ====================== */ for (super_c = first_col ; super_c != EMPTY ; super_c = Col [super_c].shared4.hash_next) { ASSERT (COL_IS_ALIVE (super_c)) ; ASSERT (Col [super_c].shared3.hash == hash) ; length = Col [super_c].length ; /* prev_c is the column preceding column c in the hash bucket */ prev_c = super_c ; /* === Compare super_c with all columns after it ================ */ for (c = Col [super_c].shared4.hash_next ; c != EMPTY ; c = Col [c].shared4.hash_next) { ASSERT (c != super_c) ; ASSERT (COL_IS_ALIVE (c)) ; ASSERT (Col [c].shared3.hash == hash) ; /* not identical if lengths or scores are different, */ /* or if in different constraint sets */ if (Col [c].length != length || Col [c].shared2.score != Col [super_c].shared2.score || CMEMBER (c) != CMEMBER (super_c)) { prev_c = c ; continue ; } /* compare the two columns */ cp1 = &A [Col [super_c].start] ; cp2 = &A [Col [c].start] ; for (i = 0 ; i < length ; i++) { /* the columns are "clean" (no dead rows) */ ASSERT (ROW_IS_ALIVE (*cp1)) ; ASSERT (ROW_IS_ALIVE (*cp2)) ; /* row indices will same order for both supercols, */ /* no gather scatter nessasary */ if (*cp1++ != *cp2++) { break ; } } /* the two columns are different if the for-loop "broke" */ /* super columns should belong to the same constraint set */ if (i != length) { prev_c = c ; continue ; } /* === Got it! two columns are identical =================== */ ASSERT (Col [c].shared2.score == Col [super_c].shared2.score) ; Col [super_c].shared1.thickness += Col [c].shared1.thickness ; Col [c].shared1.parent = super_c ; KILL_NON_PRINCIPAL_COL (c) ; /* order c later, in order_children() */ Col [c].shared2.order = EMPTY ; /* remove c from hash bucket */ Col [prev_c].shared4.hash_next = Col [c].shared4.hash_next ; /* add c to end of list of super_c */ ASSERT (Col [super_c].lastcol >= 0) ; ASSERT (Col [super_c].lastcol < n_col) ; Col [Col [super_c].lastcol].nextcol = c ; Col [super_c].lastcol = Col [c].lastcol ; #ifndef NDEBUG /* dump the supercolumn */ DEBUG1 (("Super")) ; dump_super (super_c, Col, n_col) ; #endif } } /* === Empty this hash bucket ======================================= */ if (head_column > EMPTY) { /* corresponding degree list "hash" is not empty */ Col [head_column].shared3.headhash = EMPTY ; } else { /* corresponding degree list "hash" is empty */ head [hash] = EMPTY ; } } } /* ========================================================================== */ /* === garbage_collection =================================================== */ /* ========================================================================== */ /* * Defragments and compacts columns and rows in the workspace A. Used when * all avaliable memory has been used while performing row merging. Returns * the index of the first free position in A, after garbage collection. The * time taken by this routine is linear is the size of the array A, which is * itself linear in the number of nonzeros in the input matrix. * Not user-callable. */ PRIVATE Int garbage_collection /* returns the new value of pfree */ ( /* === Parameters ======================================================= */ Int n_row, /* number of rows */ Int n_col, /* number of columns */ CColamd_Row Row [ ], /* row info */ CColamd_Col Col [ ], /* column info */ Int A [ ], /* A [0 ... Alen-1] holds the matrix */ Int *pfree /* &A [0] ... pfree is in use */ ) { /* === Local variables ================================================== */ Int *psrc ; /* source pointer */ Int *pdest ; /* destination pointer */ Int j ; /* counter */ Int r ; /* a row index */ Int c ; /* a column index */ Int length ; /* length of a row or column */ #ifndef NDEBUG Int debug_rows ; DEBUG2 (("Defrag..\n")) ; for (psrc = &A[0] ; psrc < pfree ; psrc++) ASSERT (*psrc >= 0) ; debug_rows = 0 ; #endif /* === Defragment the columns =========================================== */ pdest = &A[0] ; for (c = 0 ; c < n_col ; c++) { if (COL_IS_ALIVE (c)) { psrc = &A [Col [c].start] ; /* move and compact the column */ ASSERT (pdest <= psrc) ; Col [c].start = (Int) (pdest - &A [0]) ; length = Col [c].length ; for (j = 0 ; j < length ; j++) { r = *psrc++ ; if (ROW_IS_ALIVE (r)) { *pdest++ = r ; } } Col [c].length = (Int) (pdest - &A [Col [c].start]) ; } } /* === Prepare to defragment the rows =================================== */ for (r = 0 ; r < n_row ; r++) { if (ROW_IS_DEAD (r) || (Row [r].length == 0)) { /* This row is already dead, or is of zero length. Cannot compact * a row of zero length, so kill it. NOTE: in the current version, * there are no zero-length live rows. Kill the row (for the first * time, or again) just to be safe. */ KILL_ROW (r) ; } else { /* save first column index in Row [r].shared2.first_column */ psrc = &A [Row [r].start] ; Row [r].shared2.first_column = *psrc ; ASSERT (ROW_IS_ALIVE (r)) ; /* flag the start of the row with the one's complement of row */ *psrc = ONES_COMPLEMENT (r) ; #ifndef NDEBUG debug_rows++ ; #endif } } /* === Defragment the rows ============================================== */ psrc = pdest ; while (psrc < pfree) { /* find a negative number ... the start of a row */ if (*psrc++ < 0) { psrc-- ; /* get the row index */ r = ONES_COMPLEMENT (*psrc) ; ASSERT (r >= 0 && r < n_row) ; /* restore first column index */ *psrc = Row [r].shared2.first_column ; ASSERT (ROW_IS_ALIVE (r)) ; /* move and compact the row */ ASSERT (pdest <= psrc) ; Row [r].start = (Int) (pdest - &A [0]) ; length = Row [r].length ; for (j = 0 ; j < length ; j++) { c = *psrc++ ; if (COL_IS_ALIVE (c)) { *pdest++ = c ; } } Row [r].length = (Int) (pdest - &A [Row [r].start]) ; #ifndef NDEBUG debug_rows-- ; #endif } } /* ensure we found all the rows */ ASSERT (debug_rows == 0) ; /* === Return the new value of pfree ==================================== */ return ((Int) (pdest - &A [0])) ; } /* ========================================================================== */ /* === clear_mark =========================================================== */ /* ========================================================================== */ /* * Clears the Row [ ].shared2.mark array, and returns the new tag_mark. * Return value is the new tag_mark. Not user-callable. */ PRIVATE Int clear_mark /* return the new value for tag_mark */ ( /* === Parameters ======================================================= */ Int tag_mark, /* new value of tag_mark */ Int max_mark, /* max allowed value of tag_mark */ Int n_row, /* number of rows in A */ CColamd_Row Row [ ] /* Row [0 ... n_row-1].shared2.mark is set to zero */ ) { /* === Local variables ================================================== */ Int r ; if (tag_mark <= 0 || tag_mark >= max_mark) { for (r = 0 ; r < n_row ; r++) { if (ROW_IS_ALIVE (r)) { Row [r].shared2.mark = 0 ; } } tag_mark = 1 ; } return (tag_mark) ; } /* ========================================================================== */ /* === print_report ========================================================= */ /* ========================================================================== */ /* No printing occurs if NPRINT is defined at compile time. */ PRIVATE void print_report ( char *method, Int stats [CCOLAMD_STATS] ) { Int i1, i2, i3 ; SUITESPARSE_PRINTF (("\n%s version %d.%d, %s: ", method, CCOLAMD_MAIN_VERSION, CCOLAMD_SUB_VERSION, CCOLAMD_DATE)) ; if (!stats) { SUITESPARSE_PRINTF (("No statistics available.\n")) ; return ; } i1 = stats [CCOLAMD_INFO1] ; i2 = stats [CCOLAMD_INFO2] ; i3 = stats [CCOLAMD_INFO3] ; if (stats [CCOLAMD_STATUS] >= 0) { SUITESPARSE_PRINTF(("OK. ")) ; } else { SUITESPARSE_PRINTF(("ERROR. ")) ; } switch (stats [CCOLAMD_STATUS]) { case CCOLAMD_OK_BUT_JUMBLED: SUITESPARSE_PRINTF(( "Matrix has unsorted or duplicate row indices.\n")) ; SUITESPARSE_PRINTF(( "%s: duplicate or out-of-order row indices: "ID"\n", method, i3)) ; SUITESPARSE_PRINTF(( "%s: last seen duplicate or out-of-order row: "ID"\n", method, INDEX (i2))) ; SUITESPARSE_PRINTF(( "%s: last seen in column: "ID"", method, INDEX (i1))) ; /* no break - fall through to next case instead */ case CCOLAMD_OK: SUITESPARSE_PRINTF(("\n")) ; SUITESPARSE_PRINTF(( "%s: number of dense or empty rows ignored: "ID"\n", method, stats [CCOLAMD_DENSE_ROW])) ; SUITESPARSE_PRINTF(( "%s: number of dense or empty columns ignored: "ID"\n", method, stats [CCOLAMD_DENSE_COL])) ; SUITESPARSE_PRINTF(( "%s: number of garbage collections performed: "ID"\n", method, stats [CCOLAMD_DEFRAG_COUNT])) ; break ; case CCOLAMD_ERROR_A_not_present: SUITESPARSE_PRINTF(( "Array A (row indices of matrix) not present.\n")) ; break ; case CCOLAMD_ERROR_p_not_present: SUITESPARSE_PRINTF(( "Array p (column pointers for matrix) not present.\n")) ; break ; case CCOLAMD_ERROR_nrow_negative: SUITESPARSE_PRINTF(("Invalid number of rows ("ID").\n", i1)) ; break ; case CCOLAMD_ERROR_ncol_negative: SUITESPARSE_PRINTF(("Invalid number of columns ("ID").\n", i1)) ; break ; case CCOLAMD_ERROR_nnz_negative: SUITESPARSE_PRINTF(( "Invalid number of nonzero entries ("ID").\n", i1)) ; break ; case CCOLAMD_ERROR_p0_nonzero: SUITESPARSE_PRINTF(( "Invalid column pointer, p [0] = "ID", must be 0.\n", i1)) ; break ; case CCOLAMD_ERROR_A_too_small: SUITESPARSE_PRINTF(("Array A too small.\n")) ; SUITESPARSE_PRINTF(( " Need Alen >= "ID", but given only Alen = "ID".\n", i1, i2)) ; break ; case CCOLAMD_ERROR_col_length_negative: SUITESPARSE_PRINTF(( "Column "ID" has a negative number of entries ("ID").\n", INDEX (i1), i2)) ; break ; case CCOLAMD_ERROR_row_index_out_of_bounds: SUITESPARSE_PRINTF(( "Row index (row "ID") out of bounds ("ID" to "ID") in" "column "ID".\n", INDEX (i2), INDEX (0), INDEX (i3-1), INDEX (i1))) ; break ; case CCOLAMD_ERROR_out_of_memory: SUITESPARSE_PRINTF(("Out of memory.\n")) ; break ; case CCOLAMD_ERROR_invalid_cmember: SUITESPARSE_PRINTF(("cmember invalid\n")) ; break ; } } /* ========================================================================= */ /* === "Expert" routines =================================================== */ /* ========================================================================= */ /* The following routines are visible outside this routine, but are not meant * to be called by the user. They are meant for a future version of UMFPACK, * to replace UMFPACK internal routines with a similar name. */ /* ========================================================================== */ /* === CCOLAMD_apply_order ================================================== */ /* ========================================================================== */ /* * Apply post-ordering of supernodal elimination tree. */ GLOBAL void CCOLAMD_apply_order ( Int Front [ ], /* of size nn on input, size nfr on output */ const Int Order [ ], /* Order [i] = k, i in the range 0..nn-1, * and k in the range 0..nfr-1, means that node * i is the kth node in the postordered tree. */ Int Temp [ ], /* workspace of size nfr */ Int nn, /* nodes are numbered in the range 0..nn-1 */ Int nfr /* the number of nodes actually in use */ ) { Int i, k ; for (i = 0 ; i < nn ; i++) { k = Order [i] ; ASSERT (k >= EMPTY && k < nfr) ; if (k != EMPTY) { Temp [k] = Front [i] ; } } for (k = 0 ; k < nfr ; k++) { Front [k] = Temp [k] ; } } /* ========================================================================== */ /* === CCOLAMD_fsize ======================================================== */ /* ========================================================================== */ /* Determine the largest frontal matrix size for each subtree. * Only required to sort the children of each * node prior to postordering the column elimination tree. */ GLOBAL void CCOLAMD_fsize ( Int nn, Int Fsize [ ], Int Fnrows [ ], Int Fncols [ ], Int Parent [ ], Int Npiv [ ] ) { double dr, dc ; Int j, parent, frsize, r, c ; for (j = 0 ; j < nn ; j++) { Fsize [j] = EMPTY ; } /* ---------------------------------------------------------------------- */ /* find max front size for tree rooted at node j, for each front j */ /* ---------------------------------------------------------------------- */ DEBUG1 (("\n\n========================================FRONTS:\n")) ; for (j = 0 ; j < nn ; j++) { if (Npiv [j] > 0) { /* this is a frontal matrix */ parent = Parent [j] ; r = Fnrows [j] ; c = Fncols [j] ; /* avoid integer overflow */ dr = (double) r ; dc = (double) c ; frsize = (INT_OVERFLOW (dr * dc)) ? Int_MAX : (r * c) ; DEBUG1 ((""ID" : npiv "ID" size "ID" parent "ID" ", j, Npiv [j], frsize, parent)) ; Fsize [j] = MAX (Fsize [j], frsize) ; DEBUG1 (("Fsize [j = "ID"] = "ID"\n", j, Fsize [j])) ; if (parent != EMPTY) { /* find the maximum frontsize of self and children */ ASSERT (Npiv [parent] > 0) ; ASSERT (parent > j) ; Fsize [parent] = MAX (Fsize [parent], Fsize [j]) ; DEBUG1 (("Fsize [parent = "ID"] = "ID"\n", parent, Fsize [parent])); } } } DEBUG1 (("fsize done\n")) ; } /* ========================================================================= */ /* === CCOLAMD_postorder =================================================== */ /* ========================================================================= */ /* Perform a postordering (via depth-first search) of an assembly tree. */ GLOBAL void CCOLAMD_postorder ( /* inputs, not modified on output: */ Int nn, /* nodes are in the range 0..nn-1 */ Int Parent [ ], /* Parent [j] is the parent of j, or EMPTY if root */ Int Nv [ ], /* Nv [j] > 0 number of pivots represented by node j, * or zero if j is not a node. */ Int Fsize [ ], /* Fsize [j]: size of node j */ /* output, not defined on input: */ Int Order [ ], /* output post-order */ /* workspaces of size nn: */ Int Child [ ], Int Sibling [ ], Int Stack [ ], Int Front_cols [ ], /* input, not modified on output: */ Int cmember [ ] ) { Int i, j, k, parent, frsize, f, fprev, maxfrsize, bigfprev, bigf, fnext ; for (j = 0 ; j < nn ; j++) { Child [j] = EMPTY ; Sibling [j] = EMPTY ; } /* --------------------------------------------------------------------- */ /* place the children in link lists - bigger elements tend to be last */ /* --------------------------------------------------------------------- */ for (j = nn-1 ; j >= 0 ; j--) { if (Nv [j] > 0) { /* this is an element */ parent = Parent [j] ; if (parent != EMPTY) { /* place the element in link list of the children its parent */ /* bigger elements will tend to be at the end of the list */ Sibling [j] = Child [parent] ; if (CMEMBER (Front_cols[parent]) == CMEMBER (Front_cols[j])) { Child [parent] = j ; } } } } #ifndef NDEBUG { Int nels, ff, nchild ; DEBUG1 (("\n\n================================ ccolamd_postorder:\n")); nels = 0 ; for (j = 0 ; j < nn ; j++) { if (Nv [j] > 0) { DEBUG1 ((""ID" : nels "ID" npiv "ID" size "ID " parent "ID" maxfr "ID"\n", j, nels, Nv [j], Fsize [j], Parent [j], Fsize [j])) ; /* this is an element */ /* dump the link list of children */ nchild = 0 ; DEBUG1 ((" Children: ")) ; for (ff = Child [j] ; ff != EMPTY ; ff = Sibling [ff]) { DEBUG1 ((ID" ", ff)) ; nchild++ ; ASSERT (nchild < nn) ; } DEBUG1 (("\n")) ; parent = Parent [j] ; nels++ ; } } } #endif /* --------------------------------------------------------------------- */ /* place the largest child last in the list of children for each node */ /* --------------------------------------------------------------------- */ for (i = 0 ; i < nn ; i++) { if (Nv [i] > 0 && Child [i] != EMPTY) { #ifndef NDEBUG Int nchild ; DEBUG1 (("Before partial sort, element "ID"\n", i)) ; nchild = 0 ; for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { DEBUG1 ((" f: "ID" size: "ID"\n", f, Fsize [f])) ; nchild++ ; } #endif /* find the biggest element in the child list */ fprev = EMPTY ; maxfrsize = EMPTY ; bigfprev = EMPTY ; bigf = EMPTY ; for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { frsize = Fsize [f] ; if (frsize >= maxfrsize) { /* this is the biggest seen so far */ maxfrsize = frsize ; bigfprev = fprev ; bigf = f ; } fprev = f ; } fnext = Sibling [bigf] ; DEBUG1 (("bigf "ID" maxfrsize "ID" bigfprev "ID" fnext "ID " fprev " ID"\n", bigf, maxfrsize, bigfprev, fnext, fprev)) ; if (fnext != EMPTY) { /* if fnext is EMPTY then bigf is already at the end of list */ if (bigfprev == EMPTY) { /* delete bigf from the element of the list */ Child [i] = fnext ; } else { /* delete bigf from the middle of the list */ Sibling [bigfprev] = fnext ; } /* put bigf at the end of the list */ Sibling [bigf] = EMPTY ; Sibling [fprev] = bigf ; } #ifndef NDEBUG DEBUG1 (("After partial sort, element "ID"\n", i)) ; for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { DEBUG1 ((" "ID" "ID"\n", f, Fsize [f])) ; nchild-- ; } #endif } } /* --------------------------------------------------------------------- */ /* postorder the assembly tree */ /* --------------------------------------------------------------------- */ for (i = 0 ; i < nn ; i++) { Order [i] = EMPTY ; } k = 0 ; for (i = 0 ; i < nn ; i++) { if ((Parent [i] == EMPTY || (CMEMBER (Front_cols [Parent [i]]) != CMEMBER (Front_cols [i]))) && Nv [i] > 0) { DEBUG1 (("Root of assembly tree "ID"\n", i)) ; k = CCOLAMD_post_tree (i, k, Child, Sibling, Order, Stack) ; } } } /* ========================================================================= */ /* === CCOLAMD_post_tree =================================================== */ /* ========================================================================= */ /* Post-ordering of a supernodal column elimination tree. */ GLOBAL Int CCOLAMD_post_tree ( Int root, /* root of the tree */ Int k, /* start numbering at k */ Int Child [ ], /* input argument of size nn, undefined on * output. Child [i] is the head of a link * list of all nodes that are children of node * i in the tree. */ const Int Sibling [ ], /* input argument of size nn, not modified. * If f is a node in the link list of the * children of node i, then Sibling [f] is the * next child of node i. */ Int Order [ ], /* output order, of size nn. Order [i] = k * if node i is the kth node of the reordered * tree. */ Int Stack [ ] /* workspace of size nn */ ) { Int f, head, h, i ; #if 0 /* --------------------------------------------------------------------- */ /* recursive version (Stack [ ] is not used): */ /* --------------------------------------------------------------------- */ /* this is simple, but can cause stack overflow if nn is large */ i = root ; for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { k = CCOLAMD_post_tree (f, k, Child, Sibling, Order, Stack, nn) ; } Order [i] = k++ ; return (k) ; #endif /* --------------------------------------------------------------------- */ /* non-recursive version, using an explicit stack */ /* --------------------------------------------------------------------- */ /* push root on the stack */ head = 0 ; Stack [0] = root ; while (head >= 0) { /* get head of stack */ i = Stack [head] ; DEBUG1 (("head of stack "ID" \n", i)) ; if (Child [i] != EMPTY) { /* the children of i are not yet ordered */ /* push each child onto the stack in reverse order */ /* so that small ones at the head of the list get popped first */ /* and the biggest one at the end of the list gets popped last */ for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { head++ ; } h = head ; for (f = Child [i] ; f != EMPTY ; f = Sibling [f]) { ASSERT (h > 0) ; Stack [h--] = f ; DEBUG1 (("push "ID" on stack\n", f)) ; } ASSERT (Stack [h] == i) ; /* delete child list so that i gets ordered next time we see it */ Child [i] = EMPTY ; } else { /* the children of i (if there were any) are already ordered */ /* remove i from the stack and order it. Front i is kth front */ head-- ; DEBUG1 (("pop "ID" order "ID"\n", i, k)) ; Order [i] = k++ ; } #ifndef NDEBUG DEBUG1 (("\nStack:")) ; for (h = head ; h >= 0 ; h--) { Int j = Stack [h] ; DEBUG1 ((" "ID, j)) ; } DEBUG1 (("\n\n")) ; #endif } return (k) ; } /* ========================================================================== */ /* === CCOLAMD debugging routines =========================================== */ /* ========================================================================== */ /* When debugging is disabled, the remainder of this file is ignored. */ #ifndef NDEBUG /* ========================================================================== */ /* === debug_structures ===================================================== */ /* ========================================================================== */ /* * At this point, all empty rows and columns are dead. All live columns * are "clean" (containing no dead rows) and simplicial (no supercolumns * yet). Rows may contain dead columns, but all live rows contain at * least one live column. */ PRIVATE void debug_structures ( /* === Parameters ======================================================= */ Int n_row, Int n_col, CColamd_Row Row [ ], CColamd_Col Col [ ], Int A [ ], Int cmember [ ], Int cset_start [ ] ) { /* === Local variables ================================================== */ Int i ; Int c ; Int *cp ; Int *cp_end ; Int len ; Int score ; Int r ; Int *rp ; Int *rp_end ; Int deg ; Int cs ; /* === Check A, Row, and Col ============================================ */ for (c = 0 ; c < n_col ; c++) { if (COL_IS_ALIVE (c)) { len = Col [c].length ; score = Col [c].shared2.score ; DEBUG4 (("initial live col %5d %5d %5d\n", c, len, score)) ; ASSERT (len > 0) ; ASSERT (score >= 0) ; ASSERT (Col [c].shared1.thickness == 1) ; cp = &A [Col [c].start] ; cp_end = cp + len ; while (cp < cp_end) { r = *cp++ ; ASSERT (ROW_IS_ALIVE (r)) ; } } else { i = Col [c].shared2.order ; cs = CMEMBER (c) ; ASSERT (i >= cset_start [cs] && i < cset_start [cs+1]) ; } } for (r = 0 ; r < n_row ; r++) { if (ROW_IS_ALIVE (r)) { i = 0 ; len = Row [r].length ; deg = Row [r].shared1.degree ; ASSERT (len > 0) ; ASSERT (deg > 0) ; rp = &A [Row [r].start] ; rp_end = rp + len ; while (rp < rp_end) { c = *rp++ ; if (COL_IS_ALIVE (c)) { i++ ; } } ASSERT (i > 0) ; } } } /* ========================================================================== */ /* === debug_deg_lists ====================================================== */ /* ========================================================================== */ /* * Prints the contents of the degree lists. Counts the number of columns * in the degree list and compares it to the total it should have. Also * checks the row degrees. */ PRIVATE void debug_deg_lists ( /* === Parameters ======================================================= */ Int n_row, Int n_col, CColamd_Row Row [ ], CColamd_Col Col [ ], Int head [ ], Int min_score, Int should, Int max_deg ) { /* === Local variables ================================================== */ Int deg ; Int col ; Int have ; Int row ; /* === Check the degree lists =========================================== */ if (n_col > 10000 && ccolamd_debug <= 0) { return ; } have = 0 ; DEBUG4 (("Degree lists: "ID"\n", min_score)) ; for (deg = 0 ; deg <= n_col ; deg++) { col = head [deg] ; if (col == EMPTY) { continue ; } DEBUG4 (("%d:", deg)) ; ASSERT (Col [col].shared3.prev == EMPTY) ; while (col != EMPTY) { DEBUG4 ((" "ID"", col)) ; have += Col [col].shared1.thickness ; ASSERT (COL_IS_ALIVE (col)) ; col = Col [col].shared4.degree_next ; } DEBUG4 (("\n")) ; } DEBUG4 (("should "ID" have "ID"\n", should, have)) ; ASSERT (should == have) ; /* === Check the row degrees ============================================ */ if (n_row > 10000 && ccolamd_debug <= 0) { return ; } for (row = 0 ; row < n_row ; row++) { if (ROW_IS_ALIVE (row)) { ASSERT (Row [row].shared1.degree <= max_deg) ; } } } /* ========================================================================== */ /* === debug_mark =========================================================== */ /* ========================================================================== */ /* * Ensures that the tag_mark is less that the maximum and also ensures that * each entry in the mark array is less than the tag mark. */ PRIVATE void debug_mark ( /* === Parameters ======================================================= */ Int n_row, CColamd_Row Row [ ], Int tag_mark, Int max_mark ) { /* === Local variables ================================================== */ Int r ; /* === Check the Row marks ============================================== */ ASSERT (tag_mark > 0 && tag_mark <= max_mark) ; if (n_row > 10000 && ccolamd_debug <= 0) { return ; } for (r = 0 ; r < n_row ; r++) { ASSERT (Row [r].shared2.mark < tag_mark) ; } } /* ========================================================================== */ /* === debug_matrix ========================================================= */ /* ========================================================================== */ /* Prints out the contents of the columns and the rows. */ PRIVATE void debug_matrix ( /* === Parameters ======================================================= */ Int n_row, Int n_col, CColamd_Row Row [ ], CColamd_Col Col [ ], Int A [ ] ) { /* === Local variables ================================================== */ Int r ; Int c ; Int *rp ; Int *rp_end ; Int *cp ; Int *cp_end ; /* === Dump the rows and columns of the matrix ========================== */ if (ccolamd_debug < 3) { return ; } DEBUG3 (("DUMP MATRIX:\n")) ; for (r = 0 ; r < n_row ; r++) { DEBUG3 (("Row "ID" alive? "ID"\n", r, ROW_IS_ALIVE (r))) ; if (ROW_IS_DEAD (r)) { continue ; } DEBUG3 (("start "ID" length "ID" degree "ID"\nthickness "ID"\n", Row [r].start, Row [r].length, Row [r].shared1.degree, Row [r].thickness)) ; rp = &A [Row [r].start] ; rp_end = rp + Row [r].length ; while (rp < rp_end) { c = *rp++ ; DEBUG4 ((" "ID" col "ID"\n", COL_IS_ALIVE (c), c)) ; } } for (c = 0 ; c < n_col ; c++) { DEBUG3 (("Col "ID" alive? "ID"\n", c, COL_IS_ALIVE (c))) ; if (COL_IS_DEAD (c)) { continue ; } DEBUG3 (("start "ID" length "ID" shared1 "ID" shared2 "ID"\n", Col [c].start, Col [c].length, Col [c].shared1.thickness, Col [c].shared2.score)) ; cp = &A [Col [c].start] ; cp_end = cp + Col [c].length ; while (cp < cp_end) { r = *cp++ ; DEBUG4 ((" "ID" row "ID"\n", ROW_IS_ALIVE (r), r)) ; } } } /* ========================================================================== */ /* === dump_super =========================================================== */ /* ========================================================================== */ PRIVATE void dump_super ( Int super_c, CColamd_Col Col [ ], Int n_col ) { Int col, ncols ; DEBUG1 ((" =[ ")) ; ncols = 0 ; for (col = super_c ; col != EMPTY ; col = Col [col].nextcol) { DEBUG1 ((" "ID, col)) ; ASSERT (col >= 0 && col < n_col) ; if (col != super_c) { ASSERT (COL_IS_DEAD (col)) ; } if (Col [col].nextcol == EMPTY) { ASSERT (col == Col [super_c].lastcol) ; } ncols++ ; ASSERT (ncols <= Col [super_c].shared1.thickness) ; } ASSERT (ncols == Col [super_c].shared1.thickness) ; DEBUG1 (("]\n")) ; } /* ========================================================================== */ /* === ccolamd_get_debug ==================================================== */ /* ========================================================================== */ PRIVATE void ccolamd_get_debug ( char *method ) { FILE *debug_file ; ccolamd_debug = 0 ; /* no debug printing */ /* Read debug info from the debug file. */ debug_file = fopen ("debug", "r") ; if (debug_file) { (void) fscanf (debug_file, ""ID"", &ccolamd_debug) ; (void) fclose (debug_file) ; } DEBUG0 ((":")) ; DEBUG1 (("%s: debug version, D = "ID" (THIS WILL BE SLOW!)\n", method, ccolamd_debug)) ; DEBUG1 ((" Debug printing level: "ID"\n", ccolamd_debug)) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CCOLAMD/Makefile.am0000664000175000017500000000050014224052371016656 00000000000000noinst_LTLIBRARIES = ccolamd.la ccolamd_la_SOURCES = Source/ccolamd.c ccolamd_la_CPPFLAGS = -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CCOLAMD/Include noinst_HEADERS = Include/ccolamd.h ccolamd_la_LDFLAGS = -no-undefined -module -avoid-version DIST_EXTRA = README.txt JAGS-4.3.2/src/modules/glm/SSparse/CCOLAMD/Makefile.in0000644000175000017500000005154614400675236016714 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/CCOLAMD ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) ccolamd_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_ccolamd_la_OBJECTS = Source/ccolamd_la-ccolamd.lo ccolamd_la_OBJECTS = $(am_ccolamd_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = ccolamd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(ccolamd_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = Source/$(DEPDIR)/ccolamd_la-ccolamd.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(ccolamd_la_SOURCES) DIST_SOURCES = $(ccolamd_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = ccolamd.la ccolamd_la_SOURCES = Source/ccolamd.c ccolamd_la_CPPFLAGS = -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CCOLAMD/Include noinst_HEADERS = Include/ccolamd.h ccolamd_la_LDFLAGS = -no-undefined -module -avoid-version DIST_EXTRA = README.txt all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/CCOLAMD/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/CCOLAMD/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } Source/$(am__dirstamp): @$(MKDIR_P) Source @: > Source/$(am__dirstamp) Source/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) Source/$(DEPDIR) @: > Source/$(DEPDIR)/$(am__dirstamp) Source/ccolamd_la-ccolamd.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) ccolamd.la: $(ccolamd_la_OBJECTS) $(ccolamd_la_DEPENDENCIES) $(EXTRA_ccolamd_la_DEPENDENCIES) $(AM_V_CCLD)$(ccolamd_la_LINK) $(ccolamd_la_OBJECTS) $(ccolamd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f Source/*.$(OBJEXT) -rm -f Source/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/ccolamd_la-ccolamd.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< Source/ccolamd_la-ccolamd.lo: Source/ccolamd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ccolamd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/ccolamd_la-ccolamd.lo -MD -MP -MF Source/$(DEPDIR)/ccolamd_la-ccolamd.Tpo -c -o Source/ccolamd_la-ccolamd.lo `test -f 'Source/ccolamd.c' || echo '$(srcdir)/'`Source/ccolamd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/ccolamd_la-ccolamd.Tpo Source/$(DEPDIR)/ccolamd_la-ccolamd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/ccolamd.c' object='Source/ccolamd_la-ccolamd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(ccolamd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/ccolamd_la-ccolamd.lo `test -f 'Source/ccolamd.c' || echo '$(srcdir)/'`Source/ccolamd.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf Source/.libs Source/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f Source/$(DEPDIR)/$(am__dirstamp) -rm -f Source/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Source/$(DEPDIR)/ccolamd_la-ccolamd.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Source/$(DEPDIR)/ccolamd_la-ccolamd.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/COLAMD/0000755000175000017500000000000014400711326014600 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/COLAMD/Include/0000755000175000017500000000000014400711326016163 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/COLAMD/Include/colamd.h0000664000175000017500000002105014224052371017515 00000000000000/* ========================================================================== */ /* === colamd/symamd prototypes and definitions ============================= */ /* ========================================================================== */ /* COLAMD / SYMAMD include file You must include this file (colamd.h) in any routine that uses colamd, symamd, or the related macros and definitions. Authors: The authors of the code itself are Stefan I. Larimore and Timothy A. Davis (DrTimothyAldenDavis@gmail.com). The algorithm was developed in collaboration with John Gilbert, Xerox PARC, and Esmond Ng, Oak Ridge National Laboratory. Acknowledgements: This work was supported by the National Science Foundation, under grants DMS-9504974 and DMS-9803599. Notice: Copyright (c) 1998-2007, Timothy A. Davis, All Rights Reserved. THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK. Permission is hereby granted to use, copy, modify, and/or distribute this program, provided that the Copyright, this License, and the Availability of the original version is retained on all copies and made accessible to the end-user of any code or package that includes COLAMD or any modified version of COLAMD. Availability: The colamd/symamd library is available at http://www.suitesparse.com This file is required by the colamd.c, colamdmex.c, and symamdmex.c files, and by any C code that calls the routines whose prototypes are listed below, or that uses the colamd/symamd definitions listed below. */ #ifndef COLAMD_H #define COLAMD_H /* make it easy for C++ programs to include COLAMD */ #ifdef __cplusplus extern "C" { #endif /* ========================================================================== */ /* === Include files ======================================================== */ /* ========================================================================== */ #include /* ========================================================================== */ /* === COLAMD version ======================================================= */ /* ========================================================================== */ /* COLAMD Version 2.4 and later will include the following definitions. * As an example, to test if the version you are using is 2.4 or later: * * #ifdef COLAMD_VERSION * if (COLAMD_VERSION >= COLAMD_VERSION_CODE (2,4)) ... * #endif * * This also works during compile-time: * * #if defined(COLAMD_VERSION) && (COLAMD_VERSION >= COLAMD_VERSION_CODE (2,4)) * printf ("This is version 2.4 or later\n") ; * #else * printf ("This is an early version\n") ; * #endif * * Versions 2.3 and earlier of COLAMD do not include a #define'd version number. */ #define COLAMD_DATE "Feb 1, 2016" #define COLAMD_VERSION_CODE(main,sub) ((main) * 1000 + (sub)) #define COLAMD_MAIN_VERSION 2 #define COLAMD_SUB_VERSION 9 #define COLAMD_SUBSUB_VERSION 4 #define COLAMD_VERSION \ COLAMD_VERSION_CODE(COLAMD_MAIN_VERSION,COLAMD_SUB_VERSION) /* ========================================================================== */ /* === Knob and statistics definitions ====================================== */ /* ========================================================================== */ /* size of the knobs [ ] array. Only knobs [0..1] are currently used. */ #define COLAMD_KNOBS 20 /* number of output statistics. Only stats [0..6] are currently used. */ #define COLAMD_STATS 20 /* knobs [0] and stats [0]: dense row knob and output statistic. */ #define COLAMD_DENSE_ROW 0 /* knobs [1] and stats [1]: dense column knob and output statistic. */ #define COLAMD_DENSE_COL 1 /* knobs [2]: aggressive absorption */ #define COLAMD_AGGRESSIVE 2 /* stats [2]: memory defragmentation count output statistic */ #define COLAMD_DEFRAG_COUNT 2 /* stats [3]: colamd status: zero OK, > 0 warning or notice, < 0 error */ #define COLAMD_STATUS 3 /* stats [4..6]: error info, or info on jumbled columns */ #define COLAMD_INFO1 4 #define COLAMD_INFO2 5 #define COLAMD_INFO3 6 /* error codes returned in stats [3]: */ #define COLAMD_OK (0) #define COLAMD_OK_BUT_JUMBLED (1) #define COLAMD_ERROR_A_not_present (-1) #define COLAMD_ERROR_p_not_present (-2) #define COLAMD_ERROR_nrow_negative (-3) #define COLAMD_ERROR_ncol_negative (-4) #define COLAMD_ERROR_nnz_negative (-5) #define COLAMD_ERROR_p0_nonzero (-6) #define COLAMD_ERROR_A_too_small (-7) #define COLAMD_ERROR_col_length_negative (-8) #define COLAMD_ERROR_row_index_out_of_bounds (-9) #define COLAMD_ERROR_out_of_memory (-10) #define COLAMD_ERROR_internal_error (-999) /* ========================================================================== */ /* === Prototypes of user-callable routines ================================= */ /* ========================================================================== */ #include "SuiteSparse_config.h" size_t colamd_recommended /* returns recommended value of Alen, */ /* or 0 if input arguments are erroneous */ ( int nnz, /* nonzeros in A */ int n_row, /* number of rows in A */ int n_col /* number of columns in A */ ) ; size_t colamd_l_recommended /* returns recommended value of Alen, */ /* or 0 if input arguments are erroneous */ ( SuiteSparse_long nnz, /* nonzeros in A */ SuiteSparse_long n_row, /* number of rows in A */ SuiteSparse_long n_col /* number of columns in A */ ) ; void colamd_set_defaults /* sets default parameters */ ( /* knobs argument is modified on output */ double knobs [COLAMD_KNOBS] /* parameter settings for colamd */ ) ; void colamd_l_set_defaults /* sets default parameters */ ( /* knobs argument is modified on output */ double knobs [COLAMD_KNOBS] /* parameter settings for colamd */ ) ; int colamd /* returns (1) if successful, (0) otherwise*/ ( /* A and p arguments are modified on output */ int n_row, /* number of rows in A */ int n_col, /* number of columns in A */ int Alen, /* size of the array A */ int A [], /* row indices of A, of size Alen */ int p [], /* column pointers of A, of size n_col+1 */ double knobs [COLAMD_KNOBS],/* parameter settings for colamd */ int stats [COLAMD_STATS] /* colamd output statistics and error codes */ ) ; SuiteSparse_long colamd_l /* returns (1) if successful, (0) otherwise*/ ( /* A and p arguments are modified on output */ SuiteSparse_long n_row, /* number of rows in A */ SuiteSparse_long n_col, /* number of columns in A */ SuiteSparse_long Alen, /* size of the array A */ SuiteSparse_long A [], /* row indices of A, of size Alen */ SuiteSparse_long p [], /* column pointers of A, of size n_col+1 */ double knobs [COLAMD_KNOBS],/* parameter settings for colamd */ SuiteSparse_long stats [COLAMD_STATS] /* colamd output statistics * and error codes */ ) ; int symamd /* return (1) if OK, (0) otherwise */ ( int n, /* number of rows and columns of A */ int A [], /* row indices of A */ int p [], /* column pointers of A */ int perm [], /* output permutation, size n_col+1 */ double knobs [COLAMD_KNOBS], /* parameters (uses defaults if NULL) */ int stats [COLAMD_STATS], /* output statistics and error codes */ void * (*allocate) (size_t, size_t), /* pointer to calloc (ANSI C) or */ /* mxCalloc (for MATLAB mexFunction) */ void (*release) (void *) /* pointer to free (ANSI C) or */ /* mxFree (for MATLAB mexFunction) */ ) ; SuiteSparse_long symamd_l /* return (1) if OK, (0) otherwise */ ( SuiteSparse_long n, /* number of rows and columns of A */ SuiteSparse_long A [], /* row indices of A */ SuiteSparse_long p [], /* column pointers of A */ SuiteSparse_long perm [], /* output permutation, size n_col+1 */ double knobs [COLAMD_KNOBS], /* parameters (uses defaults if NULL) */ SuiteSparse_long stats [COLAMD_STATS], /* output stats and error codes */ void * (*allocate) (size_t, size_t), /* pointer to calloc (ANSI C) or */ /* mxCalloc (for MATLAB mexFunction) */ void (*release) (void *) /* pointer to free (ANSI C) or */ /* mxFree (for MATLAB mexFunction) */ ) ; void colamd_report ( int stats [COLAMD_STATS] ) ; void colamd_l_report ( SuiteSparse_long stats [COLAMD_STATS] ) ; void symamd_report ( int stats [COLAMD_STATS] ) ; void symamd_l_report ( SuiteSparse_long stats [COLAMD_STATS] ) ; #ifdef __cplusplus } #endif #endif /* COLAMD_H */ JAGS-4.3.2/src/modules/glm/SSparse/COLAMD/Source/0000755000175000017500000000000014400711326016040 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/COLAMD/Source/colamd.c0000664000175000017500000032435414224052371017402 00000000000000/* ========================================================================== */ /* === colamd/symamd - a sparse matrix column ordering algorithm ============ */ /* ========================================================================== */ /* COLAMD / SYMAMD colamd: an approximate minimum degree column ordering algorithm, for LU factorization of symmetric or unsymmetric matrices, QR factorization, least squares, interior point methods for linear programming problems, and other related problems. symamd: an approximate minimum degree ordering algorithm for Cholesky factorization of symmetric matrices. Purpose: Colamd computes a permutation Q such that the Cholesky factorization of (AQ)'(AQ) has less fill-in and requires fewer floating point operations than A'A. This also provides a good ordering for sparse partial pivoting methods, P(AQ) = LU, where Q is computed prior to numerical factorization, and P is computed during numerical factorization via conventional partial pivoting with row interchanges. Colamd is the column ordering method used in SuperLU, part of the ScaLAPACK library. It is also available as built-in function in MATLAB Version 6, available from MathWorks, Inc. (http://www.mathworks.com). This routine can be used in place of colmmd in MATLAB. Symamd computes a permutation P of a symmetric matrix A such that the Cholesky factorization of PAP' has less fill-in and requires fewer floating point operations than A. Symamd constructs a matrix M such that M'M has the same nonzero pattern of A, and then orders the columns of M using colmmd. The column ordering of M is then returned as the row and column ordering P of A. Authors: The authors of the code itself are Stefan I. Larimore and Timothy A. Davis (DrTimothyAldenDavis@gmail.com). The algorithm was developed in collaboration with John Gilbert, Xerox PARC, and Esmond Ng, Oak Ridge National Laboratory. Acknowledgements: This work was supported by the National Science Foundation, under grants DMS-9504974 and DMS-9803599. Copyright and License: Copyright (c) 1998-2007, Timothy A. Davis, All Rights Reserved. COLAMD is also available under alternate licenses, contact T. Davis for details. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Permission is hereby granted to use or copy this program under the terms of the GNU LGPL, provided that the Copyright, this License, and the Availability of the original version is retained on all copies. User documentation of any code that uses this code or any modified version of this code must cite the Copyright, this License, the Availability note, and "Used by permission." Permission to modify the code and to distribute modified code is granted, provided the Copyright, this License, and the Availability note are retained, and a notice that the code was modified is included. Availability: The colamd/symamd library is available at http://www.suitesparse.com Appears as ACM Algorithm 836. See the ChangeLog file for changes since Version 1.0. References: T. A. Davis, J. R. Gilbert, S. Larimore, E. Ng, An approximate column minimum degree ordering algorithm, ACM Transactions on Mathematical Software, vol. 30, no. 3., pp. 353-376, 2004. T. A. Davis, J. R. Gilbert, S. Larimore, E. Ng, Algorithm 836: COLAMD, an approximate column minimum degree ordering algorithm, ACM Transactions on Mathematical Software, vol. 30, no. 3., pp. 377-380, 2004. */ /* ========================================================================== */ /* === Description of user-callable routines ================================ */ /* ========================================================================== */ /* COLAMD includes both int and SuiteSparse_long versions of all its routines. The description below is for the int version. For SuiteSparse_long, all int arguments become SuiteSparse_long. SuiteSparse_long is normally defined as long, except for WIN64. ---------------------------------------------------------------------------- colamd_recommended: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" size_t colamd_recommended (int nnz, int n_row, int n_col) ; size_t colamd_l_recommended (SuiteSparse_long nnz, SuiteSparse_long n_row, SuiteSparse_long n_col) ; Purpose: Returns recommended value of Alen for use by colamd. Returns 0 if any input argument is negative. The use of this routine is optional. Not needed for symamd, which dynamically allocates its own memory. Note that in v2.4 and earlier, these routines returned int or long. They now return a value of type size_t. Arguments (all input arguments): int nnz ; Number of nonzeros in the matrix A. This must be the same value as p [n_col] in the call to colamd - otherwise you will get a wrong value of the recommended memory to use. int n_row ; Number of rows in the matrix A. int n_col ; Number of columns in the matrix A. ---------------------------------------------------------------------------- colamd_set_defaults: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" colamd_set_defaults (double knobs [COLAMD_KNOBS]) ; colamd_l_set_defaults (double knobs [COLAMD_KNOBS]) ; Purpose: Sets the default parameters. The use of this routine is optional. Arguments: double knobs [COLAMD_KNOBS] ; Output only. NOTE: the meaning of the dense row/col knobs has changed in v2.4 knobs [0] and knobs [1] control dense row and col detection: Colamd: rows with more than max (16, knobs [COLAMD_DENSE_ROW] * sqrt (n_col)) entries are removed prior to ordering. Columns with more than max (16, knobs [COLAMD_DENSE_COL] * sqrt (MIN (n_row,n_col))) entries are removed prior to ordering, and placed last in the output column ordering. Symamd: uses only knobs [COLAMD_DENSE_ROW], which is knobs [0]. Rows and columns with more than max (16, knobs [COLAMD_DENSE_ROW] * sqrt (n)) entries are removed prior to ordering, and placed last in the output ordering. COLAMD_DENSE_ROW and COLAMD_DENSE_COL are defined as 0 and 1, respectively, in colamd.h. Default values of these two knobs are both 10. Currently, only knobs [0] and knobs [1] are used, but future versions may use more knobs. If so, they will be properly set to their defaults by the future version of colamd_set_defaults, so that the code that calls colamd will not need to change, assuming that you either use colamd_set_defaults, or pass a (double *) NULL pointer as the knobs array to colamd or symamd. knobs [2]: aggressive absorption knobs [COLAMD_AGGRESSIVE] controls whether or not to do aggressive absorption during the ordering. Default is TRUE. ---------------------------------------------------------------------------- colamd: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" int colamd (int n_row, int n_col, int Alen, int *A, int *p, double knobs [COLAMD_KNOBS], int stats [COLAMD_STATS]) ; SuiteSparse_long colamd_l (SuiteSparse_long n_row, SuiteSparse_long n_col, SuiteSparse_long Alen, SuiteSparse_long *A, SuiteSparse_long *p, double knobs [COLAMD_KNOBS], SuiteSparse_long stats [COLAMD_STATS]) ; Purpose: Computes a column ordering (Q) of A such that P(AQ)=LU or (AQ)'AQ=LL' have less fill-in and require fewer floating point operations than factorizing the unpermuted matrix A or A'A, respectively. Returns: TRUE (1) if successful, FALSE (0) otherwise. Arguments: int n_row ; Input argument. Number of rows in the matrix A. Restriction: n_row >= 0. Colamd returns FALSE if n_row is negative. int n_col ; Input argument. Number of columns in the matrix A. Restriction: n_col >= 0. Colamd returns FALSE if n_col is negative. int Alen ; Input argument. Restriction (see note): Alen >= 2*nnz + 6*(n_col+1) + 4*(n_row+1) + n_col Colamd returns FALSE if these conditions are not met. Note: this restriction makes an modest assumption regarding the size of the two typedef's structures in colamd.h. We do, however, guarantee that Alen >= colamd_recommended (nnz, n_row, n_col) will be sufficient. Note: the macro version does not check for integer overflow, and thus is not recommended. Use the colamd_recommended routine instead. int A [Alen] ; Input argument, undefined on output. A is an integer array of size Alen. Alen must be at least as large as the bare minimum value given above, but this is very low, and can result in excessive run time. For best performance, we recommend that Alen be greater than or equal to colamd_recommended (nnz, n_row, n_col), which adds nnz/5 to the bare minimum value given above. On input, the row indices of the entries in column c of the matrix are held in A [(p [c]) ... (p [c+1]-1)]. The row indices in a given column c need not be in ascending order, and duplicate row indices may be be present. However, colamd will work a little faster if both of these conditions are met (Colamd puts the matrix into this format, if it finds that the the conditions are not met). The matrix is 0-based. That is, rows are in the range 0 to n_row-1, and columns are in the range 0 to n_col-1. Colamd returns FALSE if any row index is out of range. The contents of A are modified during ordering, and are undefined on output. int p [n_col+1] ; Both input and output argument. p is an integer array of size n_col+1. On input, it holds the "pointers" for the column form of the matrix A. Column c of the matrix A is held in A [(p [c]) ... (p [c+1]-1)]. The first entry, p [0], must be zero, and p [c] <= p [c+1] must hold for all c in the range 0 to n_col-1. The value p [n_col] is thus the total number of entries in the pattern of the matrix A. Colamd returns FALSE if these conditions are not met. On output, if colamd returns TRUE, the array p holds the column permutation (Q, for P(AQ)=LU or (AQ)'(AQ)=LL'), where p [0] is the first column index in the new ordering, and p [n_col-1] is the last. That is, p [k] = j means that column j of A is the kth pivot column, in AQ, where k is in the range 0 to n_col-1 (p [0] = j means that column j of A is the first column in AQ). If colamd returns FALSE, then no permutation is returned, and p is undefined on output. double knobs [COLAMD_KNOBS] ; Input argument. See colamd_set_defaults for a description. int stats [COLAMD_STATS] ; Output argument. Statistics on the ordering, and error status. See colamd.h for related definitions. Colamd returns FALSE if stats is not present. stats [0]: number of dense or empty rows ignored. stats [1]: number of dense or empty columns ignored (and ordered last in the output permutation p) Note that a row can become "empty" if it contains only "dense" and/or "empty" columns, and similarly a column can become "empty" if it only contains "dense" and/or "empty" rows. stats [2]: number of garbage collections performed. This can be excessively high if Alen is close to the minimum required value. stats [3]: status code. < 0 is an error code. > 1 is a warning or notice. 0 OK. Each column of the input matrix contained row indices in increasing order, with no duplicates. 1 OK, but columns of input matrix were jumbled (unsorted columns or duplicate entries). Colamd had to do some extra work to sort the matrix first and remove duplicate entries, but it still was able to return a valid permutation (return value of colamd was TRUE). stats [4]: highest numbered column that is unsorted or has duplicate entries. stats [5]: last seen duplicate or unsorted row index. stats [6]: number of duplicate or unsorted row indices. -1 A is a null pointer -2 p is a null pointer -3 n_row is negative stats [4]: n_row -4 n_col is negative stats [4]: n_col -5 number of nonzeros in matrix is negative stats [4]: number of nonzeros, p [n_col] -6 p [0] is nonzero stats [4]: p [0] -7 A is too small stats [4]: required size stats [5]: actual size (Alen) -8 a column has a negative number of entries stats [4]: column with < 0 entries stats [5]: number of entries in col -9 a row index is out of bounds stats [4]: column with bad row index stats [5]: bad row index stats [6]: n_row, # of rows of matrx -10 (unused; see symamd.c) -999 (unused; see symamd.c) Future versions may return more statistics in the stats array. Example: See colamd_example.c for a complete example. To order the columns of a 5-by-4 matrix with 11 nonzero entries in the following nonzero pattern x 0 x 0 x 0 x x 0 x x 0 0 0 x x x x 0 0 with default knobs and no output statistics, do the following: #include "colamd.h" #define ALEN 100 int A [ALEN] = {0, 1, 4, 2, 4, 0, 1, 2, 3, 1, 3} ; int p [ ] = {0, 3, 5, 9, 11} ; int stats [COLAMD_STATS] ; colamd (5, 4, ALEN, A, p, (double *) NULL, stats) ; The permutation is returned in the array p, and A is destroyed. ---------------------------------------------------------------------------- symamd: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" int symamd (int n, int *A, int *p, int *perm, double knobs [COLAMD_KNOBS], int stats [COLAMD_STATS], void (*allocate) (size_t, size_t), void (*release) (void *)) ; SuiteSparse_long symamd_l (SuiteSparse_long n, SuiteSparse_long *A, SuiteSparse_long *p, SuiteSparse_long *perm, double knobs [COLAMD_KNOBS], SuiteSparse_long stats [COLAMD_STATS], void (*allocate) (size_t, size_t), void (*release) (void *)) ; Purpose: The symamd routine computes an ordering P of a symmetric sparse matrix A such that the Cholesky factorization PAP' = LL' remains sparse. It is based on a column ordering of a matrix M constructed so that the nonzero pattern of M'M is the same as A. The matrix A is assumed to be symmetric; only the strictly lower triangular part is accessed. You must pass your selected memory allocator (usually calloc/free or mxCalloc/mxFree) to symamd, for it to allocate memory for the temporary matrix M. Returns: TRUE (1) if successful, FALSE (0) otherwise. Arguments: int n ; Input argument. Number of rows and columns in the symmetrix matrix A. Restriction: n >= 0. Symamd returns FALSE if n is negative. int A [nnz] ; Input argument. A is an integer array of size nnz, where nnz = p [n]. The row indices of the entries in column c of the matrix are held in A [(p [c]) ... (p [c+1]-1)]. The row indices in a given column c need not be in ascending order, and duplicate row indices may be present. However, symamd will run faster if the columns are in sorted order with no duplicate entries. The matrix is 0-based. That is, rows are in the range 0 to n-1, and columns are in the range 0 to n-1. Symamd returns FALSE if any row index is out of range. The contents of A are not modified. int p [n+1] ; Input argument. p is an integer array of size n+1. On input, it holds the "pointers" for the column form of the matrix A. Column c of the matrix A is held in A [(p [c]) ... (p [c+1]-1)]. The first entry, p [0], must be zero, and p [c] <= p [c+1] must hold for all c in the range 0 to n-1. The value p [n] is thus the total number of entries in the pattern of the matrix A. Symamd returns FALSE if these conditions are not met. The contents of p are not modified. int perm [n+1] ; Output argument. On output, if symamd returns TRUE, the array perm holds the permutation P, where perm [0] is the first index in the new ordering, and perm [n-1] is the last. That is, perm [k] = j means that row and column j of A is the kth column in PAP', where k is in the range 0 to n-1 (perm [0] = j means that row and column j of A are the first row and column in PAP'). The array is used as a workspace during the ordering, which is why it must be of length n+1, not just n. double knobs [COLAMD_KNOBS] ; Input argument. See colamd_set_defaults for a description. int stats [COLAMD_STATS] ; Output argument. Statistics on the ordering, and error status. See colamd.h for related definitions. Symamd returns FALSE if stats is not present. stats [0]: number of dense or empty row and columns ignored (and ordered last in the output permutation perm). Note that a row/column can become "empty" if it contains only "dense" and/or "empty" columns/rows. stats [1]: (same as stats [0]) stats [2]: number of garbage collections performed. stats [3]: status code. < 0 is an error code. > 1 is a warning or notice. 0 OK. Each column of the input matrix contained row indices in increasing order, with no duplicates. 1 OK, but columns of input matrix were jumbled (unsorted columns or duplicate entries). Symamd had to do some extra work to sort the matrix first and remove duplicate entries, but it still was able to return a valid permutation (return value of symamd was TRUE). stats [4]: highest numbered column that is unsorted or has duplicate entries. stats [5]: last seen duplicate or unsorted row index. stats [6]: number of duplicate or unsorted row indices. -1 A is a null pointer -2 p is a null pointer -3 (unused, see colamd.c) -4 n is negative stats [4]: n -5 number of nonzeros in matrix is negative stats [4]: # of nonzeros (p [n]). -6 p [0] is nonzero stats [4]: p [0] -7 (unused) -8 a column has a negative number of entries stats [4]: column with < 0 entries stats [5]: number of entries in col -9 a row index is out of bounds stats [4]: column with bad row index stats [5]: bad row index stats [6]: n_row, # of rows of matrx -10 out of memory (unable to allocate temporary workspace for M or count arrays using the "allocate" routine passed into symamd). Future versions may return more statistics in the stats array. void * (*allocate) (size_t, size_t) A pointer to a function providing memory allocation. The allocated memory must be returned initialized to zero. For a C application, this argument should normally be a pointer to calloc. For a MATLAB mexFunction, the routine mxCalloc is passed instead. void (*release) (size_t, size_t) A pointer to a function that frees memory allocated by the memory allocation routine above. For a C application, this argument should normally be a pointer to free. For a MATLAB mexFunction, the routine mxFree is passed instead. ---------------------------------------------------------------------------- colamd_report: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" colamd_report (int stats [COLAMD_STATS]) ; colamd_l_report (SuiteSparse_long stats [COLAMD_STATS]) ; Purpose: Prints the error status and statistics recorded in the stats array on the standard error output (for a standard C routine) or on the MATLAB output (for a mexFunction). Arguments: int stats [COLAMD_STATS] ; Input only. Statistics from colamd. ---------------------------------------------------------------------------- symamd_report: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" symamd_report (int stats [COLAMD_STATS]) ; symamd_l_report (SuiteSparse_long stats [COLAMD_STATS]) ; Purpose: Prints the error status and statistics recorded in the stats array on the standard error output (for a standard C routine) or on the MATLAB output (for a mexFunction). Arguments: int stats [COLAMD_STATS] ; Input only. Statistics from symamd. */ /* ========================================================================== */ /* === Scaffolding code definitions ======================================== */ /* ========================================================================== */ /* Ensure that debugging is turned off: */ #ifndef NDEBUG #define NDEBUG #endif /* turn on debugging by uncommenting the following line #undef NDEBUG */ /* Our "scaffolding code" philosophy: In our opinion, well-written library code should keep its "debugging" code, and just normally have it turned off by the compiler so as not to interfere with performance. This serves several purposes: (1) assertions act as comments to the reader, telling you what the code expects at that point. All assertions will always be true (unless there really is a bug, of course). (2) leaving in the scaffolding code assists anyone who would like to modify the code, or understand the algorithm (by reading the debugging output, one can get a glimpse into what the code is doing). (3) (gasp!) for actually finding bugs. This code has been heavily tested and "should" be fully functional and bug-free ... but you never know... The code will become outrageously slow when debugging is enabled. To control the level of debugging output, set an environment variable D to 0 (little), 1 (some), 2, 3, or 4 (lots). When debugging, you should see the following message on the standard output: colamd: debug version, D = 1 (THIS WILL BE SLOW!) or a similar message for symamd. If you don't, then debugging has not been enabled. */ /* ========================================================================== */ /* === Include files ======================================================== */ /* ========================================================================== */ #include "colamd.h" #include #include #ifdef MATLAB_MEX_FILE #include "mex.h" #include "matrix.h" #endif /* MATLAB_MEX_FILE */ #if !defined (NPRINT) || !defined (NDEBUG) #include #endif #ifndef NULL #define NULL ((void *) 0) #endif /* ========================================================================== */ /* === int or SuiteSparse_long ============================================== */ /* ========================================================================== */ #ifdef DLONG #define Int SuiteSparse_long #define ID SuiteSparse_long_id #define Int_MAX SuiteSparse_long_max #define COLAMD_recommended colamd_l_recommended #define COLAMD_set_defaults colamd_l_set_defaults #define COLAMD_MAIN colamd_l #define SYMAMD_MAIN symamd_l #define COLAMD_report colamd_l_report #define SYMAMD_report symamd_l_report #else #define Int int #define ID "%d" #define Int_MAX INT_MAX #define COLAMD_recommended colamd_recommended #define COLAMD_set_defaults colamd_set_defaults #define COLAMD_MAIN colamd #define SYMAMD_MAIN symamd #define COLAMD_report colamd_report #define SYMAMD_report symamd_report #endif /* ========================================================================== */ /* === Row and Column structures ============================================ */ /* ========================================================================== */ /* User code that makes use of the colamd/symamd routines need not directly */ /* reference these structures. They are used only for colamd_recommended. */ typedef struct Colamd_Col_struct { Int start ; /* index for A of first row in this column, or DEAD */ /* if column is dead */ Int length ; /* number of rows in this column */ union { Int thickness ; /* number of original columns represented by this */ /* col, if the column is alive */ Int parent ; /* parent in parent tree super-column structure, if */ /* the column is dead */ } shared1 ; union { Int score ; /* the score used to maintain heap, if col is alive */ Int order ; /* pivot ordering of this column, if col is dead */ } shared2 ; union { Int headhash ; /* head of a hash bucket, if col is at the head of */ /* a degree list */ Int hash ; /* hash value, if col is not in a degree list */ Int prev ; /* previous column in degree list, if col is in a */ /* degree list (but not at the head of a degree list) */ } shared3 ; union { Int degree_next ; /* next column, if col is in a degree list */ Int hash_next ; /* next column, if col is in a hash list */ } shared4 ; } Colamd_Col ; typedef struct Colamd_Row_struct { Int start ; /* index for A of first col in this row */ Int length ; /* number of principal columns in this row */ union { Int degree ; /* number of principal & non-principal columns in row */ Int p ; /* used as a row pointer in init_rows_cols () */ } shared1 ; union { Int mark ; /* for computing set differences and marking dead rows*/ Int first_column ;/* first column in row (used in garbage collection) */ } shared2 ; } Colamd_Row ; /* ========================================================================== */ /* === Definitions ========================================================== */ /* ========================================================================== */ /* Routines are either PUBLIC (user-callable) or PRIVATE (not user-callable) */ #define PUBLIC #define PRIVATE static #define DENSE_DEGREE(alpha,n) \ ((Int) MAX (16.0, (alpha) * sqrt ((double) (n)))) #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define ONES_COMPLEMENT(r) (-(r)-1) /* -------------------------------------------------------------------------- */ /* Change for version 2.1: define TRUE and FALSE only if not yet defined */ /* -------------------------------------------------------------------------- */ #ifndef TRUE #define TRUE (1) #endif #ifndef FALSE #define FALSE (0) #endif /* -------------------------------------------------------------------------- */ #define EMPTY (-1) /* Row and column status */ #define ALIVE (0) #define DEAD (-1) /* Column status */ #define DEAD_PRINCIPAL (-1) #define DEAD_NON_PRINCIPAL (-2) /* Macros for row and column status update and checking. */ #define ROW_IS_DEAD(r) ROW_IS_MARKED_DEAD (Row[r].shared2.mark) #define ROW_IS_MARKED_DEAD(row_mark) (row_mark < ALIVE) #define ROW_IS_ALIVE(r) (Row [r].shared2.mark >= ALIVE) #define COL_IS_DEAD(c) (Col [c].start < ALIVE) #define COL_IS_ALIVE(c) (Col [c].start >= ALIVE) #define COL_IS_DEAD_PRINCIPAL(c) (Col [c].start == DEAD_PRINCIPAL) #define KILL_ROW(r) { Row [r].shared2.mark = DEAD ; } #define KILL_PRINCIPAL_COL(c) { Col [c].start = DEAD_PRINCIPAL ; } #define KILL_NON_PRINCIPAL_COL(c) { Col [c].start = DEAD_NON_PRINCIPAL ; } /* ========================================================================== */ /* === Colamd reporting mechanism =========================================== */ /* ========================================================================== */ #if defined (MATLAB_MEX_FILE) || defined (MATHWORKS) /* In MATLAB, matrices are 1-based to the user, but 0-based internally */ #define INDEX(i) ((i)+1) #else /* In C, matrices are 0-based and indices are reported as such in *_report */ #define INDEX(i) (i) #endif /* ========================================================================== */ /* === Prototypes of PRIVATE routines ======================================= */ /* ========================================================================== */ PRIVATE Int init_rows_cols ( Int n_row, Int n_col, Colamd_Row Row [], Colamd_Col Col [], Int A [], Int p [], Int stats [COLAMD_STATS] ) ; PRIVATE void init_scoring ( Int n_row, Int n_col, Colamd_Row Row [], Colamd_Col Col [], Int A [], Int head [], double knobs [COLAMD_KNOBS], Int *p_n_row2, Int *p_n_col2, Int *p_max_deg ) ; PRIVATE Int find_ordering ( Int n_row, Int n_col, Int Alen, Colamd_Row Row [], Colamd_Col Col [], Int A [], Int head [], Int n_col2, Int max_deg, Int pfree, Int aggressive ) ; PRIVATE void order_children ( Int n_col, Colamd_Col Col [], Int p [] ) ; PRIVATE void detect_super_cols ( #ifndef NDEBUG Int n_col, Colamd_Row Row [], #endif /* NDEBUG */ Colamd_Col Col [], Int A [], Int head [], Int row_start, Int row_length ) ; PRIVATE Int garbage_collection ( Int n_row, Int n_col, Colamd_Row Row [], Colamd_Col Col [], Int A [], Int *pfree ) ; PRIVATE Int clear_mark ( Int tag_mark, Int max_mark, Int n_row, Colamd_Row Row [] ) ; PRIVATE void print_report ( char *method, Int stats [COLAMD_STATS] ) ; /* ========================================================================== */ /* === Debugging prototypes and definitions ================================= */ /* ========================================================================== */ #ifndef NDEBUG #include /* colamd_debug is the *ONLY* global variable, and is only */ /* present when debugging */ PRIVATE Int colamd_debug = 0 ; /* debug print level */ #define DEBUG0(params) { SUITESPARSE_PRINTF (params) ; } #define DEBUG1(params) { if (colamd_debug >= 1) SUITESPARSE_PRINTF (params) ; } #define DEBUG2(params) { if (colamd_debug >= 2) SUITESPARSE_PRINTF (params) ; } #define DEBUG3(params) { if (colamd_debug >= 3) SUITESPARSE_PRINTF (params) ; } #define DEBUG4(params) { if (colamd_debug >= 4) SUITESPARSE_PRINTF (params) ; } #ifdef MATLAB_MEX_FILE #define ASSERT(expression) (mxAssert ((expression), "")) #else #define ASSERT(expression) (assert (expression)) #endif /* MATLAB_MEX_FILE */ PRIVATE void colamd_get_debug /* gets the debug print level from getenv */ ( char *method ) ; PRIVATE void debug_deg_lists ( Int n_row, Int n_col, Colamd_Row Row [], Colamd_Col Col [], Int head [], Int min_score, Int should, Int max_deg ) ; PRIVATE void debug_mark ( Int n_row, Colamd_Row Row [], Int tag_mark, Int max_mark ) ; PRIVATE void debug_matrix ( Int n_row, Int n_col, Colamd_Row Row [], Colamd_Col Col [], Int A [] ) ; PRIVATE void debug_structures ( Int n_row, Int n_col, Colamd_Row Row [], Colamd_Col Col [], Int A [], Int n_col2 ) ; #else /* NDEBUG */ /* === No debugging ========================================================= */ #define DEBUG0(params) ; #define DEBUG1(params) ; #define DEBUG2(params) ; #define DEBUG3(params) ; #define DEBUG4(params) ; #define ASSERT(expression) #endif /* NDEBUG */ /* ========================================================================== */ /* === USER-CALLABLE ROUTINES: ============================================== */ /* ========================================================================== */ /* ========================================================================== */ /* === colamd_recommended =================================================== */ /* ========================================================================== */ /* The colamd_recommended routine returns the suggested size for Alen. This value has been determined to provide good balance between the number of garbage collections and the memory requirements for colamd. If any argument is negative, or if integer overflow occurs, a 0 is returned as an error condition. 2*nnz space is required for the row and column indices of the matrix. COLAMD_C (n_col) + COLAMD_R (n_row) space is required for the Col and Row arrays, respectively, which are internal to colamd (roughly 6*n_col + 4*n_row). An additional n_col space is the minimal amount of "elbow room", and nnz/5 more space is recommended for run time efficiency. Alen is approximately 2.2*nnz + 7*n_col + 4*n_row + 10. This function is not needed when using symamd. */ /* add two values of type size_t, and check for integer overflow */ static size_t t_add (size_t a, size_t b, int *ok) { (*ok) = (*ok) && ((a + b) >= MAX (a,b)) ; return ((*ok) ? (a + b) : 0) ; } /* compute a*k where k is a small integer, and check for integer overflow */ static size_t t_mult (size_t a, size_t k, int *ok) { size_t i, s = 0 ; for (i = 0 ; i < k ; i++) { s = t_add (s, a, ok) ; } return (s) ; } /* size of the Col and Row structures */ #define COLAMD_C(n_col,ok) \ ((t_mult (t_add (n_col, 1, ok), sizeof (Colamd_Col), ok) / sizeof (Int))) #define COLAMD_R(n_row,ok) \ ((t_mult (t_add (n_row, 1, ok), sizeof (Colamd_Row), ok) / sizeof (Int))) PUBLIC size_t COLAMD_recommended /* returns recommended value of Alen. */ ( /* === Parameters ======================================================= */ Int nnz, /* number of nonzeros in A */ Int n_row, /* number of rows in A */ Int n_col /* number of columns in A */ ) { size_t s, c, r ; int ok = TRUE ; if (nnz < 0 || n_row < 0 || n_col < 0) { return (0) ; } s = t_mult (nnz, 2, &ok) ; /* 2*nnz */ c = COLAMD_C (n_col, &ok) ; /* size of column structures */ r = COLAMD_R (n_row, &ok) ; /* size of row structures */ s = t_add (s, c, &ok) ; s = t_add (s, r, &ok) ; s = t_add (s, n_col, &ok) ; /* elbow room */ s = t_add (s, nnz/5, &ok) ; /* elbow room */ ok = ok && (s < Int_MAX) ; return (ok ? s : 0) ; } /* ========================================================================== */ /* === colamd_set_defaults ================================================== */ /* ========================================================================== */ /* The colamd_set_defaults routine sets the default values of the user- controllable parameters for colamd and symamd: Colamd: rows with more than max (16, knobs [0] * sqrt (n_col)) entries are removed prior to ordering. Columns with more than max (16, knobs [1] * sqrt (MIN (n_row,n_col))) entries are removed prior to ordering, and placed last in the output column ordering. Symamd: Rows and columns with more than max (16, knobs [0] * sqrt (n)) entries are removed prior to ordering, and placed last in the output ordering. knobs [0] dense row control knobs [1] dense column control knobs [2] if nonzero, do aggresive absorption knobs [3..19] unused, but future versions might use this */ PUBLIC void COLAMD_set_defaults ( /* === Parameters ======================================================= */ double knobs [COLAMD_KNOBS] /* knob array */ ) { /* === Local variables ================================================== */ Int i ; if (!knobs) { return ; /* no knobs to initialize */ } for (i = 0 ; i < COLAMD_KNOBS ; i++) { knobs [i] = 0 ; } knobs [COLAMD_DENSE_ROW] = 10 ; knobs [COLAMD_DENSE_COL] = 10 ; knobs [COLAMD_AGGRESSIVE] = TRUE ; /* default: do aggressive absorption*/ } /* ========================================================================== */ /* === symamd =============================================================== */ /* ========================================================================== */ PUBLIC Int SYMAMD_MAIN /* return TRUE if OK, FALSE otherwise */ ( /* === Parameters ======================================================= */ Int n, /* number of rows and columns of A */ Int A [], /* row indices of A */ Int p [], /* column pointers of A */ Int perm [], /* output permutation, size n+1 */ double knobs [COLAMD_KNOBS], /* parameters (uses defaults if NULL) */ Int stats [COLAMD_STATS], /* output statistics and error codes */ void * (*allocate) (size_t, size_t), /* pointer to calloc (ANSI C) or */ /* mxCalloc (for MATLAB mexFunction) */ void (*release) (void *) /* pointer to free (ANSI C) or */ /* mxFree (for MATLAB mexFunction) */ ) { /* === Local variables ================================================== */ Int *count ; /* length of each column of M, and col pointer*/ Int *mark ; /* mark array for finding duplicate entries */ Int *M ; /* row indices of matrix M */ size_t Mlen ; /* length of M */ Int n_row ; /* number of rows in M */ Int nnz ; /* number of entries in A */ Int i ; /* row index of A */ Int j ; /* column index of A */ Int k ; /* row index of M */ Int mnz ; /* number of nonzeros in M */ Int pp ; /* index into a column of A */ Int last_row ; /* last row seen in the current column */ Int length ; /* number of nonzeros in a column */ double cknobs [COLAMD_KNOBS] ; /* knobs for colamd */ double default_knobs [COLAMD_KNOBS] ; /* default knobs for colamd */ #ifndef NDEBUG colamd_get_debug ("symamd") ; #endif /* NDEBUG */ /* === Check the input arguments ======================================== */ if (!stats) { DEBUG0 (("symamd: stats not present\n")) ; return (FALSE) ; } for (i = 0 ; i < COLAMD_STATS ; i++) { stats [i] = 0 ; } stats [COLAMD_STATUS] = COLAMD_OK ; stats [COLAMD_INFO1] = -1 ; stats [COLAMD_INFO2] = -1 ; if (!A) { stats [COLAMD_STATUS] = COLAMD_ERROR_A_not_present ; DEBUG0 (("symamd: A not present\n")) ; return (FALSE) ; } if (!p) /* p is not present */ { stats [COLAMD_STATUS] = COLAMD_ERROR_p_not_present ; DEBUG0 (("symamd: p not present\n")) ; return (FALSE) ; } if (n < 0) /* n must be >= 0 */ { stats [COLAMD_STATUS] = COLAMD_ERROR_ncol_negative ; stats [COLAMD_INFO1] = n ; DEBUG0 (("symamd: n negative %d\n", n)) ; return (FALSE) ; } nnz = p [n] ; if (nnz < 0) /* nnz must be >= 0 */ { stats [COLAMD_STATUS] = COLAMD_ERROR_nnz_negative ; stats [COLAMD_INFO1] = nnz ; DEBUG0 (("symamd: number of entries negative %d\n", nnz)) ; return (FALSE) ; } if (p [0] != 0) { stats [COLAMD_STATUS] = COLAMD_ERROR_p0_nonzero ; stats [COLAMD_INFO1] = p [0] ; DEBUG0 (("symamd: p[0] not zero %d\n", p [0])) ; return (FALSE) ; } /* === If no knobs, set default knobs =================================== */ if (!knobs) { COLAMD_set_defaults (default_knobs) ; knobs = default_knobs ; } /* === Allocate count and mark ========================================== */ count = (Int *) ((*allocate) (n+1, sizeof (Int))) ; if (!count) { stats [COLAMD_STATUS] = COLAMD_ERROR_out_of_memory ; DEBUG0 (("symamd: allocate count (size %d) failed\n", n+1)) ; return (FALSE) ; } mark = (Int *) ((*allocate) (n+1, sizeof (Int))) ; if (!mark) { stats [COLAMD_STATUS] = COLAMD_ERROR_out_of_memory ; (*release) ((void *) count) ; DEBUG0 (("symamd: allocate mark (size %d) failed\n", n+1)) ; return (FALSE) ; } /* === Compute column counts of M, check if A is valid ================== */ stats [COLAMD_INFO3] = 0 ; /* number of duplicate or unsorted row indices*/ for (i = 0 ; i < n ; i++) { mark [i] = -1 ; } for (j = 0 ; j < n ; j++) { last_row = -1 ; length = p [j+1] - p [j] ; if (length < 0) { /* column pointers must be non-decreasing */ stats [COLAMD_STATUS] = COLAMD_ERROR_col_length_negative ; stats [COLAMD_INFO1] = j ; stats [COLAMD_INFO2] = length ; (*release) ((void *) count) ; (*release) ((void *) mark) ; DEBUG0 (("symamd: col %d negative length %d\n", j, length)) ; return (FALSE) ; } for (pp = p [j] ; pp < p [j+1] ; pp++) { i = A [pp] ; if (i < 0 || i >= n) { /* row index i, in column j, is out of bounds */ stats [COLAMD_STATUS] = COLAMD_ERROR_row_index_out_of_bounds ; stats [COLAMD_INFO1] = j ; stats [COLAMD_INFO2] = i ; stats [COLAMD_INFO3] = n ; (*release) ((void *) count) ; (*release) ((void *) mark) ; DEBUG0 (("symamd: row %d col %d out of bounds\n", i, j)) ; return (FALSE) ; } if (i <= last_row || mark [i] == j) { /* row index is unsorted or repeated (or both), thus col */ /* is jumbled. This is a notice, not an error condition. */ stats [COLAMD_STATUS] = COLAMD_OK_BUT_JUMBLED ; stats [COLAMD_INFO1] = j ; stats [COLAMD_INFO2] = i ; (stats [COLAMD_INFO3]) ++ ; DEBUG1 (("symamd: row %d col %d unsorted/duplicate\n", i, j)) ; } if (i > j && mark [i] != j) { /* row k of M will contain column indices i and j */ count [i]++ ; count [j]++ ; } /* mark the row as having been seen in this column */ mark [i] = j ; last_row = i ; } } /* v2.4: removed free(mark) */ /* === Compute column pointers of M ===================================== */ /* use output permutation, perm, for column pointers of M */ perm [0] = 0 ; for (j = 1 ; j <= n ; j++) { perm [j] = perm [j-1] + count [j-1] ; } for (j = 0 ; j < n ; j++) { count [j] = perm [j] ; } /* === Construct M ====================================================== */ mnz = perm [n] ; n_row = mnz / 2 ; Mlen = COLAMD_recommended (mnz, n_row, n) ; M = (Int *) ((*allocate) (Mlen, sizeof (Int))) ; DEBUG0 (("symamd: M is %d-by-%d with %d entries, Mlen = %g\n", n_row, n, mnz, (double) Mlen)) ; if (!M) { stats [COLAMD_STATUS] = COLAMD_ERROR_out_of_memory ; (*release) ((void *) count) ; (*release) ((void *) mark) ; DEBUG0 (("symamd: allocate M (size %g) failed\n", (double) Mlen)) ; return (FALSE) ; } k = 0 ; if (stats [COLAMD_STATUS] == COLAMD_OK) { /* Matrix is OK */ for (j = 0 ; j < n ; j++) { ASSERT (p [j+1] - p [j] >= 0) ; for (pp = p [j] ; pp < p [j+1] ; pp++) { i = A [pp] ; ASSERT (i >= 0 && i < n) ; if (i > j) { /* row k of M contains column indices i and j */ M [count [i]++] = k ; M [count [j]++] = k ; k++ ; } } } } else { /* Matrix is jumbled. Do not add duplicates to M. Unsorted cols OK. */ DEBUG0 (("symamd: Duplicates in A.\n")) ; for (i = 0 ; i < n ; i++) { mark [i] = -1 ; } for (j = 0 ; j < n ; j++) { ASSERT (p [j+1] - p [j] >= 0) ; for (pp = p [j] ; pp < p [j+1] ; pp++) { i = A [pp] ; ASSERT (i >= 0 && i < n) ; if (i > j && mark [i] != j) { /* row k of M contains column indices i and j */ M [count [i]++] = k ; M [count [j]++] = k ; k++ ; mark [i] = j ; } } } /* v2.4: free(mark) moved below */ } /* count and mark no longer needed */ (*release) ((void *) count) ; (*release) ((void *) mark) ; /* v2.4: free (mark) moved here */ ASSERT (k == n_row) ; /* === Adjust the knobs for M =========================================== */ for (i = 0 ; i < COLAMD_KNOBS ; i++) { cknobs [i] = knobs [i] ; } /* there are no dense rows in M */ cknobs [COLAMD_DENSE_ROW] = -1 ; cknobs [COLAMD_DENSE_COL] = knobs [COLAMD_DENSE_ROW] ; /* === Order the columns of M =========================================== */ /* v2.4: colamd cannot fail here, so the error check is removed */ (void) COLAMD_MAIN (n_row, n, (Int) Mlen, M, perm, cknobs, stats) ; /* Note that the output permutation is now in perm */ /* === get the statistics for symamd from colamd ======================== */ /* a dense column in colamd means a dense row and col in symamd */ stats [COLAMD_DENSE_ROW] = stats [COLAMD_DENSE_COL] ; /* === Free M =========================================================== */ (*release) ((void *) M) ; DEBUG0 (("symamd: done.\n")) ; return (TRUE) ; } /* ========================================================================== */ /* === colamd =============================================================== */ /* ========================================================================== */ /* The colamd routine computes a column ordering Q of a sparse matrix A such that the LU factorization P(AQ) = LU remains sparse, where P is selected via partial pivoting. The routine can also be viewed as providing a permutation Q such that the Cholesky factorization (AQ)'(AQ) = LL' remains sparse. */ PUBLIC Int COLAMD_MAIN /* returns TRUE if successful, FALSE otherwise*/ ( /* === Parameters ======================================================= */ Int n_row, /* number of rows in A */ Int n_col, /* number of columns in A */ Int Alen, /* length of A */ Int A [], /* row indices of A */ Int p [], /* pointers to columns in A */ double knobs [COLAMD_KNOBS],/* parameters (uses defaults if NULL) */ Int stats [COLAMD_STATS] /* output statistics and error codes */ ) { /* === Local variables ================================================== */ Int i ; /* loop index */ Int nnz ; /* nonzeros in A */ size_t Row_size ; /* size of Row [], in integers */ size_t Col_size ; /* size of Col [], in integers */ size_t need ; /* minimum required length of A */ Colamd_Row *Row ; /* pointer into A of Row [0..n_row] array */ Colamd_Col *Col ; /* pointer into A of Col [0..n_col] array */ Int n_col2 ; /* number of non-dense, non-empty columns */ Int n_row2 ; /* number of non-dense, non-empty rows */ Int ngarbage ; /* number of garbage collections performed */ Int max_deg ; /* maximum row degree */ double default_knobs [COLAMD_KNOBS] ; /* default knobs array */ Int aggressive ; /* do aggressive absorption */ int ok ; #ifndef NDEBUG colamd_get_debug ("colamd") ; #endif /* NDEBUG */ /* === Check the input arguments ======================================== */ if (!stats) { DEBUG0 (("colamd: stats not present\n")) ; return (FALSE) ; } for (i = 0 ; i < COLAMD_STATS ; i++) { stats [i] = 0 ; } stats [COLAMD_STATUS] = COLAMD_OK ; stats [COLAMD_INFO1] = -1 ; stats [COLAMD_INFO2] = -1 ; if (!A) /* A is not present */ { stats [COLAMD_STATUS] = COLAMD_ERROR_A_not_present ; DEBUG0 (("colamd: A not present\n")) ; return (FALSE) ; } if (!p) /* p is not present */ { stats [COLAMD_STATUS] = COLAMD_ERROR_p_not_present ; DEBUG0 (("colamd: p not present\n")) ; return (FALSE) ; } if (n_row < 0) /* n_row must be >= 0 */ { stats [COLAMD_STATUS] = COLAMD_ERROR_nrow_negative ; stats [COLAMD_INFO1] = n_row ; DEBUG0 (("colamd: nrow negative %d\n", n_row)) ; return (FALSE) ; } if (n_col < 0) /* n_col must be >= 0 */ { stats [COLAMD_STATUS] = COLAMD_ERROR_ncol_negative ; stats [COLAMD_INFO1] = n_col ; DEBUG0 (("colamd: ncol negative %d\n", n_col)) ; return (FALSE) ; } nnz = p [n_col] ; if (nnz < 0) /* nnz must be >= 0 */ { stats [COLAMD_STATUS] = COLAMD_ERROR_nnz_negative ; stats [COLAMD_INFO1] = nnz ; DEBUG0 (("colamd: number of entries negative %d\n", nnz)) ; return (FALSE) ; } if (p [0] != 0) { stats [COLAMD_STATUS] = COLAMD_ERROR_p0_nonzero ; stats [COLAMD_INFO1] = p [0] ; DEBUG0 (("colamd: p[0] not zero %d\n", p [0])) ; return (FALSE) ; } /* === If no knobs, set default knobs =================================== */ if (!knobs) { COLAMD_set_defaults (default_knobs) ; knobs = default_knobs ; } aggressive = (knobs [COLAMD_AGGRESSIVE] != FALSE) ; /* === Allocate the Row and Col arrays from array A ===================== */ ok = TRUE ; Col_size = COLAMD_C (n_col, &ok) ; /* size of Col array of structs */ Row_size = COLAMD_R (n_row, &ok) ; /* size of Row array of structs */ /* need = 2*nnz + n_col + Col_size + Row_size ; */ need = t_mult (nnz, 2, &ok) ; need = t_add (need, n_col, &ok) ; need = t_add (need, Col_size, &ok) ; need = t_add (need, Row_size, &ok) ; if (!ok || need > (size_t) Alen || need > Int_MAX) { /* not enough space in array A to perform the ordering */ stats [COLAMD_STATUS] = COLAMD_ERROR_A_too_small ; stats [COLAMD_INFO1] = need ; stats [COLAMD_INFO2] = Alen ; DEBUG0 (("colamd: Need Alen >= %d, given only Alen = %d\n", need,Alen)); return (FALSE) ; } Alen -= Col_size + Row_size ; Col = (Colamd_Col *) &A [Alen] ; Row = (Colamd_Row *) &A [Alen + Col_size] ; /* === Construct the row and column data structures ===================== */ if (!init_rows_cols (n_row, n_col, Row, Col, A, p, stats)) { /* input matrix is invalid */ DEBUG0 (("colamd: Matrix invalid\n")) ; return (FALSE) ; } /* === Initialize scores, kill dense rows/columns ======================= */ init_scoring (n_row, n_col, Row, Col, A, p, knobs, &n_row2, &n_col2, &max_deg) ; /* === Order the supercolumns =========================================== */ ngarbage = find_ordering (n_row, n_col, Alen, Row, Col, A, p, n_col2, max_deg, 2*nnz, aggressive) ; /* === Order the non-principal columns ================================== */ order_children (n_col, Col, p) ; /* === Return statistics in stats ======================================= */ stats [COLAMD_DENSE_ROW] = n_row - n_row2 ; stats [COLAMD_DENSE_COL] = n_col - n_col2 ; stats [COLAMD_DEFRAG_COUNT] = ngarbage ; DEBUG0 (("colamd: done.\n")) ; return (TRUE) ; } /* ========================================================================== */ /* === colamd_report ======================================================== */ /* ========================================================================== */ PUBLIC void COLAMD_report ( Int stats [COLAMD_STATS] ) { print_report ("colamd", stats) ; } /* ========================================================================== */ /* === symamd_report ======================================================== */ /* ========================================================================== */ PUBLIC void SYMAMD_report ( Int stats [COLAMD_STATS] ) { print_report ("symamd", stats) ; } /* ========================================================================== */ /* === NON-USER-CALLABLE ROUTINES: ========================================== */ /* ========================================================================== */ /* There are no user-callable routines beyond this point in the file */ /* ========================================================================== */ /* === init_rows_cols ======================================================= */ /* ========================================================================== */ /* Takes the column form of the matrix in A and creates the row form of the matrix. Also, row and column attributes are stored in the Col and Row structs. If the columns are un-sorted or contain duplicate row indices, this routine will also sort and remove duplicate row indices from the column form of the matrix. Returns FALSE if the matrix is invalid, TRUE otherwise. Not user-callable. */ PRIVATE Int init_rows_cols /* returns TRUE if OK, or FALSE otherwise */ ( /* === Parameters ======================================================= */ Int n_row, /* number of rows of A */ Int n_col, /* number of columns of A */ Colamd_Row Row [], /* of size n_row+1 */ Colamd_Col Col [], /* of size n_col+1 */ Int A [], /* row indices of A, of size Alen */ Int p [], /* pointers to columns in A, of size n_col+1 */ Int stats [COLAMD_STATS] /* colamd statistics */ ) { /* === Local variables ================================================== */ Int col ; /* a column index */ Int row ; /* a row index */ Int *cp ; /* a column pointer */ Int *cp_end ; /* a pointer to the end of a column */ Int *rp ; /* a row pointer */ Int *rp_end ; /* a pointer to the end of a row */ Int last_row ; /* previous row */ /* === Initialize columns, and check column pointers ==================== */ for (col = 0 ; col < n_col ; col++) { Col [col].start = p [col] ; Col [col].length = p [col+1] - p [col] ; if (Col [col].length < 0) { /* column pointers must be non-decreasing */ stats [COLAMD_STATUS] = COLAMD_ERROR_col_length_negative ; stats [COLAMD_INFO1] = col ; stats [COLAMD_INFO2] = Col [col].length ; DEBUG0 (("colamd: col %d length %d < 0\n", col, Col [col].length)) ; return (FALSE) ; } Col [col].shared1.thickness = 1 ; Col [col].shared2.score = 0 ; Col [col].shared3.prev = EMPTY ; Col [col].shared4.degree_next = EMPTY ; } /* p [0..n_col] no longer needed, used as "head" in subsequent routines */ /* === Scan columns, compute row degrees, and check row indices ========= */ stats [COLAMD_INFO3] = 0 ; /* number of duplicate or unsorted row indices*/ for (row = 0 ; row < n_row ; row++) { Row [row].length = 0 ; Row [row].shared2.mark = -1 ; } for (col = 0 ; col < n_col ; col++) { last_row = -1 ; cp = &A [p [col]] ; cp_end = &A [p [col+1]] ; while (cp < cp_end) { row = *cp++ ; /* make sure row indices within range */ if (row < 0 || row >= n_row) { stats [COLAMD_STATUS] = COLAMD_ERROR_row_index_out_of_bounds ; stats [COLAMD_INFO1] = col ; stats [COLAMD_INFO2] = row ; stats [COLAMD_INFO3] = n_row ; DEBUG0 (("colamd: row %d col %d out of bounds\n", row, col)) ; return (FALSE) ; } if (row <= last_row || Row [row].shared2.mark == col) { /* row index are unsorted or repeated (or both), thus col */ /* is jumbled. This is a notice, not an error condition. */ stats [COLAMD_STATUS] = COLAMD_OK_BUT_JUMBLED ; stats [COLAMD_INFO1] = col ; stats [COLAMD_INFO2] = row ; (stats [COLAMD_INFO3]) ++ ; DEBUG1 (("colamd: row %d col %d unsorted/duplicate\n",row,col)); } if (Row [row].shared2.mark != col) { Row [row].length++ ; } else { /* this is a repeated entry in the column, */ /* it will be removed */ Col [col].length-- ; } /* mark the row as having been seen in this column */ Row [row].shared2.mark = col ; last_row = row ; } } /* === Compute row pointers ============================================= */ /* row form of the matrix starts directly after the column */ /* form of matrix in A */ Row [0].start = p [n_col] ; Row [0].shared1.p = Row [0].start ; Row [0].shared2.mark = -1 ; for (row = 1 ; row < n_row ; row++) { Row [row].start = Row [row-1].start + Row [row-1].length ; Row [row].shared1.p = Row [row].start ; Row [row].shared2.mark = -1 ; } /* === Create row form ================================================== */ if (stats [COLAMD_STATUS] == COLAMD_OK_BUT_JUMBLED) { /* if cols jumbled, watch for repeated row indices */ for (col = 0 ; col < n_col ; col++) { cp = &A [p [col]] ; cp_end = &A [p [col+1]] ; while (cp < cp_end) { row = *cp++ ; if (Row [row].shared2.mark != col) { A [(Row [row].shared1.p)++] = col ; Row [row].shared2.mark = col ; } } } } else { /* if cols not jumbled, we don't need the mark (this is faster) */ for (col = 0 ; col < n_col ; col++) { cp = &A [p [col]] ; cp_end = &A [p [col+1]] ; while (cp < cp_end) { A [(Row [*cp++].shared1.p)++] = col ; } } } /* === Clear the row marks and set row degrees ========================== */ for (row = 0 ; row < n_row ; row++) { Row [row].shared2.mark = 0 ; Row [row].shared1.degree = Row [row].length ; } /* === See if we need to re-create columns ============================== */ if (stats [COLAMD_STATUS] == COLAMD_OK_BUT_JUMBLED) { DEBUG0 (("colamd: reconstructing column form, matrix jumbled\n")) ; #ifndef NDEBUG /* make sure column lengths are correct */ for (col = 0 ; col < n_col ; col++) { p [col] = Col [col].length ; } for (row = 0 ; row < n_row ; row++) { rp = &A [Row [row].start] ; rp_end = rp + Row [row].length ; while (rp < rp_end) { p [*rp++]-- ; } } for (col = 0 ; col < n_col ; col++) { ASSERT (p [col] == 0) ; } /* now p is all zero (different than when debugging is turned off) */ #endif /* NDEBUG */ /* === Compute col pointers ========================================= */ /* col form of the matrix starts at A [0]. */ /* Note, we may have a gap between the col form and the row */ /* form if there were duplicate entries, if so, it will be */ /* removed upon the first garbage collection */ Col [0].start = 0 ; p [0] = Col [0].start ; for (col = 1 ; col < n_col ; col++) { /* note that the lengths here are for pruned columns, i.e. */ /* no duplicate row indices will exist for these columns */ Col [col].start = Col [col-1].start + Col [col-1].length ; p [col] = Col [col].start ; } /* === Re-create col form =========================================== */ for (row = 0 ; row < n_row ; row++) { rp = &A [Row [row].start] ; rp_end = rp + Row [row].length ; while (rp < rp_end) { A [(p [*rp++])++] = row ; } } } /* === Done. Matrix is not (or no longer) jumbled ====================== */ return (TRUE) ; } /* ========================================================================== */ /* === init_scoring ========================================================= */ /* ========================================================================== */ /* Kills dense or empty columns and rows, calculates an initial score for each column, and places all columns in the degree lists. Not user-callable. */ PRIVATE void init_scoring ( /* === Parameters ======================================================= */ Int n_row, /* number of rows of A */ Int n_col, /* number of columns of A */ Colamd_Row Row [], /* of size n_row+1 */ Colamd_Col Col [], /* of size n_col+1 */ Int A [], /* column form and row form of A */ Int head [], /* of size n_col+1 */ double knobs [COLAMD_KNOBS],/* parameters */ Int *p_n_row2, /* number of non-dense, non-empty rows */ Int *p_n_col2, /* number of non-dense, non-empty columns */ Int *p_max_deg /* maximum row degree */ ) { /* === Local variables ================================================== */ Int c ; /* a column index */ Int r, row ; /* a row index */ Int *cp ; /* a column pointer */ Int deg ; /* degree of a row or column */ Int *cp_end ; /* a pointer to the end of a column */ Int *new_cp ; /* new column pointer */ Int col_length ; /* length of pruned column */ Int score ; /* current column score */ Int n_col2 ; /* number of non-dense, non-empty columns */ Int n_row2 ; /* number of non-dense, non-empty rows */ Int dense_row_count ; /* remove rows with more entries than this */ Int dense_col_count ; /* remove cols with more entries than this */ Int min_score ; /* smallest column score */ Int max_deg ; /* maximum row degree */ Int next_col ; /* Used to add to degree list.*/ #ifndef NDEBUG Int debug_count ; /* debug only. */ #endif /* NDEBUG */ /* === Extract knobs ==================================================== */ /* Note: if knobs contains a NaN, this is undefined: */ if (knobs [COLAMD_DENSE_ROW] < 0) { /* only remove completely dense rows */ dense_row_count = n_col-1 ; } else { dense_row_count = DENSE_DEGREE (knobs [COLAMD_DENSE_ROW], n_col) ; } if (knobs [COLAMD_DENSE_COL] < 0) { /* only remove completely dense columns */ dense_col_count = n_row-1 ; } else { dense_col_count = DENSE_DEGREE (knobs [COLAMD_DENSE_COL], MIN (n_row, n_col)) ; } DEBUG1 (("colamd: densecount: %d %d\n", dense_row_count, dense_col_count)) ; max_deg = 0 ; n_col2 = n_col ; n_row2 = n_row ; /* === Kill empty columns =============================================== */ /* Put the empty columns at the end in their natural order, so that LU */ /* factorization can proceed as far as possible. */ for (c = n_col-1 ; c >= 0 ; c--) { deg = Col [c].length ; if (deg == 0) { /* this is a empty column, kill and order it last */ Col [c].shared2.order = --n_col2 ; KILL_PRINCIPAL_COL (c) ; } } DEBUG1 (("colamd: null columns killed: %d\n", n_col - n_col2)) ; /* === Kill dense columns =============================================== */ /* Put the dense columns at the end, in their natural order */ for (c = n_col-1 ; c >= 0 ; c--) { /* skip any dead columns */ if (COL_IS_DEAD (c)) { continue ; } deg = Col [c].length ; if (deg > dense_col_count) { /* this is a dense column, kill and order it last */ Col [c].shared2.order = --n_col2 ; /* decrement the row degrees */ cp = &A [Col [c].start] ; cp_end = cp + Col [c].length ; while (cp < cp_end) { Row [*cp++].shared1.degree-- ; } KILL_PRINCIPAL_COL (c) ; } } DEBUG1 (("colamd: Dense and null columns killed: %d\n", n_col - n_col2)) ; /* === Kill dense and empty rows ======================================== */ for (r = 0 ; r < n_row ; r++) { deg = Row [r].shared1.degree ; ASSERT (deg >= 0 && deg <= n_col) ; if (deg > dense_row_count || deg == 0) { /* kill a dense or empty row */ KILL_ROW (r) ; --n_row2 ; } else { /* keep track of max degree of remaining rows */ max_deg = MAX (max_deg, deg) ; } } DEBUG1 (("colamd: Dense and null rows killed: %d\n", n_row - n_row2)) ; /* === Compute initial column scores ==================================== */ /* At this point the row degrees are accurate. They reflect the number */ /* of "live" (non-dense) columns in each row. No empty rows exist. */ /* Some "live" columns may contain only dead rows, however. These are */ /* pruned in the code below. */ /* now find the initial matlab score for each column */ for (c = n_col-1 ; c >= 0 ; c--) { /* skip dead column */ if (COL_IS_DEAD (c)) { continue ; } score = 0 ; cp = &A [Col [c].start] ; new_cp = cp ; cp_end = cp + Col [c].length ; while (cp < cp_end) { /* get a row */ row = *cp++ ; /* skip if dead */ if (ROW_IS_DEAD (row)) { continue ; } /* compact the column */ *new_cp++ = row ; /* add row's external degree */ score += Row [row].shared1.degree - 1 ; /* guard against integer overflow */ score = MIN (score, n_col) ; } /* determine pruned column length */ col_length = (Int) (new_cp - &A [Col [c].start]) ; if (col_length == 0) { /* a newly-made null column (all rows in this col are "dense" */ /* and have already been killed) */ DEBUG2 (("Newly null killed: %d\n", c)) ; Col [c].shared2.order = --n_col2 ; KILL_PRINCIPAL_COL (c) ; } else { /* set column length and set score */ ASSERT (score >= 0) ; ASSERT (score <= n_col) ; Col [c].length = col_length ; Col [c].shared2.score = score ; } } DEBUG1 (("colamd: Dense, null, and newly-null columns killed: %d\n", n_col-n_col2)) ; /* At this point, all empty rows and columns are dead. All live columns */ /* are "clean" (containing no dead rows) and simplicial (no supercolumns */ /* yet). Rows may contain dead columns, but all live rows contain at */ /* least one live column. */ #ifndef NDEBUG debug_structures (n_row, n_col, Row, Col, A, n_col2) ; #endif /* NDEBUG */ /* === Initialize degree lists ========================================== */ #ifndef NDEBUG debug_count = 0 ; #endif /* NDEBUG */ /* clear the hash buckets */ for (c = 0 ; c <= n_col ; c++) { head [c] = EMPTY ; } min_score = n_col ; /* place in reverse order, so low column indices are at the front */ /* of the lists. This is to encourage natural tie-breaking */ for (c = n_col-1 ; c >= 0 ; c--) { /* only add principal columns to degree lists */ if (COL_IS_ALIVE (c)) { DEBUG4 (("place %d score %d minscore %d ncol %d\n", c, Col [c].shared2.score, min_score, n_col)) ; /* === Add columns score to DList =============================== */ score = Col [c].shared2.score ; ASSERT (min_score >= 0) ; ASSERT (min_score <= n_col) ; ASSERT (score >= 0) ; ASSERT (score <= n_col) ; ASSERT (head [score] >= EMPTY) ; /* now add this column to dList at proper score location */ next_col = head [score] ; Col [c].shared3.prev = EMPTY ; Col [c].shared4.degree_next = next_col ; /* if there already was a column with the same score, set its */ /* previous pointer to this new column */ if (next_col != EMPTY) { Col [next_col].shared3.prev = c ; } head [score] = c ; /* see if this score is less than current min */ min_score = MIN (min_score, score) ; #ifndef NDEBUG debug_count++ ; #endif /* NDEBUG */ } } #ifndef NDEBUG DEBUG1 (("colamd: Live cols %d out of %d, non-princ: %d\n", debug_count, n_col, n_col-debug_count)) ; ASSERT (debug_count == n_col2) ; debug_deg_lists (n_row, n_col, Row, Col, head, min_score, n_col2, max_deg) ; #endif /* NDEBUG */ /* === Return number of remaining columns, and max row degree =========== */ *p_n_col2 = n_col2 ; *p_n_row2 = n_row2 ; *p_max_deg = max_deg ; } /* ========================================================================== */ /* === find_ordering ======================================================== */ /* ========================================================================== */ /* Order the principal columns of the supercolumn form of the matrix (no supercolumns on input). Uses a minimum approximate column minimum degree ordering method. Not user-callable. */ PRIVATE Int find_ordering /* return the number of garbage collections */ ( /* === Parameters ======================================================= */ Int n_row, /* number of rows of A */ Int n_col, /* number of columns of A */ Int Alen, /* size of A, 2*nnz + n_col or larger */ Colamd_Row Row [], /* of size n_row+1 */ Colamd_Col Col [], /* of size n_col+1 */ Int A [], /* column form and row form of A */ Int head [], /* of size n_col+1 */ Int n_col2, /* Remaining columns to order */ Int max_deg, /* Maximum row degree */ Int pfree, /* index of first free slot (2*nnz on entry) */ Int aggressive ) { /* === Local variables ================================================== */ Int k ; /* current pivot ordering step */ Int pivot_col ; /* current pivot column */ Int *cp ; /* a column pointer */ Int *rp ; /* a row pointer */ Int pivot_row ; /* current pivot row */ Int *new_cp ; /* modified column pointer */ Int *new_rp ; /* modified row pointer */ Int pivot_row_start ; /* pointer to start of pivot row */ Int pivot_row_degree ; /* number of columns in pivot row */ Int pivot_row_length ; /* number of supercolumns in pivot row */ Int pivot_col_score ; /* score of pivot column */ Int needed_memory ; /* free space needed for pivot row */ Int *cp_end ; /* pointer to the end of a column */ Int *rp_end ; /* pointer to the end of a row */ Int row ; /* a row index */ Int col ; /* a column index */ Int max_score ; /* maximum possible score */ Int cur_score ; /* score of current column */ unsigned Int hash ; /* hash value for supernode detection */ Int head_column ; /* head of hash bucket */ Int first_col ; /* first column in hash bucket */ Int tag_mark ; /* marker value for mark array */ Int row_mark ; /* Row [row].shared2.mark */ Int set_difference ; /* set difference size of row with pivot row */ Int min_score ; /* smallest column score */ Int col_thickness ; /* "thickness" (no. of columns in a supercol) */ Int max_mark ; /* maximum value of tag_mark */ Int pivot_col_thickness ; /* number of columns represented by pivot col */ Int prev_col ; /* Used by Dlist operations. */ Int next_col ; /* Used by Dlist operations. */ Int ngarbage ; /* number of garbage collections performed */ #ifndef NDEBUG Int debug_d ; /* debug loop counter */ Int debug_step = 0 ; /* debug loop counter */ #endif /* NDEBUG */ /* === Initialization and clear mark ==================================== */ max_mark = INT_MAX - n_col ; /* INT_MAX defined in */ tag_mark = clear_mark (0, max_mark, n_row, Row) ; min_score = 0 ; ngarbage = 0 ; DEBUG1 (("colamd: Ordering, n_col2=%d\n", n_col2)) ; /* === Order the columns ================================================ */ for (k = 0 ; k < n_col2 ; /* 'k' is incremented below */) { #ifndef NDEBUG if (debug_step % 100 == 0) { DEBUG2 (("\n... Step k: %d out of n_col2: %d\n", k, n_col2)) ; } else { DEBUG3 (("\n----------Step k: %d out of n_col2: %d\n", k, n_col2)) ; } debug_step++ ; debug_deg_lists (n_row, n_col, Row, Col, head, min_score, n_col2-k, max_deg) ; debug_matrix (n_row, n_col, Row, Col, A) ; #endif /* NDEBUG */ /* === Select pivot column, and order it ============================ */ /* make sure degree list isn't empty */ ASSERT (min_score >= 0) ; ASSERT (min_score <= n_col) ; ASSERT (head [min_score] >= EMPTY) ; #ifndef NDEBUG for (debug_d = 0 ; debug_d < min_score ; debug_d++) { ASSERT (head [debug_d] == EMPTY) ; } #endif /* NDEBUG */ /* get pivot column from head of minimum degree list */ while (head [min_score] == EMPTY && min_score < n_col) { min_score++ ; } pivot_col = head [min_score] ; ASSERT (pivot_col >= 0 && pivot_col <= n_col) ; next_col = Col [pivot_col].shared4.degree_next ; head [min_score] = next_col ; if (next_col != EMPTY) { Col [next_col].shared3.prev = EMPTY ; } ASSERT (COL_IS_ALIVE (pivot_col)) ; /* remember score for defrag check */ pivot_col_score = Col [pivot_col].shared2.score ; /* the pivot column is the kth column in the pivot order */ Col [pivot_col].shared2.order = k ; /* increment order count by column thickness */ pivot_col_thickness = Col [pivot_col].shared1.thickness ; k += pivot_col_thickness ; ASSERT (pivot_col_thickness > 0) ; DEBUG3 (("Pivot col: %d thick %d\n", pivot_col, pivot_col_thickness)) ; /* === Garbage_collection, if necessary ============================= */ needed_memory = MIN (pivot_col_score, n_col - k) ; if (pfree + needed_memory >= Alen) { pfree = garbage_collection (n_row, n_col, Row, Col, A, &A [pfree]) ; ngarbage++ ; /* after garbage collection we will have enough */ ASSERT (pfree + needed_memory < Alen) ; /* garbage collection has wiped out the Row[].shared2.mark array */ tag_mark = clear_mark (0, max_mark, n_row, Row) ; #ifndef NDEBUG debug_matrix (n_row, n_col, Row, Col, A) ; #endif /* NDEBUG */ } /* === Compute pivot row pattern ==================================== */ /* get starting location for this new merged row */ pivot_row_start = pfree ; /* initialize new row counts to zero */ pivot_row_degree = 0 ; /* tag pivot column as having been visited so it isn't included */ /* in merged pivot row */ Col [pivot_col].shared1.thickness = -pivot_col_thickness ; /* pivot row is the union of all rows in the pivot column pattern */ cp = &A [Col [pivot_col].start] ; cp_end = cp + Col [pivot_col].length ; while (cp < cp_end) { /* get a row */ row = *cp++ ; DEBUG4 (("Pivot col pattern %d %d\n", ROW_IS_ALIVE (row), row)) ; /* skip if row is dead */ if (ROW_IS_ALIVE (row)) { rp = &A [Row [row].start] ; rp_end = rp + Row [row].length ; while (rp < rp_end) { /* get a column */ col = *rp++ ; /* add the column, if alive and untagged */ col_thickness = Col [col].shared1.thickness ; if (col_thickness > 0 && COL_IS_ALIVE (col)) { /* tag column in pivot row */ Col [col].shared1.thickness = -col_thickness ; ASSERT (pfree < Alen) ; /* place column in pivot row */ A [pfree++] = col ; pivot_row_degree += col_thickness ; } } } } /* clear tag on pivot column */ Col [pivot_col].shared1.thickness = pivot_col_thickness ; max_deg = MAX (max_deg, pivot_row_degree) ; #ifndef NDEBUG DEBUG3 (("check2\n")) ; debug_mark (n_row, Row, tag_mark, max_mark) ; #endif /* NDEBUG */ /* === Kill all rows used to construct pivot row ==================== */ /* also kill pivot row, temporarily */ cp = &A [Col [pivot_col].start] ; cp_end = cp + Col [pivot_col].length ; while (cp < cp_end) { /* may be killing an already dead row */ row = *cp++ ; DEBUG3 (("Kill row in pivot col: %d\n", row)) ; KILL_ROW (row) ; } /* === Select a row index to use as the new pivot row =============== */ pivot_row_length = pfree - pivot_row_start ; if (pivot_row_length > 0) { /* pick the "pivot" row arbitrarily (first row in col) */ pivot_row = A [Col [pivot_col].start] ; DEBUG3 (("Pivotal row is %d\n", pivot_row)) ; } else { /* there is no pivot row, since it is of zero length */ pivot_row = EMPTY ; ASSERT (pivot_row_length == 0) ; } ASSERT (Col [pivot_col].length > 0 || pivot_row_length == 0) ; /* === Approximate degree computation =============================== */ /* Here begins the computation of the approximate degree. The column */ /* score is the sum of the pivot row "length", plus the size of the */ /* set differences of each row in the column minus the pattern of the */ /* pivot row itself. The column ("thickness") itself is also */ /* excluded from the column score (we thus use an approximate */ /* external degree). */ /* The time taken by the following code (compute set differences, and */ /* add them up) is proportional to the size of the data structure */ /* being scanned - that is, the sum of the sizes of each column in */ /* the pivot row. Thus, the amortized time to compute a column score */ /* is proportional to the size of that column (where size, in this */ /* context, is the column "length", or the number of row indices */ /* in that column). The number of row indices in a column is */ /* monotonically non-decreasing, from the length of the original */ /* column on input to colamd. */ /* === Compute set differences ====================================== */ DEBUG3 (("** Computing set differences phase. **\n")) ; /* pivot row is currently dead - it will be revived later. */ DEBUG3 (("Pivot row: ")) ; /* for each column in pivot row */ rp = &A [pivot_row_start] ; rp_end = rp + pivot_row_length ; while (rp < rp_end) { col = *rp++ ; ASSERT (COL_IS_ALIVE (col) && col != pivot_col) ; DEBUG3 (("Col: %d\n", col)) ; /* clear tags used to construct pivot row pattern */ col_thickness = -Col [col].shared1.thickness ; ASSERT (col_thickness > 0) ; Col [col].shared1.thickness = col_thickness ; /* === Remove column from degree list =========================== */ cur_score = Col [col].shared2.score ; prev_col = Col [col].shared3.prev ; next_col = Col [col].shared4.degree_next ; ASSERT (cur_score >= 0) ; ASSERT (cur_score <= n_col) ; ASSERT (cur_score >= EMPTY) ; if (prev_col == EMPTY) { head [cur_score] = next_col ; } else { Col [prev_col].shared4.degree_next = next_col ; } if (next_col != EMPTY) { Col [next_col].shared3.prev = prev_col ; } /* === Scan the column ========================================== */ cp = &A [Col [col].start] ; cp_end = cp + Col [col].length ; while (cp < cp_end) { /* get a row */ row = *cp++ ; row_mark = Row [row].shared2.mark ; /* skip if dead */ if (ROW_IS_MARKED_DEAD (row_mark)) { continue ; } ASSERT (row != pivot_row) ; set_difference = row_mark - tag_mark ; /* check if the row has been seen yet */ if (set_difference < 0) { ASSERT (Row [row].shared1.degree <= max_deg) ; set_difference = Row [row].shared1.degree ; } /* subtract column thickness from this row's set difference */ set_difference -= col_thickness ; ASSERT (set_difference >= 0) ; /* absorb this row if the set difference becomes zero */ if (set_difference == 0 && aggressive) { DEBUG3 (("aggressive absorption. Row: %d\n", row)) ; KILL_ROW (row) ; } else { /* save the new mark */ Row [row].shared2.mark = set_difference + tag_mark ; } } } #ifndef NDEBUG debug_deg_lists (n_row, n_col, Row, Col, head, min_score, n_col2-k-pivot_row_degree, max_deg) ; #endif /* NDEBUG */ /* === Add up set differences for each column ======================= */ DEBUG3 (("** Adding set differences phase. **\n")) ; /* for each column in pivot row */ rp = &A [pivot_row_start] ; rp_end = rp + pivot_row_length ; while (rp < rp_end) { /* get a column */ col = *rp++ ; ASSERT (COL_IS_ALIVE (col) && col != pivot_col) ; hash = 0 ; cur_score = 0 ; cp = &A [Col [col].start] ; /* compact the column */ new_cp = cp ; cp_end = cp + Col [col].length ; DEBUG4 (("Adding set diffs for Col: %d.\n", col)) ; while (cp < cp_end) { /* get a row */ row = *cp++ ; ASSERT(row >= 0 && row < n_row) ; row_mark = Row [row].shared2.mark ; /* skip if dead */ if (ROW_IS_MARKED_DEAD (row_mark)) { DEBUG4 ((" Row %d, dead\n", row)) ; continue ; } DEBUG4 ((" Row %d, set diff %d\n", row, row_mark-tag_mark)); ASSERT (row_mark >= tag_mark) ; /* compact the column */ *new_cp++ = row ; /* compute hash function */ hash += row ; /* add set difference */ cur_score += row_mark - tag_mark ; /* integer overflow... */ cur_score = MIN (cur_score, n_col) ; } /* recompute the column's length */ Col [col].length = (Int) (new_cp - &A [Col [col].start]) ; /* === Further mass elimination ================================= */ if (Col [col].length == 0) { DEBUG4 (("further mass elimination. Col: %d\n", col)) ; /* nothing left but the pivot row in this column */ KILL_PRINCIPAL_COL (col) ; pivot_row_degree -= Col [col].shared1.thickness ; ASSERT (pivot_row_degree >= 0) ; /* order it */ Col [col].shared2.order = k ; /* increment order count by column thickness */ k += Col [col].shared1.thickness ; } else { /* === Prepare for supercolumn detection ==================== */ DEBUG4 (("Preparing supercol detection for Col: %d.\n", col)) ; /* save score so far */ Col [col].shared2.score = cur_score ; /* add column to hash table, for supercolumn detection */ hash %= n_col + 1 ; DEBUG4 ((" Hash = %d, n_col = %d.\n", hash, n_col)) ; ASSERT (((Int) hash) <= n_col) ; head_column = head [hash] ; if (head_column > EMPTY) { /* degree list "hash" is non-empty, use prev (shared3) of */ /* first column in degree list as head of hash bucket */ first_col = Col [head_column].shared3.headhash ; Col [head_column].shared3.headhash = col ; } else { /* degree list "hash" is empty, use head as hash bucket */ first_col = - (head_column + 2) ; head [hash] = - (col + 2) ; } Col [col].shared4.hash_next = first_col ; /* save hash function in Col [col].shared3.hash */ Col [col].shared3.hash = (Int) hash ; ASSERT (COL_IS_ALIVE (col)) ; } } /* The approximate external column degree is now computed. */ /* === Supercolumn detection ======================================== */ DEBUG3 (("** Supercolumn detection phase. **\n")) ; detect_super_cols ( #ifndef NDEBUG n_col, Row, #endif /* NDEBUG */ Col, A, head, pivot_row_start, pivot_row_length) ; /* === Kill the pivotal column ====================================== */ KILL_PRINCIPAL_COL (pivot_col) ; /* === Clear mark =================================================== */ tag_mark = clear_mark (tag_mark+max_deg+1, max_mark, n_row, Row) ; #ifndef NDEBUG DEBUG3 (("check3\n")) ; debug_mark (n_row, Row, tag_mark, max_mark) ; #endif /* NDEBUG */ /* === Finalize the new pivot row, and column scores ================ */ DEBUG3 (("** Finalize scores phase. **\n")) ; /* for each column in pivot row */ rp = &A [pivot_row_start] ; /* compact the pivot row */ new_rp = rp ; rp_end = rp + pivot_row_length ; while (rp < rp_end) { col = *rp++ ; /* skip dead columns */ if (COL_IS_DEAD (col)) { continue ; } *new_rp++ = col ; /* add new pivot row to column */ A [Col [col].start + (Col [col].length++)] = pivot_row ; /* retrieve score so far and add on pivot row's degree. */ /* (we wait until here for this in case the pivot */ /* row's degree was reduced due to mass elimination). */ cur_score = Col [col].shared2.score + pivot_row_degree ; /* calculate the max possible score as the number of */ /* external columns minus the 'k' value minus the */ /* columns thickness */ max_score = n_col - k - Col [col].shared1.thickness ; /* make the score the external degree of the union-of-rows */ cur_score -= Col [col].shared1.thickness ; /* make sure score is less or equal than the max score */ cur_score = MIN (cur_score, max_score) ; ASSERT (cur_score >= 0) ; /* store updated score */ Col [col].shared2.score = cur_score ; /* === Place column back in degree list ========================= */ ASSERT (min_score >= 0) ; ASSERT (min_score <= n_col) ; ASSERT (cur_score >= 0) ; ASSERT (cur_score <= n_col) ; ASSERT (head [cur_score] >= EMPTY) ; next_col = head [cur_score] ; Col [col].shared4.degree_next = next_col ; Col [col].shared3.prev = EMPTY ; if (next_col != EMPTY) { Col [next_col].shared3.prev = col ; } head [cur_score] = col ; /* see if this score is less than current min */ min_score = MIN (min_score, cur_score) ; } #ifndef NDEBUG debug_deg_lists (n_row, n_col, Row, Col, head, min_score, n_col2-k, max_deg) ; #endif /* NDEBUG */ /* === Resurrect the new pivot row ================================== */ if (pivot_row_degree > 0) { /* update pivot row length to reflect any cols that were killed */ /* during super-col detection and mass elimination */ Row [pivot_row].start = pivot_row_start ; Row [pivot_row].length = (Int) (new_rp - &A[pivot_row_start]) ; ASSERT (Row [pivot_row].length > 0) ; Row [pivot_row].shared1.degree = pivot_row_degree ; Row [pivot_row].shared2.mark = 0 ; /* pivot row is no longer dead */ DEBUG1 (("Resurrect Pivot_row %d deg: %d\n", pivot_row, pivot_row_degree)) ; } } /* === All principal columns have now been ordered ====================== */ return (ngarbage) ; } /* ========================================================================== */ /* === order_children ======================================================= */ /* ========================================================================== */ /* The find_ordering routine has ordered all of the principal columns (the representatives of the supercolumns). The non-principal columns have not yet been ordered. This routine orders those columns by walking up the parent tree (a column is a child of the column which absorbed it). The final permutation vector is then placed in p [0 ... n_col-1], with p [0] being the first column, and p [n_col-1] being the last. It doesn't look like it at first glance, but be assured that this routine takes time linear in the number of columns. Although not immediately obvious, the time taken by this routine is O (n_col), that is, linear in the number of columns. Not user-callable. */ PRIVATE void order_children ( /* === Parameters ======================================================= */ Int n_col, /* number of columns of A */ Colamd_Col Col [], /* of size n_col+1 */ Int p [] /* p [0 ... n_col-1] is the column permutation*/ ) { /* === Local variables ================================================== */ Int i ; /* loop counter for all columns */ Int c ; /* column index */ Int parent ; /* index of column's parent */ Int order ; /* column's order */ /* === Order each non-principal column ================================== */ for (i = 0 ; i < n_col ; i++) { /* find an un-ordered non-principal column */ ASSERT (COL_IS_DEAD (i)) ; if (!COL_IS_DEAD_PRINCIPAL (i) && Col [i].shared2.order == EMPTY) { parent = i ; /* once found, find its principal parent */ do { parent = Col [parent].shared1.parent ; } while (!COL_IS_DEAD_PRINCIPAL (parent)) ; /* now, order all un-ordered non-principal columns along path */ /* to this parent. collapse tree at the same time */ c = i ; /* get order of parent */ order = Col [parent].shared2.order ; do { ASSERT (Col [c].shared2.order == EMPTY) ; /* order this column */ Col [c].shared2.order = order++ ; /* collaps tree */ Col [c].shared1.parent = parent ; /* get immediate parent of this column */ c = Col [c].shared1.parent ; /* continue until we hit an ordered column. There are */ /* guarranteed not to be anymore unordered columns */ /* above an ordered column */ } while (Col [c].shared2.order == EMPTY) ; /* re-order the super_col parent to largest order for this group */ Col [parent].shared2.order = order ; } } /* === Generate the permutation ========================================= */ for (c = 0 ; c < n_col ; c++) { p [Col [c].shared2.order] = c ; } } /* ========================================================================== */ /* === detect_super_cols ==================================================== */ /* ========================================================================== */ /* Detects supercolumns by finding matches between columns in the hash buckets. Check amongst columns in the set A [row_start ... row_start + row_length-1]. The columns under consideration are currently *not* in the degree lists, and have already been placed in the hash buckets. The hash bucket for columns whose hash function is equal to h is stored as follows: if head [h] is >= 0, then head [h] contains a degree list, so: head [h] is the first column in degree bucket h. Col [head [h]].headhash gives the first column in hash bucket h. otherwise, the degree list is empty, and: -(head [h] + 2) is the first column in hash bucket h. For a column c in a hash bucket, Col [c].shared3.prev is NOT a "previous column" pointer. Col [c].shared3.hash is used instead as the hash number for that column. The value of Col [c].shared4.hash_next is the next column in the same hash bucket. Assuming no, or "few" hash collisions, the time taken by this routine is linear in the sum of the sizes (lengths) of each column whose score has just been computed in the approximate degree computation. Not user-callable. */ PRIVATE void detect_super_cols ( /* === Parameters ======================================================= */ #ifndef NDEBUG /* these two parameters are only needed when debugging is enabled: */ Int n_col, /* number of columns of A */ Colamd_Row Row [], /* of size n_row+1 */ #endif /* NDEBUG */ Colamd_Col Col [], /* of size n_col+1 */ Int A [], /* row indices of A */ Int head [], /* head of degree lists and hash buckets */ Int row_start, /* pointer to set of columns to check */ Int row_length /* number of columns to check */ ) { /* === Local variables ================================================== */ Int hash ; /* hash value for a column */ Int *rp ; /* pointer to a row */ Int c ; /* a column index */ Int super_c ; /* column index of the column to absorb into */ Int *cp1 ; /* column pointer for column super_c */ Int *cp2 ; /* column pointer for column c */ Int length ; /* length of column super_c */ Int prev_c ; /* column preceding c in hash bucket */ Int i ; /* loop counter */ Int *rp_end ; /* pointer to the end of the row */ Int col ; /* a column index in the row to check */ Int head_column ; /* first column in hash bucket or degree list */ Int first_col ; /* first column in hash bucket */ /* === Consider each column in the row ================================== */ rp = &A [row_start] ; rp_end = rp + row_length ; while (rp < rp_end) { col = *rp++ ; if (COL_IS_DEAD (col)) { continue ; } /* get hash number for this column */ hash = Col [col].shared3.hash ; ASSERT (hash <= n_col) ; /* === Get the first column in this hash bucket ===================== */ head_column = head [hash] ; if (head_column > EMPTY) { first_col = Col [head_column].shared3.headhash ; } else { first_col = - (head_column + 2) ; } /* === Consider each column in the hash bucket ====================== */ for (super_c = first_col ; super_c != EMPTY ; super_c = Col [super_c].shared4.hash_next) { ASSERT (COL_IS_ALIVE (super_c)) ; ASSERT (Col [super_c].shared3.hash == hash) ; length = Col [super_c].length ; /* prev_c is the column preceding column c in the hash bucket */ prev_c = super_c ; /* === Compare super_c with all columns after it ================ */ for (c = Col [super_c].shared4.hash_next ; c != EMPTY ; c = Col [c].shared4.hash_next) { ASSERT (c != super_c) ; ASSERT (COL_IS_ALIVE (c)) ; ASSERT (Col [c].shared3.hash == hash) ; /* not identical if lengths or scores are different */ if (Col [c].length != length || Col [c].shared2.score != Col [super_c].shared2.score) { prev_c = c ; continue ; } /* compare the two columns */ cp1 = &A [Col [super_c].start] ; cp2 = &A [Col [c].start] ; for (i = 0 ; i < length ; i++) { /* the columns are "clean" (no dead rows) */ ASSERT (ROW_IS_ALIVE (*cp1)) ; ASSERT (ROW_IS_ALIVE (*cp2)) ; /* row indices will same order for both supercols, */ /* no gather scatter nessasary */ if (*cp1++ != *cp2++) { break ; } } /* the two columns are different if the for-loop "broke" */ if (i != length) { prev_c = c ; continue ; } /* === Got it! two columns are identical =================== */ ASSERT (Col [c].shared2.score == Col [super_c].shared2.score) ; Col [super_c].shared1.thickness += Col [c].shared1.thickness ; Col [c].shared1.parent = super_c ; KILL_NON_PRINCIPAL_COL (c) ; /* order c later, in order_children() */ Col [c].shared2.order = EMPTY ; /* remove c from hash bucket */ Col [prev_c].shared4.hash_next = Col [c].shared4.hash_next ; } } /* === Empty this hash bucket ======================================= */ if (head_column > EMPTY) { /* corresponding degree list "hash" is not empty */ Col [head_column].shared3.headhash = EMPTY ; } else { /* corresponding degree list "hash" is empty */ head [hash] = EMPTY ; } } } /* ========================================================================== */ /* === garbage_collection =================================================== */ /* ========================================================================== */ /* Defragments and compacts columns and rows in the workspace A. Used when all avaliable memory has been used while performing row merging. Returns the index of the first free position in A, after garbage collection. The time taken by this routine is linear is the size of the array A, which is itself linear in the number of nonzeros in the input matrix. Not user-callable. */ PRIVATE Int garbage_collection /* returns the new value of pfree */ ( /* === Parameters ======================================================= */ Int n_row, /* number of rows */ Int n_col, /* number of columns */ Colamd_Row Row [], /* row info */ Colamd_Col Col [], /* column info */ Int A [], /* A [0 ... Alen-1] holds the matrix */ Int *pfree /* &A [0] ... pfree is in use */ ) { /* === Local variables ================================================== */ Int *psrc ; /* source pointer */ Int *pdest ; /* destination pointer */ Int j ; /* counter */ Int r ; /* a row index */ Int c ; /* a column index */ Int length ; /* length of a row or column */ #ifndef NDEBUG Int debug_rows ; DEBUG2 (("Defrag..\n")) ; for (psrc = &A[0] ; psrc < pfree ; psrc++) ASSERT (*psrc >= 0) ; debug_rows = 0 ; #endif /* NDEBUG */ /* === Defragment the columns =========================================== */ pdest = &A[0] ; for (c = 0 ; c < n_col ; c++) { if (COL_IS_ALIVE (c)) { psrc = &A [Col [c].start] ; /* move and compact the column */ ASSERT (pdest <= psrc) ; Col [c].start = (Int) (pdest - &A [0]) ; length = Col [c].length ; for (j = 0 ; j < length ; j++) { r = *psrc++ ; if (ROW_IS_ALIVE (r)) { *pdest++ = r ; } } Col [c].length = (Int) (pdest - &A [Col [c].start]) ; } } /* === Prepare to defragment the rows =================================== */ for (r = 0 ; r < n_row ; r++) { if (ROW_IS_DEAD (r) || (Row [r].length == 0)) { /* This row is already dead, or is of zero length. Cannot compact * a row of zero length, so kill it. NOTE: in the current version, * there are no zero-length live rows. Kill the row (for the first * time, or again) just to be safe. */ KILL_ROW (r) ; } else { /* save first column index in Row [r].shared2.first_column */ psrc = &A [Row [r].start] ; Row [r].shared2.first_column = *psrc ; ASSERT (ROW_IS_ALIVE (r)) ; /* flag the start of the row with the one's complement of row */ *psrc = ONES_COMPLEMENT (r) ; #ifndef NDEBUG debug_rows++ ; #endif /* NDEBUG */ } } /* === Defragment the rows ============================================== */ psrc = pdest ; while (psrc < pfree) { /* find a negative number ... the start of a row */ if (*psrc++ < 0) { psrc-- ; /* get the row index */ r = ONES_COMPLEMENT (*psrc) ; ASSERT (r >= 0 && r < n_row) ; /* restore first column index */ *psrc = Row [r].shared2.first_column ; ASSERT (ROW_IS_ALIVE (r)) ; ASSERT (Row [r].length > 0) ; /* move and compact the row */ ASSERT (pdest <= psrc) ; Row [r].start = (Int) (pdest - &A [0]) ; length = Row [r].length ; for (j = 0 ; j < length ; j++) { c = *psrc++ ; if (COL_IS_ALIVE (c)) { *pdest++ = c ; } } Row [r].length = (Int) (pdest - &A [Row [r].start]) ; ASSERT (Row [r].length > 0) ; #ifndef NDEBUG debug_rows-- ; #endif /* NDEBUG */ } } /* ensure we found all the rows */ ASSERT (debug_rows == 0) ; /* === Return the new value of pfree ==================================== */ return ((Int) (pdest - &A [0])) ; } /* ========================================================================== */ /* === clear_mark =========================================================== */ /* ========================================================================== */ /* Clears the Row [].shared2.mark array, and returns the new tag_mark. Return value is the new tag_mark. Not user-callable. */ PRIVATE Int clear_mark /* return the new value for tag_mark */ ( /* === Parameters ======================================================= */ Int tag_mark, /* new value of tag_mark */ Int max_mark, /* max allowed value of tag_mark */ Int n_row, /* number of rows in A */ Colamd_Row Row [] /* Row [0 ... n_row-1].shared2.mark is set to zero */ ) { /* === Local variables ================================================== */ Int r ; if (tag_mark <= 0 || tag_mark >= max_mark) { for (r = 0 ; r < n_row ; r++) { if (ROW_IS_ALIVE (r)) { Row [r].shared2.mark = 0 ; } } tag_mark = 1 ; } return (tag_mark) ; } /* ========================================================================== */ /* === print_report ========================================================= */ /* ========================================================================== */ PRIVATE void print_report ( char *method, Int stats [COLAMD_STATS] ) { Int i1, i2, i3 ; SUITESPARSE_PRINTF (("\n%s version %d.%d, %s: ", method, COLAMD_MAIN_VERSION, COLAMD_SUB_VERSION, COLAMD_DATE)) ; if (!stats) { SUITESPARSE_PRINTF (("No statistics available.\n")) ; return ; } i1 = stats [COLAMD_INFO1] ; i2 = stats [COLAMD_INFO2] ; i3 = stats [COLAMD_INFO3] ; if (stats [COLAMD_STATUS] >= 0) { SUITESPARSE_PRINTF (("OK. ")) ; } else { SUITESPARSE_PRINTF (("ERROR. ")) ; } switch (stats [COLAMD_STATUS]) { case COLAMD_OK_BUT_JUMBLED: SUITESPARSE_PRINTF(( "Matrix has unsorted or duplicate row indices.\n")) ; SUITESPARSE_PRINTF(( "%s: number of duplicate or out-of-order row indices: %d\n", method, i3)) ; SUITESPARSE_PRINTF(( "%s: last seen duplicate or out-of-order row index: %d\n", method, INDEX (i2))) ; SUITESPARSE_PRINTF(( "%s: last seen in column: %d", method, INDEX (i1))) ; /* no break - fall through to next case instead */ case COLAMD_OK: SUITESPARSE_PRINTF(("\n")) ; SUITESPARSE_PRINTF(( "%s: number of dense or empty rows ignored: %d\n", method, stats [COLAMD_DENSE_ROW])) ; SUITESPARSE_PRINTF(( "%s: number of dense or empty columns ignored: %d\n", method, stats [COLAMD_DENSE_COL])) ; SUITESPARSE_PRINTF(( "%s: number of garbage collections performed: %d\n", method, stats [COLAMD_DEFRAG_COUNT])) ; break ; case COLAMD_ERROR_A_not_present: SUITESPARSE_PRINTF(( "Array A (row indices of matrix) not present.\n")) ; break ; case COLAMD_ERROR_p_not_present: SUITESPARSE_PRINTF(( "Array p (column pointers for matrix) not present.\n")) ; break ; case COLAMD_ERROR_nrow_negative: SUITESPARSE_PRINTF(("Invalid number of rows (%d).\n", i1)) ; break ; case COLAMD_ERROR_ncol_negative: SUITESPARSE_PRINTF(("Invalid number of columns (%d).\n", i1)) ; break ; case COLAMD_ERROR_nnz_negative: SUITESPARSE_PRINTF(( "Invalid number of nonzero entries (%d).\n", i1)) ; break ; case COLAMD_ERROR_p0_nonzero: SUITESPARSE_PRINTF(( "Invalid column pointer, p [0] = %d, must be zero.\n", i1)); break ; case COLAMD_ERROR_A_too_small: SUITESPARSE_PRINTF(("Array A too small.\n")) ; SUITESPARSE_PRINTF(( " Need Alen >= %d, but given only Alen = %d.\n", i1, i2)) ; break ; case COLAMD_ERROR_col_length_negative: SUITESPARSE_PRINTF (("Column %d has a negative number of nonzero entries (%d).\n", INDEX (i1), i2)) ; break ; case COLAMD_ERROR_row_index_out_of_bounds: SUITESPARSE_PRINTF (("Row index (row %d) out of bounds (%d to %d) in column %d.\n", INDEX (i2), INDEX (0), INDEX (i3-1), INDEX (i1))) ; break ; case COLAMD_ERROR_out_of_memory: SUITESPARSE_PRINTF(("Out of memory.\n")) ; break ; /* v2.4: internal-error case deleted */ } } /* ========================================================================== */ /* === colamd debugging routines ============================================ */ /* ========================================================================== */ /* When debugging is disabled, the remainder of this file is ignored. */ #ifndef NDEBUG /* ========================================================================== */ /* === debug_structures ===================================================== */ /* ========================================================================== */ /* At this point, all empty rows and columns are dead. All live columns are "clean" (containing no dead rows) and simplicial (no supercolumns yet). Rows may contain dead columns, but all live rows contain at least one live column. */ PRIVATE void debug_structures ( /* === Parameters ======================================================= */ Int n_row, Int n_col, Colamd_Row Row [], Colamd_Col Col [], Int A [], Int n_col2 ) { /* === Local variables ================================================== */ Int i ; Int c ; Int *cp ; Int *cp_end ; Int len ; Int score ; Int r ; Int *rp ; Int *rp_end ; Int deg ; /* === Check A, Row, and Col ============================================ */ for (c = 0 ; c < n_col ; c++) { if (COL_IS_ALIVE (c)) { len = Col [c].length ; score = Col [c].shared2.score ; DEBUG4 (("initial live col %5d %5d %5d\n", c, len, score)) ; ASSERT (len > 0) ; ASSERT (score >= 0) ; ASSERT (Col [c].shared1.thickness == 1) ; cp = &A [Col [c].start] ; cp_end = cp + len ; while (cp < cp_end) { r = *cp++ ; ASSERT (ROW_IS_ALIVE (r)) ; } } else { i = Col [c].shared2.order ; ASSERT (i >= n_col2 && i < n_col) ; } } for (r = 0 ; r < n_row ; r++) { if (ROW_IS_ALIVE (r)) { i = 0 ; len = Row [r].length ; deg = Row [r].shared1.degree ; ASSERT (len > 0) ; ASSERT (deg > 0) ; rp = &A [Row [r].start] ; rp_end = rp + len ; while (rp < rp_end) { c = *rp++ ; if (COL_IS_ALIVE (c)) { i++ ; } } ASSERT (i > 0) ; } } } /* ========================================================================== */ /* === debug_deg_lists ====================================================== */ /* ========================================================================== */ /* Prints the contents of the degree lists. Counts the number of columns in the degree list and compares it to the total it should have. Also checks the row degrees. */ PRIVATE void debug_deg_lists ( /* === Parameters ======================================================= */ Int n_row, Int n_col, Colamd_Row Row [], Colamd_Col Col [], Int head [], Int min_score, Int should, Int max_deg ) { /* === Local variables ================================================== */ Int deg ; Int col ; Int have ; Int row ; /* === Check the degree lists =========================================== */ if (n_col > 10000 && colamd_debug <= 0) { return ; } have = 0 ; DEBUG4 (("Degree lists: %d\n", min_score)) ; for (deg = 0 ; deg <= n_col ; deg++) { col = head [deg] ; if (col == EMPTY) { continue ; } DEBUG4 (("%d:", deg)) ; while (col != EMPTY) { DEBUG4 ((" %d", col)) ; have += Col [col].shared1.thickness ; ASSERT (COL_IS_ALIVE (col)) ; col = Col [col].shared4.degree_next ; } DEBUG4 (("\n")) ; } DEBUG4 (("should %d have %d\n", should, have)) ; ASSERT (should == have) ; /* === Check the row degrees ============================================ */ if (n_row > 10000 && colamd_debug <= 0) { return ; } for (row = 0 ; row < n_row ; row++) { if (ROW_IS_ALIVE (row)) { ASSERT (Row [row].shared1.degree <= max_deg) ; } } } /* ========================================================================== */ /* === debug_mark =========================================================== */ /* ========================================================================== */ /* Ensures that the tag_mark is less that the maximum and also ensures that each entry in the mark array is less than the tag mark. */ PRIVATE void debug_mark ( /* === Parameters ======================================================= */ Int n_row, Colamd_Row Row [], Int tag_mark, Int max_mark ) { /* === Local variables ================================================== */ Int r ; /* === Check the Row marks ============================================== */ ASSERT (tag_mark > 0 && tag_mark <= max_mark) ; if (n_row > 10000 && colamd_debug <= 0) { return ; } for (r = 0 ; r < n_row ; r++) { ASSERT (Row [r].shared2.mark < tag_mark) ; } } /* ========================================================================== */ /* === debug_matrix ========================================================= */ /* ========================================================================== */ /* Prints out the contents of the columns and the rows. */ PRIVATE void debug_matrix ( /* === Parameters ======================================================= */ Int n_row, Int n_col, Colamd_Row Row [], Colamd_Col Col [], Int A [] ) { /* === Local variables ================================================== */ Int r ; Int c ; Int *rp ; Int *rp_end ; Int *cp ; Int *cp_end ; /* === Dump the rows and columns of the matrix ========================== */ if (colamd_debug < 3) { return ; } DEBUG3 (("DUMP MATRIX:\n")) ; for (r = 0 ; r < n_row ; r++) { DEBUG3 (("Row %d alive? %d\n", r, ROW_IS_ALIVE (r))) ; if (ROW_IS_DEAD (r)) { continue ; } DEBUG3 (("start %d length %d degree %d\n", Row [r].start, Row [r].length, Row [r].shared1.degree)) ; rp = &A [Row [r].start] ; rp_end = rp + Row [r].length ; while (rp < rp_end) { c = *rp++ ; DEBUG4 ((" %d col %d\n", COL_IS_ALIVE (c), c)) ; } } for (c = 0 ; c < n_col ; c++) { DEBUG3 (("Col %d alive? %d\n", c, COL_IS_ALIVE (c))) ; if (COL_IS_DEAD (c)) { continue ; } DEBUG3 (("start %d length %d shared1 %d shared2 %d\n", Col [c].start, Col [c].length, Col [c].shared1.thickness, Col [c].shared2.score)) ; cp = &A [Col [c].start] ; cp_end = cp + Col [c].length ; while (cp < cp_end) { r = *cp++ ; DEBUG4 ((" %d row %d\n", ROW_IS_ALIVE (r), r)) ; } } } PRIVATE void colamd_get_debug ( char *method ) { FILE *f ; colamd_debug = 0 ; /* no debug printing */ f = fopen ("debug", "r") ; if (f == (FILE *) NULL) { colamd_debug = 0 ; } else { fscanf (f, "%d", &colamd_debug) ; fclose (f) ; } DEBUG0 (("%s: debug version, D = %d (THIS WILL BE SLOW!)\n", method, colamd_debug)) ; } #endif /* NDEBUG */ JAGS-4.3.2/src/modules/glm/SSparse/COLAMD/Source/colamd_global.c0000664000175000017500000000155714224052371020717 00000000000000/* ========================================================================== */ /* === colamd_global.c ====================================================== */ /* ========================================================================== */ /* ---------------------------------------------------------------------------- * COLAMD, Copyright (C) 2007, Timothy A. Davis. * See License.txt for the Version 2.1 of the GNU Lesser General Public License * http://www.cise.ufl.edu/research/sparse * -------------------------------------------------------------------------- */ /* Global variables for COLAMD */ #ifndef NPRINT #ifdef MATLAB_MEX_FILE #include "mex.h" int (*colamd_printf) (const char *, ...) = mexPrintf ; #else #include int (*colamd_printf) (const char *, ...) = printf ; #endif #else int (*colamd_printf) (const char *, ...) = ((void *) 0) ; #endif JAGS-4.3.2/src/modules/glm/SSparse/COLAMD/Makefile.am0000664000175000017500000000052314224052371016560 00000000000000noinst_LTLIBRARIES = colamd.la colamd_la_SOURCES = \ Source/colamd.c \ Source/colamd_global.c colamd_la_CPPFLAGS = -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/COLAMD/Include colamd_la_LDFLAGS = -no-undefined -module -avoid-version noinst_HEADERS = Include/colamd.h DIST_EXTRA = README.txt JAGS-4.3.2/src/modules/glm/SSparse/COLAMD/Makefile.in0000644000175000017500000005460614400675236016611 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/COLAMD ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) colamd_la_LIBADD = am__dirstamp = $(am__leading_dot)dirstamp am_colamd_la_OBJECTS = Source/colamd_la-colamd.lo \ Source/colamd_la-colamd_global.lo colamd_la_OBJECTS = $(am_colamd_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = colamd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(colamd_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = Source/$(DEPDIR)/colamd_la-colamd.Plo \ Source/$(DEPDIR)/colamd_la-colamd_global.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(colamd_la_SOURCES) DIST_SOURCES = $(colamd_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = colamd.la colamd_la_SOURCES = \ Source/colamd.c \ Source/colamd_global.c colamd_la_CPPFLAGS = -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/COLAMD/Include colamd_la_LDFLAGS = -no-undefined -module -avoid-version noinst_HEADERS = Include/colamd.h DIST_EXTRA = README.txt all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/COLAMD/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/COLAMD/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } Source/$(am__dirstamp): @$(MKDIR_P) Source @: > Source/$(am__dirstamp) Source/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) Source/$(DEPDIR) @: > Source/$(DEPDIR)/$(am__dirstamp) Source/colamd_la-colamd.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) Source/colamd_la-colamd_global.lo: Source/$(am__dirstamp) \ Source/$(DEPDIR)/$(am__dirstamp) colamd.la: $(colamd_la_OBJECTS) $(colamd_la_DEPENDENCIES) $(EXTRA_colamd_la_DEPENDENCIES) $(AM_V_CCLD)$(colamd_la_LINK) $(colamd_la_OBJECTS) $(colamd_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f Source/*.$(OBJEXT) -rm -f Source/*.lo distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/colamd_la-colamd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@Source/$(DEPDIR)/colamd_la-colamd_global.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< Source/colamd_la-colamd.lo: Source/colamd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(colamd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/colamd_la-colamd.lo -MD -MP -MF Source/$(DEPDIR)/colamd_la-colamd.Tpo -c -o Source/colamd_la-colamd.lo `test -f 'Source/colamd.c' || echo '$(srcdir)/'`Source/colamd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/colamd_la-colamd.Tpo Source/$(DEPDIR)/colamd_la-colamd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/colamd.c' object='Source/colamd_la-colamd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(colamd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/colamd_la-colamd.lo `test -f 'Source/colamd.c' || echo '$(srcdir)/'`Source/colamd.c Source/colamd_la-colamd_global.lo: Source/colamd_global.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(colamd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT Source/colamd_la-colamd_global.lo -MD -MP -MF Source/$(DEPDIR)/colamd_la-colamd_global.Tpo -c -o Source/colamd_la-colamd_global.lo `test -f 'Source/colamd_global.c' || echo '$(srcdir)/'`Source/colamd_global.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) Source/$(DEPDIR)/colamd_la-colamd_global.Tpo Source/$(DEPDIR)/colamd_la-colamd_global.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Source/colamd_global.c' object='Source/colamd_la-colamd_global.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(colamd_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o Source/colamd_la-colamd_global.lo `test -f 'Source/colamd_global.c' || echo '$(srcdir)/'`Source/colamd_global.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf Source/.libs Source/_libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f Source/$(DEPDIR)/$(am__dirstamp) -rm -f Source/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f Source/$(DEPDIR)/colamd_la-colamd.Plo -rm -f Source/$(DEPDIR)/colamd_la-colamd_global.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Source/$(DEPDIR)/colamd_la-colamd.Plo -rm -f Source/$(DEPDIR)/colamd_la-colamd_global.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/0000755000175000017500000000000014400711327014727 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Makefile.am0000664000175000017500000000061614224052371016711 00000000000000SUBDIRS = Check Cholesky Core Include MatrixOps Modify Supernodal noinst_LTLIBRARIES = cholmod.la cholmod_la_SOURCES = cholmod_la_LIBADD = Cholesky/cholmodcholesky.la \ Core/cholmodcore.la \ MatrixOps/cholmodmatrix.la \ Modify/cholmodmodify.la \ Supernodal/cholmodsupernodal.la \ Check/cholmodcheck.la cholmod_la_LDFLAGS = -no-undefined -module -avoid-version DIST_EXTRA = README.txt JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Makefile.in0000644000175000017500000005325314400675236016734 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/CHOLMOD ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) cholmod_la_DEPENDENCIES = Cholesky/cholmodcholesky.la \ Core/cholmodcore.la MatrixOps/cholmodmatrix.la \ Modify/cholmodmodify.la Supernodal/cholmodsupernodal.la \ Check/cholmodcheck.la am_cholmod_la_OBJECTS = cholmod_la_OBJECTS = $(am_cholmod_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = cholmod_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(cholmod_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(cholmod_la_SOURCES) DIST_SOURCES = $(cholmod_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = Check Cholesky Core Include MatrixOps Modify Supernodal noinst_LTLIBRARIES = cholmod.la cholmod_la_SOURCES = cholmod_la_LIBADD = Cholesky/cholmodcholesky.la \ Core/cholmodcore.la \ MatrixOps/cholmodmatrix.la \ Modify/cholmodmodify.la \ Supernodal/cholmodsupernodal.la \ Check/cholmodcheck.la cholmod_la_LDFLAGS = -no-undefined -module -avoid-version DIST_EXTRA = README.txt all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } cholmod.la: $(cholmod_la_OBJECTS) $(cholmod_la_DEPENDENCIES) $(EXTRA_cholmod_la_DEPENDENCIES) $(AM_V_CCLD)$(cholmod_la_LINK) $(cholmod_la_OBJECTS) $(cholmod_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Check/0000755000175000017500000000000014400711326015743 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Check/Makefile.am0000664000175000017500000000055314224052371017726 00000000000000noinst_LTLIBRARIES = cholmodcheck.la cholmodcheck_la_SOURCES = cholmod_check.c cholmod_read.c cholmod_write.c cholmodcheck_la_CPPFLAGS = -DNPARTITION \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include cholmodcheck_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt lesser.txt JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Check/Makefile.in0000644000175000017500000005662714400675236017761 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/CHOLMOD/Check ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) cholmodcheck_la_LIBADD = am_cholmodcheck_la_OBJECTS = cholmodcheck_la-cholmod_check.lo \ cholmodcheck_la-cholmod_read.lo \ cholmodcheck_la-cholmod_write.lo cholmodcheck_la_OBJECTS = $(am_cholmodcheck_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = cholmodcheck_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(cholmodcheck_la_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/cholmodcheck_la-cholmod_check.Plo \ ./$(DEPDIR)/cholmodcheck_la-cholmod_read.Plo \ ./$(DEPDIR)/cholmodcheck_la-cholmod_write.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(cholmodcheck_la_SOURCES) DIST_SOURCES = $(cholmodcheck_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = cholmodcheck.la cholmodcheck_la_SOURCES = cholmod_check.c cholmod_read.c cholmod_write.c cholmodcheck_la_CPPFLAGS = -DNPARTITION \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include cholmodcheck_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt lesser.txt all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Check/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Check/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } cholmodcheck.la: $(cholmodcheck_la_OBJECTS) $(cholmodcheck_la_DEPENDENCIES) $(EXTRA_cholmodcheck_la_DEPENDENCIES) $(AM_V_CCLD)$(cholmodcheck_la_LINK) $(cholmodcheck_la_OBJECTS) $(cholmodcheck_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcheck_la-cholmod_check.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcheck_la-cholmod_read.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcheck_la-cholmod_write.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< cholmodcheck_la-cholmod_check.lo: cholmod_check.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcheck_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcheck_la-cholmod_check.lo -MD -MP -MF $(DEPDIR)/cholmodcheck_la-cholmod_check.Tpo -c -o cholmodcheck_la-cholmod_check.lo `test -f 'cholmod_check.c' || echo '$(srcdir)/'`cholmod_check.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcheck_la-cholmod_check.Tpo $(DEPDIR)/cholmodcheck_la-cholmod_check.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_check.c' object='cholmodcheck_la-cholmod_check.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcheck_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcheck_la-cholmod_check.lo `test -f 'cholmod_check.c' || echo '$(srcdir)/'`cholmod_check.c cholmodcheck_la-cholmod_read.lo: cholmod_read.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcheck_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcheck_la-cholmod_read.lo -MD -MP -MF $(DEPDIR)/cholmodcheck_la-cholmod_read.Tpo -c -o cholmodcheck_la-cholmod_read.lo `test -f 'cholmod_read.c' || echo '$(srcdir)/'`cholmod_read.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcheck_la-cholmod_read.Tpo $(DEPDIR)/cholmodcheck_la-cholmod_read.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_read.c' object='cholmodcheck_la-cholmod_read.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcheck_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcheck_la-cholmod_read.lo `test -f 'cholmod_read.c' || echo '$(srcdir)/'`cholmod_read.c cholmodcheck_la-cholmod_write.lo: cholmod_write.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcheck_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcheck_la-cholmod_write.lo -MD -MP -MF $(DEPDIR)/cholmodcheck_la-cholmod_write.Tpo -c -o cholmodcheck_la-cholmod_write.lo `test -f 'cholmod_write.c' || echo '$(srcdir)/'`cholmod_write.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcheck_la-cholmod_write.Tpo $(DEPDIR)/cholmodcheck_la-cholmod_write.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_write.c' object='cholmodcheck_la-cholmod_write.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcheck_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcheck_la-cholmod_write.lo `test -f 'cholmod_write.c' || echo '$(srcdir)/'`cholmod_write.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/cholmodcheck_la-cholmod_check.Plo -rm -f ./$(DEPDIR)/cholmodcheck_la-cholmod_read.Plo -rm -f ./$(DEPDIR)/cholmodcheck_la-cholmod_write.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/cholmodcheck_la-cholmod_check.Plo -rm -f ./$(DEPDIR)/cholmodcheck_la-cholmod_read.Plo -rm -f ./$(DEPDIR)/cholmodcheck_la-cholmod_write.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Check/cholmod_check.c0000664000175000017500000020307014224052371020617 00000000000000/* ========================================================================== */ /* === Check/cholmod_check ================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Check Module. Copyright (C) 2005-2013, Timothy A. Davis * The CHOLMOD/Check Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Routines to check and print the contents of the 5 CHOLMOD objects: * * No CHOLMOD routine calls the check or print routines. If a user wants to * check CHOLMOD's input parameters, a separate call to the appropriate check * routine should be used before calling other CHOLMOD routines. * * cholmod_check_common check statistics and workspace in Common * cholmod_check_sparse check sparse matrix in compressed column form * cholmod_check_dense check dense matrix * cholmod_check_factor check factorization * cholmod_check_triplet check sparse matrix in triplet form * * cholmod_print_common print statistics in Common * cholmod_print_sparse print sparse matrix in compressed column form * cholmod_print_dense print dense matrix * cholmod_print_factor print factorization * cholmod_print_triplet print sparse matrix in triplet form * * In addition, this file contains routines to check and print three types of * integer vectors: * * cholmod_check_perm check a permutation of 0:n-1 (no duplicates) * cholmod_check_subset check a subset of 0:n-1 (duplicates OK) * cholmod_check_parent check an elimination tree * * cholmod_print_perm print a permutation * cholmod_print_subset print a subset * cholmod_print_parent print an elimination tree * * Each Common->print level prints the items at or below the given level: * * 0: print nothing; just check the data structures and return TRUE/FALSE * 1: error messages * 2: warning messages * 3: one-line summary of each object printed * 4: short summary of each object (first and last few entries) * 5: entire contents of the object * * No CHOLMOD routine calls these routines, so no printing occurs unless * the user specifically calls a cholmod_print_* routine. Thus, the default * print level is 3. * * Common->precise controls the # of digits printed for numerical entries * (5 if FALSE, 15 if TRUE). * * If SuiteSparse_config.printf_func is NULL, then no printing occurs. The * cholmod_check_* and cholmod_print_* routines still check their inputs and * return TRUE/FALSE if the object is valid or not. * * This file also includes debugging routines that are enabled only when * NDEBUG is defined in cholmod_internal.h (cholmod_dump_*). */ #ifndef NCHECK #include "cholmod_internal.h" #include "cholmod_check.h" /* ========================================================================== */ /* === printing definitions ================================================= */ /* ========================================================================== */ #ifdef LONG #define I8 "%8ld" #define I_8 "%-8ld" #else #define I8 "%8d" #define I_8 "%-8d" #endif #define PR(i,format,arg) \ { \ if (print >= i && SuiteSparse_config.printf_func != NULL) \ { \ SuiteSparse_config.printf_func (format, arg) ; \ } \ } #define P1(format,arg) PR(1,format,arg) #define P2(format,arg) PR(2,format,arg) #define P3(format,arg) PR(3,format,arg) #define P4(format,arg) PR(4,format,arg) #define ERR(msg) \ { \ P1 ("\nCHOLMOD ERROR: %s: ", type) ; \ if (name != NULL) \ { \ P1 ("%s", name) ; \ } \ P1 (": %s\n", msg) ; \ ERROR (CHOLMOD_INVALID, "invalid") ; \ return (FALSE) ; \ } /* print a numerical value */ #define PRINTVALUE(value) \ { \ if (Common->precise) \ { \ P4 (" %23.15e", value) ; \ } \ else \ { \ P4 (" %.5g", value) ; \ } \ } /* start printing */ #define ETC_START(count,limit) \ { \ count = (init_print == 4) ? (limit) : (-1) ; \ } /* re-enable printing if condition is met */ #define ETC_ENABLE(condition,count,limit) \ { \ if ((condition) && init_print == 4) \ { \ count = limit ; \ print = 4 ; \ } \ } /* turn off printing if limit is reached */ #define ETC_DISABLE(count) \ { \ if ((count >= 0) && (count-- == 0) && print == 4) \ { \ P4 ("%s", " ...\n") ; \ print = 3 ; \ } \ } /* re-enable printing, or turn if off after limit is reached */ #define ETC(condition,count,limit) \ { \ ETC_ENABLE (condition, count, limit) ; \ ETC_DISABLE (count) ; \ } #define BOOLSTR(x) ((x) ? "true " : "false") /* ========================================================================== */ /* === print_value ========================================================== */ /* ========================================================================== */ static void print_value ( Int print, Int xtype, double *Xx, double *Xz, Int p, cholmod_common *Common) { if (xtype == CHOLMOD_REAL) { PRINTVALUE (Xx [p]) ; } else if (xtype == CHOLMOD_COMPLEX) { P4 ("%s", "(") ; PRINTVALUE (Xx [2*p ]) ; P4 ("%s", " , ") ; PRINTVALUE (Xx [2*p+1]) ; P4 ("%s", ")") ; } else if (xtype == CHOLMOD_ZOMPLEX) { P4 ("%s", "(") ; PRINTVALUE (Xx [p]) ; P4 ("%s", " , ") ; PRINTVALUE (Xz [p]) ; P4 ("%s", ")") ; } } /* ========================================================================== */ /* === cholmod_check_common ================================================= */ /* ========================================================================== */ /* Print and verify the contents of Common */ static int check_common ( Int print, const char *name, cholmod_common *Common ) { double fl, lnz ; double *Xwork ; Int *Flag, *Head ; SuiteSparse_long mark ; Int i, nrow, nmethods, ordering, xworksize, amd_backup, init_print ; const char *type = "common" ; /* ---------------------------------------------------------------------- */ /* print control parameters and statistics */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; init_print = print ; P2 ("%s", "\n") ; P1 ("CHOLMOD version %d", CHOLMOD_MAIN_VERSION) ; P1 (".%d", CHOLMOD_SUB_VERSION) ; P1 (".%d", CHOLMOD_SUBSUB_VERSION) ; P1 (", %s: ", CHOLMOD_DATE) ; if (name != NULL) { P1 ("%s: ", name) ; } switch (Common->status) { case CHOLMOD_OK: P1 ("%s", "status: OK\n") ; break ; case CHOLMOD_OUT_OF_MEMORY: P1 ("%s", "status: ERROR, out of memory\n") ; break ; case CHOLMOD_INVALID: P1 ("%s", "status: ERROR, invalid parameter\n") ; break ; case CHOLMOD_TOO_LARGE: P1 ("%s", "status: ERROR, problem too large\n") ; break ; case CHOLMOD_NOT_INSTALLED: P1 ("%s", "status: ERROR, method not installed\n") ; break ; case CHOLMOD_GPU_PROBLEM: P1 ("%s", "status: ERROR, GPU had a fatal error\n") ; break ; case CHOLMOD_NOT_POSDEF: P1 ("%s", "status: warning, matrix not positive definite\n") ; break ; case CHOLMOD_DSMALL: P1 ("%s", "status: warning, diagonal entry has tiny abs. value\n") ; break ; default: ERR ("unknown status") ; } P2 (" Architecture: %s\n", CHOLMOD_ARCHITECTURE) ; P3 (" sizeof(int): %d\n", (int) sizeof (int)) ; P3 (" sizeof(SuiteSparse_long): %d\n", (int) sizeof (SuiteSparse_long)); P3 (" sizeof(void *): %d\n", (int) sizeof (void *)) ; P3 (" sizeof(double): %d\n", (int) sizeof (double)) ; P3 (" sizeof(Int): %d (CHOLMOD's basic integer)\n", (int) sizeof (Int)) ; P3 (" sizeof(BLAS_INT): %d (integer used in the BLAS)\n", (int) sizeof (BLAS_INT)) ; if (Common->fl != EMPTY) { P2 ("%s", " Results from most recent analysis:\n") ; P2 (" Cholesky flop count: %.5g\n", Common->fl) ; P2 (" Nonzeros in L: %.5g\n", Common->lnz) ; } if (Common->modfl != EMPTY) { P2 (" Update/downdate flop count: %.5g\n", Common->modfl) ; } P2 (" memory blocks in use: %8.0f\n", (double) (Common->malloc_count)) ; P2 (" memory in use (MB): %8.1f\n", (double) (Common->memory_inuse) / 1048576.) ; P2 (" peak memory usage (MB): %8.1f\n", (double) (Common->memory_usage) / 1048576.) ; /* ---------------------------------------------------------------------- */ /* primary control parameters and related ordering statistics */ /* ---------------------------------------------------------------------- */ P3 (" maxrank: update/downdate rank: "ID"\n", (Int) CHOLMOD(maxrank) (0, Common)) ; P3 (" supernodal control: %d", Common->supernodal) ; P3 (" %g ", Common->supernodal_switch) ; if (Common->supernodal <= CHOLMOD_SIMPLICIAL) { P3 ("%s", "(always do simplicial)\n") ; } else if (Common->supernodal == CHOLMOD_AUTO) { P3 ("(supernodal if flops/lnz >= %g)\n", Common->supernodal_switch) ; } else { P3 ("%s", "(always do supernodal)\n") ; } nmethods = MIN (Common->nmethods, CHOLMOD_MAXMETHODS) ; nmethods = MAX (0, nmethods) ; if (nmethods > 0) { P3 ("%s", " nmethods: number of ordering methods to try: ") ; P3 (""ID"\n", nmethods) ; amd_backup = (nmethods > 1) || (nmethods == 1 && (Common->method [0].ordering == CHOLMOD_METIS || Common->method [0].ordering == CHOLMOD_NESDIS)) ; } else { P3 ("%s", " nmethods=0: default strategy: Try user permutation if " "given. Try AMD.\n") ; #ifndef NPARTITION if (Common->default_nesdis) { P3 ("%s", " Try NESDIS if AMD reports flops/nnz(L) >= 500 and " "nnz(L)/nnz(A) >= 5.\n") ; } else { P3 ("%s", " Try METIS if AMD reports flops/nnz(L) >= 500 and " "nnz(L)/nnz(A) >= 5.\n") ; } #endif P3 ("%s", " Select best ordering tried.\n") ; Common->method [0].ordering = CHOLMOD_GIVEN ; Common->method [1].ordering = CHOLMOD_AMD ; Common->method [2].ordering = (Common->default_nesdis ? CHOLMOD_NESDIS : CHOLMOD_METIS) ; amd_backup = FALSE ; #ifndef NPARTITION nmethods = 3 ; #else nmethods = 2 ; #endif } for (i = 0 ; i < nmethods ; i++) { P3 (" method "ID": ", i) ; ordering = Common->method [i].ordering ; fl = Common->method [i].fl ; lnz = Common->method [i].lnz ; switch (ordering) { case CHOLMOD_NATURAL: P3 ("%s", "natural\n") ; break ; case CHOLMOD_GIVEN: P3 ("%s", "user permutation (if given)\n") ; break ; case CHOLMOD_AMD: P3 ("%s", "AMD (or COLAMD if factorizing AA')\n") ; amd_backup = FALSE ; break ; case CHOLMOD_COLAMD: P3 ("%s", "AMD if factorizing A, COLAMD if factorizing AA')\n"); amd_backup = FALSE ; break ; case CHOLMOD_METIS: P3 ("%s", "METIS_NodeND nested dissection\n") ; break ; case CHOLMOD_NESDIS: P3 ("%s", "CHOLMOD nested dissection\n") ; P3 (" nd_small: # nodes in uncut subgraph: "ID"\n", (Int) (Common->method [i].nd_small)) ; P3 (" nd_compress: compress the graph: %s\n", BOOLSTR (Common->method [i].nd_compress)) ; P3 (" nd_camd: use constrained min degree: %s\n", BOOLSTR (Common->method [i].nd_camd)) ; break ; default: P3 (ID, ordering) ; ERR ("unknown ordering method") ; break ; } if (!(ordering == CHOLMOD_NATURAL || ordering == CHOLMOD_GIVEN)) { if (Common->method [i].prune_dense < 0) { P3 (" prune_dense: for pruning dense nodes: %s\n", " none pruned") ; } else { P3 (" prune_dense: for pruning dense nodes: " "%.5g\n", Common->method [i].prune_dense) ; P3 (" a dense node has degree " ">= max(16,(%.5g)*sqrt(n))\n", Common->method [i].prune_dense) ; } } if (ordering == CHOLMOD_COLAMD || ordering == CHOLMOD_NESDIS) { if (Common->method [i].prune_dense2 < 0) { P3 (" prune_dense2: for pruning dense rows for AA':" " %s\n", " none pruned") ; } else { P3 (" prune_dense2: for pruning dense rows for AA':" " %.5g\n", Common->method [i].prune_dense2) ; P3 (" a dense row has degree " ">= max(16,(%.5g)*sqrt(ncol))\n", Common->method [i].prune_dense2) ; } } if (fl != EMPTY) P3 (" flop count: %.5g\n", fl) ; if (lnz != EMPTY) P3 (" nnz(L): %.5g\n", lnz) ; } /* backup AMD results, if any */ if (amd_backup) { P3 ("%s", " backup method: ") ; P3 ("%s", "AMD (or COLAMD if factorizing AA')\n") ; fl = Common->method [nmethods].fl ; lnz = Common->method [nmethods].lnz ; if (fl != EMPTY) P3 (" AMD flop count: %.5g\n", fl) ; if (lnz != EMPTY) P3 (" AMD nnz(L): %.5g\n", lnz) ; } /* ---------------------------------------------------------------------- */ /* arcane control parameters */ /* ---------------------------------------------------------------------- */ if (Common->final_asis) { P4 ("%s", " final_asis: TRUE, leave as is\n") ; } else { P4 ("%s", " final_asis: FALSE, convert when done\n") ; if (Common->final_super) { P4 ("%s", " final_super: TRUE, leave in supernodal form\n") ; } else { P4 ("%s", " final_super: FALSE, convert to simplicial form\n") ; } if (Common->final_ll) { P4 ("%s", " final_ll: TRUE, convert to LL' form\n") ; } else { P4 ("%s", " final_ll: FALSE, convert to LDL' form\n") ; } if (Common->final_pack) { P4 ("%s", " final_pack: TRUE, pack when done\n") ; } else { P4 ("%s", " final_pack: FALSE, do not pack when done\n") ; } if (Common->final_monotonic) { P4 ("%s", " final_monotonic: TRUE, ensure L is monotonic\n") ; } else { P4 ("%s", " final_monotonic: FALSE, do not ensure L is monotonic\n") ; } P4 (" final_resymbol: remove zeros from amalgamation: %s\n", BOOLSTR (Common->final_resymbol)) ; } P4 (" dbound: LDL' diagonal threshold: % .5g\n Entries with abs. value" " less than dbound are replaced with +/- dbound.\n", Common->dbound) ; P4 (" grow0: memory reallocation: % .5g\n", Common->grow0) ; P4 (" grow1: memory reallocation: % .5g\n", Common->grow1) ; P4 (" grow2: memory reallocation: %g\n", (double) (Common->grow2)) ; P4 ("%s", " nrelax, zrelax: supernodal amalgamation rule:\n") ; P4 ("%s", " s = # columns in two adjacent supernodes\n") ; P4 ("%s", " z = % of zeros in new supernode if they are merged.\n") ; P4 ("%s", " Two supernodes are merged if") ; P4 (" (s <= %g) or (no new zero entries) or\n", (double) (Common->nrelax [0])) ; P4 (" (s <= %g and ", (double) (Common->nrelax [1])) ; P4 ("z < %.5g%%) or", Common->zrelax [0] * 100) ; P4 (" (s <= %g and ", (double) (Common->nrelax [2])) ; P4 ("z < %.5g%%) or", Common->zrelax [1] * 100) ; P4 (" (z < %.5g%%)\n", Common->zrelax [2] * 100) ; /* ---------------------------------------------------------------------- */ /* check workspace */ /* ---------------------------------------------------------------------- */ mark = Common->mark ; nrow = Common->nrow ; Flag = Common->Flag ; Head = Common->Head ; if (nrow > 0) { if (mark < 0 || Flag == NULL || Head == NULL) { ERR ("workspace corrupted (Flag and/or Head missing)") ; } for (i = 0 ; i < nrow ; i++) { if (Flag [i] >= mark) { PRINT0 (("Flag ["ID"]="ID", mark = %ld\n", i, Flag [i], mark)) ; ERR ("workspace corrupted (Flag)") ; } } for (i = 0 ; i <= nrow ; i++) { if (Head [i] != EMPTY) { PRINT0 (("Head ["ID"] = "ID",\n", i, Head [i])) ; ERR ("workspace corrupted (Head)") ; } } } xworksize = Common->xworksize ; Xwork = Common->Xwork ; if (xworksize > 0) { if (Xwork == NULL) { ERR ("workspace corrupted (Xwork missing)") ; } for (i = 0 ; i < xworksize ; i++) { if (Xwork [i] != 0.) { PRINT0 (("Xwork ["ID"] = %g\n", i, Xwork [i])) ; ERR ("workspace corrupted (Xwork)") ; } } } /* workspace and parameters are valid */ P3 ("%s", " OK\n") ; P4 ("%s", "\n") ; return (TRUE) ; } int CHOLMOD(check_common) ( cholmod_common *Common ) { return (check_common (0, NULL, Common)) ; } int CHOLMOD(print_common) ( /* ---- input ---- */ const char *name, /* printed name of Common object */ /* --------------- */ cholmod_common *Common ) { Int print = (Common == NULL) ? 3 : (Common->print) ; return (check_common (print, name, Common)) ; } /* ========================================================================== */ /* === cholmod_gpu_stats ==================================================== */ /* ========================================================================== */ /* Print CPU / GPU statistics. If the timer is not installed, the times are reported as zero, but this function still works. Likewise, the function still works if the GPU BLAS is not installed. */ int CHOLMOD(gpu_stats) ( cholmod_common *Common /* input */ ) { double cpu_time, gpu_time ; int print ; RETURN_IF_NULL_COMMON (FALSE) ; print = Common->print ; P2 ("%s", "\nCHOLMOD GPU/CPU statistics:\n") ; P2 ("SYRK CPU calls %12.0f", (double) Common->CHOLMOD_CPU_SYRK_CALLS) ; P2 (" time %12.4e\n", Common->CHOLMOD_CPU_SYRK_TIME) ; P2 (" GPU calls %12.0f", (double) Common->CHOLMOD_GPU_SYRK_CALLS) ; P2 (" time %12.4e\n", Common->CHOLMOD_GPU_SYRK_TIME) ; P2 ("GEMM CPU calls %12.0f", (double) Common->CHOLMOD_CPU_GEMM_CALLS) ; P2 (" time %12.4e\n", Common->CHOLMOD_CPU_GEMM_TIME) ; P2 (" GPU calls %12.0f", (double) Common->CHOLMOD_GPU_GEMM_CALLS) ; P2 (" time %12.4e\n", Common->CHOLMOD_GPU_GEMM_TIME) ; P2 ("POTRF CPU calls %12.0f", (double) Common->CHOLMOD_CPU_POTRF_CALLS) ; P2 (" time %12.4e\n", Common->CHOLMOD_CPU_POTRF_TIME) ; P2 (" GPU calls %12.0f", (double) Common->CHOLMOD_GPU_POTRF_CALLS) ; P2 (" time %12.4e\n", Common->CHOLMOD_GPU_POTRF_TIME) ; P2 ("TRSM CPU calls %12.0f", (double) Common->CHOLMOD_CPU_TRSM_CALLS) ; P2 (" time %12.4e\n", Common->CHOLMOD_CPU_TRSM_TIME) ; P2 (" GPU calls %12.0f", (double) Common->CHOLMOD_GPU_TRSM_CALLS) ; P2 (" time %12.4e\n", Common->CHOLMOD_GPU_TRSM_TIME) ; cpu_time = Common->CHOLMOD_CPU_SYRK_TIME + Common->CHOLMOD_CPU_TRSM_TIME + Common->CHOLMOD_CPU_GEMM_TIME + Common->CHOLMOD_CPU_POTRF_TIME ; gpu_time = Common->CHOLMOD_GPU_SYRK_TIME + Common->CHOLMOD_GPU_TRSM_TIME + Common->CHOLMOD_GPU_GEMM_TIME + Common->CHOLMOD_GPU_POTRF_TIME ; P2 ("time in the BLAS: CPU %12.4e", cpu_time) ; P2 (" GPU %12.4e", gpu_time) ; P2 (" total: %12.4e\n", cpu_time + gpu_time) ; P2 ("assembly time %12.4e", Common->CHOLMOD_ASSEMBLE_TIME) ; P2 (" %12.4e\n", Common->CHOLMOD_ASSEMBLE_TIME2) ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_check_sparse ================================================= */ /* ========================================================================== */ /* Ensure that a sparse matrix in column-oriented form is valid, and optionally * print it. Returns the number of entries on the diagonal or -1 if error. * * workspace: Iwork (nrow) */ static SuiteSparse_long check_sparse ( Int *Wi, Int print, const char *name, cholmod_sparse *A, SuiteSparse_long *nnzdiag, cholmod_common *Common ) { double *Ax, *Az ; Int *Ap, *Ai, *Anz ; Int nrow, ncol, nzmax, sorted, packed, j, p, pend, i, nz, ilast, space, init_print, dnz, count, xtype ; const char *type = "sparse" ; /* ---------------------------------------------------------------------- */ /* print header information */ /* ---------------------------------------------------------------------- */ P4 ("%s", "\n") ; P3 ("%s", "CHOLMOD sparse: ") ; if (name != NULL) { P3 ("%s: ", name) ; } if (A == NULL) { ERR ("null") ; } nrow = A->nrow ; ncol = A->ncol ; nzmax = A->nzmax ; sorted = A->sorted ; packed = A->packed ; xtype = A->xtype ; Ap = A->p ; Ai = A->i ; Ax = A->x ; Az = A->z ; Anz = A->nz ; nz = CHOLMOD(nnz) (A, Common) ; P3 (" "ID"", nrow) ; P3 ("-by-"ID", ", ncol) ; P3 ("nz "ID",", nz) ; if (A->stype > 0) { P3 ("%s", " upper.") ; } else if (A->stype < 0) { P3 ("%s", " lower.") ; } else { P3 ("%s", " up/lo.") ; } P4 ("\n nzmax "ID", ", nzmax) ; if (nz > nzmax) { ERR ("nzmax too small") ; } if (!sorted) { P4 ("%s", "un") ; } P4 ("%s", "sorted, ") ; if (!packed) { P4 ("%s", "un") ; } P4 ("%s", "packed, ") ; switch (A->itype) { case CHOLMOD_INT: P4 ("%s", "\n scalar types: int, ") ; break ; case CHOLMOD_INTLONG: ERR ("mixed int/long type unsupported") ; case CHOLMOD_LONG: P4 ("%s", "\n scalar types: SuiteSparse_long, "); break ; default: ERR ("unknown itype") ; } switch (A->xtype) { case CHOLMOD_PATTERN: P4 ("%s", "pattern") ; break ; case CHOLMOD_REAL: P4 ("%s", "real") ; break ; case CHOLMOD_COMPLEX: P4 ("%s", "complex") ; break ; case CHOLMOD_ZOMPLEX: P4 ("%s", "zomplex") ; break ; default: ERR ("unknown xtype") ; } switch (A->dtype) { case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ; case CHOLMOD_SINGLE: ERR ("float unsupported") ; default: ERR ("unknown dtype") ; } if (A->itype != ITYPE || A->dtype != DTYPE) { ERR ("integer and real type must match routine") ; } if (A->stype && nrow != ncol) { ERR ("symmetric but not square") ; } /* check for existence of Ap, Ai, Anz, Ax, and Az arrays */ if (Ap == NULL) { ERR ("p array not present") ; } if (Ai == NULL) { ERR ("i array not present") ; } if (!packed && Anz == NULL) { ERR ("nz array not present") ; } if (xtype != CHOLMOD_PATTERN && Ax == NULL) { ERR ("x array not present") ; } if (xtype == CHOLMOD_ZOMPLEX && Az == NULL) { ERR ("z array not present") ; } /* packed matrices must start at Ap [0] = 0 */ if (packed && Ap [0] != 0) { ERR ("p [0] must be zero") ; } if (packed && (Ap [ncol] < Ap [0] || Ap [ncol] > nzmax)) { ERR ("p [ncol] invalid") ; } /* ---------------------------------------------------------------------- */ /* allocate workspace if needed */ /* ---------------------------------------------------------------------- */ if (!sorted) { if (Wi == NULL) { CHOLMOD(allocate_work) (0, nrow, 0, Common) ; Wi = Common->Iwork ; /* size nrow, (i/i/l) */ } if (Common->status < CHOLMOD_OK) { return (FALSE) ; /* out of memory */ } for (i = 0 ; i < nrow ; i++) { Wi [i] = EMPTY ; } } /* ---------------------------------------------------------------------- */ /* check and print each column */ /* ---------------------------------------------------------------------- */ init_print = print ; dnz = 0 ; ETC_START (count, 8) ; for (j = 0 ; j < ncol ; j++) { ETC (j == ncol-1, count, 4) ; p = Ap [j] ; if (packed) { pend = Ap [j+1] ; nz = pend - p ; } else { /* Note that Anz [j] < 0 is treated as zero */ nz = MAX (0, Anz [j]) ; pend = p + nz ; } /* Note that space can be negative if the matrix is non-monotonic */ space = Ap [j+1] - p ; P4 (" col "ID":", j) ; P4 (" nz "ID"", nz) ; P4 (" start "ID"", p) ; P4 (" end "ID"", pend) ; if (!packed) { P4 (" space "ID"", space) ; } P4 ("%s", ":\n") ; if (p < 0 || pend > nzmax) { ERR ("pointer invalid") ; } if (nz < 0 || nz > nrow) { ERR ("nz invalid") ; } ilast = EMPTY ; for ( ; p < pend ; p++) { ETC (j == ncol-1 && p >= pend-4, count, -1) ; i = Ai [p] ; P4 (" "I8":", i) ; print_value (print, xtype, Ax, Az, p, Common) ; if (i == j) { dnz++ ; } if (i < 0 || i >= nrow) { ERR ("row index out of range") ; } if (sorted && i <= ilast) { ERR ("row indices out of order") ; } if (!sorted && Wi [i] == j) { ERR ("duplicate row index") ; } P4 ("%s", "\n") ; ilast = i ; if (!sorted) { Wi [i] = j ; } } } /* matrix is valid */ P4 (" nnz on diagonal: "ID"\n", dnz) ; P3 ("%s", " OK\n") ; P4 ("%s", "\n") ; *nnzdiag = dnz ; return (TRUE) ; } int CHOLMOD(check_sparse) ( /* ---- input ---- */ cholmod_sparse *A, /* sparse matrix to check */ /* --------------- */ cholmod_common *Common ) { SuiteSparse_long nnzdiag ; RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_sparse (NULL, 0, NULL, A, &nnzdiag, Common)) ; } int CHOLMOD(print_sparse) ( /* ---- input ---- */ cholmod_sparse *A, /* sparse matrix to print */ const char *name, /* printed name of sparse matrix */ /* --------------- */ cholmod_common *Common ) { SuiteSparse_long nnzdiag ; RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_sparse (NULL, Common->print, name, A, &nnzdiag, Common)) ; } /* ========================================================================== */ /* === cholmod_check_dense ================================================== */ /* ========================================================================== */ /* Ensure a dense matrix is valid, and optionally print it. */ static int check_dense ( Int print, const char *name, cholmod_dense *X, cholmod_common *Common ) { double *Xx, *Xz ; Int i, j, d, nrow, ncol, nzmax, nz, init_print, count, xtype ; const char *type = "dense" ; /* ---------------------------------------------------------------------- */ /* print header information */ /* ---------------------------------------------------------------------- */ P4 ("%s", "\n") ; P3 ("%s", "CHOLMOD dense: ") ; if (name != NULL) { P3 ("%s: ", name) ; } if (X == NULL) { ERR ("null") ; } nrow = X->nrow ; ncol = X->ncol ; nzmax = X->nzmax ; d = X->d ; Xx = X->x ; Xz = X->z ; xtype = X->xtype ; P3 (" "ID"", nrow) ; P3 ("-by-"ID", ", ncol) ; P4 ("\n leading dimension "ID", ", d) ; P4 ("nzmax "ID", ", nzmax) ; if (d * ncol > nzmax) { ERR ("nzmax too small") ; } if (d < nrow) { ERR ("leading dimension must be >= # of rows") ; } if (Xx == NULL) { ERR ("null") ; } switch (X->xtype) { case CHOLMOD_PATTERN: ERR ("pattern unsupported") ; break ; case CHOLMOD_REAL: P4 ("%s", "real") ; break ; case CHOLMOD_COMPLEX: P4 ("%s", "complex") ; break ; case CHOLMOD_ZOMPLEX: P4 ("%s", "zomplex") ; break ; default: ERR ("unknown xtype") ; } switch (X->dtype) { case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ; case CHOLMOD_SINGLE: ERR ("single unsupported") ; default: ERR ("unknown dtype") ; } /* ---------------------------------------------------------------------- */ /* check and print each entry */ /* ---------------------------------------------------------------------- */ if (print >= 4) { init_print = print ; ETC_START (count, 9) ; nz = nrow * ncol ; for (j = 0 ; j < ncol ; j++) { ETC (j == ncol-1, count, 5) ; P4 (" col "ID":\n", j) ; for (i = 0 ; i < nrow ; i++) { ETC (j == ncol-1 && i >= nrow-4, count, -1) ; P4 (" "I8":", i) ; print_value (print, xtype, Xx, Xz, i+j*d, Common) ; P4 ("%s", "\n") ; } } } /* dense is valid */ P3 ("%s", " OK\n") ; P4 ("%s", "\n") ; return (TRUE) ; } int CHOLMOD(check_dense) ( /* ---- input ---- */ cholmod_dense *X, /* dense matrix to check */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_dense (0, NULL, X, Common)) ; } int CHOLMOD(print_dense) ( /* ---- input ---- */ cholmod_dense *X, /* dense matrix to print */ const char *name, /* printed name of dense matrix */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_dense (Common->print, name, X, Common)) ; } /* ========================================================================== */ /* === cholmod_check_subset ================================================= */ /* ========================================================================== */ /* Ensure S (0:len-1) is a subset of 0:n-1. Duplicates are allowed. S may be * NULL. A negative len denotes the set 0:n-1. * * To check the rset and cset for A(rset,cset), where nc and nr are the length * of cset and rset respectively: * * cholmod_check_subset (cset, nc, A->ncol, Common) ; * cholmod_check_subset (rset, nr, A->nrow, Common) ; * * workspace: none */ static int check_subset ( Int *S, SuiteSparse_long len, size_t n, Int print, const char *name, cholmod_common *Common ) { Int i, k, init_print, count ; const char *type = "subset" ; init_print = print ; if (S == NULL) { /* zero len denotes S = [ ], negative len denotes S = 0:n-1 */ len = (len < 0) ? (-1) : 0 ; } P4 ("%s", "\n") ; P3 ("%s", "CHOLMOD subset: ") ; if (name != NULL) { P3 ("%s: ", name) ; } P3 (" len: %ld ", len) ; if (len < 0) { P3 ("%s", "(denotes 0:n-1) ") ; } P3 ("n: "ID"", (Int) n) ; P4 ("%s", "\n") ; if (len <= 0 || S == NULL) { P3 ("%s", " OK\n") ; P4 ("%s", "\n") ; return (TRUE) ; } if (print >= 4) { ETC_START (count, 8) ; for (k = 0 ; k < ((Int) len) ; k++) { ETC (k == ((Int) len) - 4, count, -1) ; i = S [k] ; P4 (" "I8":", k) ; P4 (" "ID"\n", i) ; if (i < 0 || i >= ((Int) n)) { ERR ("entry out range") ; } } } else { for (k = 0 ; k < ((Int) len) ; k++) { i = S [k] ; if (i < 0 || i >= ((Int) n)) { ERR ("entry out range") ; } } } P3 ("%s", " OK\n") ; P4 ("%s", "\n") ; return (TRUE) ; } int CHOLMOD(check_subset) ( /* ---- input ---- */ Int *Set, /* Set [0:len-1] is a subset of 0:n-1. Duplicates OK */ SuiteSparse_long len, /* size of Set (an integer array), or < 0 if 0:n-1 */ size_t n, /* 0:n-1 is valid range */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_subset (Set, len, n, 0, NULL, Common)) ; } int CHOLMOD(print_subset) ( /* ---- input ---- */ Int *Set, /* Set [0:len-1] is a subset of 0:n-1. Duplicates OK */ SuiteSparse_long len, /* size of Set (an integer array), or < 0 if 0:n-1 */ size_t n, /* 0:n-1 is valid range */ const char *name, /* printed name of Set */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_subset (Set, len, n, Common->print, name, Common)) ; } /* ========================================================================== */ /* === cholmod_check_perm =================================================== */ /* ========================================================================== */ /* Ensure that Perm [0..len-1] is a permutation of a subset of 0:n-1. Perm * may be NULL, which is interpreted as the identity permutation. There can * be no duplicate entries (len must be <= n). * * If n <= Common->nrow, then this routine takes O(len) time and does not * allocate any memory, by using Common->Flag. Otherwise, it takes O(n) time * and ensures that Common->Iwork is at least n*sizeof(Int) in size. * * To check the fset: cholmod_check_perm (fset, fsize, ncol, Common) ; * To check a permutation: cholmod_check_perm (Perm, n, n, Common) ; * * workspace: Flag (n) if n <= Common->nrow, Iwork (n) otherwise. */ static int check_perm ( Int *Wi, Int print, const char *name, Int *Perm, size_t len, size_t n, cholmod_common *Common ) { Int *Flag ; Int i, k, mark, init_print, count ; const char *type = "perm" ; /* ---------------------------------------------------------------------- */ /* checks that take O(1) time */ /* ---------------------------------------------------------------------- */ if (Perm == NULL || n == 0) { /* Perm is valid implicit identity, or empty */ return (TRUE) ; } /* ---------------------------------------------------------------------- */ /* checks that take O(n) time or require memory allocation */ /* ---------------------------------------------------------------------- */ init_print = print ; ETC_START (count, 8) ; if (Wi == NULL && n <= Common->nrow) { /* use the Common->Flag array if it's big enough */ mark = CHOLMOD(clear_flag) (Common) ; Flag = Common->Flag ; ASSERT (CHOLMOD(dump_work) (TRUE, FALSE, 0, Common)) ; if (print >= 4) { for (k = 0 ; k < ((Int) len) ; k++) { ETC (k >= ((Int) len) - 4, count, -1) ; i = Perm [k] ; P4 (" "I8":", k) ; P4 (""ID"\n", i) ; if (i < 0 || i >= ((Int) n) || Flag [i] == mark) { CHOLMOD(clear_flag) (Common) ; ERR ("invalid permutation") ; } Flag [i] = mark ; } } else { for (k = 0 ; k < ((Int) len) ; k++) { i = Perm [k] ; if (i < 0 || i >= ((Int) n) || Flag [i] == mark) { CHOLMOD(clear_flag) (Common) ; ERR ("invalid permutation") ; } Flag [i] = mark ; } } CHOLMOD(clear_flag) (Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, FALSE, 0, Common)) ; } else { if (Wi == NULL) { /* use Common->Iwork instead, but initialize it first */ CHOLMOD(allocate_work) (0, n, 0, Common) ; Wi = Common->Iwork ; /* size n, (i/i/i) is OK */ } if (Common->status < CHOLMOD_OK) { return (FALSE) ; /* out of memory */ } for (i = 0 ; i < ((Int) n) ; i++) { Wi [i] = FALSE ; } if (print >= 4) { for (k = 0 ; k < ((Int) len) ; k++) { ETC (k >= ((Int) len) - 4, count, -1) ; i = Perm [k] ; P4 (" "I8":", k) ; P4 (""ID"\n", i) ; if (i < 0 || i >= ((Int) n) || Wi [i]) { ERR ("invalid permutation") ; } Wi [i] = TRUE ; } } else { for (k = 0 ; k < ((Int) len) ; k++) { i = Perm [k] ; if (i < 0 || i >= ((Int) n) || Wi [i]) { ERR ("invalid permutation") ; } Wi [i] = TRUE ; } } } /* perm is valid */ return (TRUE) ; } int CHOLMOD(check_perm) ( /* ---- input ---- */ Int *Perm, /* Perm [0:len-1] is a permutation of subset of 0:n-1 */ size_t len, /* size of Perm (an integer array) */ size_t n, /* 0:n-1 is valid range */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_perm (NULL, 0, NULL, Perm, len, n, Common)) ; } int CHOLMOD(print_perm) ( /* ---- input ---- */ Int *Perm, /* Perm [0:len-1] is a permutation of subset of 0:n-1 */ size_t len, /* size of Perm (an integer array) */ size_t n, /* 0:n-1 is valid range */ const char *name, /* printed name of Perm */ /* --------------- */ cholmod_common *Common ) { Int ok, print ; RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; print = Common->print ; P4 ("%s", "\n") ; P3 ("%s", "CHOLMOD perm: ") ; if (name != NULL) { P3 ("%s: ", name) ; } P3 (" len: "ID"", (Int) len) ; P3 (" n: "ID"", (Int) n) ; P4 ("%s", "\n") ; ok = check_perm (NULL, print, name, Perm, len, n, Common) ; if (ok) { P3 ("%s", " OK\n") ; P4 ("%s", "\n") ; } return (ok) ; } /* ========================================================================== */ /* === cholmod_check_parent ================================================= */ /* ========================================================================== */ /* Ensure that Parent is a valid elimination tree of nodes 0 to n-1. * If j is a root of the tree then Parent [j] is EMPTY (-1). * * NOTE: this check will fail if applied to the component tree (CParent) in * cholmod_nested_dissection, unless it has been postordered and renumbered. * * workspace: none */ static int check_parent ( Int *Parent, size_t n, Int print, const char *name, cholmod_common *Common ) { Int j, p, init_print, count ; const char *type = "parent" ; init_print = print ; P4 ("%s", "\n") ; P3 ("%s", "CHOLMOD parent: ") ; if (name != NULL) { P3 ("%s: ", name) ; } P3 (" n: "ID"", (Int) n) ; P4 ("%s", "\n") ; if (Parent == NULL) { ERR ("null") ; } /* ---------------------------------------------------------------------- */ /* checks that take O(n) time */ /* ---------------------------------------------------------------------- */ ETC_START (count, 8) ; for (j = 0 ; j < ((Int) n) ; j++) { ETC (j == ((Int) n) - 4, count, -1) ; p = Parent [j] ; P4 (" "I8":", j) ; P4 (" "ID"\n", p) ; if (!(p == EMPTY || p > j)) { ERR ("invalid") ; } } P3 ("%s", " OK\n") ; P4 ("%s", "\n") ; return (TRUE) ; } int CHOLMOD(check_parent) ( /* ---- input ---- */ Int *Parent, /* Parent [0:n-1] is an elimination tree */ size_t n, /* size of Parent */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_parent (Parent, n, 0, NULL, Common)) ; } int CHOLMOD(print_parent) ( /* ---- input ---- */ Int *Parent, /* Parent [0:n-1] is an elimination tree */ size_t n, /* size of Parent */ const char *name, /* printed name of Parent */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_parent (Parent, n, Common->print, name, Common)) ; } /* ========================================================================== */ /* === cholmod_check_factor ================================================= */ /* ========================================================================== */ static int check_factor ( Int *Wi, Int print, const char *name, cholmod_factor *L, cholmod_common *Common ) { double *Lx, *Lz ; Int *Lp, *Li, *Lnz, *Lnext, *Lprev, *Perm, *ColCount, *Lpi, *Lpx, *Super, *Ls ; Int n, nzmax, j, p, pend, i, nz, ordering, space, is_monotonic, minor, count, precise, init_print, ilast, lnz, head, tail, jprev, plast, jnext, examine_super, nsuper, s, k1, k2, psi, psend, psx, nsrow, nscol, ps2, psxend, ssize, xsize, maxcsize, maxesize, nsrow2, jj, ii, xtype ; Int check_Lpx ; const char *type = "factor" ; /* ---------------------------------------------------------------------- */ /* print header information */ /* ---------------------------------------------------------------------- */ P4 ("%s", "\n") ; P3 ("%s", "CHOLMOD factor: ") ; if (name != NULL) { P3 ("%s: ", name) ; } if (L == NULL) { ERR ("null") ; } n = L->n ; minor = L->minor ; ordering = L->ordering ; xtype = L->xtype ; Perm = L->Perm ; ColCount = L->ColCount ; lnz = 0 ; precise = Common->precise ; P3 (" "ID"", n) ; P3 ("-by-"ID"", n) ; if (minor < n) { P3 (" not positive definite (column "ID")", minor) ; } switch (L->itype) { case CHOLMOD_INT: P4 ("%s", "\n scalar types: int, ") ; break ; case CHOLMOD_INTLONG: ERR ("mixed int/long type unsupported") ; case CHOLMOD_LONG: P4 ("%s", "\n scalar types: SuiteSparse_long, "); break ; default: ERR ("unknown itype") ; } switch (L->xtype) { case CHOLMOD_PATTERN: P4 ("%s", "pattern") ; break ; case CHOLMOD_REAL: P4 ("%s", "real") ; break ; case CHOLMOD_COMPLEX: P4 ("%s", "complex") ; break ; case CHOLMOD_ZOMPLEX: P4 ("%s", "zomplex") ; break ; default: ERR ("unknown xtype") ; } switch (L->dtype) { case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ; case CHOLMOD_SINGLE: ERR ("single unsupported") ; default: ERR ("unknown dtype") ; } if (L->itype != ITYPE || L->dtype != DTYPE) { ERR ("integer and real type must match routine") ; } if (L->is_super) { P3 ("%s", " supernodal") ; } else { P3 ("%s", " simplicial") ; } if (L->is_ll) { P3 ("%s", ", LL'.") ; } else { P3 ("%s", ", LDL'.") ; } P4 ("%s", "\n ordering method used: ") ; switch (L->ordering) { case CHOLMOD_POSTORDERED:P4 ("%s", "natural (postordered)") ; break ; case CHOLMOD_NATURAL: P4 ("%s", "natural") ; break ; case CHOLMOD_GIVEN: P4 ("%s", "user-provided") ; break ; case CHOLMOD_AMD: P4 ("%s", "AMD") ; break ; case CHOLMOD_COLAMD: P4 ("%s", "AMD for A, COLAMD for A*A'") ;break ; #ifndef NPARTITION case CHOLMOD_METIS: P4 ("%s", "METIS NodeND") ; break ; case CHOLMOD_NESDIS: P4 ("%s", "CHOLMOD nested dissection") ; break ; #endif default: ERR ("unknown ordering") ; } P4 ("%s", "\n") ; init_print = print ; if (L->is_super && L->xtype == CHOLMOD_ZOMPLEX) { ERR ("Supernodal zomplex L not supported") ; } /* ---------------------------------------------------------------------- */ /* check L->Perm */ /* ---------------------------------------------------------------------- */ if (!check_perm (Wi, print, name, Perm, n, n, Common)) { return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* check L->ColCount */ /* ---------------------------------------------------------------------- */ if (ColCount == NULL) { ERR ("ColCount vector invalid") ; } ETC_START (count, 8) ; for (j = 0 ; j < n ; j++) { ETC (j >= n-4, count, -1) ; P4 (" col: "ID" ", j) ; nz = ColCount [j] ; P4 ("colcount: "ID"\n", nz) ; if (nz < 0 || nz > n-j) { ERR ("ColCount out of range") ; } } /* ---------------------------------------------------------------------- */ /* check factor */ /* ---------------------------------------------------------------------- */ if (L->xtype == CHOLMOD_PATTERN && !(L->is_super)) { /* ------------------------------------------------------------------ */ /* check simplicial symbolic factor */ /* ------------------------------------------------------------------ */ /* nothing else to do */ ; } else if (L->xtype != CHOLMOD_PATTERN && !(L->is_super)) { /* ------------------------------------------------------------------ */ /* check simplicial numerical factor */ /* ------------------------------------------------------------------ */ P4 ("monotonic: %d\n", L->is_monotonic) ; nzmax = L->nzmax ; P3 (" nzmax "ID".", nzmax) ; P4 ("%s", "\n") ; Lp = L->p ; Li = L->i ; Lx = L->x ; Lz = L->z ; Lnz = L->nz ; Lnext = L->next ; Lprev = L->prev ; /* check for existence of Lp, Li, Lnz, Lnext, Lprev, and Lx arrays */ if (Lp == NULL) { ERR ("p array not present") ; } if (Li == NULL) { ERR ("i array not present") ; } if (Lnz == NULL) { ERR ("nz array not present") ; } if (Lx == NULL) { ERR ("x array not present") ; } if (xtype == CHOLMOD_ZOMPLEX && Lz == NULL) { ERR ("z array not present") ; } if (Lnext == NULL) { ERR ("next array not present") ; } if (Lprev == NULL) { ERR ("prev array not present") ; } ETC_START (count, 8) ; /* check each column of L */ plast = 0 ; is_monotonic = TRUE ; for (j = 0 ; j < n ; j++) { ETC (j >= n-3, count, -1) ; p = Lp [j] ; nz = Lnz [j] ; pend = p + nz ; lnz += nz ; P4 (" col "ID":", j) ; P4 (" nz "ID"", nz) ; P4 (" start "ID"", p) ; P4 (" end "ID"", pend) ; if (Lnext [j] < 0 || Lnext [j] > n) { ERR ("invalid link list") ; } space = Lp [Lnext [j]] - p ; P4 (" space "ID"", space) ; P4 (" free "ID":\n", space - nz) ; if (p < 0 || pend > nzmax || space < 1) { ERR ("pointer invalid") ; } if (nz < 1 || nz > (n-j) || nz > space) { ERR ("nz invalid") ; } ilast = j-1 ; if (p < plast) { is_monotonic = FALSE ; } plast = p ; i = Li [p] ; P4 (" "I8":", i) ; if (i != j) { ERR ("diagonal missing") ; } print_value (print, xtype, Lx, Lz, p, Common) ; P4 ("%s", "\n") ; ilast = j ; for (p++ ; p < pend ; p++) { ETC_DISABLE (count) ; i = Li [p] ; P4 (" "I8":", i) ; if (i < j || i >= n) { ERR ("row index out of range") ; } if (i <= ilast) { ERR ("row indices out of order") ; } print_value (print, xtype, Lx, Lz, p, Common) ; P4 ("%s", "\n") ; ilast = i ; } } if (L->is_monotonic && !is_monotonic) { ERR ("columns not monotonic") ; } /* check the link list */ head = n+1 ; tail = n ; j = head ; jprev = EMPTY ; count = 0 ; for ( ; ; ) { if (j < 0 || j > n+1 || count > n+2) { ERR ("invalid link list") ; } jnext = Lnext [j] ; if (j >= 0 && j < n) { if (jprev != Lprev [j]) { ERR ("invalid link list") ; } } count++ ; if (j == tail) { break ; } jprev = j ; j = jnext ; } if (Lnext [tail] != EMPTY || count != n+2) { ERR ("invalid link list") ; } } else { /* ------------------------------------------------------------------ */ /* check supernodal numeric or symbolic factor */ /* ------------------------------------------------------------------ */ nsuper = L->nsuper ; ssize = L->ssize ; xsize = L->xsize ; maxcsize = L->maxcsize ; maxesize = L->maxesize ; Ls = L->s ; Lpi = L->pi ; Lpx = L->px ; Super = L->super ; Lx = L->x ; ETC_START (count, 8) ; P4 (" ssize "ID" ", ssize) ; P4 ("xsize "ID" ", xsize) ; P4 ("maxcsize "ID" ", maxcsize) ; P4 ("maxesize "ID"\n", maxesize) ; if (Ls == NULL) { ERR ("invalid: L->s missing") ; } if (Lpi == NULL) { ERR ("invalid: L->pi missing") ; } if (Lpx == NULL) { ERR ("invalid: L->px missing") ; } if (Super == NULL) { ERR ("invalid: L->super missing") ; } if (L->xtype != CHOLMOD_PATTERN) { /* numerical supernodal factor */ if (Lx == NULL) { ERR ("invalid: L->x missing") ; } if (Ls [0] == EMPTY) { ERR ("invalid: L->s not defined") ; } examine_super = TRUE ; } else { /* symbolic supernodal factor, but only if it has been computed */ examine_super = (Ls [0] != EMPTY) ; } if (examine_super) { if (Lpi [0] != 0 || MAX (1, Lpi [nsuper]) != ssize) { PRINT0 (("Lpi [0] "ID", Lpi [nsuper = "ID"] = "ID"\n", Lpi [0], nsuper, Lpi [nsuper])) ; ERR ("invalid: L->pi invalid") ; } /* If Lpx [0] is 123456, then supernodes are present but Lpx [0...nsuper] is not defined, so don't check it. This is used in the non-GPU accelerated SPQR */ check_Lpx = (Lpx [0] != 123456) ; if (check_Lpx && (Lpx [0] != 0 || MAX (1, Lpx[nsuper]) != xsize)) { ERR ("invalid: L->px invalid") ; } /* check and print each supernode */ for (s = 0 ; s < nsuper ; s++) { k1 = Super [s] ; k2 = Super [s+1] ; psi = Lpi [s] ; psend = Lpi [s+1] ; nsrow = psend - psi ; nscol = k2 - k1 ; nsrow2 = nsrow - nscol ; ps2 = psi + nscol ; if (check_Lpx) { psx = Lpx [s] ; psxend = Lpx [s+1] ; } ETC (s == nsuper-1, count, 4) ; P4 (" supernode "ID", ", s) ; P4 ("col "ID" ", k1) ; P4 ("to "ID". ", k2-1) ; P4 ("nz in first col: "ID".\n", nsrow) ; if (check_Lpx) { P4 (" values start "ID", ", psx) ; P4 ("end "ID"\n", psxend) ; } if (k1 > k2 || k1 < 0 || k2 > n || nsrow < nscol || nsrow2 < 0 || (check_Lpx && psxend - psx != nsrow * nscol)) { ERR ("invalid supernode") ; } lnz += nscol * nsrow - (nscol*nscol - nscol)/2 ; if (L->xtype != CHOLMOD_PATTERN) { /* print each column of the supernode */ for (jj = 0 ; jj < nscol ; jj++) { ETC_ENABLE (s == nsuper-1 && jj >= nscol-3, count, -1) ; j = k1 + jj ; P4 (" col "ID"\n", j) ; ilast = j ; i = Ls [psi + jj] ; P4 (" "I8":", i) ; if (i != j) { ERR ("row index invalid") ; } /* PRINTVALUE (Lx [psx + jj + jj*nsrow]) ; */ print_value (print, xtype, Lx, NULL, psx + jj + jj*nsrow, Common) ; P4 ("%s", "\n") ; for (ii = jj + 1 ; ii < nsrow ; ii++) { ETC_DISABLE (count) ; i = Ls [psi + ii] ; P4 (" "I8":", i) ; if (i <= ilast || i > n) { ERR ("row index out of range") ; } /* PRINTVALUE (Lx [psx + ii + jj*nsrow]) ; */ print_value (print, xtype, Lx, NULL, psx + ii + jj*nsrow, Common) ; P4 ("%s", "\n") ; ilast = i ; } } } else { /* just print the leading column of the supernode */ P4 (" col "ID"\n", k1) ; for (jj = 0 ; jj < nscol ; jj++) { ETC (s == nsuper-1 && jj >= nscol-3, count, -1) ; j = k1 + jj ; i = Ls [psi + jj] ; P4 (" "I8"", i) ; if (i != j) { ERR ("row index invalid") ; } P4 ("%s", "\n") ; } ilast = j ; for (ii = nscol ; ii < nsrow ; ii++) { ETC_DISABLE (count) ; i = Ls [psi + ii] ; P4 (" "I8"", i) ; if (i <= ilast || i > n) { ERR ("row index out of range") ; } P4 ("%s", "\n") ; ilast = i ; } } } } } /* factor is valid */ P3 (" nz "ID"", lnz) ; P3 ("%s", " OK\n") ; P4 ("%s", "\n") ; return (TRUE) ; } int CHOLMOD(check_factor) ( /* ---- input ---- */ cholmod_factor *L, /* factor to check */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_factor (NULL, 0, NULL, L, Common)) ; } int CHOLMOD(print_factor) ( /* ---- input ---- */ cholmod_factor *L, /* factor to print */ const char *name, /* printed name of factor */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_factor (NULL, Common->print, name, L, Common)) ; } /* ========================================================================== */ /* === cholmod_check_triplet ================================================ */ /* ========================================================================== */ /* Ensure a triplet matrix is valid, and optionally print it. */ static int check_triplet ( Int print, const char *name, cholmod_triplet *T, cholmod_common *Common ) { double *Tx, *Tz ; Int *Ti, *Tj ; Int i, j, p, nrow, ncol, nzmax, nz, xtype, init_print, count ; const char *type = "triplet" ; /* ---------------------------------------------------------------------- */ /* print header information */ /* ---------------------------------------------------------------------- */ P4 ("%s", "\n") ; P3 ("%s", "CHOLMOD triplet: ") ; if (name != NULL) { P3 ("%s: ", name) ; } if (T == NULL) { ERR ("null") ; } nrow = T->nrow ; ncol = T->ncol ; nzmax = T->nzmax ; nz = T->nnz ; Ti = T->i ; Tj = T->j ; Tx = T->x ; Tz = T->z ; xtype = T->xtype ; P3 (" "ID"", nrow) ; P3 ("-by-"ID", ", ncol) ; P3 ("nz "ID",", nz) ; if (T->stype > 0) { P3 ("%s", " upper.") ; } else if (T->stype < 0) { P3 ("%s", " lower.") ; } else { P3 ("%s", " up/lo.") ; } P4 ("\n nzmax "ID", ", nzmax) ; if (nz > nzmax) { ERR ("nzmax too small") ; } switch (T->itype) { case CHOLMOD_INT: P4 ("%s", "\n scalar types: int, ") ; break ; case CHOLMOD_INTLONG: ERR ("mixed int/long type unsupported") ; case CHOLMOD_LONG: P4 ("%s", "\n scalar types: SuiteSparse_long, "); break ; default: ERR ("unknown itype") ; } switch (T->xtype) { case CHOLMOD_PATTERN: P4 ("%s", "pattern") ; break ; case CHOLMOD_REAL: P4 ("%s", "real") ; break ; case CHOLMOD_COMPLEX: P4 ("%s", "complex") ; break ; case CHOLMOD_ZOMPLEX: P4 ("%s", "zomplex") ; break ; default: ERR ("unknown xtype") ; } switch (T->dtype) { case CHOLMOD_DOUBLE: P4 ("%s", ", double\n") ; break ; case CHOLMOD_SINGLE: ERR ("single unsupported") ; default: ERR ("unknown dtype") ; } if (T->itype != ITYPE || T->dtype != DTYPE) { ERR ("integer and real type must match routine") ; } if (T->stype && nrow != ncol) { ERR ("symmetric but not square") ; } /* check for existence of Ti, Tj, Tx arrays */ if (Tj == NULL) { ERR ("j array not present") ; } if (Ti == NULL) { ERR ("i array not present") ; } if (xtype != CHOLMOD_PATTERN && Tx == NULL) { ERR ("x array not present") ; } if (xtype == CHOLMOD_ZOMPLEX && Tz == NULL) { ERR ("z array not present") ; } /* ---------------------------------------------------------------------- */ /* check and print each entry */ /* ---------------------------------------------------------------------- */ init_print = print ; ETC_START (count, 8) ; for (p = 0 ; p < nz ; p++) { ETC (p >= nz-4, count, -1) ; i = Ti [p] ; P4 (" "I8":", p) ; P4 (" "I_8"", i) ; if (i < 0 || i >= nrow) { ERR ("row index out of range") ; } j = Tj [p] ; P4 (" "I_8"", j) ; if (j < 0 || j >= ncol) { ERR ("column index out of range") ; } print_value (print, xtype, Tx, Tz, p, Common) ; P4 ("%s", "\n") ; } /* triplet matrix is valid */ P3 ("%s", " OK\n") ; P4 ("%s", "\n") ; return (TRUE) ; } int CHOLMOD(check_triplet) ( /* ---- input ---- */ cholmod_triplet *T, /* triplet matrix to check */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_triplet (0, NULL, T, Common)) ; } int CHOLMOD(print_triplet) ( /* ---- input ---- */ cholmod_triplet *T, /* triplet matrix to print */ const char *name, /* printed name of triplet matrix */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; return (check_triplet (Common->print, name, T, Common)) ; } /* ========================================================================== */ /* === CHOLMOD debugging routines =========================================== */ /* ========================================================================== */ #ifndef NDEBUG /* The global variables present only when debugging enabled. */ int CHOLMOD(dump) = 0 ; int CHOLMOD(dump_malloc) = -1 ; /* workspace: no debug routines use workspace in Common */ /* ========================================================================== */ /* === cholmod_dump_init ==================================================== */ /* ========================================================================== */ void CHOLMOD(dump_init) (const char *s, cholmod_common *Common) { int i = 0 ; FILE *f ; f = fopen ("debug", "r") ; CHOLMOD(dump) = 0 ; if (f != NULL) { i = fscanf (f, "%d", &CHOLMOD(dump)) ; fclose (f) ; } PRINT1 (("%s: cholmod_dump_init, D = %d\n", s, CHOLMOD(dump))) ; } /* ========================================================================== */ /* === cholmod_dump_sparse ================================================== */ /* ========================================================================== */ /* returns nnz (diag (A)) or EMPTY if error */ SuiteSparse_long CHOLMOD(dump_sparse) ( cholmod_sparse *A, const char *name, cholmod_common *Common ) { Int *Wi ; SuiteSparse_long nnzdiag ; Int ok ; if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return (0) ; } RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; Wi = malloc (MAX (1, A->nrow) * sizeof (Int)) ; ok = check_sparse (Wi, CHOLMOD(dump), name, A, &nnzdiag, Common) ; if (Wi != NULL) free (Wi) ; return (ok ? nnzdiag : EMPTY) ; } /* ========================================================================== */ /* === cholmod_dump_factor ================================================== */ /* ========================================================================== */ int CHOLMOD(dump_factor) ( cholmod_factor *L, const char *name, cholmod_common *Common ) { Int *Wi ; int ok ; if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return (TRUE) ; } RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; Wi = malloc (MAX (1, L->n) * sizeof (Int)) ; ok = check_factor (Wi, CHOLMOD(dump), name, L, Common) ; if (Wi != NULL) free (Wi) ; return (ok) ; } /* ========================================================================== */ /* === cholmod_dump_perm ==================================================== */ /* ========================================================================== */ int CHOLMOD(dump_perm) ( Int *Perm, size_t len, size_t n, const char *name, cholmod_common *Common ) { Int *Wi ; int ok ; if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return (TRUE) ; } RETURN_IF_NULL_COMMON (FALSE) ; Wi = malloc (MAX (1, n) * sizeof (Int)) ; ok = check_perm (Wi, CHOLMOD(dump), name, Perm, len, n,Common) ; if (Wi != NULL) free (Wi) ; return (ok) ; } /* ========================================================================== */ /* === cholmod_dump_dense =================================================== */ /* ========================================================================== */ int CHOLMOD(dump_dense) ( cholmod_dense *X, const char *name, cholmod_common *Common ) { if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return (TRUE) ; } RETURN_IF_NULL_COMMON (FALSE) ; return (check_dense (CHOLMOD(dump), name, X, Common)) ; } /* ========================================================================== */ /* === cholmod_dump_triplet ================================================= */ /* ========================================================================== */ int CHOLMOD(dump_triplet) ( cholmod_triplet *T, const char *name, cholmod_common *Common ) { if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return (TRUE) ; } RETURN_IF_NULL_COMMON (FALSE) ; return (check_triplet (CHOLMOD(dump), name, T, Common)) ; } /* ========================================================================== */ /* === cholmod_dump_subset ================================================== */ /* ========================================================================== */ int CHOLMOD(dump_subset) ( Int *S, size_t len, size_t n, const char *name, cholmod_common *Common ) { if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return (TRUE) ; } RETURN_IF_NULL_COMMON (FALSE) ; return (check_subset (S, len, n, CHOLMOD(dump), name, Common)) ; } /* ========================================================================== */ /* === cholmod_dump_parent ================================================== */ /* ========================================================================== */ int CHOLMOD(dump_parent) ( Int *Parent, size_t n, const char *name, cholmod_common *Common ) { if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return (TRUE) ; } RETURN_IF_NULL_COMMON (FALSE) ; return (check_parent (Parent, n, CHOLMOD(dump), name, Common)) ; } /* ========================================================================== */ /* === cholmod_dump_real ==================================================== */ /* ========================================================================== */ void CHOLMOD(dump_real) ( const char *name, Real *X, SuiteSparse_long nrow, SuiteSparse_long ncol, int lower, int xentry, cholmod_common *Common ) { /* dump an nrow-by-ncol real dense matrix */ SuiteSparse_long i, j ; double x, z ; if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return ; } PRINT1 (("%s: dump_real, nrow: %ld ncol: %ld lower: %d\n", name, nrow, ncol, lower)) ; for (j = 0 ; j < ncol ; j++) { PRINT2 ((" col %ld\n", j)) ; for (i = 0 ; i < nrow ; i++) { /* X is stored in column-major form */ if (lower && i < j) { PRINT2 ((" %5ld: -", i)) ; } else { x = *X ; PRINT2 ((" %5ld: %e", i, x)) ; if (xentry == 2) { z = *(X+1) ; PRINT2 ((", %e", z)) ; } } PRINT2 (("\n")) ; X += xentry ; } } } /* ========================================================================== */ /* === cholmod_dump_super =================================================== */ /* ========================================================================== */ void CHOLMOD(dump_super) ( SuiteSparse_long s, Int *Super, Int *Lpi, Int *Ls, Int *Lpx, double *Lx, int xentry, cholmod_common *Common ) { Int k1, k2, do_values, psi, psx, nsrow, nscol, psend, ilast, p, i ; if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return ; } k1 = Super [s] ; k2 = Super [s+1] ; nscol = k2 - k1 ; do_values = (Lpx != NULL) && (Lx != NULL) ; psi = Lpi [s] ; psend = Lpi [s+1] ; nsrow = psend - psi ; PRINT1 (("\nSuper %ld, columns "ID" to "ID", "ID" rows "ID" cols\n", s, k1, k2-1, nsrow, nscol)) ; ilast = -1 ; for (p = psi ; p < psend ; p++) { i = Ls [p] ; PRINT2 ((" "ID" : p-psi "ID"\n", i, p-psi)) ; ASSERT (IMPLIES (p-psi < nscol, i == k1 + (p-psi))) ; if (p-psi == nscol-1) PRINT2 (("------\n")) ; ASSERT (i > ilast) ; ilast = i ; } if (do_values) { psx = Lpx [s] ; CHOLMOD(dump_real) ("Supernode", Lx + xentry*psx, nsrow, nscol, TRUE, xentry, Common) ; } } /* ========================================================================== */ /* === cholmod_dump_mem ===================================================== */ /* ========================================================================== */ int CHOLMOD(dump_mem) ( const char *where, SuiteSparse_long should, cholmod_common *Common ) { SuiteSparse_long diff = should - Common->memory_inuse ; if (diff != 0) { PRINT0 (("mem: %-15s peak %10g inuse %10g should %10g\n", where, (double) Common->memory_usage, (double) Common->memory_inuse, (double) should)) ; PRINT0 (("mem: %s diff %ld !\n", where, diff)) ; } return (diff == 0) ; } /* ========================================================================== */ /* === cholmod_dump_partition =============================================== */ /* ========================================================================== */ /* make sure we have a proper separator (for debugging only) * * workspace: none */ int CHOLMOD(dump_partition) ( SuiteSparse_long n, Int *Cp, Int *Ci, Int *Cnw, /* can be NULL */ Int *Part, SuiteSparse_long sepsize, cholmod_common *Common ) { Int chek [3], which, ok, i, j, p ; PRINT1 (("bisect sepsize %ld\n", sepsize)) ; ok = TRUE ; chek [0] = 0 ; chek [1] = 0 ; chek [2] = 0 ; for (j = 0 ; j < n ; j++) { PRINT2 (("--------j "ID" in part "ID" nw "ID"\n", j, Part [j], Cnw ? (Cnw[j]):1)); which = Part [j] ; for (p = Cp [j] ; p < Cp [j+1] ; p++) { i = Ci [p] ; PRINT3 (("i "ID", part "ID"\n", i, Part [i])) ; if (which == 0) { if (Part [i] == 1) { PRINT0 (("Error! "ID" "ID"\n", i, j)) ; ok = FALSE ; } } else if (which == 1) { if (Part [i] == 0) { PRINT0 (("Error! "ID" "ID"\n", i, j)) ; ok = FALSE ; } } } if (which < 0 || which > 2) { PRINT0 (("Part out of range\n")) ; ok = FALSE ; } chek [which] += (Cnw ? (Cnw [j]) : 1) ; } PRINT1 (("sepsize %ld check "ID" "ID" "ID"\n", sepsize, chek[0], chek[1],chek[2])); if (sepsize != chek[2]) { PRINT0 (("mismatch!\n")) ; ok = FALSE ; } return (ok) ; } /* ========================================================================== */ /* === cholmod_dump_work ==================================================== */ /* ========================================================================== */ int CHOLMOD(dump_work) (int flag, int head, SuiteSparse_long wsize, cholmod_common *Common) { double *W ; Int *Flag, *Head ; Int k, nrow, mark ; if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return (TRUE) ; } RETURN_IF_NULL_COMMON (FALSE) ; nrow = Common->nrow ; Flag = Common->Flag ; Head = Common->Head ; W = Common->Xwork ; mark = Common->mark ; if (wsize < 0) { /* check all of Xwork */ wsize = Common->xworksize ; } else { /* check on the first wsize doubles in Xwork */ wsize = MIN (wsize, (Int) (Common->xworksize)) ; } if (flag) { for (k = 0 ; k < nrow ; k++) { if (Flag [k] >= mark) { PRINT0 (("Flag invalid, Flag ["ID"] = "ID", mark = "ID"\n", k, Flag [k], mark)) ; ASSERT (0) ; return (FALSE) ; } } } if (head) { for (k = 0 ; k < nrow ; k++) { if (Head [k] != EMPTY) { PRINT0 (("Head invalid, Head ["ID"] = "ID"\n", k, Head [k])) ; ASSERT (0) ; return (FALSE) ; } } } for (k = 0 ; k < wsize ; k++) { if (W [k] != 0.) { PRINT0 (("W invalid, W ["ID"] = %g\n", k, W [k])) ; ASSERT (0) ; return (FALSE) ; } } return (TRUE) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Check/cholmod_read.c0000664000175000017500000011740114224052371020457 00000000000000/* ========================================================================== */ /* === Check/cholmod_read =================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Check Module. Copyright (C) 2005-2006, Timothy A. Davis. * The CHOLMOD/Check Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Read a sparse matrix in triplet or dense form. A triplet matrix can be * returned as compressed-column sparse matrix. The file format is compatible * with all variations of the Matrix Market "coordinate" and "array" format * (http://www.nist.gov/MatrixMarket). The format supported by these routines * also allow other formats, where the Matrix Market header is optional. * * Although the Matrix Market header is optional, I recommend that users stick * with the strict Matrix Market format. The optional format appears here to * support the reading of symmetric matrices stored with just their upper * triangular parts present, for testing and development of the A->stype > 0 * format in CHOLMOD. That format is not included in the Matrix Market format. * * If the first line of the file starts with %%MatrixMarket, then it is * interpretted as a file in Matrix Market format. This line must have * the following format: * * %%MatrixMarket matrix * * is one of: coordinate or array. The former is a sparse matrix in * triplet form. The latter is a dense matrix in column-major form. * * is one of: real, complex, pattern, or integer. * The functions here convert the "integer" and "pattern" types to real. * * is one of: general, hermitian, symmetric, or skew-symmetric * * The strings are case-insensitive. Only the first character is * significant (or the first two for skew-symmetric). * * is ignored for all matrices; the actual type (real, complex, * or pattern) is inferred from the number of tokens in each line of the * file. For a "coordinate" matrix: 2: pattern, 3: real, 4: complex; for * a dense "array" matrix: 1: real, 2: complex. This is compatible with * the Matrix Market format, since pattern matrices must have two tokens * per line, real matrices must have 3, and complex matrices must have 4. * A storage of "general" implies an stype of zero (see below). * "symmetric" and "hermitian" imply an stype of -1. Skew-symmetric and * complex symmetric matrices are always returned with both upper and lower * triangular parts present, with an stype of zero, since CHOLMOD does not * have a method for representing skew-symmetric and complex symmetric * matrices. Real symmetric and complex Hermitian matrices may optionally * be returned with both parts present. * * Any other lines starting with "%" are treated as comments, and are ignored. * Blank lines are ignored. The Matrix Market header is optional in this * routine (it is not optional in the Matrix Market format). * * Note that complex matrices are always returned in CHOLMOD_COMPLEX format, * not CHOLMOD_ZOMPLEX. * * ----------------------------------------------------------------------------- * Triplet matrices: * ----------------------------------------------------------------------------- * * The first data line of a triplet matrix contains 3 or 4 integers: * * nrow ncol nnz stype * * where stype is optional (stype does not appear in the Matrix Market format). * The matrix is nrow-by-ncol. The following nnz lines (excluding comments * and blank lines) each contain a single entry. Duplicates are permitted, * and are summed in the output matrix. * * The stype is first derived from the Matrix Market header. If the stype * appears as the fourth integer in the first data line, it is determined from * that line. * * If stype is present, it denotes the storage format for the matrix. * stype = 0 denotes an unsymmetric matrix (same as Matrix Market "general"). * stype = -1 denotes a real symmetric or complex Hermitian matrix whose lower * triangular entries are stored. Entries may be present in the upper * triangular part, but these are ignored (same as Matrix Market * "real symmetric" and "complex Hermitian"). * stype = 1 denotes a real symmetric or complex Hermitian matrix whose upper * triangular entries are stored. Entries may be present in the lower * triangular part, but these are ignored. This option is not present * in the Matrix Market format. * * If stype is not present (no Matrix Market header and not in the first data * line) it is inferred from the rest of the data. If the matrix is * rectangular, or has entries in both the upper and lower triangular parts, * then it is assumed to be unsymmetric (stype=0). If only entries in the * lower triangular part are present, the matrix is assumed to have stype = -1. * If only entries in the upper triangular part are present, the matrix is * assumed to have stype = 1. * * After the first data line (with nrow, ncol, nnz, and optionally stype), * each nonzero consists of one line with 2, 3, or 4 entries. All lines must * have the same number of entries. The first two entries are the row and * column indices of the nonzero. If 3 entries are present, the 3rd entry is * the numerical value, and the matrix is real. If 4 entries are present, * the 3rd and 4th entries in the line are the real and imaginary parts of * a complex value. * * The matrix can be either 0-based or 1-based. It is first assumed to be * one-based (all matrices in the Matrix Market are one-based), with row indices * in the range 1 to ncol and column indices in the range 1 to nrow. If a row * or column index of zero is found, the matrix is assumed to be zero-based * (with row indices in the range 0 to ncol-1 and column indices in the range 0 * to nrow-1). * * If Common->prefer_binary is set to its default value of FALSE, then * for symmetric pattern-only matrices, the kth diagonal (if present) is set to * one plus the degree of the row/column k, and the off-diagonal entries are set * to -1. A symmetric pattern-only matrix with a zero-free diagonal is thus * converted into a symmetric positive definite matrix. All entries are set to * one for an unsymmetric pattern-only matrix. This differs from the * Matrix Market format (A = mmread ('file') returns a binary pattern for A for * symmetric pattern-only matrices). If Common->prefer_binary is TRUE, then * this function returns a binary matrix (just like mmread('file')). * * ----------------------------------------------------------------------------- * Dense matrices: * ----------------------------------------------------------------------------- * * A dense matrix is specified by the Matrix Market "array" format. The * Matrix Market header is optional; if not present, the matrix is assumed to * be in the Matrix Market "general" format. The first data line contains just * two integers: * * nrow ncol * * The can be real, integer, or complex (not pattern). These functions * convert an integer type to real. The entries in the matrix are stored in * column-major format, with one line per entry. Two entries are present in * each line for complex matrices, one for real and integer matrices. In * rectangular and unsymmetric matrices, all entries are present. For real * symmetric or complex Hermitian matrices, only entries in the lower triangular * part appear. For skew-symmetric matrices, only entries in the strictly * lower triangular part appear. * * Since CHOLMOD does not have a data structure for presenting dense symmetric/ * Hermitian matrices, these functions always return a dense matrix in its * general form, with both upper and lower parts present. */ #ifndef NCHECK #include "cholmod_internal.h" #include "cholmod_check.h" #include #include /* The MatrixMarket format specificies a maximum line length of 1024 */ #define MAXLINE 1030 /* ========================================================================== */ /* === get_line ============================================================= */ /* ========================================================================== */ /* Read one line of the file, return TRUE if successful, FALSE if EOF. */ static int get_line (FILE *f, char *buf) { buf [0] = '\0' ; buf [1] = '\0' ; buf [MAXLINE] = '\0' ; return (fgets (buf, MAXLINE, f) != NULL) ; } /* ========================================================================== */ /* === fix_inf ============================================================== */ /* ========================================================================== */ /* Replace huge values with +/- Inf's, since scanf and printf don't deal * with Inf's properly. */ static double fix_inf (double x) { if ((x >= HUGE_DOUBLE) || (x <= -HUGE_DOUBLE)) { /* treat this as +/- Inf (assume 2*x leads to overflow) */ x = 2*x ; } return (x) ; } /* ========================================================================== */ /* === is_blank_line ======================================================== */ /* ========================================================================== */ /* TRUE if s is a blank line or comment, FALSE otherwise */ static int is_blank_line ( char *s ) { int c, k ; if (s [0] == '%') { /* a comment line */ return (TRUE) ; } for (k = 0 ; k <= MAXLINE ; k++) { c = s [k] ; if (c == '\0') { /* end of line */ break ; } if (!isspace (c)) { /* non-space character */ return (FALSE) ; } } return (TRUE) ; } /* ========================================================================== */ /* === read_header ========================================================== */ /* ========================================================================== */ /* Read the header. This consists of zero or more comment lines (blank, or * starting with a "%" in the first column), followed by a single data line * containing up to four numerical values. * * The first line may optionally be a Matrix Market header line, of the form * * %%MatrixMarket matrix * * The first data line of a sparse matrix in triplet form consists of 3 or 4 * numerical values: * * nrow ncol nnz stype * * where stype is optional (it does not appear in the Matrix Market file * format). The first line of a dense matrix in column-major form consists of * two numerical values: * * nrow ncol * * The stype of the matrix is determine either from the Matrix Market header, * or (optionally) from the first data line. stypes of 0 to -3 directly * correlate with the Matrix Market format; stype = 1 is an extension to that * format. * * 999: unknown (will be inferred from the data) * 1: real symmetric or complex Hermitian with upper part stored * (not in the Matrix Market format) * 0: unsymmetric (same as Matrix Market "general") * -1: real symmetric or complex Hermitian, with lower part stored * (Matrix Market "real symmetric" or "complex hermitian") * -2: real or complex skew symmetric (lower part stored, can only be * specified by Matrix Market header) * -3: complex symmetric (lower part stored) * specified by Matrix Market header) * * The Matrix Market header is optional. If stype appears in the first data * line, it is determine by that data line. Otherwise, if the Matrix Market * header appears, stype is determined from that header. If stype does not * appear, it is set to "unknown" (999). */ #define STYPE_UNKNOWN 999 #define STYPE_SYMMETRIC_UPPER 1 #define STYPE_UNSYMMETRIC 0 #define STYPE_SYMMETRIC_LOWER -1 #define STYPE_SKEW_SYMMETRIC -2 #define STYPE_COMPLEX_SYMMETRIC_LOWER -3 static int read_header /* returns TRUE if successful, FALSE on error */ ( /* ---- input ---- */ FILE *f, /* file to read from */ /* ---- output --- */ char *buf, /* a character array of size MAXLINE+1 */ int *mtype, /* CHOLMOD_TRIPLET or CHOLMOD_DENSE */ size_t *nrow, /* number of rows in the matrix */ size_t *ncol, /* number of columns in the matrix */ size_t *nnz, /* number of entries in a triplet matrix (0 for dense)*/ int *stype /* stype (see above) */ ) { char *p ; int first = TRUE, got_mm_header = FALSE, c, c2, is_complex, nitems ; double l1, l2, l3, l4 ; *mtype = CHOLMOD_TRIPLET ; *nrow = 0 ; *ncol = 0 ; *nnz = 0 ; *stype = STYPE_UNKNOWN ; for ( ; ; ) { /* ------------------------------------------------------------------ */ /* get the next line */ /* ------------------------------------------------------------------ */ if (!get_line (f, buf)) { /* premature end of file */ return (FALSE) ; } if (first && (strncmp (buf, "%%MatrixMarket", 14) == 0)) { /* -------------------------------------------------------------- */ /* read a Matrix Market header */ /* -------------------------------------------------------------- */ got_mm_header = TRUE ; p = buf ; /* -------------------------------------------------------------- */ /* get "matrix" token */ /* -------------------------------------------------------------- */ while (*p && !isspace (*p)) p++ ; while (*p && isspace (*p)) p++ ; c = tolower (*p) ; if (c != 'm') { /* bad format */ return (FALSE) ; } /* -------------------------------------------------------------- */ /* get the fmt token ("coord" or "array") */ /* -------------------------------------------------------------- */ while (*p && !isspace (*p)) p++ ; while (*p && isspace (*p)) p++ ; c = tolower (*p) ; if (c == 'c') { *mtype = CHOLMOD_TRIPLET ; } else if (c == 'a') { *mtype = CHOLMOD_DENSE ; } else { /* bad format, neither "coordinate" nor "array" */ return (FALSE) ; } /* -------------------------------------------------------------- */ /* get type token (real, pattern, complex, integer) */ /* -------------------------------------------------------------- */ while (*p && !isspace (*p)) p++ ; while (*p && isspace (*p)) p++ ; c = tolower (*p) ; if (!(c == 'r' || c == 'p' || c == 'c' || c == 'i')) { /* bad format */ return (FALSE) ; } is_complex = (c == 'c') ; /* -------------------------------------------------------------- */ /* get storage token (general, hermitian, symmetric, skew) */ /* -------------------------------------------------------------- */ while (*p && !isspace (*p)) p++ ; while (*p && isspace (*p)) p++ ; c = tolower (*p) ; c2 = tolower (*(p+1)) ; if (c == 'g') { /* "general" storage (unsymmetric matrix), both parts present */ *stype = STYPE_UNSYMMETRIC ; } else if (c == 's' && c2 == 'y') { /* "symmetric" */ if (is_complex) { /* complex symmetric, lower triangular part present */ *stype = STYPE_COMPLEX_SYMMETRIC_LOWER ; } else { /* real symmetric, lower triangular part present */ *stype = STYPE_SYMMETRIC_LOWER ; } } else if (c == 'h') { /* "hermitian" matrix, lower triangular part present */ *stype = STYPE_SYMMETRIC_LOWER ; } else if (c == 's' && c2 == 'k') { /* "skew-symmetric" (real or complex), lower part present */ *stype = STYPE_SKEW_SYMMETRIC ; } else { /* bad format */ return (FALSE) ; } } else if (is_blank_line (buf)) { /* -------------------------------------------------------------- */ /* blank line or comment line */ /* -------------------------------------------------------------- */ continue ; } else { /* -------------------------------------------------------------- */ /* read the first data line and return */ /* -------------------------------------------------------------- */ /* format: nrow ncol nnz stype */ l1 = EMPTY ; l2 = EMPTY ; l3 = 0 ; l4 = 0 ; nitems = sscanf (buf, "%lg %lg %lg %lg\n", &l1, &l2, &l3, &l4) ; if (nitems < 2 || nitems > 4 || l1 > Int_max || l2 > Int_max) { /* invalid matrix */ return (FALSE) ; } *nrow = l1 ; *ncol = l2 ; if (nitems == 2) { /* a dense matrix */ if (!got_mm_header) { *mtype = CHOLMOD_DENSE ; *stype = STYPE_UNSYMMETRIC ; } } if (nitems == 3 || nitems == 4) { /* a sparse triplet matrix */ *nnz = l3 ; if (!got_mm_header) { *mtype = CHOLMOD_TRIPLET ; } } if (nitems == 4) { /* an stype specified here can only be 1, 0, or -1 */ if (l4 < 0) { *stype = STYPE_SYMMETRIC_LOWER ; } else if (l4 > 0) { *stype = STYPE_SYMMETRIC_UPPER ; } else { *stype = STYPE_UNSYMMETRIC ; } } if (*nrow != *ncol) { /* a rectangular matrix must be unsymmetric */ *stype = STYPE_UNSYMMETRIC ; } return (TRUE) ; } first = FALSE ; } } /* ========================================================================== */ /* === read_triplet ========================================================= */ /* ========================================================================== */ /* Header has already been read in, including first line (nrow ncol nnz stype). * Read the triplets. */ static cholmod_triplet *read_triplet ( /* ---- input ---- */ FILE *f, /* file to read from, must already be open */ size_t nrow, /* number of rows */ size_t ncol, /* number of columns */ size_t nnz, /* number of triplets in file to read */ int stype, /* stype from header, or "unknown" */ int prefer_unsym, /* if TRUE, always return T->stype of zero */ /* ---- workspace */ char *buf, /* of size MAXLINE+1 */ /* --------------- */ cholmod_common *Common ) { double x, z ; double *Tx ; Int *Ti, *Tj, *Rdeg, *Cdeg ; cholmod_triplet *T ; double l1, l2 ; Int nitems, xtype, unknown, k, nshould, is_lower, is_upper, one_based, i, j, imax, jmax, skew_symmetric, p, complex_symmetric ; size_t s, nnz2, extra ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* quick return for empty matrix */ /* ---------------------------------------------------------------------- */ if (nrow == 0 || ncol == 0 || nnz == 0) { /* return an empty matrix */ return (CHOLMOD(allocate_triplet) (nrow, ncol, 0, 0, CHOLMOD_REAL, Common)) ; } /* ---------------------------------------------------------------------- */ /* special stype cases: unknown, skew symmetric, and complex symmetric */ /* ---------------------------------------------------------------------- */ unknown = (stype == STYPE_UNKNOWN) ; skew_symmetric = (stype == STYPE_SKEW_SYMMETRIC) ; complex_symmetric = (stype == STYPE_COMPLEX_SYMMETRIC_LOWER) ; extra = 0 ; if (stype < STYPE_SYMMETRIC_LOWER || (prefer_unsym && stype != STYPE_UNSYMMETRIC)) { /* 999: unknown might be converted to unsymmetric */ /* 1: symmetric upper converted to unsym. if prefer_unsym is TRUE */ /* -1: symmetric lower converted to unsym. if prefer_unsym is TRUE */ /* -2: real or complex skew symmetric converted to unsymmetric */ /* -3: complex symmetric converted to unsymmetric */ stype = STYPE_UNSYMMETRIC ; extra = nnz ; } nnz2 = CHOLMOD(add_size_t) (nnz, extra, &ok) ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* s = nrow + ncol */ s = CHOLMOD(add_size_t) (nrow, ncol, &ok) ; if (!ok || nrow > Int_max || ncol > Int_max || nnz > Int_max) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (NULL) ; } CHOLMOD(allocate_work) (0, s, 0, Common) ; Rdeg = Common->Iwork ; /* size nrow */ Cdeg = Rdeg + nrow ; /* size ncol */ /* ---------------------------------------------------------------------- */ /* read the triplets */ /* ---------------------------------------------------------------------- */ is_lower = TRUE ; is_upper = TRUE ; one_based = TRUE ; imax = 0 ; jmax = 0 ; Tx = NULL ; Ti = NULL ; Tj = NULL ; xtype = 999 ; nshould = 0 ; for (k = 0 ; k < (Int) nnz ; k++) { /* ------------------------------------------------------------------ */ /* get the next triplet, skipping blank lines and comment lines */ /* ------------------------------------------------------------------ */ l1 = EMPTY ; l2 = EMPTY ; x = 0 ; z = 0 ; for ( ; ; ) { if (!get_line (f, buf)) { /* premature end of file - not enough triplets read in */ ERROR (CHOLMOD_INVALID, "premature EOF") ; return (NULL) ; } if (is_blank_line (buf)) { /* blank line or comment */ continue ; } nitems = sscanf (buf, "%lg %lg %lg %lg\n", &l1, &l2, &x, &z) ; x = fix_inf (x) ; z = fix_inf (z) ; break ; } nitems = (nitems == EOF) ? 0 : nitems ; i = l1 ; j = l2 ; /* ------------------------------------------------------------------ */ /* for first triplet: determine type and allocate triplet matrix */ /* ------------------------------------------------------------------ */ if (k == 0) { if (nitems < 2 || nitems > 4) { /* invalid matrix */ ERROR (CHOLMOD_INVALID, "invalid format") ; return (NULL) ; } else if (nitems == 2) { /* this will be converted into a real matrix later */ xtype = CHOLMOD_PATTERN ; } else if (nitems == 3) { xtype = CHOLMOD_REAL ; } else if (nitems == 4) { xtype = CHOLMOD_COMPLEX ; } /* the rest of the lines should have the same number of entries */ nshould = nitems ; /* allocate triplet matrix */ T = CHOLMOD(allocate_triplet) (nrow, ncol, nnz2, stype, (xtype == CHOLMOD_PATTERN ? CHOLMOD_REAL : xtype), Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } Ti = T->i ; Tj = T->j ; Tx = T->x ; T->nnz = nnz ; } /* ------------------------------------------------------------------ */ /* save the entry in the triplet matrix */ /* ------------------------------------------------------------------ */ if (nitems != nshould || i < 0 || j < 0) { /* wrong format, premature end-of-file, or negative indices */ CHOLMOD(free_triplet) (&T, Common) ; ERROR (CHOLMOD_INVALID, "invalid matrix file") ; return (NULL) ; } Ti [k] = i ; Tj [k] = j ; if (i < j) { /* this entry is in the upper triangular part */ is_lower = FALSE ; } if (i > j) { /* this entry is in the lower triangular part */ is_upper = FALSE ; } if (xtype == CHOLMOD_REAL) { Tx [k] = x ; } else if (xtype == CHOLMOD_COMPLEX) { Tx [2*k ] = x ; /* real part */ Tx [2*k+1] = z ; /* imaginary part */ } if (i == 0 || j == 0) { one_based = FALSE ; } imax = MAX (i, imax) ; jmax = MAX (j, jmax) ; } /* ---------------------------------------------------------------------- */ /* convert to zero-based */ /* ---------------------------------------------------------------------- */ if (one_based) { /* input matrix is one-based; convert matrix to zero-based */ for (k = 0 ; k < (Int) nnz ; k++) { Ti [k]-- ; Tj [k]-- ; } } if (one_based ? (imax > (Int) nrow || jmax > (Int) ncol) : (imax >= (Int) nrow || jmax >= (Int) ncol)) { /* indices out of range */ CHOLMOD(free_triplet) (&T, Common) ; ERROR (CHOLMOD_INVALID, "indices out of range") ; return (NULL) ; } /* ---------------------------------------------------------------------- */ /* determine the stype, if not yet known */ /* ---------------------------------------------------------------------- */ if (unknown) { if (is_lower && is_upper) { /* diagonal matrix, symmetric with upper part present */ stype = STYPE_SYMMETRIC_UPPER ; } else if (is_lower && !is_upper) { /* symmetric, lower triangular part present */ stype = STYPE_SYMMETRIC_LOWER ; } else if (!is_lower && is_upper) { /* symmetric, upper triangular part present */ stype = STYPE_SYMMETRIC_UPPER ; } else { /* unsymmetric */ stype = STYPE_UNSYMMETRIC ; extra = 0 ; } } /* ---------------------------------------------------------------------- */ /* add the remainder of symmetric, skew-symmetric or Hermitian matrices */ /* ---------------------------------------------------------------------- */ /* note that this step is not done for real symmetric or complex Hermitian * matrices, unless prefer_unsym is TRUE */ if (extra > 0) { p = nnz ; for (k = 0 ; k < (Int) nnz ; k++) { i = Ti [k] ; j = Tj [k] ; if (i != j) { Ti [p] = j ; Tj [p] = i ; if (xtype == CHOLMOD_REAL) { if (skew_symmetric) { Tx [p] = -Tx [k] ; } else { Tx [p] = Tx [k] ; } } else if (xtype == CHOLMOD_COMPLEX) { if (skew_symmetric) { Tx [2*p ] = -Tx [2*k ] ; Tx [2*p+1] = -Tx [2*k+1] ; } else if (complex_symmetric) { Tx [2*p ] = Tx [2*k ] ; Tx [2*p+1] = Tx [2*k+1] ; } else /* Hermitian */ { Tx [2*p ] = Tx [2*k ] ; Tx [2*p+1] = -Tx [2*k+1] ; } } p++ ; } } T->nnz = p ; nnz = p ; } T->stype = stype ; /* ---------------------------------------------------------------------- */ /* create values for a pattern-only matrix */ /* ---------------------------------------------------------------------- */ if (xtype == CHOLMOD_PATTERN) { if (stype == STYPE_UNSYMMETRIC || Common->prefer_binary) { /* unsymmetric case, or binary case */ for (k = 0 ; k < (Int) nnz ; k++) { Tx [k] = 1 ; } } else { /* compute the row and columm degrees (excluding the diagonal) */ for (i = 0 ; i < (Int) nrow ; i++) { Rdeg [i] = 0 ; } for (j = 0 ; j < (Int) ncol ; j++) { Cdeg [j] = 0 ; } for (k = 0 ; k < (Int) nnz ; k++) { i = Ti [k] ; j = Tj [k] ; if ((stype < 0 && i > j) || (stype > 0 && i < j)) { /* both a(i,j) and a(j,i) appear in the matrix */ Rdeg [i]++ ; Cdeg [j]++ ; Rdeg [j]++ ; Cdeg [i]++ ; } } /* assign the numerical values */ for (k = 0 ; k < (Int) nnz ; k++) { i = Ti [k] ; j = Tj [k] ; Tx [k] = (i == j) ? (1 + MAX (Rdeg [i], Cdeg [j])) : (-1) ; } } } /* ---------------------------------------------------------------------- */ /* return the new triplet matrix */ /* ---------------------------------------------------------------------- */ return (T) ; } /* ========================================================================== */ /* === read_dense =========================================================== */ /* ========================================================================== */ /* Header has already been read in, including first line (nrow ncol). * Read a dense matrix. */ static cholmod_dense *read_dense ( /* ---- input ---- */ FILE *f, /* file to read from, must already be open */ size_t nrow, /* number of rows */ size_t ncol, /* number of columns */ int stype, /* stype from header */ /* ---- workspace */ char *buf, /* of size MAXLINE+1 */ /* --------------- */ cholmod_common *Common ) { double x, z ; double *Xx = NULL ; cholmod_dense *X ; Int nitems, xtype = -1, nshould = 0, i, j, k, kup, first ; /* ---------------------------------------------------------------------- */ /* quick return for empty matrix */ /* ---------------------------------------------------------------------- */ if (nrow == 0 || ncol == 0) { /* return an empty dense matrix */ return (CHOLMOD(zeros) (nrow, ncol, CHOLMOD_REAL, Common)) ; } /* ---------------------------------------------------------------------- */ /* read the entries */ /* ---------------------------------------------------------------------- */ first = TRUE ; for (j = 0 ; j < (Int) ncol ; j++) { /* ------------------------------------------------------------------ */ /* get the row index of the first entry in the file for column j */ /* ------------------------------------------------------------------ */ if (stype == STYPE_UNSYMMETRIC) { i = 0 ; } else if (stype == STYPE_SKEW_SYMMETRIC) { i = j+1 ; } else /* real symmetric or complex Hermitian lower */ { i = j ; } /* ------------------------------------------------------------------ */ /* get column j */ /* ------------------------------------------------------------------ */ for ( ; i < (Int) nrow ; i++) { /* -------------------------------------------------------------- */ /* get the next entry, skipping blank lines and comment lines */ /* -------------------------------------------------------------- */ x = 0 ; z = 0 ; for ( ; ; ) { if (!get_line (f, buf)) { /* premature end of file - not enough entries read in */ ERROR (CHOLMOD_INVALID, "premature EOF") ; return (NULL) ; } if (is_blank_line (buf)) { /* blank line or comment */ continue ; } nitems = sscanf (buf, "%lg %lg\n", &x, &z) ; x = fix_inf (x) ; z = fix_inf (z) ; break ; } nitems = (nitems == EOF) ? 0 : nitems ; /* -------------------------------------------------------------- */ /* for first entry: determine type and allocate dense matrix */ /* -------------------------------------------------------------- */ if (first) { first = FALSE ; if (nitems < 1 || nitems > 2) { /* invalid matrix */ ERROR (CHOLMOD_INVALID, "invalid format") ; return (NULL) ; } else if (nitems == 1) { /* a real matrix */ xtype = CHOLMOD_REAL ; } else if (nitems == 2) { /* a complex matrix */ xtype = CHOLMOD_COMPLEX ; } /* the rest of the lines should have same number of entries */ nshould = nitems ; /* allocate the result */ X = CHOLMOD(zeros) (nrow, ncol, xtype, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } Xx = X->x ; } /* -------------------------------------------------------------- */ /* save the entry in the dense matrix */ /* -------------------------------------------------------------- */ if (nitems != nshould) { /* wrong format or premature end-of-file */ CHOLMOD(free_dense) (&X, Common) ; ERROR (CHOLMOD_INVALID, "invalid matrix file") ; return (NULL) ; } k = i + j*nrow ; kup = j + i*nrow ; if (xtype == CHOLMOD_REAL) { /* real matrix */ Xx [k] = x ; if (k != kup) { if (stype == STYPE_SYMMETRIC_LOWER) { /* real symmetric matrix */ Xx [kup] = x ; } else if (stype == STYPE_SKEW_SYMMETRIC) { /* real skew symmetric matrix */ Xx [kup] = -x ; } } } else if (xtype == CHOLMOD_COMPLEX) { Xx [2*k ] = x ; /* real part */ Xx [2*k+1] = z ; /* imaginary part */ if (k != kup) { if (stype == STYPE_SYMMETRIC_LOWER) { /* complex Hermitian */ Xx [2*kup ] = x ; /* real part */ Xx [2*kup+1] = -z ; /* imaginary part */ } else if (stype == STYPE_SKEW_SYMMETRIC) { /* complex skew symmetric */ Xx [2*kup ] = -x ; /* real part */ Xx [2*kup+1] = -z ; /* imaginary part */ } if (stype == STYPE_COMPLEX_SYMMETRIC_LOWER) { /* complex symmetric */ Xx [2*kup ] = x ; /* real part */ Xx [2*kup+1] = z ; /* imaginary part */ } } } } } /* ---------------------------------------------------------------------- */ /* return the new dense matrix */ /* ---------------------------------------------------------------------- */ return (X) ; } /* ========================================================================== */ /* === cholmod_read_triplet ================================================= */ /* ========================================================================== */ /* Read in a triplet matrix from a file. */ cholmod_triplet *CHOLMOD(read_triplet) ( /* ---- input ---- */ FILE *f, /* file to read from, must already be open */ /* --------------- */ cholmod_common *Common ) { char buf [MAXLINE+1] ; size_t nrow, ncol, nnz ; int stype, mtype ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (f, NULL) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* read the header and first data line */ /* ---------------------------------------------------------------------- */ if (!read_header (f, buf, &mtype, &nrow, &ncol, &nnz, &stype) || mtype != CHOLMOD_TRIPLET) { /* invalid matrix - this function can only read in a triplet matrix */ ERROR (CHOLMOD_INVALID, "invalid format") ; return (NULL) ; } /* ---------------------------------------------------------------------- */ /* read the triplet matrix */ /* ---------------------------------------------------------------------- */ return (read_triplet (f, nrow, ncol, nnz, stype, FALSE, buf, Common)) ; } /* ========================================================================== */ /* === cholmod_read_sparse ================================================== */ /* ========================================================================== */ /* Read a sparse matrix from a file. See cholmod_read_triplet for a discussion * of the file format. * * If Common->prefer_upper is TRUE (the default case), a symmetric matrix is * returned stored in upper-triangular form (A->stype == 1). */ cholmod_sparse *CHOLMOD(read_sparse) ( /* ---- input ---- */ FILE *f, /* file to read from, must already be open */ /* --------------- */ cholmod_common *Common ) { cholmod_sparse *A, *A2 ; cholmod_triplet *T ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (f, NULL) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* convert to a sparse matrix in compressed-column form */ /* ---------------------------------------------------------------------- */ T = CHOLMOD(read_triplet) (f, Common) ; A = CHOLMOD(triplet_to_sparse) (T, 0, Common) ; CHOLMOD(free_triplet) (&T, Common) ; if (Common->prefer_upper && A != NULL && A->stype == -1) { /* A=A' */ A2 = CHOLMOD(transpose) (A, 2, Common) ; CHOLMOD(free_sparse) (&A, Common) ; A = A2 ; } return (A) ; } /* ========================================================================== */ /* === cholmod_read_dense =================================================== */ /* ========================================================================== */ /* Read a dense matrix from a file. */ cholmod_dense *CHOLMOD(read_dense) ( /* ---- input ---- */ FILE *f, /* file to read from, must already be open */ /* --------------- */ cholmod_common *Common ) { char buf [MAXLINE+1] ; size_t nrow, ncol, nnz ; int stype, mtype ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (f, NULL) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* read the header and first data line */ /* ---------------------------------------------------------------------- */ if (!read_header (f, buf, &mtype, &nrow, &ncol, &nnz, &stype) || mtype != CHOLMOD_DENSE) { /* invalid matrix - this function can only read in a dense matrix */ ERROR (CHOLMOD_INVALID, "invalid format") ; return (NULL) ; } /* ---------------------------------------------------------------------- */ /* read the dense matrix */ /* ---------------------------------------------------------------------- */ return (read_dense (f, nrow, ncol, stype, buf, Common)) ; } /* ========================================================================== */ /* === cholmod_read_matrix ================================================== */ /* ========================================================================== */ /* Read a triplet matrix, sparse matrix or a dense matrix from a file. Returns * a void pointer to either a cholmod_triplet, cholmod_sparse, or cholmod_dense * object. The type of object is passed back to the caller as the mtype * argument. */ void *CHOLMOD(read_matrix) ( /* ---- input ---- */ FILE *f, /* file to read from, must already be open */ int prefer, /* If 0, a sparse matrix is always return as a * cholmod_triplet form. It can have any stype * (symmetric-lower, unsymmetric, or * symmetric-upper). * If 1, a sparse matrix is returned as an unsymmetric * cholmod_sparse form (A->stype == 0), with both * upper and lower triangular parts present. * This is what the MATLAB mread mexFunction does, * since MATLAB does not have an stype. * If 2, a sparse matrix is returned with an stype of 0 * or 1 (unsymmetric, or symmetric with upper part * stored). * This argument has no effect for dense matrices. */ /* ---- output---- */ int *mtype, /* CHOLMOD_TRIPLET, CHOLMOD_SPARSE or CHOLMOD_DENSE */ /* --------------- */ cholmod_common *Common ) { void *G = NULL ; cholmod_sparse *A, *A2 ; cholmod_triplet *T ; char buf [MAXLINE+1] ; size_t nrow, ncol, nnz ; int stype ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (f, NULL) ; RETURN_IF_NULL (mtype, NULL) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* read the header to determine the mtype */ /* ---------------------------------------------------------------------- */ if (!read_header (f, buf, mtype, &nrow, &ncol, &nnz, &stype)) { /* invalid matrix */ ERROR (CHOLMOD_INVALID, "invalid format") ; return (NULL) ; } /* ---------------------------------------------------------------------- */ /* read a matrix */ /* ---------------------------------------------------------------------- */ if (*mtype == CHOLMOD_TRIPLET) { /* read in the triplet matrix, converting to unsymmetric format if * prefer == 1 */ T = read_triplet (f, nrow, ncol, nnz, stype, prefer == 1, buf, Common) ; if (prefer == 0) { /* return matrix in its original triplet form */ G = T ; } else { /* return matrix in a compressed-column form */ A = CHOLMOD(triplet_to_sparse) (T, 0, Common) ; CHOLMOD(free_triplet) (&T, Common) ; if (A != NULL && prefer == 2 && A->stype == -1) { /* convert A from symmetric-lower to symmetric-upper */ A2 = CHOLMOD(transpose) (A, 2, Common) ; CHOLMOD(free_sparse) (&A, Common) ; A = A2 ; } *mtype = CHOLMOD_SPARSE ; G = A ; } } else if (*mtype == CHOLMOD_DENSE) { /* return a dense matrix */ G = read_dense (f, nrow, ncol, stype, buf, Common) ; } return (G) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Check/cholmod_write.c0000664000175000017500000005127614224052371020705 00000000000000/* ========================================================================== */ /* === Check/cholmod_write ================================================== */ /* ========================================================================== */ /* Write a matrix to a file in Matrix Market form. * * A can be sparse or full. * * If present and non-empty, A and Z must have the same dimension. Z contains * the explicit zero entries in the matrix (which MATLAB drops). The entries * of Z appear as explicit zeros in the output file. Z is optional. If it is * an empty matrix it is ignored. Z must be sparse or empty, if present. * It is ignored if A is full. * * filename is the name of the output file. comments is file whose * contents are include after the Matrix Market header and before the first * data line. Ignored if an empty string or not present. * * Except for the workspace used by cholmod_symmetry (ncol integers) for * the sparse case, these routines use no workspace at all. */ #ifndef NCHECK #include "cholmod_config.h" #include "cholmod_internal.h" #include "cholmod_check.h" #include "cholmod_matrixops.h" #include #include #define MMLEN 1024 #define MAXLINE MMLEN+6 /* ========================================================================== */ /* === include_comments ===================================================== */ /* ========================================================================== */ /* Read in the comments file, if it exists, and copy it to the Matrix Market * file. A "%" is prepended to each line. Returns TRUE if successful, FALSE * otherwise. */ static int include_comments (FILE *f, const char *comments) { FILE *cf = NULL ; char buffer [MAXLINE] ; int ok = TRUE ; if (comments != NULL && comments [0] != '\0') { cf = fopen (comments, "r") ; if (cf == NULL) { return (FALSE) ; } while (ok && fgets (buffer, MAXLINE, cf) != NULL) { /* ensure the line is not too long */ buffer [MMLEN-1] = '\0' ; buffer [MMLEN-2] = '\n' ; ok = ok && (fprintf (f, "%%%s", buffer) > 0) ; } fclose (cf) ; } return (ok) ; } /* ========================================================================== */ /* === get_value ============================================================ */ /* ========================================================================== */ /* Get the pth value in the matrix. */ static void get_value ( double *Ax, /* real values, or real/imag. for CHOLMOD_COMPLEX type */ double *Az, /* imaginary values for CHOLMOD_ZOMPLEX type */ Int p, /* get the pth entry */ Int xtype, /* A->xtype: pattern, real, complex, or zomplex */ double *x, /* the real part */ double *z /* the imaginary part */ ) { switch (xtype) { case CHOLMOD_PATTERN: *x = 1 ; *z = 0 ; break ; case CHOLMOD_REAL: *x = Ax [p] ; *z = 0 ; break ; case CHOLMOD_COMPLEX: *x = Ax [2*p] ; *z = Ax [2*p+1] ; break ; case CHOLMOD_ZOMPLEX: *x = Ax [p] ; *z = Az [p] ; break ; } } /* ========================================================================== */ /* === print_value ========================================================== */ /* ========================================================================== */ /* Print a numeric value to the file, using the shortest format that ensures * the value is written precisely. Returns TRUE if successful, FALSE otherwise. */ static int print_value ( FILE *f, /* file to print to */ double x, /* value to print */ Int is_integer /* TRUE if printing as an integer */ ) { double y ; char s [MAXLINE], *p ; Int i, dest = 0, src = 0 ; int width, ok ; if (is_integer) { i = (Int) x ; ok = (fprintf (f, ID, i) > 0) ; return (ok) ; } /* ---------------------------------------------------------------------- */ /* handle Inf and NaN */ /* ---------------------------------------------------------------------- */ /* change -inf to -HUGE_DOUBLE, and change +inf and nan to +HUGE_DOUBLE */ if (CHOLMOD_IS_NAN (x) || x >= HUGE_DOUBLE) { x = HUGE_DOUBLE ; } else if (x <= -HUGE_DOUBLE) { x = -HUGE_DOUBLE ; } /* ---------------------------------------------------------------------- */ /* find the smallest acceptable precision */ /* ---------------------------------------------------------------------- */ for (width = 6 ; width < 20 ; width++) { sprintf (s, "%.*g", width, x) ; sscanf (s, "%lg", &y) ; if (x == y) break ; } /* ---------------------------------------------------------------------- */ /* shorten the string */ /* ---------------------------------------------------------------------- */ /* change "e+0" to "e", change "e+" to "e", and change "e-0" to "e-" */ for (i = 0 ; i < MAXLINE && s [i] != '\0' ; i++) { if (s [i] == 'e') { if (s [i+1] == '+') { dest = i+1 ; if (s [i+2] == '0') { /* delete characters s[i+1] and s[i+2] */ src = i+3 ; } else { /* delete characters s[i+1] */ src = i+2 ; } } else if (s [i+1] == '-') { dest = i+2 ; if (s [i+2] == '0') { /* delete character s[i+2] */ src = i+3 ; } else { /* no change */ break ; } } while (s [src] != '\0') { s [dest++] = s [src++] ; } s [dest] = '\0' ; break ; } } /* delete the leading "0" if present and not necessary */ p = s ; s [MAXLINE-1] = '\0' ; i = strlen (s) ; if (i > 2 && s [0] == '0' && s [1] == '.') { /* change "0.x" to ".x" */ p = s + 1 ; } else if (i > 3 && s [0] == '-' && s [1] == '0' && s [2] == '.') { /* change "-0.x" to "-.x" */ s [1] = '-' ; p = s + 1 ; } #if 0 /* double-check */ i = sscanf (p, "%lg", &z) ; if (i != 1 || y != z) { /* oops! something went wrong in the "e+0" edit, above. */ /* this "cannot" happen */ sprintf (s, "%.*g", width, x) ; p = s ; } #endif /* ---------------------------------------------------------------------- */ /* print the value to the file */ /* ---------------------------------------------------------------------- */ ok = (fprintf (f, "%s", p) > 0) ; return (ok) ; } /* ========================================================================== */ /* === print_triplet ======================================================== */ /* ========================================================================== */ /* Print a triplet, converting it to one-based. Returns TRUE if successful, * FALSE otherwise. */ static int print_triplet ( FILE *f, /* file to print to */ Int is_binary, /* TRUE if file is "pattern" */ Int is_complex, /* TRUE if file is "complex" */ Int is_integer, /* TRUE if file is "integer" */ Int i, /* row index (zero-based) */ Int j, /* column index (zero-based) */ double x, /* real part */ double z /* imaginary part */ ) { int ok ; ok = (fprintf (f, ID " " ID, 1+i, 1+j) > 0) ; if (!is_binary) { fprintf (f, " ") ; ok = ok && print_value (f, x, is_integer) ; if (is_complex) { fprintf (f, " ") ; ok = ok && print_value (f, z, is_integer) ; } } ok = ok && (fprintf (f, "\n") > 0) ; return (ok) ; } /* ========================================================================== */ /* === ntriplets ============================================================ */ /* ========================================================================== */ /* Compute the number of triplets that will be printed to the file * from the matrix A. */ static Int ntriplets ( cholmod_sparse *A, /* matrix that will be printed */ Int is_sym /* TRUE if the file is symmetric (lower part only)*/ ) { Int *Ap, *Ai, *Anz, packed, i, j, p, pend, ncol, stype, nz = 0 ; if (A == NULL) { /* the Z matrix is NULL */ return (0) ; } stype = A->stype ; Ap = A->p ; Ai = A->i ; Anz = A->nz ; packed = A->packed ; ncol = A->ncol ; for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? Ap [j+1] : p + Anz [j] ; for ( ; p < pend ; p++) { i = Ai [p] ; if ((stype < 0 && i >= j) || (stype == 0 && (i >= j || !is_sym))) { /* CHOLMOD matrix is symmetric-lower (and so is the file); * or CHOLMOD matrix is unsymmetric and either A(i,j) is in * the lower part or the file is unsymmetric. */ nz++ ; } else if (stype > 0 && i <= j) { /* CHOLMOD matrix is symmetric-upper, but the file is * symmetric-lower. Need to transpose the entry. */ nz++ ; } } } return (nz) ; } /* ========================================================================== */ /* === cholmod_write_sparse ================================================= */ /* ========================================================================== */ /* Write a sparse matrix to a file in Matrix Market format. Optionally include * comments, and print explicit zero entries given by the pattern of the Z * matrix. If not NULL, the Z matrix must have the same dimensions and stype * as A. * * Returns the symmetry in which the matrix was printed (1 to 7, see the * CHOLMOD_MM_* codes in CHOLMOD/Include/cholmod_core.h), or -1 on failure. * * If A and Z are sorted on input, and either unsymmetric (stype = 0) or * symmetric-lower (stype < 0), and if A and Z do not overlap, then the triplets * are sorted, first by column and then by row index within each column, with * no duplicate entries. If all the above holds except stype > 0, then the * triplets are sorted by row first and then column. */ int CHOLMOD(write_sparse) ( /* ---- input ---- */ FILE *f, /* file to write to, must already be open */ cholmod_sparse *A, /* matrix to print */ cholmod_sparse *Z, /* optional matrix with pattern of explicit zeros */ const char *comments, /* optional filename of comments to include */ /* --------------- */ cholmod_common *Common ) { double x = 0, z = 0 ; double *Ax, *Az ; Int *Ap, *Ai, *Anz, *Zp, *Zi, *Znz ; Int nrow, ncol, is_complex, symmetry, i, j, q, iz, p, nz, is_binary, stype, is_integer, asym, is_sym, xtype, apacked, zpacked, pend, qend, zsym ; int ok ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (f, EMPTY) ; RETURN_IF_NULL (A, EMPTY) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, EMPTY) ; if (Z != NULL && (Z->nrow == 0 || Z->ncol == 0)) { /* Z is non-NULL but empty, so treat it as a NULL matrix */ Z = NULL ; } if (Z != NULL) { RETURN_IF_XTYPE_INVALID (Z, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, EMPTY) ; if (Z->nrow != A->nrow || Z->ncol != A->ncol || Z->stype != A->stype) { ERROR (CHOLMOD_INVALID, "dimension or type of A and Z mismatch") ; return (EMPTY) ; } } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* get the A matrix */ /* ---------------------------------------------------------------------- */ Ap = A->p ; Ai = A->i ; Ax = A->x ; Az = A->z ; Anz = A->nz ; nrow = A->nrow ; ncol = A->ncol ; xtype = A->xtype ; apacked = A->packed ; if (xtype == CHOLMOD_PATTERN) { /* a CHOLMOD pattern matrix is printed as "pattern" in the file */ is_binary = TRUE ; is_integer = FALSE ; is_complex = FALSE ; } else if (xtype == CHOLMOD_REAL) { /* determine if a real matrix is in fact binary or integer */ is_binary = TRUE ; is_integer = TRUE ; is_complex = FALSE ; for (j = 0 ; (is_binary || is_integer) && j < ncol ; j++) { p = Ap [j] ; pend = (apacked) ? Ap [j+1] : p + Anz [j] ; for ( ; (is_binary || is_integer) && p < pend ; p++) { x = Ax [p] ; if (x != 1) { is_binary = FALSE ; } /* convert to Int and then back to double */ i = (Int) x ; z = (double) i ; if (z != x) { is_integer = FALSE ; } } } } else { /* a CHOLMOD complex matrix is printed as "complex" in the file */ is_binary = FALSE ; is_integer = FALSE ; is_complex = TRUE ; } /* ---------------------------------------------------------------------- */ /* get the Z matrix (only consider the pattern) */ /* ---------------------------------------------------------------------- */ Zp = NULL ; Zi = NULL ; Znz = NULL ; zpacked = TRUE ; if (Z != NULL) { Zp = Z->p ; Zi = Z->i ; Znz = Z->nz ; zpacked = Z->packed ; } /* ---------------------------------------------------------------------- */ /* determine the symmetry of A and Z */ /* ---------------------------------------------------------------------- */ stype = A->stype ; if (A->nrow != A->ncol) { asym = CHOLMOD_MM_RECTANGULAR ; } else if (stype != 0) { /* CHOLMOD's A and Z matrices have a symmetric (and matching) stype. * Note that the diagonal is not checked. */ asym = is_complex ? CHOLMOD_MM_HERMITIAN : CHOLMOD_MM_SYMMETRIC ; } else if (!A->sorted) { /* A is in unsymmetric storage, but unsorted */ asym = CHOLMOD_MM_UNSYMMETRIC ; } else { /* CHOLMOD's stype is zero (stored in unsymmetric form) */ asym = EMPTY ; zsym = EMPTY ; #ifndef NMATRIXOPS /* determine if the matrices are in fact symmetric or Hermitian */ asym = CHOLMOD(symmetry) (A, 1, NULL, NULL, NULL, NULL, Common) ; zsym = (Z == NULL) ? 999 : CHOLMOD(symmetry) (Z, 1, NULL, NULL, NULL, NULL, Common) ; #endif if (asym == EMPTY || zsym <= CHOLMOD_MM_UNSYMMETRIC) { /* not computed, out of memory, or Z is unsymmetric */ asym = CHOLMOD_MM_UNSYMMETRIC ; } } /* ---------------------------------------------------------------------- */ /* write the Matrix Market header */ /* ---------------------------------------------------------------------- */ ok = fprintf (f, "%%%%MatrixMarket matrix coordinate") > 0 ; if (is_complex) { ok = ok && (fprintf (f, " complex") > 0) ; } else if (is_binary) { ok = ok && (fprintf (f, " pattern") > 0) ; } else if (is_integer) { ok = ok && (fprintf (f, " integer") > 0) ; } else { ok = ok && (fprintf (f, " real") > 0) ; } is_sym = FALSE ; switch (asym) { case CHOLMOD_MM_RECTANGULAR: case CHOLMOD_MM_UNSYMMETRIC: /* A is rectangular or unsymmetric */ ok = ok && (fprintf (f, " general\n") > 0) ; is_sym = FALSE ; symmetry = CHOLMOD_MM_UNSYMMETRIC ; break ; case CHOLMOD_MM_SYMMETRIC: case CHOLMOD_MM_SYMMETRIC_POSDIAG: /* A is symmetric */ ok = ok && (fprintf (f, " symmetric\n") > 0) ; is_sym = TRUE ; symmetry = CHOLMOD_MM_SYMMETRIC ; break ; case CHOLMOD_MM_HERMITIAN: case CHOLMOD_MM_HERMITIAN_POSDIAG: /* A is Hermitian */ ok = ok && (fprintf (f, " Hermitian\n") > 0) ; is_sym = TRUE ; symmetry = CHOLMOD_MM_HERMITIAN ; break ; case CHOLMOD_MM_SKEW_SYMMETRIC: /* A is skew symmetric */ ok = ok && (fprintf (f, " skew-symmetric\n") > 0) ; is_sym = TRUE ; symmetry = CHOLMOD_MM_SKEW_SYMMETRIC ; break ; } /* ---------------------------------------------------------------------- */ /* include the comments if present */ /* ---------------------------------------------------------------------- */ ok = ok && include_comments (f, comments) ; /* ---------------------------------------------------------------------- */ /* write a sparse matrix (A and Z) */ /* ---------------------------------------------------------------------- */ nz = ntriplets (A, is_sym) + ntriplets (Z, is_sym) ; /* write the first data line, with nrow, ncol, and # of triplets */ ok = ok && (fprintf (f, ID " " ID " " ID "\n", nrow, ncol, nz) > 0) ; for (j = 0 ; ok && j < ncol ; j++) { /* merge column of A and Z */ p = Ap [j] ; pend = (apacked) ? Ap [j+1] : p + Anz [j] ; q = (Z == NULL) ? 0 : Zp [j] ; qend = (Z == NULL) ? 0 : ((zpacked) ? Zp [j+1] : q + Znz [j]) ; while (ok) { /* get the next row index from A and Z */ i = (p < pend) ? Ai [p] : (nrow+1) ; iz = (q < qend) ? Zi [q] : (nrow+2) ; if (i <= iz) { /* get A(i,j), or quit if both A and Z are exhausted */ if (i == nrow+1) break ; get_value (Ax, Az, p, xtype, &x, &z) ; p++ ; } else { /* get Z(i,j) */ i = iz ; x = 0 ; z = 0 ; q++ ; } if ((stype < 0 && i >= j) || (stype == 0 && (i >= j || !is_sym))) { /* CHOLMOD matrix is symmetric-lower (and so is the file); * or CHOLMOD matrix is unsymmetric and either A(i,j) is in * the lower part or the file is unsymmetric. */ ok = ok && print_triplet (f, is_binary, is_complex, is_integer, i,j, x,z) ; } else if (stype > 0 && i <= j) { /* CHOLMOD matrix is symmetric-upper, but the file is * symmetric-lower. Need to transpose the entry. If the * matrix is real, the complex part is ignored. If the matrix * is complex, it Hermitian. */ ASSERT (IMPLIES (is_complex, asym == CHOLMOD_MM_HERMITIAN)) ; if (z != 0) { z = -z ; } ok = ok && print_triplet (f, is_binary, is_complex, is_integer, j,i, x,z) ; } } } if (!ok) { ERROR (CHOLMOD_INVALID, "error reading/writing file") ; return (EMPTY) ; } return (asym) ; } /* ========================================================================== */ /* === cholmod_write_dense ================================================== */ /* ========================================================================== */ /* Write a dense matrix to a file in Matrix Market format. Optionally include * comments. Returns > 0 if successful, -1 otherwise (1 if rectangular, 2 if * square). Future versions may return 1 to 7 on success (a CHOLMOD_MM_* code, * just as cholmod_write_sparse does). * * A dense matrix is written in "general" format; symmetric formats in the * Matrix Market standard are not exploited. */ int CHOLMOD(write_dense) ( /* ---- input ---- */ FILE *f, /* file to write to, must already be open */ cholmod_dense *X, /* matrix to print */ const char *comments, /* optional filename of comments to include */ /* --------------- */ cholmod_common *Common ) { double x = 0, z = 0 ; double *Xx, *Xz ; Int nrow, ncol, is_complex, i, j, xtype, p ; int ok ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (f, EMPTY) ; RETURN_IF_NULL (X, EMPTY) ; RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, EMPTY) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* get the X matrix */ /* ---------------------------------------------------------------------- */ Xx = X->x ; Xz = X->z ; nrow = X->nrow ; ncol = X->ncol ; xtype = X->xtype ; is_complex = (xtype == CHOLMOD_COMPLEX) || (xtype == CHOLMOD_ZOMPLEX) ; /* ---------------------------------------------------------------------- */ /* write the Matrix Market header */ /* ---------------------------------------------------------------------- */ ok = (fprintf (f, "%%%%MatrixMarket matrix array") > 0) ; if (is_complex) { ok = ok && (fprintf (f, " complex general\n") > 0) ; } else { ok = ok && (fprintf (f, " real general\n") > 0) ; } /* ---------------------------------------------------------------------- */ /* include the comments if present */ /* ---------------------------------------------------------------------- */ ok = ok && include_comments (f, comments) ; /* ---------------------------------------------------------------------- */ /* write a dense matrix */ /* ---------------------------------------------------------------------- */ /* write the first data line, with nrow and ncol */ ok = ok && (fprintf (f, ID " " ID "\n", nrow, ncol) > 0) ; Xx = X->x ; Xz = X->z ; for (j = 0 ; ok && j < ncol ; j++) { for (i = 0 ; ok && i < nrow ; i++) { p = i + j*nrow ; get_value (Xx, Xz, p, xtype, &x, &z) ; ok = ok && print_value (f, x, FALSE) ; if (is_complex) { ok = ok && (fprintf (f, " ") > 0) ; ok = ok && print_value (f, z, FALSE) ; } ok = ok && (fprintf (f, "\n") > 0) ; } } if (!ok) { ERROR (CHOLMOD_INVALID, "error reading/writing file") ; return (EMPTY) ; } return ((nrow == ncol) ? CHOLMOD_MM_UNSYMMETRIC : CHOLMOD_MM_RECTANGULAR) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Check/License.txt0000664000175000017500000000204214224052371020010 00000000000000CHOLMOD/Check Module. Copyright (C) 2005-2006, Timothy A. Davis CHOLMOD is also available under other licenses; contact authors for details. http://www.suitesparse.com Note that this license is for the CHOLMOD/Check module only. All CHOLMOD modules are licensed separately. -------------------------------------------------------------------------------- This Module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This Module 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this Module; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Check/lesser.txt0000664000175000017500000006350014224052371017731 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/0000755000175000017500000000000014400711326016507 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/Makefile.am0000664000175000017500000000134614224052371020473 00000000000000noinst_LTLIBRARIES = cholmodcholesky.la cholmodcholesky_la_SOURCES = cholmod_amd.c cholmod_analyze.c \ cholmod_colamd.c cholmod_etree.c cholmod_factorize.c \ cholmod_postorder.c cholmod_rcond.c cholmod_resymbol.c \ cholmod_rowcolcounts.c cholmod_rowfac.c cholmod_solve.c \ cholmod_spsolve.c cholmodcholesky_la_CPPFLAGS = -DNPARTITION \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include \ -I$(top_srcdir)/src/modules/glm/SSparse/AMD/Include \ -I$(top_srcdir)/src/modules/glm/SSparse/COLAMD/Include cholmodcholesky_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt lesser.txt t_cholmod_lsolve.c \ t_cholmod_ltsolve.c t_cholmod_rowfac.c t_cholmod_solve.c JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/Makefile.in0000644000175000017500000011334414400675236020513 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/CHOLMOD/Cholesky ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) cholmodcholesky_la_LIBADD = am_cholmodcholesky_la_OBJECTS = cholmodcholesky_la-cholmod_amd.lo \ cholmodcholesky_la-cholmod_analyze.lo \ cholmodcholesky_la-cholmod_colamd.lo \ cholmodcholesky_la-cholmod_etree.lo \ cholmodcholesky_la-cholmod_factorize.lo \ cholmodcholesky_la-cholmod_postorder.lo \ cholmodcholesky_la-cholmod_rcond.lo \ cholmodcholesky_la-cholmod_resymbol.lo \ cholmodcholesky_la-cholmod_rowcolcounts.lo \ cholmodcholesky_la-cholmod_rowfac.lo \ cholmodcholesky_la-cholmod_solve.lo \ cholmodcholesky_la-cholmod_spsolve.lo cholmodcholesky_la_OBJECTS = $(am_cholmodcholesky_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = cholmodcholesky_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(cholmodcholesky_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/cholmodcholesky_la-cholmod_amd.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_analyze.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_colamd.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_etree.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_factorize.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_postorder.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_rcond.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_resymbol.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_rowcolcounts.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_rowfac.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_solve.Plo \ ./$(DEPDIR)/cholmodcholesky_la-cholmod_spsolve.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(cholmodcholesky_la_SOURCES) DIST_SOURCES = $(cholmodcholesky_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = cholmodcholesky.la cholmodcholesky_la_SOURCES = cholmod_amd.c cholmod_analyze.c \ cholmod_colamd.c cholmod_etree.c cholmod_factorize.c \ cholmod_postorder.c cholmod_rcond.c cholmod_resymbol.c \ cholmod_rowcolcounts.c cholmod_rowfac.c cholmod_solve.c \ cholmod_spsolve.c cholmodcholesky_la_CPPFLAGS = -DNPARTITION \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include \ -I$(top_srcdir)/src/modules/glm/SSparse/AMD/Include \ -I$(top_srcdir)/src/modules/glm/SSparse/COLAMD/Include cholmodcholesky_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt lesser.txt t_cholmod_lsolve.c \ t_cholmod_ltsolve.c t_cholmod_rowfac.c t_cholmod_solve.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Cholesky/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Cholesky/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } cholmodcholesky.la: $(cholmodcholesky_la_OBJECTS) $(cholmodcholesky_la_DEPENDENCIES) $(EXTRA_cholmodcholesky_la_DEPENDENCIES) $(AM_V_CCLD)$(cholmodcholesky_la_LINK) $(cholmodcholesky_la_OBJECTS) $(cholmodcholesky_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_amd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_analyze.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_colamd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_etree.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_factorize.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_postorder.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_rcond.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_resymbol.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_rowcolcounts.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_rowfac.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_solve.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcholesky_la-cholmod_spsolve.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< cholmodcholesky_la-cholmod_amd.lo: cholmod_amd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_amd.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_amd.Tpo -c -o cholmodcholesky_la-cholmod_amd.lo `test -f 'cholmod_amd.c' || echo '$(srcdir)/'`cholmod_amd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_amd.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_amd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_amd.c' object='cholmodcholesky_la-cholmod_amd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_amd.lo `test -f 'cholmod_amd.c' || echo '$(srcdir)/'`cholmod_amd.c cholmodcholesky_la-cholmod_analyze.lo: cholmod_analyze.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_analyze.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_analyze.Tpo -c -o cholmodcholesky_la-cholmod_analyze.lo `test -f 'cholmod_analyze.c' || echo '$(srcdir)/'`cholmod_analyze.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_analyze.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_analyze.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_analyze.c' object='cholmodcholesky_la-cholmod_analyze.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_analyze.lo `test -f 'cholmod_analyze.c' || echo '$(srcdir)/'`cholmod_analyze.c cholmodcholesky_la-cholmod_colamd.lo: cholmod_colamd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_colamd.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_colamd.Tpo -c -o cholmodcholesky_la-cholmod_colamd.lo `test -f 'cholmod_colamd.c' || echo '$(srcdir)/'`cholmod_colamd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_colamd.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_colamd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_colamd.c' object='cholmodcholesky_la-cholmod_colamd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_colamd.lo `test -f 'cholmod_colamd.c' || echo '$(srcdir)/'`cholmod_colamd.c cholmodcholesky_la-cholmod_etree.lo: cholmod_etree.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_etree.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_etree.Tpo -c -o cholmodcholesky_la-cholmod_etree.lo `test -f 'cholmod_etree.c' || echo '$(srcdir)/'`cholmod_etree.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_etree.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_etree.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_etree.c' object='cholmodcholesky_la-cholmod_etree.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_etree.lo `test -f 'cholmod_etree.c' || echo '$(srcdir)/'`cholmod_etree.c cholmodcholesky_la-cholmod_factorize.lo: cholmod_factorize.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_factorize.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_factorize.Tpo -c -o cholmodcholesky_la-cholmod_factorize.lo `test -f 'cholmod_factorize.c' || echo '$(srcdir)/'`cholmod_factorize.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_factorize.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_factorize.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_factorize.c' object='cholmodcholesky_la-cholmod_factorize.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_factorize.lo `test -f 'cholmod_factorize.c' || echo '$(srcdir)/'`cholmod_factorize.c cholmodcholesky_la-cholmod_postorder.lo: cholmod_postorder.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_postorder.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_postorder.Tpo -c -o cholmodcholesky_la-cholmod_postorder.lo `test -f 'cholmod_postorder.c' || echo '$(srcdir)/'`cholmod_postorder.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_postorder.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_postorder.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_postorder.c' object='cholmodcholesky_la-cholmod_postorder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_postorder.lo `test -f 'cholmod_postorder.c' || echo '$(srcdir)/'`cholmod_postorder.c cholmodcholesky_la-cholmod_rcond.lo: cholmod_rcond.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_rcond.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_rcond.Tpo -c -o cholmodcholesky_la-cholmod_rcond.lo `test -f 'cholmod_rcond.c' || echo '$(srcdir)/'`cholmod_rcond.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_rcond.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_rcond.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_rcond.c' object='cholmodcholesky_la-cholmod_rcond.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_rcond.lo `test -f 'cholmod_rcond.c' || echo '$(srcdir)/'`cholmod_rcond.c cholmodcholesky_la-cholmod_resymbol.lo: cholmod_resymbol.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_resymbol.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_resymbol.Tpo -c -o cholmodcholesky_la-cholmod_resymbol.lo `test -f 'cholmod_resymbol.c' || echo '$(srcdir)/'`cholmod_resymbol.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_resymbol.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_resymbol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_resymbol.c' object='cholmodcholesky_la-cholmod_resymbol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_resymbol.lo `test -f 'cholmod_resymbol.c' || echo '$(srcdir)/'`cholmod_resymbol.c cholmodcholesky_la-cholmod_rowcolcounts.lo: cholmod_rowcolcounts.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_rowcolcounts.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_rowcolcounts.Tpo -c -o cholmodcholesky_la-cholmod_rowcolcounts.lo `test -f 'cholmod_rowcolcounts.c' || echo '$(srcdir)/'`cholmod_rowcolcounts.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_rowcolcounts.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_rowcolcounts.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_rowcolcounts.c' object='cholmodcholesky_la-cholmod_rowcolcounts.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_rowcolcounts.lo `test -f 'cholmod_rowcolcounts.c' || echo '$(srcdir)/'`cholmod_rowcolcounts.c cholmodcholesky_la-cholmod_rowfac.lo: cholmod_rowfac.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_rowfac.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_rowfac.Tpo -c -o cholmodcholesky_la-cholmod_rowfac.lo `test -f 'cholmod_rowfac.c' || echo '$(srcdir)/'`cholmod_rowfac.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_rowfac.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_rowfac.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_rowfac.c' object='cholmodcholesky_la-cholmod_rowfac.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_rowfac.lo `test -f 'cholmod_rowfac.c' || echo '$(srcdir)/'`cholmod_rowfac.c cholmodcholesky_la-cholmod_solve.lo: cholmod_solve.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_solve.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_solve.Tpo -c -o cholmodcholesky_la-cholmod_solve.lo `test -f 'cholmod_solve.c' || echo '$(srcdir)/'`cholmod_solve.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_solve.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_solve.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_solve.c' object='cholmodcholesky_la-cholmod_solve.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_solve.lo `test -f 'cholmod_solve.c' || echo '$(srcdir)/'`cholmod_solve.c cholmodcholesky_la-cholmod_spsolve.lo: cholmod_spsolve.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcholesky_la-cholmod_spsolve.lo -MD -MP -MF $(DEPDIR)/cholmodcholesky_la-cholmod_spsolve.Tpo -c -o cholmodcholesky_la-cholmod_spsolve.lo `test -f 'cholmod_spsolve.c' || echo '$(srcdir)/'`cholmod_spsolve.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcholesky_la-cholmod_spsolve.Tpo $(DEPDIR)/cholmodcholesky_la-cholmod_spsolve.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_spsolve.c' object='cholmodcholesky_la-cholmod_spsolve.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcholesky_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcholesky_la-cholmod_spsolve.lo `test -f 'cholmod_spsolve.c' || echo '$(srcdir)/'`cholmod_spsolve.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_amd.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_analyze.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_colamd.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_etree.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_factorize.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_postorder.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_rcond.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_resymbol.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_rowcolcounts.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_rowfac.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_solve.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_spsolve.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_amd.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_analyze.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_colamd.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_etree.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_factorize.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_postorder.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_rcond.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_resymbol.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_rowcolcounts.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_rowfac.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_solve.Plo -rm -f ./$(DEPDIR)/cholmodcholesky_la-cholmod_spsolve.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_amd.c0000664000175000017500000001521614224052371021052 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_amd ================================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* CHOLMOD interface to the AMD ordering routine. Orders A if the matrix is * symmetric. On output, Perm [k] = i if row/column i of A is the kth * row/column of P*A*P'. This corresponds to A(p,p) in MATLAB notation. * * If A is unsymmetric, cholmod_amd orders A*A'. On output, Perm [k] = i if * row/column i of A*A' is the kth row/column of P*A*A'*P'. This corresponds to * A(p,:)*A(p,:)' in MATLAB notation. If f is present, A(p,f)*A(p,f)' is * ordered. * * Computes the flop count for a subsequent LL' factorization, the number * of nonzeros in L, and the number of nonzeros in the matrix ordered (A, * A*A' or A(:,f)*A(:,f)'). * * workspace: Iwork (6*nrow). Head (nrow). * * Allocates a temporary copy of A+A' or A*A' (with * both upper and lower triangular parts) as input to AMD. * * Supports any xtype (pattern, real, complex, or zomplex) */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "amd.h" #include "cholmod_cholesky.h" #if (!defined (AMD_VERSION) || (AMD_VERSION < AMD_VERSION_CODE (2,0))) #error "AMD v2.0 or later is required" #endif /* ========================================================================== */ /* === cholmod_amd ========================================================== */ /* ========================================================================== */ int CHOLMOD(amd) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* ---- output --- */ Int *Perm, /* size A->nrow, output permutation */ /* --------------- */ cholmod_common *Common ) { double Info [AMD_INFO], Control2 [AMD_CONTROL], *Control ; Int *Cp, *Len, *Nv, *Head, *Elen, *Degree, *Wi, *Iwork, *Next ; cholmod_sparse *C ; Int j, n, cnz ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; n = A->nrow ; RETURN_IF_NULL (Perm, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; Common->status = CHOLMOD_OK ; if (n == 0) { /* nothing to do */ Common->fl = 0 ; Common->lnz = 0 ; Common->anz = 0 ; return (TRUE) ; } /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ /* Note: this is less than the space used in cholmod_analyze, so if * cholmod_amd is being called by that routine, no space will be * allocated. */ /* s = MAX (6*n, A->ncol) */ s = CHOLMOD(mult_size_t) (n, 6, &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } s = MAX (s, A->ncol) ; CHOLMOD(allocate_work) (n, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } Iwork = Common->Iwork ; Degree = Iwork ; /* size n */ Wi = Iwork + n ; /* size n */ Len = Iwork + 2*((size_t) n) ; /* size n */ Nv = Iwork + 3*((size_t) n) ; /* size n */ Next = Iwork + 4*((size_t) n) ; /* size n */ Elen = Iwork + 5*((size_t) n) ; /* size n */ Head = Common->Head ; /* size n+1, but only n is used */ /* ---------------------------------------------------------------------- */ /* construct the input matrix for AMD */ /* ---------------------------------------------------------------------- */ if (A->stype == 0) { /* C = A*A' or A(:,f)*A(:,f)', add extra space of nnz(C)/2+n to C */ C = CHOLMOD(aat) (A, fset, fsize, -2, Common) ; } else { /* C = A+A', but use only the upper triangular part of A if A->stype = 1 * and only the lower part of A if A->stype = -1. Add extra space of * nnz(C)/2+n to C. */ C = CHOLMOD(copy) (A, 0, -2, Common) ; } if (Common->status < CHOLMOD_OK) { /* out of memory, fset invalid, or other error */ return (FALSE) ; } Cp = C->p ; for (j = 0 ; j < n ; j++) { Len [j] = Cp [j+1] - Cp [j] ; } /* C does not include the diagonal, and both upper and lower parts. * Common->anz includes the diagonal, and just the lower part of C */ cnz = Cp [n] ; Common->anz = cnz / 2 + n ; /* ---------------------------------------------------------------------- */ /* order C using AMD */ /* ---------------------------------------------------------------------- */ /* get parameters */ if (Common->current < 0 || Common->current >= CHOLMOD_MAXMETHODS) { /* use AMD defaults */ Control = NULL ; } else { Control = Control2 ; Control [AMD_DENSE] = Common->method [Common->current].prune_dense ; Control [AMD_AGGRESSIVE] = Common->method [Common->current].aggressive ; } #ifdef LONG amd_l2 (n, C->p, C->i, Len, C->nzmax, cnz, Nv, Next, Perm, Head, Elen, Degree, Wi, Control, Info) ; #else amd_2 (n, C->p, C->i, Len, C->nzmax, cnz, Nv, Next, Perm, Head, Elen, Degree, Wi, Control, Info) ; #endif /* LL' flop count. Need to subtract n for LL' flop count. Note that this * is a slight upper bound which is often exact (see AMD/Source/amd_2.c for * details). cholmod_analyze computes an exact flop count and fill-in. */ Common->fl = Info [AMD_NDIV] + 2 * Info [AMD_NMULTSUBS_LDL] + n ; /* Info [AMD_LNZ] excludes the diagonal */ Common->lnz = n + Info [AMD_LNZ] ; /* ---------------------------------------------------------------------- */ /* free the AMD workspace and clear the persistent workspace in Common */ /* ---------------------------------------------------------------------- */ ASSERT (IMPLIES (Common->status == CHOLMOD_OK, CHOLMOD(dump_perm) (Perm, n, n, "AMD2 perm", Common))) ; CHOLMOD(free_sparse) (&C, Common) ; for (j = 0 ; j <= n ; j++) { Head [j] = EMPTY ; } return (TRUE) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_analyze.c0000664000175000017500000010027414224052371021753 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_analyze ============================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2013, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Order and analyze a matrix (either simplicial or supernodal), in prepartion * for numerical factorization via cholmod_factorize or via the "expert" * routines cholmod_rowfac and cholmod_super_numeric. * * symmetric case: A or A(p,p) * unsymmetric case: AA', A(p,:)*A(p,:)', A(:,f)*A(:,f)', or A(p,f)*A(p,f)' * * For the symmetric case, only the upper or lower triangular part of A is * accessed (depending on the type of A). LL'=A (or permuted A) is analzed. * For the unsymmetric case (LL'=AA' or permuted A). * * There can be no duplicate entries in p or f. p is of length m if A is * m-by-n. f can be length 0 to n. * * In both cases, the columns of A need not be sorted. A can be in packed * or unpacked form. * * Ordering options include: * * natural: A is not permuted to reduce fill-in * given: a permutation can be provided to this routine (UserPerm) * AMD: approximate minumum degree (AMD for the symmetric case, * COLAMD for the AA' case). * METIS: nested dissection with METIS_NodeND * NESDIS: nested dissection using METIS_ComputeVertexSeparator, * typically followed by a constrained minimum degree * (CAMD for the symmetric case, CCOLAMD for the AA' case). * * Multiple ordering options can be tried (up to 9 of them), and the best one * is selected (the one that gives the smallest number of nonzeros in the * simplicial factor L). If one method fails, cholmod_analyze keeps going, and * picks the best among the methods that succeeded. This routine fails (and * returns NULL) if either initial memory allocation fails, all ordering methods * fail, or the supernodal analysis (if requested) fails. By default, the 9 * methods available are: * * 1) given permutation (skipped if UserPerm is NULL) * 2) AMD (symmetric case) or COLAMD (unsymmetric case) * 3) METIS with default parameters * 4) NESDIS with default parameters (stopping the partitioning when * the graph is of size nd_small = 200 or less, remove nodes with * more than max (16, prune_dense * sqrt (n)) nodes where * prune_dense = 10, and follow partitioning with CCOLAMD, a * constrained minimum degree ordering). * 5) natural * 6) NESDIS, nd_small = 20000, prune_dense = 10 * 7) NESDIS, nd_small = 4, prune_dense = 10, no min degree * 8) NESDIS, nd_small = 200, prune_dense = 0 * 9) COLAMD for A*A' or AMD for A * * By default, the first two are tried, and METIS is tried if AMD reports a high * flop count and fill-in. Let fl denote the flop count for the AMD, ordering, * nnz(L) the # of nonzeros in L, and nnz(tril(A)) (or A*A'). If * fl/nnz(L) >= 500 and nnz(L)/nnz(tril(A)) >= 5, then METIS is attempted. The * best ordering is used (UserPerm if given, AMD, and METIS if attempted). If * you do not have METIS, only the first two will be tried (user permutation, * if provided, and AMD/COLAMD). This default behavior is obtained when * Common->nmethods is zero. In this case, methods 0, 1, and 2 in * Common->method [..] are reset to User-provided, AMD, and METIS (or NESDIS * if Common->default_nesdis is set to the non-default value of TRUE), * respectively. * * You can modify these 9 methods and the number of methods tried by changing * parameters in the Common argument. If you know the best ordering for your * matrix, set Common->nmethods to 1 and set Common->method[0].ordering to the * requested ordering method. Parameters for each method can also be modified * (refer to cholmod.h for details). * * Note that it is possible for METIS to terminate your program if it runs out * of memory. This is not the case for any CHOLMOD or minimum degree ordering * routine (AMD, COLAMD, CAMD, CCOLAMD, or CSYMAMD). Since NESDIS relies on * METIS, it too can terminate your program. * * The factor L is returned as simplicial symbolic (L->is_super FALSE) if * Common->supernodal <= CHOLMOD_SIMPLICIAL (0) or as supernodal symbolic if * Common->supernodal >= CHOLMOD_SUPERNODAL (2). If Common->supernodal is * equal to CHOLMOD_AUTO (1), then L is simplicial if the flop count per * nonzero in L is less than Common->supernodal_switch (default: 40), and * is returned as a supernodal factor otherwise. * * In both cases, L->xtype is CHOLMOD_PATTERN. * A subsequent call to cholmod_factorize will perform a * simplicial or supernodal factorization, depending on the type of L. * * For the simplicial case, L contains the fill-reducing permutation (L->Perm) * and the counts of nonzeros in each column of L (L->ColCount). For the * supernodal case, L also contains the nonzero pattern of each supernode. * * workspace: Flag (nrow), Head (nrow+1) * if symmetric: Iwork (6*nrow) * if unsymmetric: Iwork (6*nrow+ncol). * calls various ordering routines, which typically allocate O(nnz(A)) * temporary workspace ((2 to 3)*nnz(A) * sizeof (Int) is typical, but it * can be much higher if A*A' must be explicitly formed for METIS). Also * allocates up to 2 temporary (permuted/transpose) copies of the nonzero * pattern of A, and up to 3*n*sizeof(Int) additional workspace. * * Supports any xtype (pattern, real, complex, or zomplex) */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "cholmod_cholesky.h" #ifndef NSUPERNODAL #include "cholmod_supernodal.h" #endif #ifndef NPARTITION #include "cholmod_partition.h" #endif /* ========================================================================== */ /* === cholmod_analyze ====================================================== */ /* ========================================================================== */ /* Orders and analyzes A, AA', PAP', or PAA'P' and returns a symbolic factor * that can later be passed to cholmod_factorize. */ cholmod_factor *CHOLMOD(analyze) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order and analyze */ /* --------------- */ cholmod_common *Common ) { return (CHOLMOD(analyze_p2) (TRUE, A, NULL, NULL, 0, Common)) ; } /* ========================================================================== */ /* === cholmod_analyze_p ==================================================== */ /* ========================================================================== */ /* Orders and analyzes A, AA', PAP', PAA'P', FF', or PFF'P and returns a * symbolic factor that can later be passed to cholmod_factorize, where * F = A(:,fset) if fset is not NULL and A->stype is zero. * UserPerm is tried if non-NULL. */ cholmod_factor *CHOLMOD(analyze_p) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order and analyze */ Int *UserPerm, /* user-provided permutation, size A->nrow */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* --------------- */ cholmod_common *Common ) { return (CHOLMOD(analyze_p2) (TRUE, A, UserPerm, fset, fsize, Common)) ; } /* ========================================================================== */ /* === permute_matrices ===================================================== */ /* ========================================================================== */ /* Permute and transpose a matrix. Allocates the A1 and A2 matrices, if needed, * or returns them as NULL if not needed. */ static int permute_matrices ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to permute */ Int ordering, /* ordering method used */ Int *Perm, /* fill-reducing permutation */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ Int do_rowcolcounts,/* if TRUE, compute both S and F. If FALSE, only * S is needed for the symmetric case, and only F for * the unsymmetric case */ /* ---- output --- */ cholmod_sparse **A1_handle, /* see comments below for A1, A2, S, F */ cholmod_sparse **A2_handle, cholmod_sparse **S_handle, cholmod_sparse **F_handle, /* --------------- */ cholmod_common *Common ) { cholmod_sparse *A1, *A2, *S, *F ; *A1_handle = NULL ; *A2_handle = NULL ; *S_handle = NULL ; *F_handle = NULL ; A1 = NULL ; A2 = NULL ; if (ordering == CHOLMOD_NATURAL) { /* ------------------------------------------------------------------ */ /* natural ordering of A */ /* ------------------------------------------------------------------ */ if (A->stype < 0) { /* symmetric lower case: A already in lower form, so S=A' */ /* workspace: Iwork (nrow) */ A2 = CHOLMOD(ptranspose) (A, 0, NULL, NULL, 0, Common) ; F = A ; S = A2 ; } else if (A->stype > 0) { /* symmetric upper case: F = pattern of triu (A)', S = A */ /* workspace: Iwork (nrow) */ if (do_rowcolcounts) { /* F not needed for symmetric case if do_rowcolcounts FALSE */ A1 = CHOLMOD(ptranspose) (A, 0, NULL, fset, fsize, Common) ; } F = A1 ; S = A ; } else { /* unsymmetric case: F = pattern of A (:,f)', S = A */ /* workspace: Iwork (nrow if no fset, MAX(nrow,ncol) if fset) */ A1 = CHOLMOD(ptranspose) (A, 0, NULL, fset, fsize, Common) ; F = A1 ; S = A ; } } else { /* ------------------------------------------------------------------ */ /* A is permuted */ /* ------------------------------------------------------------------ */ if (A->stype < 0) { /* symmetric lower case: S = tril (A (p,p))' and F = S' */ /* workspace: Iwork (2*nrow) */ A2 = CHOLMOD(ptranspose) (A, 0, Perm, NULL, 0, Common) ; S = A2 ; /* workspace: Iwork (nrow) */ if (do_rowcolcounts) { /* F not needed for symmetric case if do_rowcolcounts FALSE */ A1 = CHOLMOD(ptranspose) (A2, 0, NULL, NULL, 0, Common) ; } F = A1 ; } else if (A->stype > 0) { /* symmetric upper case: F = triu (A (p,p))' and S = F' */ /* workspace: Iwork (2*nrow) */ A1 = CHOLMOD(ptranspose) (A, 0, Perm, NULL, 0, Common) ; F = A1 ; /* workspace: Iwork (nrow) */ A2 = CHOLMOD(ptranspose) (A1, 0, NULL, NULL, 0, Common) ; S = A2 ; } else { /* unsymmetric case: F = A (p,f)' and S = F' */ /* workspace: Iwork (nrow if no fset, MAX(nrow,ncol) if fset) */ A1 = CHOLMOD(ptranspose) (A, 0, Perm, fset, fsize, Common) ; F = A1 ; if (do_rowcolcounts) { /* S not needed for unsymmetric case if do_rowcolcounts FALSE */ /* workspace: Iwork (nrow) */ A2 = CHOLMOD(ptranspose) (A1, 0, NULL, NULL, 0, Common) ; } S = A2 ; } } /* If any cholmod_*transpose fails, one or more matrices will be NULL */ *A1_handle = A1 ; *A2_handle = A2 ; *S_handle = S ; *F_handle = F ; return (Common->status == CHOLMOD_OK) ; } /* ========================================================================== */ /* === cholmod_analyze_ordering ============================================= */ /* ========================================================================== */ /* Given a matrix A and its fill-reducing permutation, compute the elimination * tree, its (non-weighted) postordering, and the number of nonzeros in each * column of L. Also computes the flop count, the total nonzeros in L, and * the nonzeros in A (Common->fl, Common->lnz, and Common->anz). * * The column counts of L, flop count, and other statistics from * cholmod_rowcolcounts are not computed if ColCount is NULL. * * workspace: Iwork (2*nrow if symmetric, 2*nrow+ncol if unsymmetric), * Flag (nrow), Head (nrow+1) */ int CHOLMOD(analyze_ordering) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ int ordering, /* ordering method used */ Int *Perm, /* size n, fill-reducing permutation to analyze */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* ---- output --- */ Int *Parent, /* size n, elimination tree */ Int *Post, /* size n, postordering of elimination tree */ Int *ColCount, /* size n, nnz in each column of L */ /* ---- workspace */ Int *First, /* size n workspace for cholmod_postorder */ Int *Level, /* size n workspace for cholmod_postorder */ /* --------------- */ cholmod_common *Common ) { cholmod_sparse *A1, *A2, *S, *F ; Int n, ok, do_rowcolcounts ; /* check inputs */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; n = A->nrow ; do_rowcolcounts = (ColCount != NULL) ; /* permute A according to Perm and fset */ ok = permute_matrices (A, ordering, Perm, fset, fsize, do_rowcolcounts, &A1, &A2, &S, &F, Common) ; /* find etree of S (symmetric upper/lower case) or F (unsym case) */ /* workspace: symmmetric: Iwork (nrow), unsym: Iwork (nrow+ncol) */ ok = ok && CHOLMOD(etree) (A->stype ? S:F, Parent, Common) ; /* postorder the etree (required by cholmod_rowcolcounts) */ /* workspace: Iwork (2*nrow) */ ok = ok && (CHOLMOD(postorder) (Parent, n, NULL, Post, Common) == n) ; /* cholmod_postorder doesn't set Common->status if it returns < n */ Common->status = (!ok && Common->status == CHOLMOD_OK) ? CHOLMOD_INVALID : Common->status ; /* analyze LL'=S or SS' or S(:,f)*S(:,f)' */ /* workspace: * if symmetric: Flag (nrow), Iwork (2*nrow) * if unsymmetric: Flag (nrow), Iwork (2*nrow+ncol), Head (nrow+1) */ if (do_rowcolcounts) { ok = ok && CHOLMOD(rowcolcounts) (A->stype ? F:S, fset, fsize, Parent, Post, NULL, ColCount, First, Level, Common) ; } /* free temporary matrices and return result */ CHOLMOD(free_sparse) (&A1, Common) ; CHOLMOD(free_sparse) (&A2, Common) ; return (ok) ; } /* ========================================================================== */ /* === Free workspace and return L ========================================== */ /* ========================================================================== */ #define FREE_WORKSPACE_AND_RETURN \ { \ Common->no_workspace_reallocate = FALSE ; \ CHOLMOD(free) (n, sizeof (Int), Lparent, Common) ; \ CHOLMOD(free) (n, sizeof (Int), Perm, Common) ; \ CHOLMOD(free) (n, sizeof (Int), ColCount, Common) ; \ if (Common->status < CHOLMOD_OK) \ { \ CHOLMOD(free_factor) (&L, Common) ; \ } \ ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; \ return (L) ; \ } /* ========================================================================== */ /* === cholmod_analyze_p2 =================================================== */ /* ========================================================================== */ /* Ordering and analysis for sparse Cholesky or sparse QR. */ cholmod_factor *CHOLMOD(analyze_p2) ( /* ---- input ---- */ int for_whom, /* FOR_SPQR (0): for SPQR but not GPU-accelerated FOR_CHOLESKY (1): for Cholesky (GPU or not) FOR_SPQRGPU (2): for SPQR with GPU acceleration */ cholmod_sparse *A, /* matrix to order and analyze */ Int *UserPerm, /* user-provided permutation, size A->nrow */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* --------------- */ cholmod_common *Common ) { double lnz_best ; Int *First, *Level, *Work4n, *Cmember, *CParent, *ColCount, *Lperm, *Parent, *Post, *Perm, *Lparent, *Lcolcount ; cholmod_factor *L ; Int k, n, ordering, method, nmethods, status, default_strategy, ncol, uncol, skip_analysis, skip_best ; Int amd_backup ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, NULL) ; Common->status = CHOLMOD_OK ; status = CHOLMOD_OK ; Common->selected = EMPTY ; Common->called_nd = FALSE ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ n = A->nrow ; ncol = A->ncol ; uncol = (A->stype == 0) ? (A->ncol) : 0 ; /* ---------------------------------------------------------------------- */ /* set the default strategy */ /* ---------------------------------------------------------------------- */ lnz_best = (double) EMPTY ; skip_best = FALSE ; nmethods = MIN (Common->nmethods, CHOLMOD_MAXMETHODS) ; nmethods = MAX (0, nmethods) ; #ifndef NDEBUG PRINT1 (("cholmod_analyze_p2 :: nmethods "ID"\n", nmethods)) ; for (method = 0 ; method < nmethods ; method++) { PRINT1 ((" "ID": ordering "ID"\n", method, Common->method [method].ordering)) ; } #endif default_strategy = (nmethods == 0) ; if (default_strategy) { /* default strategy: try UserPerm, if given. Try AMD for A, or AMD * to order A*A'. Try METIS for the symmetric case only if AMD reports * a high degree of fill-in and flop count. METIS is not tried if the * Partition Module isn't installed. If Common->default_nesdis is * TRUE, then NESDIS is used as the 3rd ordering instead. */ Common->method [0].ordering = CHOLMOD_GIVEN ;/* skip if UserPerm NULL */ Common->method [1].ordering = CHOLMOD_AMD ; Common->method [2].ordering = (Common->default_nesdis ? CHOLMOD_NESDIS : CHOLMOD_METIS) ; amd_backup = FALSE ; #ifndef NPARTITION nmethods = 3 ; #else nmethods = 2 ; #endif } else { /* If only METIS and NESDIS are selected, or if 2 or more methods are * being tried, then enable AMD backup */ amd_backup = (nmethods > 1) || (nmethods == 1 && (Common->method [0].ordering == CHOLMOD_METIS || Common->method [0].ordering == CHOLMOD_NESDIS)) ; } #ifdef NSUPERNODAL /* CHOLMOD Supernodal module not installed, just do simplicial analysis */ Common->supernodal = CHOLMOD_SIMPLICIAL ; #endif /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* Note: enough space needs to be allocated here so that routines called by * cholmod_analyze do not reallocate the space. */ /* s = 6*n + uncol */ s = CHOLMOD(mult_size_t) (n, 6, &ok) ; s = CHOLMOD(add_size_t) (s, uncol, &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (NULL) ; } CHOLMOD(allocate_work) (n, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* ensure that subsequent routines, called by cholmod_analyze, do not * reallocate any workspace. This is set back to FALSE in the * FREE_WORKSPACE_AND_RETURN macro, which is the only way this function * returns to its caller. */ Common->no_workspace_reallocate = TRUE ; /* Use the last 4*n Int's in Iwork for Parent, First, Level, and Post, since * other CHOLMOD routines will use the first 2n+uncol space. The ordering * routines (cholmod_amd, cholmod_colamd, cholmod_ccolamd, cholmod_metis) * are an exception. They can use all 6n + ncol space, since the contents * of Parent, First, Level, and Post are not needed across calls to those * routines. */ Work4n = Common->Iwork ; Work4n += 2*((size_t) n) + uncol ; Parent = Work4n ; First = Work4n + n ; Level = Work4n + 2*((size_t) n) ; Post = Work4n + 3*((size_t) n) ; /* note that this assignment means that cholmod_nested_dissection, * cholmod_ccolamd, and cholmod_camd can use only the first 4n+uncol * space in Common->Iwork */ Cmember = Post ; CParent = Level ; /* ---------------------------------------------------------------------- */ /* allocate more workspace, and an empty simplicial symbolic factor */ /* ---------------------------------------------------------------------- */ L = CHOLMOD(allocate_factor) (n, Common) ; Lparent = CHOLMOD(malloc) (n, sizeof (Int), Common) ; Perm = CHOLMOD(malloc) (n, sizeof (Int), Common) ; ColCount = CHOLMOD(malloc) (n, sizeof (Int), Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ FREE_WORKSPACE_AND_RETURN ; } Lperm = L->Perm ; Lcolcount = L->ColCount ; Common->anz = EMPTY ; /* ---------------------------------------------------------------------- */ /* try all the requested ordering options and backup to AMD if needed */ /* ---------------------------------------------------------------------- */ /* turn off error handling [ */ Common->try_catch = TRUE ; for (method = 0 ; method <= nmethods ; method++) { /* ------------------------------------------------------------------ */ /* determine the method to try */ /* ------------------------------------------------------------------ */ Common->fl = EMPTY ; Common->lnz = EMPTY ; skip_analysis = FALSE ; if (method == nmethods) { /* All methods failed: backup to AMD */ if (Common->selected == EMPTY && amd_backup) { PRINT1 (("All methods requested failed: backup to AMD\n")) ; ordering = CHOLMOD_AMD ; } else { break ; } } else { ordering = Common->method [method].ordering ; } Common->current = method ; PRINT1 (("method "ID": Try method: "ID"\n", method, ordering)) ; /* ------------------------------------------------------------------ */ /* find the fill-reducing permutation */ /* ------------------------------------------------------------------ */ if (ordering == CHOLMOD_NATURAL) { /* -------------------------------------------------------------- */ /* natural ordering */ /* -------------------------------------------------------------- */ for (k = 0 ; k < n ; k++) { Perm [k] = k ; } } else if (ordering == CHOLMOD_GIVEN) { /* -------------------------------------------------------------- */ /* use given ordering of A, if provided */ /* -------------------------------------------------------------- */ if (UserPerm == NULL) { /* this is not an error condition */ PRINT1 (("skip, no user perm given\n")) ; continue ; } for (k = 0 ; k < n ; k++) { /* UserPerm is checked in cholmod_ptranspose */ Perm [k] = UserPerm [k] ; } } else if (ordering == CHOLMOD_AMD) { /* -------------------------------------------------------------- */ /* AMD ordering of A, A*A', or A(:,f)*A(:,f)' */ /* -------------------------------------------------------------- */ amd_backup = FALSE ; /* no need to try AMD twice ... */ CHOLMOD(amd) (A, fset, fsize, Perm, Common) ; skip_analysis = TRUE ; } else if (ordering == CHOLMOD_COLAMD) { /* -------------------------------------------------------------- */ /* AMD for symmetric case, COLAMD for A*A' or A(:,f)*A(:,f)' */ /* -------------------------------------------------------------- */ if (A->stype) { CHOLMOD(amd) (A, fset, fsize, Perm, Common) ; skip_analysis = TRUE ; } else { /* Alternative: CHOLMOD(ccolamd) (A, fset, fsize, NULL, Perm, Common) ; */ /* do not postorder, it is done later, below */ /* workspace: Iwork (4*nrow+uncol), Flag (nrow), Head (nrow+1)*/ CHOLMOD(colamd) (A, fset, fsize, FALSE, Perm, Common) ; } } else if (ordering == CHOLMOD_METIS) { /* -------------------------------------------------------------- */ /* use METIS_NodeND directly (via a CHOLMOD wrapper) */ /* -------------------------------------------------------------- */ #ifndef NPARTITION /* postorder parameter is false, because it will be later, below */ /* workspace: Iwork (4*nrow+uncol), Flag (nrow), Head (nrow+1) */ Common->called_nd = TRUE ; CHOLMOD(metis) (A, fset, fsize, FALSE, Perm, Common) ; #else Common->status = CHOLMOD_NOT_INSTALLED ; #endif } else if (ordering == CHOLMOD_NESDIS) { /* -------------------------------------------------------------- */ /* use CHOLMOD's nested dissection */ /* -------------------------------------------------------------- */ /* this method is based on METIS' node bissection routine * (METIS_ComputeVertexSeparator). In contrast to METIS_NodeND, * it calls CAMD or CCOLAMD on the whole graph, instead of MMD * on just the leaves. */ #ifndef NPARTITION /* workspace: Flag (nrow), Head (nrow+1), Iwork (2*nrow) */ Common->called_nd = TRUE ; CHOLMOD(nested_dissection) (A, fset, fsize, Perm, CParent, Cmember, Common) ; #else Common->status = CHOLMOD_NOT_INSTALLED ; #endif } else { /* -------------------------------------------------------------- */ /* invalid ordering method */ /* -------------------------------------------------------------- */ Common->status = CHOLMOD_INVALID ; PRINT1 (("No such ordering: "ID"\n", ordering)) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; if (Common->status < CHOLMOD_OK) { /* out of memory, or method failed */ status = MIN (status, Common->status) ; Common->status = CHOLMOD_OK ; continue ; } /* ------------------------------------------------------------------ */ /* analyze the ordering */ /* ------------------------------------------------------------------ */ if (!skip_analysis) { if (!CHOLMOD(analyze_ordering) (A, ordering, Perm, fset, fsize, Parent, Post, ColCount, First, Level, Common)) { /* ordering method failed; clear status and try next method */ status = MIN (status, Common->status) ; Common->status = CHOLMOD_OK ; continue ; } } ASSERT (Common->fl >= 0 && Common->lnz >= 0) ; Common->method [method].fl = Common->fl ; Common->method [method].lnz = Common->lnz ; PRINT1 (("lnz %g fl %g\n", Common->lnz, Common->fl)) ; /* ------------------------------------------------------------------ */ /* pick the best method */ /* ------------------------------------------------------------------ */ /* fl.pt. compare, but lnz can never be NaN */ if (Common->selected == EMPTY || Common->lnz < lnz_best) { Common->selected = method ; PRINT1 (("this is best so far, method "ID"\n", method)) ; L->ordering = ordering ; lnz_best = Common->lnz ; for (k = 0 ; k < n ; k++) { Lperm [k] = Perm [k] ; } /* save the results of cholmod_analyze_ordering, if it was called */ skip_best = skip_analysis ; if (!skip_analysis) { /* save the column count; becomes permanent part of L */ for (k = 0 ; k < n ; k++) { Lcolcount [k] = ColCount [k] ; } /* Parent is needed for weighted postordering and for supernodal * analysis. Does not become a permanent part of L */ for (k = 0 ; k < n ; k++) { Lparent [k] = Parent [k] ; } } } /* ------------------------------------------------------------------ */ /* determine if METIS is to be skipped */ /* ------------------------------------------------------------------ */ if (default_strategy && ordering == CHOLMOD_AMD) { if ((Common->fl < 500 * Common->lnz) || (Common->lnz < 5 * Common->anz)) { /* AMD found an ordering with less than 500 flops per nonzero in * L, or one with a fill-in ratio (nnz(L)/nnz(A)) of less than * 5. This is pretty good, and it's unlikely that METIS will do * better (this heuristic is based on tests on all symmetric * positive definite matrices in the UF sparse matrix * collection, and it works well across a wide range of * problems). METIS can take much more time than AMD. */ break ; } } } /* turn error printing back on ] */ Common->try_catch = FALSE ; /* ---------------------------------------------------------------------- */ /* return if no ordering method succeeded */ /* ---------------------------------------------------------------------- */ if (Common->selected == EMPTY) { /* All methods failed. * If two or more methods failed, they may have failed for different * reasons. Both would clear Common->status and skip to the next * method. Common->status needs to be restored here to the worst error * obtained in any of the methods. CHOLMOD_INVALID is worse * than CHOLMOD_OUT_OF_MEMORY, since the former implies something may * be wrong with the user's input. CHOLMOD_OUT_OF_MEMORY is simply an * indication of lack of resources. */ if (status >= CHOLMOD_OK) { /* this can occur if nmethods = 1, ordering = CHOLMOD_GIVEN, but UserPerm is NULL */ status = CHOLMOD_INVALID ; } ERROR (status, "all methods failed") ; FREE_WORKSPACE_AND_RETURN ; } /* ---------------------------------------------------------------------- */ /* do the analysis for AMD, if skipped */ /* ---------------------------------------------------------------------- */ Common->fl = Common->method [Common->selected].fl ; Common->lnz = Common->method [Common->selected].lnz ; ASSERT (Common->lnz >= 0) ; if (skip_best) { if (!CHOLMOD(analyze_ordering) (A, L->ordering, Lperm, fset, fsize, Lparent, Post, Lcolcount, First, Level, Common)) { /* out of memory, or method failed */ FREE_WORKSPACE_AND_RETURN ; } } /* ---------------------------------------------------------------------- */ /* postorder the etree, weighted by the column counts */ /* ---------------------------------------------------------------------- */ if (Common->postorder) { /* combine the fill-reducing ordering with the weighted postorder */ /* workspace: Iwork (2*nrow) */ if (CHOLMOD(postorder) (Lparent, n, Lcolcount, Post, Common) == n) { /* use First and Level as workspace [ */ Int *Wi = First, *InvPost = Level ; Int newchild, oldchild, newparent, oldparent ; for (k = 0 ; k < n ; k++) { Wi [k] = Lperm [Post [k]] ; } for (k = 0 ; k < n ; k++) { Lperm [k] = Wi [k] ; } for (k = 0 ; k < n ; k++) { Wi [k] = Lcolcount [Post [k]] ; } for (k = 0 ; k < n ; k++) { Lcolcount [k] = Wi [k] ; } for (k = 0 ; k < n ; k++) { InvPost [Post [k]] = k ; } /* updated Lparent needed only for supernodal case */ for (newchild = 0 ; newchild < n ; newchild++) { oldchild = Post [newchild] ; oldparent = Lparent [oldchild] ; newparent = (oldparent == EMPTY) ? EMPTY : InvPost [oldparent] ; Wi [newchild] = newparent ; } for (k = 0 ; k < n ; k++) { Lparent [k] = Wi [k] ; } /* done using Iwork as workspace ] */ /* L is now postordered, no longer in natural ordering */ if (L->ordering == CHOLMOD_NATURAL) { L->ordering = CHOLMOD_POSTORDERED ; } } } /* ---------------------------------------------------------------------- */ /* supernodal analysis, if requested or if selected automatically */ /* ---------------------------------------------------------------------- */ #ifndef NSUPERNODAL if (Common->supernodal > CHOLMOD_AUTO || (Common->supernodal == CHOLMOD_AUTO && Common->lnz > 0 && (Common->fl / Common->lnz) >= Common->supernodal_switch)) { cholmod_sparse *S, *F, *A2, *A1 ; permute_matrices (A, L->ordering, Lperm, fset, fsize, TRUE, &A1, &A2, &S, &F, Common) ; /* workspace: Flag (nrow), Head (nrow), Iwork (5*nrow) */ CHOLMOD(super_symbolic2) (for_whom, S, F, Lparent, L, Common) ; PRINT1 (("status %d\n", Common->status)) ; CHOLMOD(free_sparse) (&A1, Common) ; CHOLMOD(free_sparse) (&A2, Common) ; } #endif /* ---------------------------------------------------------------------- */ /* free temporary matrices and workspace, and return result L */ /* ---------------------------------------------------------------------- */ FREE_WORKSPACE_AND_RETURN ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_colamd.c0000664000175000017500000001542714224052371021554 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_colamd ============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* CHOLMOD interface to the COLAMD ordering routine (version 2.4 or later). * Finds a permutation p such that the Cholesky factorization of PAA'P' is * sparser than AA' using colamd. If the postorder input parameter is TRUE, * the column etree is found and postordered, and the colamd ordering is then * combined with its postordering. A must be unsymmetric. * * There can be no duplicate entries in f. * f can be length 0 to n if A is m-by-n. * * workspace: Iwork (4*nrow+ncol), Head (nrow+1), Flag (nrow) * Allocates a copy of its input matrix, which * is then used as CCOLAMD's workspace. * * Supports any xtype (pattern, real, complex, or zomplex) */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "colamd.h" #include "cholmod_cholesky.h" #if (!defined (COLAMD_VERSION) || (COLAMD_VERSION < COLAMD_VERSION_CODE (2,5))) #error "COLAMD v2.5 or later is required" #endif /* ========================================================================== */ /* === cholmod_colamd ======================================================= */ /* ========================================================================== */ int CHOLMOD(colamd) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int postorder, /* if TRUE, follow with a coletree postorder */ /* ---- output --- */ Int *Perm, /* size A->nrow, output permutation */ /* --------------- */ cholmod_common *Common ) { double knobs [COLAMD_KNOBS] ; cholmod_sparse *C ; Int *NewPerm, *Parent, *Post, *Work2n ; Int k, nrow, ncol ; size_t s, alen ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (Perm, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; if (A->stype != 0) { ERROR (CHOLMOD_INVALID, "matrix must be unsymmetric") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ nrow = A->nrow ; ncol = A->ncol ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* Note: this is less than the space used in cholmod_analyze, so if * cholmod_colamd is being called by that routine, no space will be * allocated. */ /* s = 4*nrow + ncol */ s = CHOLMOD(mult_size_t) (nrow, 4, &ok) ; s = CHOLMOD(add_size_t) (s, ncol, &ok) ; #ifdef LONG alen = colamd_l_recommended (A->nzmax, ncol, nrow) ; colamd_l_set_defaults (knobs) ; #else alen = colamd_recommended (A->nzmax, ncol, nrow) ; colamd_set_defaults (knobs) ; #endif if (!ok || alen == 0) { ERROR (CHOLMOD_TOO_LARGE, "matrix invalid or too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (0, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* allocate COLAMD workspace */ /* ---------------------------------------------------------------------- */ C = CHOLMOD(allocate_sparse) (ncol, nrow, alen, TRUE, TRUE, 0, CHOLMOD_PATTERN, Common) ; /* ---------------------------------------------------------------------- */ /* copy (and transpose) the input matrix A into the colamd workspace */ /* ---------------------------------------------------------------------- */ /* C = A (:,f)', which also packs A if needed. */ /* workspace: Iwork (nrow if no fset; MAX (nrow,ncol) if fset) */ ok = CHOLMOD(transpose_unsym) (A, 0, NULL, fset, fsize, C, Common) ; /* ---------------------------------------------------------------------- */ /* order the matrix (destroys the contents of C->i and C->p) */ /* ---------------------------------------------------------------------- */ /* get parameters */ if (Common->current < 0 || Common->current >= CHOLMOD_MAXMETHODS) { /* this is the CHOLMOD default, not the COLAMD default */ knobs [COLAMD_DENSE_ROW] = -1 ; } else { /* get the knobs from the Common parameters */ knobs [COLAMD_DENSE_COL] = Common->method[Common->current].prune_dense ; knobs [COLAMD_DENSE_ROW] = Common->method[Common->current].prune_dense2; knobs [COLAMD_AGGRESSIVE] = Common->method[Common->current].aggressive ; } if (ok) { Int *Cp ; Int stats [COLAMD_STATS] ; Cp = C->p ; #ifdef LONG colamd_l (ncol, nrow, alen, C->i, Cp, knobs, stats) ; #else colamd (ncol, nrow, alen, C->i, Cp, knobs, stats) ; #endif ok = stats [COLAMD_STATUS] ; ok = (ok == COLAMD_OK || ok == COLAMD_OK_BUT_JUMBLED) ; /* permutation returned in C->p, if the ordering succeeded */ for (k = 0 ; k < nrow ; k++) { Perm [k] = Cp [k] ; } } CHOLMOD(free_sparse) (&C, Common) ; /* ---------------------------------------------------------------------- */ /* column etree postordering */ /* ---------------------------------------------------------------------- */ if (postorder) { /* use the last 2*n space in Iwork for Parent and Post */ Work2n = Common->Iwork ; Work2n += 2*((size_t) nrow) + ncol ; Parent = Work2n ; /* size nrow (i/i/l) */ Post = Work2n + nrow ; /* size nrow (i/i/l) */ /* workspace: Iwork (2*nrow+ncol), Flag (nrow), Head (nrow+1) */ ok = ok && CHOLMOD(analyze_ordering) (A, CHOLMOD_COLAMD, Perm, fset, fsize, Parent, Post, NULL, NULL, NULL, Common) ; /* combine the colamd permutation with its postordering */ if (ok) { NewPerm = Common->Iwork ; /* size nrow (i/i/l) */ for (k = 0 ; k < nrow ; k++) { NewPerm [k] = Perm [Post [k]] ; } for (k = 0 ; k < nrow ; k++) { Perm [k] = NewPerm [k] ; } } } return (ok) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_etree.c0000664000175000017500000001577014224052371021422 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_etree =============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Compute the elimination tree of A or A'*A * * In the symmetric case, the upper triangular part of A is used. Entries not * in this part of the matrix are ignored. Computing the etree of a symmetric * matrix from just its lower triangular entries is not supported. * * In the unsymmetric case, all of A is used, and the etree of A'*A is computed. * * References: * * J. Liu, "A compact row storage scheme for Cholesky factors", ACM Trans. * Math. Software, vol 12, 1986, pp. 127-148. * * J. Liu, "The role of elimination trees in sparse factorization", SIAM J. * Matrix Analysis & Applic., vol 11, 1990, pp. 134-172. * * J. Gilbert, X. Li, E. Ng, B. Peyton, "Computing row and column counts for * sparse QR and LU factorization", BIT, vol 41, 2001, pp. 693-710. * * workspace: symmetric: Iwork (nrow), unsymmetric: Iwork (nrow+ncol) * * Supports any xtype (pattern, real, complex, or zomplex) */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "cholmod_cholesky.h" /* ========================================================================== */ /* === update_etree ========================================================= */ /* ========================================================================== */ static void update_etree ( /* inputs, not modified */ Int k, /* process the edge (k,i) in the input graph */ Int i, /* inputs, modified on output */ Int Parent [ ], /* Parent [t] = p if p is the parent of t */ Int Ancestor [ ] /* Ancestor [t] is the ancestor of node t in the partially-constructed etree */ ) { Int a ; for ( ; ; ) /* traverse the path from k to the root of the tree */ { a = Ancestor [k] ; if (a == i) { /* final ancestor reached; no change to tree */ return ; } /* perform path compression */ Ancestor [k] = i ; if (a == EMPTY) { /* final ancestor undefined; this is a new edge in the tree */ Parent [k] = i ; return ; } /* traverse up to the ancestor of k */ k = a ; } } /* ========================================================================== */ /* === cholmod_etree ======================================================== */ /* ========================================================================== */ /* Find the elimination tree of A or A'*A */ int CHOLMOD(etree) ( /* ---- input ---- */ cholmod_sparse *A, /* ---- output --- */ Int *Parent, /* size ncol. Parent [j] = p if p is the parent of j */ /* --------------- */ cholmod_common *Common ) { Int *Ap, *Ai, *Anz, *Ancestor, *Prev, *Iwork ; Int i, j, jprev, p, pend, nrow, ncol, packed, stype ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (Parent, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ stype = A->stype ; /* s = A->nrow + (stype ? 0 : A->ncol) */ s = CHOLMOD(add_size_t) (A->nrow, (stype ? 0 : A->ncol), &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (0, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; /* out of memory */ } ASSERT (CHOLMOD(dump_sparse) (A, "etree", Common) >= 0) ; Iwork = Common->Iwork ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ ncol = A->ncol ; /* the number of columns of A */ nrow = A->nrow ; /* the number of rows of A */ Ap = A->p ; /* size ncol+1, column pointers for A */ Ai = A->i ; /* the row indices of A */ Anz = A->nz ; /* number of nonzeros in each column of A */ packed = A->packed ; Ancestor = Iwork ; /* size ncol (i/i/l) */ for (j = 0 ; j < ncol ; j++) { Parent [j] = EMPTY ; Ancestor [j] = EMPTY ; } /* ---------------------------------------------------------------------- */ /* compute the etree */ /* ---------------------------------------------------------------------- */ if (stype > 0) { /* ------------------------------------------------------------------ */ /* symmetric (upper) case: compute etree (A) */ /* ------------------------------------------------------------------ */ for (j = 0 ; j < ncol ; j++) { /* for each row i in column j of triu(A), excluding the diagonal */ p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i < j) { update_etree (i, j, Parent, Ancestor) ; } } } } else if (stype == 0) { /* ------------------------------------------------------------------ */ /* unsymmetric case: compute etree (A'*A) */ /* ------------------------------------------------------------------ */ Prev = Iwork + ncol ; /* size nrow (i/i/l) */ for (i = 0 ; i < nrow ; i++) { Prev [i] = EMPTY ; } for (j = 0 ; j < ncol ; j++) { /* for each row i in column j of A */ p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { /* a graph is constructed dynamically with one path per row * of A. If the ith row of A contains column indices * (j1,j2,j3,j4) then the new graph has edges (j1,j2), (j2,j3), * and (j3,j4). When at node i of this path-graph, all edges * (jprev,j) are considered, where jprevPerm). If A is unsymmetric, either * A(p,:)*A(p,:)'+beta*I or A(p,f)*A(p,f)'+beta*I is factorized. The set f and * the nonzero pattern of the matrix A must be the same as the matrix passed to * cholmod_analyze for the supernodal case. For the simplicial case, it can * be different, but it should be the same for best performance. beta is real. * * A simplicial factorization or supernodal factorization is chosen, based on * the type of the factor L. If L->is_super is TRUE, a supernodal LL' * factorization is computed. Otherwise, a simplicial numeric factorization * is computed, either LL' or LDL', depending on Common->final_ll. * * Once the factorization is complete, it can be left as is or optionally * converted into any simplicial numeric type, depending on the * Common->final_* parameters. If converted from a supernodal to simplicial * type, and the Common->final_resymbol parameter is true, then numerically * zero entries in L due to relaxed supernodal amalgamation are removed from * the simplicial factor (they are always left in the supernodal form of L). * Entries that are numerically zero but present in the simplicial symbolic * pattern of L are left in place (that is, the graph of L remains chordal). * This is required for the update/downdate/rowadd/rowdel routines to work * properly. * * workspace: Flag (nrow), Head (nrow+1), * if symmetric: Iwork (2*nrow+2*nsuper) * if unsymmetric: Iwork (2*nrow+MAX(2*nsuper,ncol)) * where nsuper is 0 if simplicial, or the # of relaxed supernodes in * L otherwise (nsuper <= nrow). * if simplicial: W (nrow). * Allocates up to two temporary copies of its input matrix (including * both pattern and numerical values). * * If the matrix is not positive definite the routine returns TRUE, but * sets Common->status to CHOLMOD_NOT_POSDEF and L->minor is set to the * column at which the failure occurred. Columns L->minor to L->n-1 are * set to zero. * * Supports any xtype (pattern, real, complex, or zomplex), except that the * input matrix A cannot be pattern-only. If L is simplicial, its numeric * xtype matches A on output. If L is supernodal, its xtype is real if A is * real, or complex if A is complex or zomplex. */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "cholmod_cholesky.h" #ifndef NSUPERNODAL #include "cholmod_supernodal.h" #endif /* ========================================================================== */ /* === cholmod_factorize ==================================================== */ /* ========================================================================== */ /* Factorizes PAP' (or PAA'P' if A->stype is 0), using a factor obtained * from cholmod_analyze. The analysis can be re-used simply by calling this * routine a second time with another matrix. A must have the same nonzero * pattern as that passed to cholmod_analyze. */ int CHOLMOD(factorize) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ /* ---- in/out --- */ cholmod_factor *L, /* resulting factorization */ /* --------------- */ cholmod_common *Common ) { double zero [2] ; zero [0] = 0 ; zero [1] = 0 ; return (CHOLMOD(factorize_p) (A, zero, NULL, 0, L, Common)) ; } /* ========================================================================== */ /* === cholmod_factorize_p ================================================== */ /* ========================================================================== */ /* Same as cholmod_factorize, but with more options. */ int CHOLMOD(factorize_p) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ double beta [2], /* factorize beta*I+A or beta*I+A'*A */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* ---- in/out --- */ cholmod_factor *L, /* resulting factorization */ /* --------------- */ cholmod_common *Common ) { cholmod_sparse *S, *F, *A1, *A2 ; Int nrow, ncol, stype, convert, n, nsuper, grow2, status ; size_t s, t, uncol ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; nrow = A->nrow ; ncol = A->ncol ; n = L->n ; stype = A->stype ; if (L->n != A->nrow) { ERROR (CHOLMOD_INVALID, "A and L dimensions do not match") ; return (FALSE) ; } if (stype != 0 && nrow != ncol) { ERROR (CHOLMOD_INVALID, "matrix invalid") ; return (FALSE) ; } DEBUG (CHOLMOD(dump_sparse) (A, "A for cholmod_factorize", Common)) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ nsuper = (L->is_super ? L->nsuper : 0) ; uncol = ((stype != 0) ? 0 : ncol) ; /* s = 2*nrow + MAX (uncol, 2*nsuper) */ s = CHOLMOD(mult_size_t) (nsuper, 2, &ok) ; s = MAX (uncol, s) ; t = CHOLMOD(mult_size_t) (nrow, 2, &ok) ; s = CHOLMOD(add_size_t) (s, t, &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (nrow, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } S = NULL ; F = NULL ; A1 = NULL ; A2 = NULL ; /* convert to another form when done, if requested */ convert = !(Common->final_asis) ; /* ---------------------------------------------------------------------- */ /* perform supernodal LL' or simplicial LDL' factorization */ /* ---------------------------------------------------------------------- */ if (L->is_super) { #ifndef NSUPERNODAL /* ------------------------------------------------------------------ */ /* supernodal factorization */ /* ------------------------------------------------------------------ */ if (L->ordering == CHOLMOD_NATURAL) { /* -------------------------------------------------------------- */ /* natural ordering */ /* -------------------------------------------------------------- */ if (stype > 0) { /* S = tril (A'), F not needed */ /* workspace: Iwork (nrow) */ A1 = CHOLMOD(ptranspose) (A, 2, NULL, NULL, 0, Common) ; S = A1 ; } else if (stype < 0) { /* This is the fastest option for the natural ordering */ /* S = A; F not needed */ S = A ; } else { /* F = A(:,f)' */ /* workspace: Iwork (nrow) */ /* workspace: Iwork (nrow if no fset; MAX (nrow,ncol) if fset)*/ A1 = CHOLMOD(ptranspose) (A, 2, NULL, fset, fsize, Common) ; F = A1 ; /* S = A */ S = A ; } } else { /* -------------------------------------------------------------- */ /* permute the input matrix before factorization */ /* -------------------------------------------------------------- */ if (stype > 0) { /* This is the fastest option for factoring a permuted matrix */ /* S = tril (PAP'); F not needed */ /* workspace: Iwork (2*nrow) */ A1 = CHOLMOD(ptranspose) (A, 2, L->Perm, NULL, 0, Common) ; S = A1 ; } else if (stype < 0) { /* A2 = triu (PAP') */ /* workspace: Iwork (2*nrow) */ A2 = CHOLMOD(ptranspose) (A, 2, L->Perm, NULL, 0, Common) ; /* S = tril (A2'); F not needed */ /* workspace: Iwork (nrow) */ A1 = CHOLMOD(ptranspose) (A2, 2, NULL, NULL, 0, Common) ; S = A1 ; CHOLMOD(free_sparse) (&A2, Common) ; ASSERT (A2 == NULL) ; } else { /* F = A(p,f)' */ /* workspace: Iwork (nrow if no fset; MAX (nrow,ncol) if fset)*/ A1 = CHOLMOD(ptranspose) (A, 2, L->Perm, fset, fsize, Common) ; F = A1 ; /* S = F' */ /* workspace: Iwork (nrow) */ A2 = CHOLMOD(ptranspose) (F, 2, NULL, NULL, 0, Common) ; S = A2 ; } } /* ------------------------------------------------------------------ */ /* supernodal factorization */ /* ------------------------------------------------------------------ */ /* workspace: Flag (nrow), Head (nrow+1), Iwork (2*nrow+2*nsuper) */ if (Common->status == CHOLMOD_OK) { CHOLMOD(super_numeric) (S, F, beta, L, Common) ; } status = Common->status ; ASSERT (IMPLIES (status >= CHOLMOD_OK, L->xtype != CHOLMOD_PATTERN)) ; /* ------------------------------------------------------------------ */ /* convert to final form, if requested */ /* ------------------------------------------------------------------ */ if (Common->status >= CHOLMOD_OK && convert) { /* workspace: none */ ok = CHOLMOD(change_factor) (L->xtype, Common->final_ll, Common->final_super, Common->final_pack, Common->final_monotonic, L, Common) ; if (ok && Common->final_resymbol && !(L->is_super)) { /* workspace: Flag (nrow), Head (nrow+1), * if symmetric: Iwork (2*nrow) * if unsymmetric: Iwork (2*nrow+ncol) */ CHOLMOD(resymbol_noperm) (S, fset, fsize, Common->final_pack, L, Common) ; } } #else /* ------------------------------------------------------------------ */ /* CHOLMOD Supernodal module not installed */ /* ------------------------------------------------------------------ */ status = CHOLMOD_NOT_INSTALLED ; ERROR (CHOLMOD_NOT_INSTALLED,"Supernodal module not installed") ; #endif } else { /* ------------------------------------------------------------------ */ /* simplicial LDL' factorization */ /* ------------------------------------------------------------------ */ /* Permute the input matrix A if necessary. cholmod_rowfac requires * triu(A) in column form for the symmetric case, and A in column form * for the unsymmetric case (the matrix S). The unsymmetric case * requires A in row form, or equivalently A' in column form (the * matrix F). */ if (L->ordering == CHOLMOD_NATURAL) { /* -------------------------------------------------------------- */ /* natural ordering */ /* -------------------------------------------------------------- */ if (stype > 0) { /* F is not needed, S = A */ S = A ; } else if (stype < 0) { /* F is not needed, S = A' */ /* workspace: Iwork (nrow) */ A2 = CHOLMOD(ptranspose) (A, 2, NULL, NULL, 0, Common) ; S = A2 ; } else { /* F = A (:,f)' */ /* workspace: Iwork (nrow if no fset; MAX (nrow,ncol) if fset)*/ A1 = CHOLMOD(ptranspose) (A, 2, NULL, fset, fsize, Common) ; F = A1 ; S = A ; } } else { /* -------------------------------------------------------------- */ /* permute the input matrix before factorization */ /* -------------------------------------------------------------- */ if (stype > 0) { /* F = tril (A (p,p)') */ /* workspace: Iwork (2*nrow) */ A1 = CHOLMOD(ptranspose) (A, 2, L->Perm, NULL, 0, Common) ; /* A2 = triu (F') */ /* workspace: Iwork (nrow) */ A2 = CHOLMOD(ptranspose) (A1, 2, NULL, NULL, 0, Common) ; /* the symmetric case does not need F, free it and set to NULL*/ CHOLMOD(free_sparse) (&A1, Common) ; } else if (stype < 0) { /* A2 = triu (A (p,p)'), F not needed. This is the fastest * way to factorize a matrix using the simplicial routine * (cholmod_rowfac). */ /* workspace: Iwork (2*nrow) */ A2 = CHOLMOD(ptranspose) (A, 2, L->Perm, NULL, 0, Common) ; } else { /* F = A (p,f)' */ /* workspace: Iwork (nrow if no fset; MAX (nrow,ncol) if fset)*/ A1 = CHOLMOD(ptranspose) (A, 2, L->Perm, fset, fsize, Common) ; F = A1 ; /* A2 = F' */ /* workspace: Iwork (nrow) */ A2 = CHOLMOD(ptranspose) (F, 2, NULL, NULL, 0, Common) ; } S = A2 ; } /* ------------------------------------------------------------------ */ /* simplicial LDL' or LL' factorization */ /* ------------------------------------------------------------------ */ /* factorize beta*I+S (symmetric) or beta*I+F*F' (unsymmetric) */ /* workspace: Flag (nrow), W (nrow), Iwork (2*nrow) */ if (Common->status == CHOLMOD_OK) { grow2 = Common->grow2 ; L->is_ll = BOOLEAN (Common->final_ll) ; if (L->xtype == CHOLMOD_PATTERN && Common->final_pack) { /* allocate a factor with exactly the space required */ Common->grow2 = 0 ; } CHOLMOD(rowfac) (S, F, beta, 0, nrow, L, Common) ; Common->grow2 = grow2 ; } status = Common->status ; /* ------------------------------------------------------------------ */ /* convert to final form, if requested */ /* ------------------------------------------------------------------ */ if (Common->status >= CHOLMOD_OK && convert) { /* workspace: none */ CHOLMOD(change_factor) (L->xtype, L->is_ll, FALSE, Common->final_pack, Common->final_monotonic, L, Common) ; } } /* ---------------------------------------------------------------------- */ /* free A1 and A2 if they exist */ /* ---------------------------------------------------------------------- */ CHOLMOD(free_sparse) (&A1, Common) ; CHOLMOD(free_sparse) (&A2, Common) ; Common->status = MAX (Common->status, status) ; return (Common->status >= CHOLMOD_OK) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_postorder.c0000664000175000017500000002275014224052371022333 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_postorder =========================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Compute the postorder of a tree. */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "cholmod_cholesky.h" /* ========================================================================== */ /* === dfs ================================================================== */ /* ========================================================================== */ /* The code below includes both a recursive and non-recursive depth-first-search * of a tree. The recursive code is simpler, but can lead to stack overflow. * It is left here for reference, to understand what the non-recursive code * is computing. To try the recursive version, uncomment the following * #define, or compile the code with -DRECURSIVE. Be aware that stack * overflow may occur. #define RECURSIVE */ #ifdef RECURSIVE /* recursive version: a working code for reference only, not actual use */ static Int dfs /* return the new value of k */ ( Int p, /* start a DFS at node p */ Int k, /* start the node numbering at k */ Int Post [ ], /* Post ordering, modified on output */ Int Head [ ], /* Head [p] = youngest child of p; EMPTY on output */ Int Next [ ], /* Next [j] = sibling of j; unmodified */ Int Pstack [ ] /* unused */ ) { Int j ; /* start a DFS at each child of node p */ for (j = Head [p] ; j != EMPTY ; j = Next [j]) { /* start a DFS at child node j */ k = dfs (j, k, Post, Head, Next, Pstack) ; } Post [k++] = p ; /* order node p as the kth node */ Head [p] = EMPTY ; /* link list p no longer needed */ return (k) ; /* the next node will be numbered k */ } #else /* non-recursive version for actual use */ static Int dfs /* return the new value of k */ ( Int p, /* start the DFS at a root node p */ Int k, /* start the node numbering at k */ Int Post [ ], /* Post ordering, modified on output */ Int Head [ ], /* Head [p] = youngest child of p; EMPTY on output */ Int Next [ ], /* Next [j] = sibling of j; unmodified */ Int Pstack [ ] /* workspace of size n, undefined on input or output */ ) { Int j, phead ; /* put the root node on the stack */ Pstack [0] = p ; phead = 0 ; /* while the stack is not empty, do: */ while (phead >= 0) { /* grab the node p from top of the stack and get its youngest child j */ p = Pstack [phead] ; j = Head [p] ; if (j == EMPTY) { /* all children of p ordered. remove p from stack and order it */ phead-- ; Post [k++] = p ; /* order node p as the kth node */ } else { /* leave p on the stack. Start a DFS at child node j by putting * j on the stack and removing j from the list of children of p. */ Head [p] = Next [j] ; Pstack [++phead] = j ; } } return (k) ; /* the next node will be numbered k */ } #endif /* ========================================================================== */ /* === cholmod_postorder ==================================================== */ /* ========================================================================== */ /* Postorder a tree. The tree is either an elimination tree (the output from * from cholmod_etree) or a component tree (from cholmod_nested_dissection). * * An elimination tree is a complete tree of n nodes with Parent [j] > j or * Parent [j] = EMPTY if j is a root. On output Post [0..n-1] is a complete * permutation vector. * * A component tree is a subset of 0..n-1. Parent [j] = -2 if node j is not * in the component tree. Parent [j] = EMPTY if j is a root of the component * tree, and Parent [j] is in the range 0 to n-1 if j is in the component * tree but not a root. On output, Post [k] is defined only for nodes in * the component tree. Post [k] = j if node j is the kth node in the * postordered component tree, where k is in the range 0 to the number of * components minus 1. * * Node j is ignored and not included in the postorder if Parent [j] < EMPTY. * * As a result, check_parent (Parent, n,...) may fail on input, since * cholmod_check_parent assumes Parent is an elimination tree. Similarly, * cholmod_check_perm (Post, ...) may fail on output, since Post is a partial * permutation if Parent is a component tree. * * An optional node weight can be given. When starting a postorder at node j, * the children of j are ordered in increasing order of their weight. * If no weights are given (Weight is NULL) then children are ordered in * increasing order of their node number. The weight of a node must be in the * range 0 to n-1. Weights outside that range are silently converted to that * range (weights < 0 are treated as zero, and weights >= n are treated as n-1). * * * workspace: Head (n), Iwork (2*n) */ SuiteSparse_long CHOLMOD(postorder) /* return # of nodes postordered */ ( /* ---- input ---- */ Int *Parent, /* size n. Parent [j] = p if p is the parent of j */ size_t n, Int *Weight, /* size n, optional. Weight [j] is weight of node j */ /* ---- output --- */ Int *Post, /* size n. Post [k] = j is kth in postordered tree */ /* --------------- */ cholmod_common *Common ) { Int *Head, *Next, *Pstack, *Iwork ; Int j, p, k, w, nextj ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (Parent, EMPTY) ; RETURN_IF_NULL (Post, EMPTY) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* s = 2*n */ s = CHOLMOD(mult_size_t) (n, 2, &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (EMPTY) ; } CHOLMOD(allocate_work) (n, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (EMPTY) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Head = Common->Head ; /* size n+1, initially all EMPTY */ Iwork = Common->Iwork ; Next = Iwork ; /* size n (i/i/l) */ Pstack = Iwork + n ; /* size n (i/i/l) */ /* ---------------------------------------------------------------------- */ /* construct a link list of children for each node */ /* ---------------------------------------------------------------------- */ if (Weight == NULL) { /* in reverse order so children are in ascending order in each list */ for (j = n-1 ; j >= 0 ; j--) { p = Parent [j] ; if (p >= 0 && p < ((Int) n)) { /* add j to the list of children for node p */ Next [j] = Head [p] ; Head [p] = j ; } } /* Head [p] = j if j is the youngest (least-numbered) child of p */ /* Next [j1] = j2 if j2 is the next-oldest sibling of j1 */ } else { /* First, construct a set of link lists according to Weight. * * Whead [w] = j if node j is the first node in bucket w. * Next [j1] = j2 if node j2 follows j1 in a link list. */ Int *Whead = Pstack ; /* use Pstack as workspace for Whead [ */ for (w = 0 ; w < ((Int) n) ; w++) { Whead [w] = EMPTY ; } /* do in forward order, so nodes that ties are ordered by node index */ for (j = 0 ; j < ((Int) n) ; j++) { p = Parent [j] ; if (p >= 0 && p < ((Int) n)) { w = Weight [j] ; w = MAX (0, w) ; w = MIN (w, ((Int) n) - 1) ; /* place node j at the head of link list for weight w */ Next [j] = Whead [w] ; Whead [w] = j ; } } /* traverse weight buckets, placing each node in its parent's list */ for (w = n-1 ; w >= 0 ; w--) { for (j = Whead [w] ; j != EMPTY ; j = nextj) { nextj = Next [j] ; /* put node j in the link list of its parent */ p = Parent [j] ; ASSERT (p >= 0 && p < ((Int) n)) ; Next [j] = Head [p] ; Head [p] = j ; } } /* Whead no longer needed ] */ /* Head [p] = j if j is the lightest child of p */ /* Next [j1] = j2 if j2 is the next-heaviest sibling of j1 */ } /* ---------------------------------------------------------------------- */ /* start a DFS at each root node of the etree */ /* ---------------------------------------------------------------------- */ k = 0 ; for (j = 0 ; j < ((Int) n) ; j++) { if (Parent [j] == EMPTY) { /* j is the root of a tree; start a DFS here */ k = dfs (j, k, Post, Head, Next, Pstack) ; } } /* this would normally be EMPTY already, unless Parent is invalid */ for (j = 0 ; j < ((Int) n) ; j++) { Head [j] = EMPTY ; } PRINT1 (("postordered "ID" nodes\n", k)) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; return (k) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_rcond.c0000664000175000017500000001144214224052371021413 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_rcond =============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Return a rough estimate of the reciprocal of the condition number: * the minimum entry on the diagonal of L (or absolute entry of D for an LDL' * factorization) divided by the maximum entry (squared for LL'). L can be * real, complex, or zomplex. Returns -1 on error, 0 if the matrix is singular * or has a zero entry on the diagonal of L, 1 if the matrix is 0-by-0, or * min(diag(L))/max(diag(L)) otherwise. Never returns NaN; if L has a NaN on * the diagonal it returns zero instead. * * For an LL' factorization, (min(diag(L))/max(diag(L)))^2 is returned. * For an LDL' factorization, (min(diag(D))/max(diag(D))) is returned. */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "cholmod_cholesky.h" /* ========================================================================== */ /* === LMINMAX ============================================================== */ /* ========================================================================== */ /* Update lmin and lmax for one entry L(j,j) */ #define FIRST_LMINMAX(Ljj,lmin,lmax) \ { \ double ljj = Ljj ; \ if (IS_NAN (ljj)) \ { \ return (0) ; \ } \ lmin = ljj ; \ lmax = ljj ; \ } #define LMINMAX(Ljj,lmin,lmax) \ { \ double ljj = Ljj ; \ if (IS_NAN (ljj)) \ { \ return (0) ; \ } \ if (ljj < lmin) \ { \ lmin = ljj ; \ } \ else if (ljj > lmax) \ { \ lmax = ljj ; \ } \ } /* ========================================================================== */ /* === cholmod_rcond ======================================================== */ /* ========================================================================== */ double CHOLMOD(rcond) /* return min(diag(L)) / max(diag(L)) */ ( /* ---- input ---- */ cholmod_factor *L, /* --------------- */ cholmod_common *Common ) { double lmin, lmax, rcond ; double *Lx ; Int *Lpi, *Lpx, *Super, *Lp ; Int n, e, nsuper, s, k1, k2, psi, psend, psx, nsrow, nscol, jj, j ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (L, EMPTY) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, EMPTY) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ n = L->n ; if (n == 0) { return (1) ; } if (L->minor < L->n) { return (0) ; } e = (L->xtype == CHOLMOD_COMPLEX) ? 2 : 1 ; if (L->is_super) { /* L is supernodal */ nsuper = L->nsuper ; /* number of supernodes in L */ Lpi = L->pi ; /* column pointers for integer pattern */ Lpx = L->px ; /* column pointers for numeric values */ Super = L->super ; /* supernode sizes */ Lx = L->x ; /* numeric values */ FIRST_LMINMAX (Lx [0], lmin, lmax) ; /* first diagonal entry of L */ for (s = 0 ; s < nsuper ; s++) { k1 = Super [s] ; /* first column in supernode s */ k2 = Super [s+1] ; /* last column in supernode is k2-1 */ psi = Lpi [s] ; /* first row index is L->s [psi] */ psend = Lpi [s+1] ; /* last row index is L->s [psend-1] */ psx = Lpx [s] ; /* first numeric entry is Lx [psx] */ nsrow = psend - psi ; /* supernode is nsrow-by-nscol */ nscol = k2 - k1 ; for (jj = 0 ; jj < nscol ; jj++) { LMINMAX (Lx [e * (psx + jj + jj*nsrow)], lmin, lmax) ; } } } else { /* L is simplicial */ Lp = L->p ; Lx = L->x ; if (L->is_ll) { /* LL' factorization */ FIRST_LMINMAX (Lx [Lp [0]], lmin, lmax) ; for (j = 1 ; j < n ; j++) { LMINMAX (Lx [e * Lp [j]], lmin, lmax) ; } } else { /* LDL' factorization, the diagonal might be negative */ FIRST_LMINMAX (fabs (Lx [Lp [0]]), lmin, lmax) ; for (j = 1 ; j < n ; j++) { LMINMAX (fabs (Lx [e * Lp [j]]), lmin, lmax) ; } } } rcond = lmin / lmax ; if (L->is_ll) { rcond = rcond*rcond ; } return (rcond) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_resymbol.c0000664000175000017500000004441414224052371022147 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_resymbol ============================================ */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Recompute the symbolic pattern of L. Entries not in the symbolic pattern * are dropped. L->Perm can be used (or not) to permute the input matrix A. * * These routines are used after a supernodal factorization is converted into * a simplicial one, to remove zero entries that were added due to relaxed * supernode amalgamation. They can also be used after a series of downdates * to remove entries that would no longer be present if the matrix were * factorized from scratch. A downdate (cholmod_updown) does not remove any * entries from L. * * workspace: Flag (nrow), Head (nrow+1), * if symmetric: Iwork (2*nrow) * if unsymmetric: Iwork (2*nrow+ncol). * Allocates up to 2 copies of its input matrix A (pattern only). */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "cholmod_cholesky.h" /* ========================================================================== */ /* === cholmod_resymbol ===================================================== */ /* ========================================================================== */ /* Remove entries from L that are not in the factorization of P*A*P', P*A*A'*P', * or P*F*F'*P' (depending on A->stype and whether fset is NULL or not). * * cholmod_resymbol is the same as cholmod_resymbol_noperm, except that it * first permutes A according to L->Perm. A can be upper/lower/unsymmetric, * in contrast to cholmod_resymbol_noperm (which can be lower or unsym). */ int CHOLMOD(resymbol) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int pack, /* if TRUE, pack the columns of L */ /* ---- in/out --- */ cholmod_factor *L, /* factorization, entries pruned on output */ /* --------------- */ cholmod_common *Common ) { cholmod_sparse *H, *F, *G ; Int stype, nrow, ncol ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; Common->status = CHOLMOD_OK ; if (L->is_super) { /* cannot operate on a supernodal factorization */ ERROR (CHOLMOD_INVALID, "cannot operate on supernodal L") ; return (FALSE) ; } if (L->n != A->nrow) { /* dimensions must agree */ ERROR (CHOLMOD_INVALID, "A and L dimensions do not match") ; return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ stype = A->stype ; nrow = A->nrow ; ncol = A->ncol ; /* s = 2*nrow + (stype ? 0 : ncol) */ s = CHOLMOD(mult_size_t) (nrow, 2, &ok) ; s = CHOLMOD(add_size_t) (s, (stype ? 0 : ncol), &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (nrow, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* permute the input matrix if necessary */ /* ---------------------------------------------------------------------- */ H = NULL ; G = NULL ; if (stype > 0) { if (L->ordering == CHOLMOD_NATURAL) { /* F = triu(A)' */ /* workspace: Iwork (nrow) */ G = CHOLMOD(ptranspose) (A, 0, NULL, NULL, 0, Common) ; } else { /* F = triu(A(p,p))' */ /* workspace: Iwork (2*nrow) */ G = CHOLMOD(ptranspose) (A, 0, L->Perm, NULL, 0, Common) ; } F = G ; } else if (stype < 0) { if (L->ordering == CHOLMOD_NATURAL) { F = A ; } else { /* G = triu(A(p,p))' */ /* workspace: Iwork (2*nrow) */ G = CHOLMOD(ptranspose) (A, 0, L->Perm, NULL, 0, Common) ; /* H = G' */ /* workspace: Iwork (nrow) */ H = CHOLMOD(ptranspose) (G, 0, NULL, NULL, 0, Common) ; F = H ; } } else { if (L->ordering == CHOLMOD_NATURAL) { F = A ; } else { /* G = A(p,f)' */ /* workspace: Iwork (nrow if no fset; MAX (nrow,ncol) if fset)*/ G = CHOLMOD(ptranspose) (A, 0, L->Perm, fset, fsize, Common) ; /* H = G' */ /* workspace: Iwork (ncol) */ H = CHOLMOD(ptranspose) (G, 0, NULL, NULL, 0, Common) ; F = H ; } } /* No need to check for failure here. cholmod_resymbol_noperm will return * FALSE if F is NULL. */ /* ---------------------------------------------------------------------- */ /* resymbol */ /* ---------------------------------------------------------------------- */ ok = CHOLMOD(resymbol_noperm) (F, fset, fsize, pack, L, Common) ; /* ---------------------------------------------------------------------- */ /* free the temporary matrices, if they exist */ /* ---------------------------------------------------------------------- */ CHOLMOD(free_sparse) (&H, Common) ; CHOLMOD(free_sparse) (&G, Common) ; return (ok) ; } /* ========================================================================== */ /* === cholmod_resymbol_noperm ============================================== */ /* ========================================================================== */ /* Redo symbolic LDL' or LL' factorization of I + F*F' or I+A, where F=A(:,f). * * L already exists, but is a superset of the true dynamic pattern (simple * column downdates and row deletions haven't pruned anything). Just redo the * symbolic factorization and drop entries that are no longer there. The * diagonal is not modified. The number of nonzeros in column j of L * (L->nz[j]) can decrease. The column pointers (L->p[j]) remain unchanged if * pack is FALSE or if L is not monotonic. Otherwise, the columns of L are * packed in place. * * For the symmetric case, the columns of the lower triangular part of A * are accessed by column. NOTE that this the transpose of the general case. * * For the unsymmetric case, F=A(:,f) is accessed by column. * * A need not be sorted, and can be packed or unpacked. If L->Perm is not * identity, then A must already be permuted according to the permutation used * to factorize L. The advantage of using this routine is that it does not * need to create permuted copies of A first. * * This routine can be called if L is only partially factored via cholmod_rowfac * since all it does is prune. If an entry is in F*F' or A, but not in L, it * isn't added to L. * * L must be simplicial LDL' or LL'; it cannot be supernodal or symbolic. * * The set f is held in fset and fsize. * fset = NULL means ":" in MATLAB. fset is ignored. * fset != NULL means f = fset [0..fset-1]. * fset != NULL and fsize = 0 means f is the empty set. * There can be no duplicates in fset. * Common->status is set to CHOLMOD_INVALID if fset is invalid. * * workspace: Flag (nrow), Head (nrow+1), * if symmetric: Iwork (2*nrow) * if unsymmetric: Iwork (2*nrow+ncol). * Unlike cholmod_resymbol, this routine does not allocate any temporary * copies of its input matrix. */ int CHOLMOD(resymbol_noperm) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int pack, /* if TRUE, pack the columns of L */ /* ---- in/out --- */ cholmod_factor *L, /* factorization, entries pruned on output */ /* --------------- */ cholmod_common *Common ) { double *Lx, *Lz ; Int i, j, k, row, parent, p, pend, pdest, ncol, apacked, sorted, nrow, nf, use_fset, mark, jj, stype, xtype ; Int *Ap, *Ai, *Anz, *Li, *Lp, *Lnz, *Flag, *Head, *Link, *Anext, *Iwork ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; ncol = A->ncol ; nrow = A->nrow ; stype = A->stype ; ASSERT (IMPLIES (stype != 0, nrow == ncol)) ; if (stype > 0) { /* symmetric, with upper triangular part, not supported */ ERROR (CHOLMOD_INVALID, "symmetric upper not supported ") ; return (FALSE) ; } if (L->is_super) { /* cannot operate on a supernodal or symbolic factorization */ ERROR (CHOLMOD_INVALID, "cannot operate on supernodal L") ; return (FALSE) ; } if (L->n != A->nrow) { /* dimensions must agree */ ERROR (CHOLMOD_INVALID, "A and L dimensions do not match") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* s = 2*nrow + (stype ? 0 : ncol) */ s = CHOLMOD(mult_size_t) (nrow, 2, &ok) ; if (stype != 0) { s = CHOLMOD(add_size_t) (s, ncol, &ok) ; } if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (nrow, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; /* out of memory */ } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Ai = A->i ; Ap = A->p ; Anz = A->nz ; apacked = A->packed ; sorted = A->sorted ; Li = L->i ; Lx = L->x ; Lz = L->z ; Lp = L->p ; Lnz = L->nz ; xtype = L->xtype ; /* If L is monotonic on input, then it can be packed or * unpacked on output, depending on the pack input parameter. */ /* cannot pack a non-monotonic matrix */ if (!(L->is_monotonic)) { pack = FALSE ; } ASSERT (L->nzmax >= (size_t) (Lp [L->n])) ; pdest = 0 ; PRINT1 (("\n\n===================== Resymbol pack %d Apacked %d\n", pack, A->packed)) ; ASSERT (CHOLMOD(dump_sparse) (A, "ReSymbol A:", Common) >= 0) ; DEBUG (CHOLMOD(dump_factor) (L, "ReSymbol initial L (i, x):", Common)) ; /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Flag = Common->Flag ; /* size nrow */ Head = Common->Head ; /* size nrow+1 */ Iwork = Common->Iwork ; Link = Iwork ; /* size nrow (i/i/l) [ */ Lnz = Iwork + nrow ; /* size nrow (i/i/l), if L not packed */ Anext = Iwork + 2*((size_t) nrow) ; /* size ncol (i/i/l), unsym. only */ for (j = 0 ; j < nrow ; j++) { Link [j] = EMPTY ; } /* use Lnz in L itself */ Lnz = L->nz ; ASSERT (Lnz != NULL) ; /* ---------------------------------------------------------------------- */ /* for the unsymmetric case, queue each column of A (:,f) */ /* ---------------------------------------------------------------------- */ /* place each column of the basis set on the link list corresponding to */ /* the smallest row index in that column */ if (stype == 0) { use_fset = (fset != NULL) ; if (use_fset) { nf = fsize ; /* This is the only O(ncol) loop in cholmod_resymbol. * It is required only to check the fset. */ for (j = 0 ; j < ncol ; j++) { Anext [j] = -2 ; } for (jj = 0 ; jj < nf ; jj++) { j = fset [jj] ; if (j < 0 || j > ncol || Anext [j] != -2) { /* out-of-range or duplicate entry in fset */ ERROR (CHOLMOD_INVALID, "fset invalid") ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; return (FALSE) ; } /* flag column j as having been seen */ Anext [j] = EMPTY ; } /* the fset is now valid */ ASSERT (CHOLMOD(dump_perm) (fset, nf, ncol, "fset", Common)) ; } else { nf = ncol ; } for (jj = 0 ; jj < nf ; jj++) { j = (use_fset) ? (fset [jj]) : jj ; /* column j is the fset; find the smallest row (if any) */ p = Ap [j] ; pend = (apacked) ? (Ap [j+1]) : (p + Anz [j]) ; if (pend > p) { k = Ai [p] ; if (!sorted) { for ( ; p < pend ; p++) { k = MIN (k, Ai [p]) ; } } /* place column j on link list k */ ASSERT (k >= 0 && k < nrow) ; Anext [j] = Head [k] ; Head [k] = j ; } } } /* ---------------------------------------------------------------------- */ /* recompute symbolic LDL' factorization */ /* ---------------------------------------------------------------------- */ for (k = 0 ; k < nrow ; k++) { #ifndef NDEBUG PRINT1 (("\n\n================== Initial column k = "ID"\n", k)) ; for (p = Lp [k] ; p < Lp [k] + Lnz [k] ; p++) { PRINT1 ((" row: "ID" value: ", Li [p])) ; PRINT1 (("\n")) ; } PRINT1 (("Recomputing LDL, column k = "ID"\n", k)) ; #endif /* ------------------------------------------------------------------ */ /* compute column k of I+F*F' or I+A */ /* ------------------------------------------------------------------ */ /* flag the diagonal entry */ /* mark = CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; Flag [k] = mark ; PRINT1 ((" row: "ID" (diagonal)\n", k)) ; if (stype != 0) { /* merge column k of A into Flag (lower triangular part only) */ p = Ap [k] ; pend = (apacked) ? (Ap [k+1]) : (p + Anz [k]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i > k) { Flag [i] = mark ; } } } else { /* for each column j whos first row index is in row k */ for (j = Head [k] ; j != EMPTY ; j = Anext [j]) { /* merge column j of A into Flag */ PRINT1 ((" ---- A column "ID"\n", j)) ; p = Ap [j] ; pend = (apacked) ? (Ap [j+1]) : (p + Anz [j]) ; PRINT1 ((" length "ID" adding\n", pend-p)) ; for ( ; p < pend ; p++) { #ifndef NDEBUG ASSERT (Ai [p] >= k && Ai [p] < nrow) ; if (Flag [Ai [p]] < mark) PRINT1 ((" row "ID"\n", Ai [p])) ; #endif Flag [Ai [p]] = mark ; } } /* clear the kth link list */ Head [k] = EMPTY ; } /* ------------------------------------------------------------------ */ /* compute pruned pattern of kth column of L = union of children */ /* ------------------------------------------------------------------ */ /* for each column j of L whose parent is k */ for (j = Link [k] ; j != EMPTY ; j = Link [j]) { /* merge column j of L into Flag */ PRINT1 ((" ---- L column "ID"\n", k)) ; ASSERT (j < k) ; ASSERT (Lnz [j] > 0) ; p = Lp [j] ; pend = p + Lnz [j] ; ASSERT (Li [p] == j && Li [p+1] == k) ; p++ ; /* skip past the diagonal entry */ for ( ; p < pend ; p++) { /* add to pattern */ ASSERT (Li [p] >= k && Li [p] < nrow) ; Flag [Li [p]] = mark ; } } /* ------------------------------------------------------------------ */ /* prune the kth column of L */ /* ------------------------------------------------------------------ */ PRINT1 (("Final column of L:\n")) ; p = Lp [k] ; pend = p + Lnz [k] ; if (pack) { /* shift column k upwards */ Lp [k] = pdest ; } else { /* leave column k in place, just reduce Lnz [k] */ pdest = p ; } for ( ; p < pend ; p++) { ASSERT (pdest < pend) ; ASSERT (pdest <= p) ; row = Li [p] ; ASSERT (row >= k && row < nrow) ; if (Flag [row] == mark) { /* keep this entry */ Li [pdest] = row ; if (xtype == CHOLMOD_REAL) { Lx [pdest] = Lx [p] ; } else if (xtype == CHOLMOD_COMPLEX) { Lx [2*pdest ] = Lx [2*p ] ; Lx [2*pdest+1] = Lx [2*p+1] ; } else if (xtype == CHOLMOD_ZOMPLEX) { Lx [pdest] = Lx [p] ; Lz [pdest] = Lz [p] ; } pdest++ ; } } /* ------------------------------------------------------------------ */ /* prepare this column for its parent */ /* ------------------------------------------------------------------ */ Lnz [k] = pdest - Lp [k] ; PRINT1 ((" L("ID") length "ID"\n", k, Lnz [k])) ; ASSERT (Lnz [k] > 0) ; /* parent is the first entry in the column after the diagonal */ parent = (Lnz [k] > 1) ? (Li [Lp [k] + 1]) : EMPTY ; PRINT1 (("parent ("ID") = "ID"\n", k, parent)) ; ASSERT ((parent > k && parent < nrow) || (parent == EMPTY)) ; if (parent != EMPTY) { Link [k] = Link [parent] ; Link [parent] = k ; } } /* done using Iwork for Link, Lnz (if needed), and Anext ] */ /* ---------------------------------------------------------------------- */ /* convert L to packed, if requested */ /* ---------------------------------------------------------------------- */ if (pack) { /* finalize Lp */ Lp [nrow] = pdest ; /* Shrink L to be just large enough. It cannot fail. */ /* workspace: none */ ASSERT ((size_t) (Lp [nrow]) <= L->nzmax) ; CHOLMOD(reallocate_factor) (Lp [nrow], L, Common) ; ASSERT (Common->status >= CHOLMOD_OK) ; } /* ---------------------------------------------------------------------- */ /* clear workspace */ /* ---------------------------------------------------------------------- */ /* CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; DEBUG (CHOLMOD(dump_factor) (L, "ReSymbol final L (i, x):", Common)) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; return (TRUE) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_rowcolcounts.c0000664000175000017500000004365614224052371023063 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_rowcolcounts ======================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Compute the row and column counts of the Cholesky factor L of the matrix * A or A*A'. The etree and its postordering must already be computed (see * cholmod_etree and cholmod_postorder) and given as inputs to this routine. * * For the symmetric case (LL'=A), A is accessed by column. Only the lower * triangular part of A is used. Entries not in this part of the matrix are * ignored. This is the same as storing the upper triangular part of A by * rows, with entries in the lower triangular part being ignored. NOTE: this * representation is the TRANSPOSE of the input to cholmod_etree. * * For the unsymmetric case (LL'=AA'), A is accessed by column. Equivalently, * if A is viewed as a matrix in compressed-row form, this routine computes * the row and column counts for L where LL'=A'A. If the input vector f is * present, then F*F' is analyzed instead, where F = A(:,f). * * The set f is held in fset and fsize. * fset = NULL means ":" in MATLAB. fset is ignored. * fset != NULL means f = fset [0..fset-1]. * fset != NULL and fsize = 0 means f is the empty set. * Common->status is set to CHOLMOD_INVALID if fset is invalid. * * In both cases, the columns of A need not be sorted. * A can be packed or unpacked. * * References: * J. Gilbert, E. Ng, B. Peyton, "An efficient algorithm to compute row and * column counts for sparse Cholesky factorization", SIAM J. Matrix Analysis & * Applic., vol 15, 1994, pp. 1075-1091. * * J. Gilbert, X. Li, E. Ng, B. Peyton, "Computing row and column counts for * sparse QR and LU factorization", BIT, vol 41, 2001, pp. 693-710. * * workspace: * if symmetric: Flag (nrow), Iwork (2*nrow) * if unsymmetric: Flag (nrow), Iwork (2*nrow+ncol), Head (nrow+1) * * Supports any xtype (pattern, real, complex, or zomplex). */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "cholmod_cholesky.h" /* ========================================================================== */ /* === initialize_node ====================================================== */ /* ========================================================================== */ static int initialize_node /* initial work for kth node in postordered etree */ ( Int k, /* at the kth step of the algorithm (and kth node) */ Int Post [ ], /* Post [k] = i, the kth node in postordered etree */ Int Parent [ ], /* Parent [i] is the parent of i in the etree */ Int ColCount [ ], /* ColCount [c] is the current weight of node c */ Int PrevNbr [ ] /* PrevNbr [u] = k if u was last considered at step k */ ) { Int p, parent ; /* determine p, the kth node in the postordered etree */ p = Post [k] ; /* adjust the weight if p is not a root of the etree */ parent = Parent [p] ; if (parent != EMPTY) { ColCount [parent]-- ; } /* flag node p to exclude self edges (p,p) */ PrevNbr [p] = k ; return (p) ; } /* ========================================================================== */ /* === process_edge ========================================================= */ /* ========================================================================== */ /* edge (p,u) is being processed. p < u is a descendant of its ancestor u in * the etree. node p is the kth node in the postordered etree. */ static void process_edge ( Int p, /* process edge (p,u) of the matrix */ Int u, Int k, /* we are at the kth node in the postordered etree */ Int First [ ], /* First [i] = k if the postordering of first * descendent of node i is k */ Int PrevNbr [ ], /* u was last considered at step k = PrevNbr [u] */ Int ColCount [ ], /* ColCount [c] is the current weight of node c */ Int PrevLeaf [ ], /* s = PrevLeaf [u] means that s was the last leaf * seen in the subtree rooted at u. */ Int RowCount [ ], /* RowCount [i] is # of nonzeros in row i of L, * including the diagonal. Not computed if NULL. */ Int SetParent [ ], /* the FIND/UNION data structure, which forms a set * of trees. A root i has i = SetParent [i]. Following * a path from i to the root q of the subtree containing * i means that q is the SetParent representative of i. * All nodes in the tree could have their SetParent * equal to the root q; the tree representation is used * to save time. When a path is traced from i to its * root q, the path is re-traversed to set the SetParent * of the whole path to be the root q. */ Int Level [ ] /* Level [i] = length of path from node i to root */ ) { Int prevleaf, q, s, sparent ; if (First [p] > PrevNbr [u]) { /* p is a leaf of the subtree of u */ ColCount [p]++ ; prevleaf = PrevLeaf [u] ; if (prevleaf == EMPTY) { /* p is the first leaf of subtree of u; RowCount will be incremented * by the length of the path in the etree from p up to u. */ q = u ; } else { /* q = FIND (prevleaf): find the root q of the * SetParent tree containing prevleaf */ for (q = prevleaf ; q != SetParent [q] ; q = SetParent [q]) { ; } /* the root q has been found; re-traverse the path and * perform path compression */ s = prevleaf ; for (s = prevleaf ; s != q ; s = sparent) { sparent = SetParent [s] ; SetParent [s] = q ; } /* adjust the RowCount and ColCount; RowCount will be incremented by * the length of the path from p to the SetParent root q, and * decrement the ColCount of q by one. */ ColCount [q]-- ; } if (RowCount != NULL) { /* if RowCount is being computed, increment it by the length of * the path from p to q */ RowCount [u] += (Level [p] - Level [q]) ; } /* p is a leaf of the subtree of u, so mark PrevLeaf [u] to be p */ PrevLeaf [u] = p ; } /* flag u has having been processed at step k */ PrevNbr [u] = k ; } /* ========================================================================== */ /* === finalize_node ======================================================== */ /* ========================================================================== */ static void finalize_node /* compute UNION (p, Parent [p]) */ ( Int p, Int Parent [ ], /* Parent [p] is the parent of p in the etree */ Int SetParent [ ] /* see process_edge, above */ ) { /* all nodes in the SetParent tree rooted at p now have as their final * root the node Parent [p]. This computes UNION (p, Parent [p]) */ if (Parent [p] != EMPTY) { SetParent [p] = Parent [p] ; } } /* ========================================================================== */ /* === cholmod_rowcolcounts ================================================= */ /* ========================================================================== */ int CHOLMOD(rowcolcounts) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ Int *Parent, /* size nrow. Parent [i] = p if p is the parent of i */ Int *Post, /* size nrow. Post [k] = i if i is the kth node in * the postordered etree. */ /* ---- output --- */ Int *RowCount, /* size nrow. RowCount [i] = # entries in the ith row of * L, including the diagonal. */ Int *ColCount, /* size nrow. ColCount [i] = # entries in the ith * column of L, including the diagonal. */ Int *First, /* size nrow. First [i] = k is the least postordering * of any descendant of i. */ Int *Level, /* size nrow. Level [i] is the length of the path from * i to the root, with Level [root] = 0. */ /* --------------- */ cholmod_common *Common ) { double fl, ff ; Int *Ap, *Ai, *Anz, *PrevNbr, *SetParent, *Head, *PrevLeaf, *Anext, *Ipost, *Iwork ; Int i, j, r, k, len, s, p, pend, inew, stype, nf, anz, inode, parent, nrow, ncol, packed, use_fset, jj ; size_t w ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (Parent, FALSE) ; RETURN_IF_NULL (Post, FALSE) ; RETURN_IF_NULL (ColCount, FALSE) ; RETURN_IF_NULL (First, FALSE) ; RETURN_IF_NULL (Level, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; stype = A->stype ; if (stype > 0) { /* symmetric with upper triangular part not supported */ ERROR (CHOLMOD_INVALID, "symmetric upper not supported") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ nrow = A->nrow ; /* the number of rows of A */ ncol = A->ncol ; /* the number of columns of A */ /* w = 2*nrow + (stype ? 0 : ncol) */ w = CHOLMOD(mult_size_t) (nrow, 2, &ok) ; w = CHOLMOD(add_size_t) (w, (stype ? 0 : ncol), &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (nrow, w, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } ASSERT (CHOLMOD(dump_perm) (Post, nrow, nrow, "Post", Common)) ; ASSERT (CHOLMOD(dump_parent) (Parent, nrow, "Parent", Common)) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Ap = A->p ; /* size ncol+1, column pointers for A */ Ai = A->i ; /* the row indices of A, of size nz=Ap[ncol+1] */ Anz = A->nz ; packed = A->packed ; ASSERT (IMPLIES (!packed, Anz != NULL)) ; /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Iwork = Common->Iwork ; SetParent = Iwork ; /* size nrow (i/i/l) */ PrevNbr = Iwork + nrow ; /* size nrow (i/i/l) */ Anext = Iwork + 2*((size_t) nrow) ; /* size ncol (i/i/l) (unsym only) */ PrevLeaf = Common->Flag ; /* size nrow */ Head = Common->Head ; /* size nrow+1 (unsym only)*/ /* ---------------------------------------------------------------------- */ /* find the first descendant and level of each node in the tree */ /* ---------------------------------------------------------------------- */ /* First [i] = k if the postordering of first descendent of node i is k */ /* Level [i] = length of path from node i to the root (Level [root] = 0) */ for (i = 0 ; i < nrow ; i++) { First [i] = EMPTY ; } /* postorder traversal of the etree */ for (k = 0 ; k < nrow ; k++) { /* node i of the etree is the kth node in the postordered etree */ i = Post [k] ; /* i is a leaf if First [i] is still EMPTY */ /* ColCount [i] starts at 1 if i is a leaf, zero otherwise */ ColCount [i] = (First [i] == EMPTY) ? 1 : 0 ; /* traverse the path from node i to the root, stopping if we find a * node r whose First [r] is already defined. */ len = 0 ; for (r = i ; (r != EMPTY) && (First [r] == EMPTY) ; r = Parent [r]) { First [r] = k ; len++ ; } if (r == EMPTY) { /* we hit a root node, the level of which is zero */ len-- ; } else { /* we stopped at node r, where Level [r] is already defined */ len += Level [r] ; } /* re-traverse the path from node i to r; set the level of each node */ for (s = i ; s != r ; s = Parent [s]) { Level [s] = len-- ; } } /* ---------------------------------------------------------------------- */ /* AA' case: sort columns of A according to first postordered row index */ /* ---------------------------------------------------------------------- */ fl = 0.0 ; if (stype == 0) { /* [ use PrevNbr [0..nrow-1] as workspace for Ipost */ Ipost = PrevNbr ; /* Ipost [i] = k if i is the kth node in the postordered etree. */ for (k = 0 ; k < nrow ; k++) { Ipost [Post [k]] = k ; } use_fset = (fset != NULL) ; if (use_fset) { nf = fsize ; /* clear Anext to check fset */ for (j = 0 ; j < ncol ; j++) { Anext [j] = -2 ; } /* find the first postordered row in each column of A (post,f) * and place the column in the corresponding link list */ for (jj = 0 ; jj < nf ; jj++) { j = fset [jj] ; if (j < 0 || j > ncol || Anext [j] != -2) { /* out-of-range or duplicate entry in fset */ ERROR (CHOLMOD_INVALID, "fset invalid") ; return (FALSE) ; } /* flag column j as having been seen */ Anext [j] = EMPTY ; } /* fset is now valid */ ASSERT (CHOLMOD(dump_perm) (fset, nf, ncol, "fset", Common)) ; } else { nf = ncol ; } for (jj = 0 ; jj < nf ; jj++) { j = (use_fset) ? (fset [jj]) : jj ; /* column j is in the fset; find the smallest row (if any) */ p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; ff = (double) MAX (0, pend - p) ; fl += ff*ff + ff ; if (pend > p) { k = Ipost [Ai [p]] ; for ( ; p < pend ; p++) { inew = Ipost [Ai [p]] ; k = MIN (k, inew) ; } /* place column j in link list k */ ASSERT (k >= 0 && k < nrow) ; Anext [j] = Head [k] ; Head [k] = j ; } } /* Ipost no longer needed for inverse postordering ] * Head [k] contains a link list of all columns whose first * postordered row index is equal to k, for k = 0 to nrow-1. */ } /* ---------------------------------------------------------------------- */ /* compute the row counts and node weights */ /* ---------------------------------------------------------------------- */ if (RowCount != NULL) { for (i = 0 ; i < nrow ; i++) { RowCount [i] = 1 ; } } for (i = 0 ; i < nrow ; i++) { PrevLeaf [i] = EMPTY ; PrevNbr [i] = EMPTY ; SetParent [i] = i ; /* every node is in its own set, by itself */ } if (stype != 0) { /* ------------------------------------------------------------------ */ /* symmetric case: LL' = A */ /* ------------------------------------------------------------------ */ /* also determine the number of entries in triu(A) */ anz = nrow ; for (k = 0 ; k < nrow ; k++) { /* j is the kth node in the postordered etree */ j = initialize_node (k, Post, Parent, ColCount, PrevNbr) ; /* for all nonzeros A(i,j) below the diagonal, in column j of A */ p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i > j) { /* j is a descendant of i in etree(A) */ anz++ ; process_edge (j, i, k, First, PrevNbr, ColCount, PrevLeaf, RowCount, SetParent, Level) ; } } /* update SetParent: UNION (j, Parent [j]) */ finalize_node (j, Parent, SetParent) ; } Common->anz = anz ; } else { /* ------------------------------------------------------------------ */ /* unsymmetric case: LL' = AA' */ /* ------------------------------------------------------------------ */ for (k = 0 ; k < nrow ; k++) { /* inode is the kth node in the postordered etree */ inode = initialize_node (k, Post, Parent, ColCount, PrevNbr) ; /* for all cols j whose first postordered row is k: */ for (j = Head [k] ; j != EMPTY ; j = Anext [j]) { /* k is the first postordered row in column j of A */ /* for all rows i in column j: */ p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; /* has i already been considered at this step k */ if (PrevNbr [i] < k) { /* inode is a descendant of i in etree(AA') */ /* process edge (inode,i) and set PrevNbr[i] to k */ process_edge (inode, i, k, First, PrevNbr, ColCount, PrevLeaf, RowCount, SetParent, Level) ; } } } /* clear link list k */ Head [k] = EMPTY ; /* update SetParent: UNION (inode, Parent [inode]) */ finalize_node (inode, Parent, SetParent) ; } } /* ---------------------------------------------------------------------- */ /* finish computing the column counts */ /* ---------------------------------------------------------------------- */ for (j = 0 ; j < nrow ; j++) { parent = Parent [j] ; if (parent != EMPTY) { /* add the ColCount of j to its parent */ ColCount [parent] += ColCount [j] ; } } /* ---------------------------------------------------------------------- */ /* clear workspace */ /* ---------------------------------------------------------------------- */ Common->mark = EMPTY ; /* CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* ---------------------------------------------------------------------- */ /* flop count and nnz(L) for subsequent LL' numerical factorization */ /* ---------------------------------------------------------------------- */ /* use double to avoid integer overflow. lnz cannot be NaN. */ Common->aatfl = fl ; Common->lnz = 0. ; fl = 0 ; for (j = 0 ; j < nrow ; j++) { ff = (double) (ColCount [j]) ; Common->lnz += ff ; fl += ff*ff ; } Common->fl = fl ; PRINT1 (("rowcol fl %g lnz %g\n", Common->fl, Common->lnz)) ; return (TRUE) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_rowfac.c0000664000175000017500000006074014224052371021574 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_rowfac ============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2013, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Full or incremental numerical LDL' or LL' factorization (simplicial, not * supernodal) cholmod_factorize is the "easy" wrapper for this code, but it * does not provide access to incremental factorization. * * cholmod_rowfac computes the full or incremental LDL' or LL' factorization of * A+beta*I (where A is symmetric) or A*F+beta*I (where A and F are unsymmetric * and only the upper triangular part of A*F+beta*I is used). It computes * L (and D, for LDL') one row at a time. beta is real. * * A is nrow-by-ncol or nrow-by-nrow. In "packed" form it is a conventional * column-oriented sparse matrix. Row indices of column j are in * Ai [Ap [j] ... Ap [j+1]-1] and values in the same locations of Ax. * will be faster if A has sorted columns. In "unpacked" form the column * of A ends at Ap [j] + Anz [j] - 1 instead of Ap [j+1] - 1. * * Row indices in each column of A can be sorted or unsorted, but the routine * routine works fastest if A is sorted, or if only triu(A) is provided * for the symmetric case. * * The unit-diagonal nrow-by-nrow output matrix L is returned in "unpacked" * column form, with row indices of column j in Li [Lp [j] ... * Lp [j] + Lnz [j] - 1] and values in the same location in Lx. The row * indices in each column of L are in sorted order. The unit diagonal of L * is not stored. * * L can be a simplicial symbolic or numeric (L->is_super must be FALSE). * A symbolic factor is converted immediately into a numeric factor containing * the identity matrix. * * For a full factorization, kstart = 0 and kend = nrow. The existing nonzero * entries (numerical values in L->x and L->z for the zomplex case, and indices * in L->i), if any, are overwritten. * * To compute an incremental factorization, select kstart and kend as the range * of rows of L you wish to compute. A correct factorization will be computed * only if all descendants of all nodes k = kstart to kend-1 in the etree have * been factorized by a prior call to this routine, and if rows kstart to kend-1 * have not been factorized. This condition is NOT checked on input. * * --------------- * Symmetric case: * --------------- * * The factorization (in MATLAB notation) is: * * S = beta*I + A * S = triu (S) + triu (S,1)' * L*D*L' = S, or L*L' = S * * A is a conventional sparse matrix in compressed column form. Only the * diagonal and upper triangular part of A is accessed; the lower * triangular part is ignored and assumed to be equal to the upper * triangular part. For an incremental factorization, only columns kstart * to kend-1 of A are accessed. F is not used. * * --------------- * Unsymmetric case: * --------------- * * The factorization (in MATLAB notation) is: * * S = beta*I + A*F * S = triu (S) + triu (S,1)' * L*D*L' = S, or L*L' = S * * The typical case is F=A'. Alternatively, if F=A(:,f)', then this * routine factorizes S = beta*I + A(:,f)*A(:,f)'. * * All of A and F are accessed, but only the upper triangular part of A*F * is used. F must be of size A->ncol by A->nrow. F is used for the * unsymmetric case only. F can be packed or unpacked and it need not be * sorted. * * For a complete factorization of beta*I + A*A', * this routine performs a number of flops exactly equal to: * * sum (for each column j of A) of (Anz (j)^2 + Anz (j)), to form S * + * sum (for each column j of L) of (Lnz (j)^2 + 3*Lnz (j)), to factorize S * * where Anz (j) is the number of nonzeros in column j of A, and Lnz (j) * is the number of nonzero in column j of L below the diagonal. * * * workspace: Flag (nrow), W (nrow if real, 2*nrow if complex/zomplex), * Iwork (nrow) * * Supports any xtype, except a pattern-only input matrix A cannot be * factorized. */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "cholmod_cholesky.h" /* ========================================================================== */ /* === subtree ============================================================== */ /* ========================================================================== */ /* Compute the nonzero pattern of the sparse triangular solve Lx=b, where L in * this case is L(0:k-1,0:k-1), and b is a column of A. This is done by * traversing the kth row-subtree of the elimination tree of L, starting from * each nonzero entry in b. The pattern is returned postordered, and is valid * for a subsequent numerical triangular solve of Lx=b. The elimination tree * can be provided in a Parent array, or extracted from the pattern of L itself. * * The pattern of x = inv(L)*b is returned in Stack [top...]. * Also scatters b, or a multiple of b, into the work vector W. * * The SCATTER macro is defines how the numerical values of A or A*A' are to be * scattered. * * PARENT(i) is a macro the defines how the etree is accessed. It is either: * #define PARENT(i) Parent [i] * #define PARENT(i) (Lnz [i] > 1) ? (Li [Lp [i] + 1]) : EMPTY */ #define SUBTREE \ for ( ; p < pend ; p++) \ { \ i = Ai [p] ; \ if (i <= k) \ { \ /* scatter the column of A, or A*A' into Wx and Wz */ \ SCATTER ; \ /* start at node i and traverse up the subtree, stop at node k */ \ for (len = 0 ; i < k && i != EMPTY && Flag [i] < mark ; i = parent) \ { \ /* L(k,i) is nonzero, and seen for the first time */ \ Stack [len++] = i ; /* place i on the stack */ \ Flag [i] = mark ; /* mark i as visited */ \ parent = PARENT (i) ; /* traverse up the etree to the parent */ \ } \ /* move the path down to the bottom of the stack */ \ while (len > 0) \ { \ Stack [--top] = Stack [--len] ; \ } \ } \ else if (sorted) \ { \ break ; \ } \ } /* ========================================================================== */ /* === TEMPLATE ============================================================= */ /* ========================================================================== */ #define REAL #include "t_cholmod_rowfac.c" #define COMPLEX #include "t_cholmod_rowfac.c" #define ZOMPLEX #include "t_cholmod_rowfac.c" #define MASK #define REAL #include "t_cholmod_rowfac.c" #define COMPLEX #include "t_cholmod_rowfac.c" #define ZOMPLEX #include "t_cholmod_rowfac.c" #undef MASK /* ========================================================================== */ /* === cholmod_row_subtree ================================================== */ /* ========================================================================== */ /* Compute the nonzero pattern of the solution to the lower triangular system * L(0:k-1,0:k-1) * x = A (0:k-1,k) if A is symmetric, or * L(0:k-1,0:k-1) * x = A (0:k-1,:) * A (:,k)' if A is unsymmetric. * This gives the nonzero pattern of row k of L (excluding the diagonal). * The pattern is returned postordered. * * The symmetric case requires A to be in symmetric-upper form. * * The result is returned in R, a pre-allocated sparse matrix of size nrow-by-1, * with R->nzmax >= nrow. R is assumed to be packed (Rnz [0] is not updated); * the number of entries in R is given by Rp [0]. * * FUTURE WORK: a very minor change to this routine could allow it to compute * the nonzero pattern of x for any system Lx=b. The SUBTREE macro would need * to change, to eliminate its dependence on k. * * workspace: Flag (nrow) */ int CHOLMOD(row_subtree) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,f)' */ size_t krow, /* row k of L */ Int *Parent, /* elimination tree */ /* ---- output --- */ cholmod_sparse *R, /* pattern of L(k,:), 1-by-n with R->nzmax >= n */ /* --------------- */ cholmod_common *Common ) { Int *Rp, *Stack, *Flag, *Ap, *Ai, *Anz, *Fp, *Fi, *Fnz ; Int p, pend, parent, t, stype, nrow, k, pf, pfend, Fpacked, packed, sorted, top, len, i, mark ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (R, FALSE) ; RETURN_IF_NULL (Parent, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (R, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; stype = A->stype ; if (stype == 0) { RETURN_IF_NULL (F, FALSE) ; RETURN_IF_XTYPE_INVALID (F, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; } if (krow >= A->nrow) { ERROR (CHOLMOD_INVALID, "subtree: k invalid") ; return (FALSE) ; } if (R->ncol != 1 || A->nrow != R->nrow || A->nrow > R->nzmax) { ERROR (CHOLMOD_INVALID, "subtree: R invalid") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ nrow = A->nrow ; CHOLMOD(allocate_work) (nrow, 0, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ if (stype > 0) { /* symmetric upper case: F is not needed. It may be NULL */ Fp = NULL ; Fi = NULL ; Fnz = NULL ; Fpacked = TRUE ; } else if (stype == 0) { /* unsymmetric case: F is required. */ Fp = F->p ; Fi = F->i ; Fnz = F->nz ; Fpacked = F->packed ; } else { /* symmetric lower triangular form not supported */ ERROR (CHOLMOD_INVALID, "symmetric lower not supported") ; return (FALSE) ; } Ap = A->p ; Ai = A->i ; Anz = A->nz ; packed = A->packed ; sorted = A->sorted ; k = krow ; Stack = R->i ; /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Flag = Common->Flag ; /* size nrow, Flag [i] < mark must hold */ /* mark = CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; /* ---------------------------------------------------------------------- */ /* compute the pattern of L(k,:) */ /* ---------------------------------------------------------------------- */ top = nrow ; /* Stack is empty */ Flag [k] = mark ; /* do not include diagonal entry in Stack */ #define SCATTER /* do not scatter numerical values */ #define PARENT(i) Parent [i] /* use Parent for etree */ if (stype != 0) { /* scatter kth col of triu (A), get pattern L(k,:) */ p = Ap [k] ; pend = (packed) ? (Ap [k+1]) : (p + Anz [k]) ; SUBTREE ; } else { /* scatter kth col of triu (beta*I+AA'), get pattern L(k,:) */ pf = Fp [k] ; pfend = (Fpacked) ? (Fp [k+1]) : (pf + Fnz [k]) ; for ( ; pf < pfend ; pf++) { /* get nonzero entry F (t,k) */ t = Fi [pf] ; p = Ap [t] ; pend = (packed) ? (Ap [t+1]) : (p + Anz [t]) ; SUBTREE ; } } #undef SCATTER #undef PARENT /* shift the stack upwards, to the first part of R */ len = nrow - top ; for (i = 0 ; i < len ; i++) { Stack [i] = Stack [top + i] ; } Rp = R->p ; Rp [0] = 0 ; Rp [1] = len ; R->sorted = FALSE ; CHOLMOD(clear_flag) (Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_lsolve_pattern =============================================== */ /* ========================================================================== */ /* Compute the nonzero pattern of Y=L\B. L must be simplicial, and B * must be a single sparse column vector with B->stype = 0. The values of * B are not used; it just specifies a nonzero pattern. The pattern of * Y is not sorted, but is in topological order instead (suitable for a * sparse forward/backsolve). */ int CHOLMOD(lsolve_pattern) ( /* ---- input ---- */ cholmod_sparse *B, /* sparse right-hand-side (a single sparse column) */ cholmod_factor *L, /* the factor L from which parent(i) is derived */ /* ---- output --- */ cholmod_sparse *Yset, /* pattern of Y=L\B, n-by-1 with Y->nzmax >= n */ /* --------------- */ cholmod_common *Common ) { size_t krow ; RETURN_IF_NULL (B, FALSE) ; krow = B->nrow ; return (CHOLMOD(row_lsubtree) (B, NULL, 0, krow, L, Yset, Common)) ; } /* ========================================================================== */ /* === cholmod_row_lsubtree ================================================= */ /* ========================================================================== */ /* Identical to cholmod_row_subtree, except that the elimination tree is * obtained from L itself, as the first off-diagonal entry in each column. * L must be simplicial, not supernodal. * * If krow = A->nrow, then A must be a single sparse column vector, (A->stype * must be zero), and the nonzero pattern of x=L\b is computed, where b=A(:,0) * is the single sparse right-hand-side. The inputs Fi and fnz are ignored. * See CHOLMOD(lsolve_pattern) above for a simpler interface for this case. */ int CHOLMOD(row_lsubtree) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ Int *Fi, size_t fnz, /* nonzero pattern of kth row of A', not required * for the symmetric case. Need not be sorted. */ size_t krow, /* row k of L */ cholmod_factor *L, /* the factor L from which parent(i) is derived */ /* ---- output --- */ cholmod_sparse *R, /* pattern of L(k,:), n-by-1 with R->nzmax >= n */ /* --------------- */ cholmod_common *Common ) { Int *Rp, *Stack, *Flag, *Ap, *Ai, *Anz, *Lp, *Li, *Lnz ; Int p, pend, parent, t, stype, nrow, k, pf, packed, sorted, top, len, i, mark, ka ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (R, FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (R, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; nrow = A->nrow ; stype = A->stype ; if (stype < 0) { /* symmetric lower triangular form not supported */ ERROR (CHOLMOD_INVALID, "symmetric lower not supported") ; return (FALSE) ; } if (krow > nrow) { ERROR (CHOLMOD_INVALID, "lsubtree: krow invalid") ; return (FALSE) ; } else if (krow == nrow) { /* find pattern of x=L\b where b=A(:,0) */ k = nrow ; /* compute all of the result; don't stop in SUBTREE */ ka = 0 ; /* use column A(:,0) */ if (stype != 0 || A->ncol != 1) { /* A must be unsymmetric (it's a single sparse column vector) */ ERROR (CHOLMOD_INVALID, "lsubtree: A invalid") ; return (FALSE) ; } } else { /* find pattern of L(k,:) using A(:,k) and Fi if A unsymmetric */ k = krow ; /* which row of L to compute */ ka = k ; /* which column of A to use */ if (stype == 0) { RETURN_IF_NULL (Fi, FALSE) ; } } if (R->ncol != 1 || nrow != R->nrow || nrow > R->nzmax || ((krow == nrow || stype != 0) && ka >= A->ncol)) { ERROR (CHOLMOD_INVALID, "lsubtree: R invalid") ; return (FALSE) ; } if (L->is_super) { ERROR (CHOLMOD_INVALID, "lsubtree: L invalid (cannot be supernodal)") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ CHOLMOD(allocate_work) (nrow, 0, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Ap = A->p ; Ai = A->i ; Anz = A->nz ; packed = A->packed ; sorted = A->sorted ; Stack = R->i ; Lp = L->p ; Li = L->i ; Lnz = L->nz ; /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Flag = Common->Flag ; /* size nrow, Flag [i] < mark must hold */ mark = CHOLMOD(clear_flag) (Common) ; /* ---------------------------------------------------------------------- */ /* compute the pattern of L(k,:) */ /* ---------------------------------------------------------------------- */ top = nrow ; /* Stack is empty */ if (k < nrow) { Flag [k] = mark ; /* do not include diagonal entry in Stack */ } #define SCATTER /* do not scatter numerical values */ #define PARENT(i) (Lnz [i] > 1) ? (Li [Lp [i] + 1]) : EMPTY if (krow == nrow || stype != 0) { /* scatter kth col of triu (A), get pattern L(k,:) */ p = Ap [ka] ; pend = (packed) ? (Ap [ka+1]) : (p + Anz [ka]) ; SUBTREE ; } else { /* scatter kth col of triu (beta*I+AA'), get pattern L(k,:) */ for (pf = 0 ; pf < (Int) fnz ; pf++) { /* get nonzero entry F (t,k) */ t = Fi [pf] ; p = Ap [t] ; pend = (packed) ? (Ap [t+1]) : (p + Anz [t]) ; SUBTREE ; } } #undef SCATTER #undef PARENT /* shift the stack upwards, to the first part of R */ len = nrow - top ; for (i = 0 ; i < len ; i++) { Stack [i] = Stack [top + i] ; } Rp = R->p ; Rp [0] = 0 ; Rp [1] = len ; R->sorted = FALSE ; CHOLMOD(clear_flag) (Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_rowfac ======================================================= */ /* ========================================================================== */ /* This is the incremental factorization for general purpose usage. */ int CHOLMOD(rowfac) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,f)' */ double beta [2], /* factorize beta*I+A or beta*I+AA' */ size_t kstart, /* first row to factorize */ size_t kend, /* last row to factorize is kend-1 */ /* ---- in/out --- */ cholmod_factor *L, /* --------------- */ cholmod_common *Common ) { return (CHOLMOD(rowfac_mask2) (A, F, beta, kstart, kend, NULL, 0, NULL, L, Common)) ; } /* ========================================================================== */ /* === cholmod_rowfac_mask ================================================== */ /* ========================================================================== */ /* This is meant for use in LPDASA only. */ int CHOLMOD(rowfac_mask) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,f)' */ double beta [2], /* factorize beta*I+A or beta*I+AA' */ size_t kstart, /* first row to factorize */ size_t kend, /* last row to factorize is kend-1 */ Int *mask, /* size A->nrow. if mask[i] >= 0 row i is set to zero */ Int *RLinkUp, /* size A->nrow. link list of rows to compute */ /* ---- in/out --- */ cholmod_factor *L, /* --------------- */ cholmod_common *Common ) { Int maskmark = 0 ; return (CHOLMOD(rowfac_mask2) (A, F, beta, kstart, kend, mask, maskmark, RLinkUp, L, Common)) ; } /* ========================================================================== */ /* === cholmod_rowfac_mask2 ================================================= */ /* ========================================================================== */ /* This is meant for use in LPDASA only. */ int CHOLMOD(rowfac_mask2) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,f)' */ double beta [2], /* factorize beta*I+A or beta*I+AA' */ size_t kstart, /* first row to factorize */ size_t kend, /* last row to factorize is kend-1 */ Int *mask, /* size A->nrow. if mask[i] >= maskmark row i is set to zero */ Int maskmark, /* for mask [i] test */ Int *RLinkUp, /* size A->nrow. link list of rows to compute */ /* ---- in/out --- */ cholmod_factor *L, /* --------------- */ cholmod_common *Common ) { Int n ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; if (L->xtype != CHOLMOD_PATTERN && A->xtype != L->xtype) { ERROR (CHOLMOD_INVALID, "xtype of A and L do not match") ; return (FALSE) ; } if (L->is_super) { ERROR (CHOLMOD_INVALID, "can only do simplicial factorization"); return (FALSE) ; } if (A->stype == 0) { RETURN_IF_NULL (F, FALSE) ; if (A->xtype != F->xtype) { ERROR (CHOLMOD_INVALID, "xtype of A and F do not match") ; return (FALSE) ; } } if (A->stype < 0) { /* symmetric lower triangular form not supported */ ERROR (CHOLMOD_INVALID, "symmetric lower not supported") ; return (FALSE) ; } if (kend > L->n) { ERROR (CHOLMOD_INVALID, "kend invalid") ; return (FALSE) ; } if (A->nrow != L->n) { ERROR (CHOLMOD_INVALID, "dimensions of A and L do not match") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; Common->rowfacfl = 0 ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* Xwork is of size n for the real case, 2*n for complex/zomplex */ n = L->n ; /* s = ((A->xtype != CHOLMOD_REAL) ? 2:1)*n */ s = CHOLMOD(mult_size_t) (n, ((A->xtype != CHOLMOD_REAL) ? 2:1), &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (n, n, s, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, A->nrow, Common)) ; /* ---------------------------------------------------------------------- */ /* factorize the matrix, using template routine */ /* ---------------------------------------------------------------------- */ if (RLinkUp == NULL) { switch (A->xtype) { case CHOLMOD_REAL: ok = r_cholmod_rowfac (A, F, beta, kstart, kend, L, Common) ; break ; case CHOLMOD_COMPLEX: ok = c_cholmod_rowfac (A, F, beta, kstart, kend, L, Common) ; break ; case CHOLMOD_ZOMPLEX: ok = z_cholmod_rowfac (A, F, beta, kstart, kend, L, Common) ; break ; } } else { switch (A->xtype) { case CHOLMOD_REAL: ok = r_cholmod_rowfac_mask (A, F, beta, kstart, kend, mask, maskmark, RLinkUp, L, Common) ; break ; case CHOLMOD_COMPLEX: ok = c_cholmod_rowfac_mask (A, F, beta, kstart, kend, mask, maskmark, RLinkUp, L, Common) ; break ; case CHOLMOD_ZOMPLEX: ok = z_cholmod_rowfac_mask (A, F, beta, kstart, kend, mask, maskmark, RLinkUp, L, Common) ; break ; } } return (ok) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_solve.c0000664000175000017500000014152414224052371021443 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_solve =============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2013, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Solve one of the following systems. D is identity for an LL' factorization, * in which the D operation is skipped: * * Ax=b 0: CHOLMOD_A x = P' * (L' \ (D \ (L \ (P * b)))) * LDL'x=b 1: CHOLMOD_LDLt x = (L' \ (D \ (L \ ( b)))) * LDx=b 2: CHOLMOD_LD x = ( (D \ (L \ ( b)))) * DL'x=b 3: CHOLMOD_DLt x = (L' \ (D \ ( ( b)))) * Lx=b 4: CHOLMOD_L x = ( ( (L \ ( b)))) * L'x=b 5: CHOLMOD_Lt x = (L' \ ( ( ( b)))) * Dx=b 6: CHOLMOD_D x = ( (D \ ( ( b)))) * x=Pb 7: CHOLMOD_P x = ( ( ( (P * b)))) * x=P'b 8: CHOLMOD_Pt x = P' * ( ( ( ( b)))) * * The factorization can be simplicial LDL', simplicial LL', or supernodal LL'. * For an LL' factorization, D is the identity matrix. Thus CHOLMOD_LD and * CHOLMOD_L solve the same system if an LL' factorization was performed, * for example. * * The supernodal solver uses BLAS routines dtrsv, dgemv, dtrsm, and dgemm, * or their complex counterparts ztrsv, zgemv, ztrsm, and zgemm. * * If both L and B are real, then X is returned real. If either is complex * or zomplex, X is returned as either complex or zomplex, depending on the * Common->prefer_zomplex parameter. * * Supports any numeric xtype (pattern-only matrices not supported). * * This routine does not check to see if the diagonal of L or D is zero, * because sometimes a partial solve can be done with indefinite or singular * matrix. If you wish to check in your own code, test L->minor. If * L->minor == L->n, then the matrix has no zero diagonal entries. * If k = L->minor < L->n, then L(k,k) is zero for an LL' factorization, or * D(k,k) is zero for an LDL' factorization. * * This routine returns X as NULL only if it runs out of memory. If L is * indefinite or singular, then X may contain Inf's or NaN's, but it will * exist on output. */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "cholmod_cholesky.h" #ifndef NSUPERNODAL #include "cholmod_supernodal.h" #endif /* ========================================================================== */ /* === TEMPLATE ============================================================= */ /* ========================================================================== */ #define REAL #include "t_cholmod_solve.c" #define COMPLEX #include "t_cholmod_solve.c" #define ZOMPLEX #include "t_cholmod_solve.c" /* ========================================================================== */ /* === Permutation macro ==================================================== */ /* ========================================================================== */ /* If Perm is NULL, it is interpretted as the identity permutation */ #define P(k) ((Perm == NULL) ? (k) : Perm [k]) /* ========================================================================== */ /* === perm ================================================================= */ /* ========================================================================== */ /* Y = B (P (1:nrow), k1 : min (k1+ncols,ncol)-1) where B is nrow-by-ncol. * * Creates a permuted copy of a contiguous set of columns of B. * Y is already allocated on input. Y must be of sufficient size. Let nk be * the number of columns accessed in B. Y->xtype determines the complexity of * the result. * * If B is real and Y is complex (or zomplex), only the real part of B is * copied into Y. The imaginary part of Y is set to zero. * * If B is complex (or zomplex) and Y is real, both the real and imaginary and * parts of B are returned in Y. Y is returned as nrow-by-2*nk. The even * columns of Y contain the real part of B and the odd columns contain the * imaginary part of B. Y->nzmax must be >= 2*nrow*nk. Otherise, Y is * returned as nrow-by-nk with leading dimension nrow. Y->nzmax must be >= * nrow*nk. * * The case where the input (B) is real and the output (Y) is zomplex is * not used. */ static void perm ( /* ---- input ---- */ cholmod_dense *B, /* input matrix B */ Int *Perm, /* optional input permutation (can be NULL) */ Int k1, /* first column of B to copy */ Int ncols, /* last column to copy is min(k1+ncols,B->ncol)-1 */ /* ---- in/out --- */ cholmod_dense *Y /* output matrix Y, already allocated */ ) { double *Yx, *Yz, *Bx, *Bz ; Int k2, nk, p, k, j, nrow, ncol, d, dual, dj, j2 ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ ncol = B->ncol ; nrow = B->nrow ; k2 = MIN (k1+ncols, ncol) ; nk = MAX (k2 - k1, 0) ; dual = (Y->xtype == CHOLMOD_REAL && B->xtype != CHOLMOD_REAL) ? 2 : 1 ; d = B->d ; Bx = B->x ; Bz = B->z ; Yx = Y->x ; Yz = Y->z ; Y->nrow = nrow ; Y->ncol = dual*nk ; Y->d = nrow ; ASSERT (((Int) Y->nzmax) >= nrow*nk*dual) ; /* ---------------------------------------------------------------------- */ /* Y = B (P (1:nrow), k1:k2-1) */ /* ---------------------------------------------------------------------- */ switch (Y->xtype) { case CHOLMOD_REAL: switch (B->xtype) { case CHOLMOD_REAL: /* Y real, B real */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [k + j2] = Bx [p] ; /* real */ } } break ; case CHOLMOD_COMPLEX: /* Y real, B complex. Y is nrow-by-2*nk */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * 2 * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [k + j2 ] = Bx [2*p ] ; /* real */ Yx [k + j2 + nrow] = Bx [2*p+1] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y real, B zomplex. Y is nrow-by-2*nk */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * 2 * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [k + j2 ] = Bx [p] ; /* real */ Yx [k + j2 + nrow] = Bz [p] ; /* imag */ } } break ; } break ; case CHOLMOD_COMPLEX: switch (B->xtype) { case CHOLMOD_REAL: /* Y complex, B real */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * 2 * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [2*k + j2] = Bx [p] ; /* real */ Yx [2*k+1 + j2] = 0 ; /* imag */ } } break ; case CHOLMOD_COMPLEX: /* Y complex, B complex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * 2 * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [2*k + j2] = Bx [2*p ] ; /* real */ Yx [2*k+1 + j2] = Bx [2*p+1] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y complex, B zomplex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * 2 * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [2*k + j2] = Bx [p] ; /* real */ Yx [2*k+1 + j2] = Bz [p] ; /* imag */ } } break ; } break ; case CHOLMOD_ZOMPLEX: switch (B->xtype) { #if 0 case CHOLMOD_REAL: /* this case is not used */ break ; #endif case CHOLMOD_COMPLEX: /* Y zomplex, B complex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [k + j2] = Bx [2*p ] ; /* real */ Yz [k + j2] = Bx [2*p+1] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y zomplex, B zomplex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [k + j2] = Bx [p] ; /* real */ Yz [k + j2] = Bz [p] ; /* imag */ } } break ; } break ; } } /* ========================================================================== */ /* === iperm ================================================================ */ /* ========================================================================== */ /* X (P (1:nrow), k1 : min (k1+ncols,ncol)-1) = Y where X is nrow-by-ncol. * * Copies and permutes Y into a contiguous set of columns of X. X is already * allocated on input. Y must be of sufficient size. Let nk be the number * of columns accessed in X. X->xtype determines the complexity of the result. * * If X is real and Y is complex (or zomplex), only the real part of B is * copied into X. The imaginary part of Y is ignored. * * If X is complex (or zomplex) and Y is real, both the real and imaginary and * parts of Y are returned in X. Y is nrow-by-2*nk. The even * columns of Y contain the real part of B and the odd columns contain the * imaginary part of B. Y->nzmax must be >= 2*nrow*nk. Otherise, Y is * nrow-by-nk with leading dimension nrow. Y->nzmax must be >= nrow*nk. * * The case where the input (Y) is complex and the output (X) is real, * and the case where the input (Y) is zomplex and the output (X) is real, * are not used. */ static void iperm ( /* ---- input ---- */ cholmod_dense *Y, /* input matrix Y */ Int *Perm, /* optional input permutation (can be NULL) */ Int k1, /* first column of B to copy */ Int ncols, /* last column to copy is min(k1+ncols,B->ncol)-1 */ /* ---- in/out --- */ cholmod_dense *X /* output matrix X, already allocated */ ) { double *Yx, *Yz, *Xx, *Xz ; Int k2, nk, p, k, j, nrow, ncol, d, dj, j2 ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ ncol = X->ncol ; nrow = X->nrow ; k2 = MIN (k1+ncols, ncol) ; nk = MAX (k2 - k1, 0) ; d = X->d ; Xx = X->x ; Xz = X->z ; Yx = Y->x ; Yz = Y->z ; ASSERT (((Int) Y->nzmax) >= nrow*nk* ((X->xtype != CHOLMOD_REAL && Y->xtype == CHOLMOD_REAL) ? 2:1)) ; /* ---------------------------------------------------------------------- */ /* X (P (1:nrow), k1:k2-1) = Y */ /* ---------------------------------------------------------------------- */ switch (Y->xtype) { case CHOLMOD_REAL: switch (X->xtype) { case CHOLMOD_REAL: /* Y real, X real */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [p] = Yx [k + j2] ; /* real */ } } break ; case CHOLMOD_COMPLEX: /* Y real, X complex. Y is nrow-by-2*nk */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * 2 * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [2*p ] = Yx [k + j2 ] ; /* real */ Xx [2*p+1] = Yx [k + j2 + nrow] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y real, X zomplex. Y is nrow-by-2*nk */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * 2 * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [p] = Yx [k + j2 ] ; /* real */ Xz [p] = Yx [k + j2 + nrow] ; /* imag */ } } break ; } break ; case CHOLMOD_COMPLEX: switch (X->xtype) { #if 0 case CHOLMOD_REAL: /* this case is not used */ break ; #endif case CHOLMOD_COMPLEX: /* Y complex, X complex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * 2 * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [2*p ] = Yx [2*k + j2] ; /* real */ Xx [2*p+1] = Yx [2*k+1 + j2] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y complex, X zomplex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * 2 * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [p] = Yx [2*k + j2] ; /* real */ Xz [p] = Yx [2*k+1 + j2] ; /* imag */ } } break ; } break ; case CHOLMOD_ZOMPLEX: switch (X->xtype) { #if 0 case CHOLMOD_REAL: /* this case is not used */ break ; #endif case CHOLMOD_COMPLEX: /* Y zomplex, X complex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [2*p ] = Yx [k + j2] ; /* real */ Xx [2*p+1] = Yz [k + j2] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y zomplex, X zomplex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = nrow * (j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [p] = Yx [k + j2] ; /* real */ Xz [p] = Yz [k + j2] ; /* imag */ } } break ; } break ; } } /* ========================================================================== */ /* === ptrans =============================================================== */ /* ========================================================================== */ /* Y = B (P (1:nrow), k1 : min (k1+ncols,ncol)-1)' where B is nrow-by-ncol. * * Creates a permuted and transposed copy of a contiguous set of columns of B. * Y is already allocated on input. Y must be of sufficient size. Let nk be * the number of columns accessed in B. Y->xtype determines the complexity of * the result. * * If B is real and Y is complex (or zomplex), only the real part of B is * copied into Y. The imaginary part of Y is set to zero. * * If B is complex (or zomplex) and Y is real, both the real and imaginary and * parts of B are returned in Y. Y is returned as 2*nk-by-nrow. The even * rows of Y contain the real part of B and the odd rows contain the * imaginary part of B. Y->nzmax must be >= 2*nrow*nk. Otherise, Y is * returned as nk-by-nrow with leading dimension nk. Y->nzmax must be >= * nrow*nk. * * The array transpose is performed, not the complex conjugate transpose. */ static void ptrans ( /* ---- input ---- */ cholmod_dense *B, /* input matrix B */ Int *Perm, /* optional input permutation (can be NULL) */ Int k1, /* first column of B to copy */ Int ncols, /* last column to copy is min(k1+ncols,B->ncol)-1 */ /* ---- in/out --- */ cholmod_dense *Y /* output matrix Y, already allocated */ ) { double *Yx, *Yz, *Bx, *Bz ; Int k2, nk, p, k, j, nrow, ncol, d, dual, dj, j2 ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ ncol = B->ncol ; nrow = B->nrow ; k2 = MIN (k1+ncols, ncol) ; nk = MAX (k2 - k1, 0) ; dual = (Y->xtype == CHOLMOD_REAL && B->xtype != CHOLMOD_REAL) ? 2 : 1 ; d = B->d ; Bx = B->x ; Bz = B->z ; Yx = Y->x ; Yz = Y->z ; Y->nrow = dual*nk ; Y->ncol = nrow ; Y->d = dual*nk ; ASSERT (((Int) Y->nzmax) >= nrow*nk*dual) ; /* ---------------------------------------------------------------------- */ /* Y = B (P (1:nrow), k1:k2-1)' */ /* ---------------------------------------------------------------------- */ switch (Y->xtype) { case CHOLMOD_REAL: switch (B->xtype) { case CHOLMOD_REAL: /* Y real, B real */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = j-k1 ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [j2 + k*nk] = Bx [p] ; /* real */ } } break ; case CHOLMOD_COMPLEX: /* Y real, B complex. Y is 2*nk-by-nrow */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = 2*(j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [j2 + k*2*nk] = Bx [2*p ] ; /* real */ Yx [j2+1 + k*2*nk] = Bx [2*p+1] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y real, B zomplex. Y is 2*nk-by-nrow */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = 2*(j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [j2 + k*2*nk] = Bx [p] ; /* real */ Yx [j2+1 + k*2*nk] = Bz [p] ; /* imag */ } } break ; } break ; case CHOLMOD_COMPLEX: switch (B->xtype) { case CHOLMOD_REAL: /* Y complex, B real */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = 2*(j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [j2 + k*2*nk] = Bx [p] ; /* real */ Yx [j2+1 + k*2*nk] = 0 ; /* imag */ } } break ; case CHOLMOD_COMPLEX: /* Y complex, B complex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = 2*(j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [j2 + k*2*nk] = Bx [2*p ] ; /* real */ Yx [j2+1 + k*2*nk] = Bx [2*p+1] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y complex, B zomplex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = 2*(j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [j2 + k*2*nk] = Bx [p] ; /* real */ Yx [j2+1 + k*2*nk] = Bz [p] ; /* imag */ } } break ; } break ; case CHOLMOD_ZOMPLEX: switch (B->xtype) { case CHOLMOD_REAL: /* Y zomplex, B real */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = j-k1 ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [j2 + k*nk] = Bx [p] ; /* real */ Yz [j2 + k*nk] = 0 ; /* imag */ } } break ; case CHOLMOD_COMPLEX: /* Y zomplex, B complex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = j-k1 ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [j2 + k*nk] = Bx [2*p ] ; /* real */ Yz [j2 + k*nk] = Bx [2*p+1] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y zomplex, B zomplex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = j-k1 ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Yx [j2 + k*nk] = Bx [p] ; /* real */ Yz [j2 + k*nk] = Bz [p] ; /* imag */ } } break ; } break ; } } /* ========================================================================== */ /* === iptrans ============================================================== */ /* ========================================================================== */ /* X (P (1:nrow), k1 : min (k1+ncols,ncol)-1) = Y' where X is nrow-by-ncol. * * Copies into a permuted and transposed contiguous set of columns of X. * X is already allocated on input. Y must be of sufficient size. Let nk be * the number of columns accessed in X. X->xtype determines the complexity of * the result. * * If X is real and Y is complex (or zomplex), only the real part of Y is * copied into X. The imaginary part of Y is ignored. * * If X is complex (or zomplex) and Y is real, both the real and imaginary and * parts of X are returned in Y. Y is 2*nk-by-nrow. The even * rows of Y contain the real part of X and the odd rows contain the * imaginary part of X. Y->nzmax must be >= 2*nrow*nk. Otherise, Y is * nk-by-nrow with leading dimension nk. Y->nzmax must be >= nrow*nk. * * The case where Y is complex or zomplex, and X is real, is not used. * * The array transpose is performed, not the complex conjugate transpose. */ static void iptrans ( /* ---- input ---- */ cholmod_dense *Y, /* input matrix Y */ Int *Perm, /* optional input permutation (can be NULL) */ Int k1, /* first column of X to copy into */ Int ncols, /* last column to copy is min(k1+ncols,X->ncol)-1 */ /* ---- in/out --- */ cholmod_dense *X /* output matrix X, already allocated */ ) { double *Yx, *Yz, *Xx, *Xz ; Int k2, nk, p, k, j, nrow, ncol, d, dj, j2 ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ ncol = X->ncol ; nrow = X->nrow ; k2 = MIN (k1+ncols, ncol) ; nk = MAX (k2 - k1, 0) ; d = X->d ; Xx = X->x ; Xz = X->z ; Yx = Y->x ; Yz = Y->z ; ASSERT (((Int) Y->nzmax) >= nrow*nk* ((X->xtype != CHOLMOD_REAL && Y->xtype == CHOLMOD_REAL) ? 2:1)) ; /* ---------------------------------------------------------------------- */ /* X (P (1:nrow), k1:k2-1) = Y' */ /* ---------------------------------------------------------------------- */ switch (Y->xtype) { case CHOLMOD_REAL: switch (X->xtype) { case CHOLMOD_REAL: /* Y real, X real */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = j-k1 ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [p] = Yx [j2 + k*nk] ; /* real */ } } break ; case CHOLMOD_COMPLEX: /* Y real, X complex. Y is 2*nk-by-nrow */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = 2*(j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [2*p ] = Yx [j2 + k*2*nk] ; /* real */ Xx [2*p+1] = Yx [j2+1 + k*2*nk] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y real, X zomplex. Y is 2*nk-by-nrow */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = 2*(j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [p] = Yx [j2 + k*2*nk] ; /* real */ Xz [p] = Yx [j2+1 + k*2*nk] ; /* imag */ } } break ; } break ; case CHOLMOD_COMPLEX: switch (X->xtype) { #if 0 case CHOLMOD_REAL: /* this case is not used */ break ; #endif case CHOLMOD_COMPLEX: /* Y complex, X complex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = 2*(j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [2*p ] = Yx [j2 + k*2*nk] ; /* real */ Xx [2*p+1] = Yx [j2+1 + k*2*nk] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y complex, X zomplex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = 2*(j-k1) ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [p] = Yx [j2 + k*2*nk] ; /* real */ Xz [p] = Yx [j2+1 + k*2*nk] ; /* imag */ } } break ; } break ; case CHOLMOD_ZOMPLEX: switch (X->xtype) { #if 0 case CHOLMOD_REAL: /* this case is not used */ break ; #endif case CHOLMOD_COMPLEX: /* Y zomplex, X complex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = j-k1 ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [2*p ] = Yx [j2 + k*nk] ; /* real */ Xx [2*p+1] = Yz [j2 + k*nk] ; /* imag */ } } break ; case CHOLMOD_ZOMPLEX: /* Y zomplex, X zomplex */ for (j = k1 ; j < k2 ; j++) { dj = d*j ; j2 = j-k1 ; for (k = 0 ; k < nrow ; k++) { p = P(k) + dj ; Xx [p] = Yx [j2 + k*nk] ; /* real */ Xz [p] = Yz [j2 + k*nk] ; /* imag */ } } break ; } break ; } } /* ========================================================================== */ /* === cholmod_solve ======================================================== */ /* ========================================================================== */ /* Solve a linear system. * * The factorization can be simplicial LDL', simplicial LL', or supernodal LL'. * The Dx=b solve returns silently for the LL' factorizations (it is implicitly * identity). */ cholmod_dense *CHOLMOD(solve) ( /* ---- input ---- */ int sys, /* system to solve */ cholmod_factor *L, /* factorization to use */ cholmod_dense *B, /* right-hand-side */ /* --------------- */ cholmod_common *Common ) { cholmod_dense *Y = NULL, *X = NULL ; cholmod_dense *E = NULL ; int ok ; /* do the solve, allocating workspaces as needed */ ok = CHOLMOD (solve2) (sys, L, B, NULL, &X, NULL, &Y, &E, Common) ; /* free workspaces if allocated, and free result if an error occured */ CHOLMOD(free_dense) (&Y, Common) ; CHOLMOD(free_dense) (&E, Common) ; if (!ok) { CHOLMOD(free_dense) (&X, Common) ; } return (X) ; } /* ========================================================================== */ /* === cholmod_solve2 ======================================================= */ /* ========================================================================== */ /* This function acts just like cholmod_solve, except that the solution X and * the internal workspace (Y and E) can be passed in preallocated. If the * solution X or any required workspaces are not allocated on input, or if they * are the wrong size or type, then this function frees them and reallocates * them as the proper size and type. Thus, if you have a sequence of solves to * do, you can let this function allocate X, Y, and E on the first call. * Subsequent calls to cholmod_solve2 can then reuse this space. You must * then free the workspaces Y and E (and X if desired) when you are finished. * For example, the first call to cholmod_l_solve2, below, will solve the * requested system. The next 2 calls (with different right-hand-sides but * the same value of "sys") will resuse the workspace and solution X from the * first call. Finally, when all solves are done, you must free the workspaces * Y and E (otherwise you will have a memory leak), and you should also free X * when you are done with it. Note that on input, X, Y, and E must be either * valid cholmod_dense matrices, or initialized to NULL. You cannot pass in an * uninitialized X, Y, or E. * * cholmod_dense *X = NULL, *Y = NULL, *E = NULL ; * ... * cholmod_l_solve2 (sys, L, B1, NULL, &X, NULL, &Y, &E, Common) ; * cholmod_l_solve2 (sys, L, B2, NULL, &X, NULL, &Y, &E, Common) ; * cholmod_l_solve2 (sys, L, B3, NULL, &X, NULL, &Y, &E, Common) ; * cholmod_l_free_dense (&X, Common) ; * cholmod_l_free_dense (&Y, Common) ; * cholmod_l_free_dense (&E, Common) ; * * The equivalent when using cholmod_l_solve is: * * cholmod_dense *X = NULL, *Y = NULL, *E = NULL ; * ... * X = cholmod_l_solve (sys, L, B1, Common) ; * cholmod_l_free_dense (&X, Common) ; * X = cholmod_l_solve (sys, L, B2, Common) ; * cholmod_l_free_dense (&X, Common) ; * X = cholmod_l_solve (sys, L, B3, Common) ; * cholmod_l_free_dense (&X, Common) ; * * Both methods work fine, but in the 2nd method with cholmod_solve, the * internal workspaces (Y and E) are allocated and freed on each call. * * Bset is an optional sparse column (pattern only) that specifies a set * of row indices. It is ignored if NULL, or if sys is CHOLMOD_P or * CHOLMOD_Pt. If it is present and not ignored, B must be a dense column * vector, and only entries B(i) where i is in the pattern of Bset are * considered. All others are treated as if they were zero (they are not * accessed). L must be a simplicial factorization, not supernodal. L is * converted from supernodal to simplicial if necessary. The solution X is * defined only for entries in the output sparse pattern of Xset. * The xtype (real/complex/zomplex) of L and B must match. * * NOTE: If Bset is present and L is supernodal, it is converted to simplicial * on output. */ int CHOLMOD(solve2) /* returns TRUE on success, FALSE on failure */ ( /* ---- input ---- */ int sys, /* system to solve */ cholmod_factor *L, /* factorization to use */ cholmod_dense *B, /* right-hand-side */ cholmod_sparse *Bset, /* ---- output --- */ cholmod_dense **X_Handle, /* solution, allocated if need be */ cholmod_sparse **Xset_Handle, /* ---- workspace */ cholmod_dense **Y_Handle, /* workspace, or NULL */ cholmod_dense **E_Handle, /* workspace, or NULL */ /* --------------- */ cholmod_common *Common ) { double *Yx, *Yz, *Bx, *Bz, *Xx, *Xz ; cholmod_dense *Y = NULL, *X = NULL ; cholmod_sparse *C, *Yset, C_header, Yset_header, *Xset ; Int *Perm = NULL, *IPerm = NULL ; Int n, nrhs, ncols, ctype, xtype, k1, nr, ytype, k, blen, p, i, d, nrow ; Int Cp [2], Ysetp [2], *Ci, *Yseti, ysetlen ; Int *Bsetp, *Bseti, *Bsetnz, *Xseti, *Xsetp, *Iwork ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_NULL (B, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (B, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; if (sys < CHOLMOD_A || sys > CHOLMOD_Pt) { ERROR (CHOLMOD_INVALID, "invalid system") ; return (FALSE) ; } DEBUG (CHOLMOD(dump_factor) (L, "L", Common)) ; DEBUG (CHOLMOD(dump_dense) (B, "B", Common)) ; nrhs = B->ncol ; n = (Int) L->n ; d = (Int) B->d ; nrow = (Int) B->nrow ; if (d < n || nrow != n) { ERROR (CHOLMOD_INVALID, "dimensions of L and B do not match") ; return (FALSE) ; } if (Bset) { if (nrhs != 1) { ERROR (CHOLMOD_INVALID, "Bset requires a single right-hand side") ; return (FALSE) ; } if (L->xtype != B->xtype) { ERROR (CHOLMOD_INVALID, "Bset requires xtype of L and B to match") ; return (FALSE) ; } DEBUG (CHOLMOD(dump_sparse) (Bset, "Bset", Common)) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ if ((sys == CHOLMOD_P || sys == CHOLMOD_Pt || sys == CHOLMOD_A) && L->ordering != CHOLMOD_NATURAL) { /* otherwise, Perm is NULL, and the identity permutation is used */ Perm = L->Perm ; } /* ---------------------------------------------------------------------- */ /* allocate the result X (or resuse the space from a prior call) */ /* ---------------------------------------------------------------------- */ ctype = (Common->prefer_zomplex) ? CHOLMOD_ZOMPLEX : CHOLMOD_COMPLEX ; if (Bset) { xtype = L->xtype ; } else if (sys == CHOLMOD_P || sys == CHOLMOD_Pt) { /* x=Pb and x=P'b return X real if B is real; X is the preferred * complex/zcomplex type if B is complex or zomplex */ xtype = (B->xtype == CHOLMOD_REAL) ? CHOLMOD_REAL : ctype ; } else if (L->xtype == CHOLMOD_REAL && B->xtype == CHOLMOD_REAL) { /* X is real if both L and B are real */ xtype = CHOLMOD_REAL ; } else { /* X is complex, use the preferred complex/zomplex type */ xtype = ctype ; } /* ensure X has the right size and type */ X = CHOLMOD(ensure_dense) (X_Handle, n, nrhs, n, xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* solve using L, D, L', P, or some combination */ /* ---------------------------------------------------------------------- */ if (Bset) { /* ------------------------------------------------------------------ */ /* solve for a subset of x, with a sparse b */ /* ------------------------------------------------------------------ */ Int save_realloc_state ; #ifndef NSUPERNODAL /* convert a supernodal L to simplicial when using Bset */ if (L->is_super) { /* Can only use Bset on a simplicial factorization. The supernodal * factor L is converted to simplicial, leaving the xtype unchanged * (real, complex, or zomplex). Since the supernodal factorization * is already LL', it is left in that form. This conversion uses * the ll_super_to_simplicial_numeric function in * cholmod_change_factor. */ CHOLMOD(change_factor) ( CHOLMOD_REAL, /* ignored, since L is already numeric */ TRUE, /* convert to LL' (no change to num. values) */ FALSE, /* convert to simplicial */ FALSE, /* do not pack the columns of L */ FALSE, /* (ignored) */ L, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory, L is returned unchanged */ return (FALSE) ; } } #endif /* L, X, and B are all the same xtype */ /* ensure Y is the the right size */ Y = CHOLMOD(ensure_dense) (Y_Handle, 1, n, 1, L->xtype, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (FALSE) ; } /* ------------------------------------------------------------------ */ /* get the inverse permutation, constructing it if needed */ /* ------------------------------------------------------------------ */ DEBUG (CHOLMOD (dump_perm) (Perm, n,n, "Perm", Common)) ; if ((sys == CHOLMOD_A || sys == CHOLMOD_P) && Perm != NULL) { /* The inverse permutation IPerm is used for the c=Pb step, which is needed only for solving Ax=b or x=Pb. No other steps should use IPerm */ if (L->IPerm == NULL) { /* construct the inverse permutation. This is done only once * and then stored in L permanently. */ L->IPerm = CHOLMOD(malloc) (n, sizeof (Int), Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (FALSE) ; } IPerm = L->IPerm ; for (k = 0 ; k < n ; k++) { IPerm [Perm [k]] = k ; } } /* x=A\b and x=Pb both need IPerm */ IPerm = L->IPerm ; } if (sys == CHOLMOD_P) { /* x=Pb needs to turn off the subsequent x=P'b permutation */ Perm = NULL ; } DEBUG (CHOLMOD (dump_perm) (Perm, n,n, "Perm", Common)) ; DEBUG (CHOLMOD (dump_perm) (IPerm, n,n, "IPerm", Common)) ; /* ------------------------------------------------------------------ */ /* ensure Xset is the right size and type */ /* ------------------------------------------------------------------ */ /* Xset is n-by-1, nzmax >= n, pattern-only, packed, unsorted */ Xset = *Xset_Handle ; if (Xset == NULL || (Int) Xset->nrow != n || (Int) Xset->ncol != 1 || (Int) Xset->nzmax < n || Xset->itype != CHOLMOD_PATTERN) { /* this is done only once, for the 1st call to cholmod_solve */ CHOLMOD(free_sparse) (Xset_Handle, Common) ; Xset = CHOLMOD(allocate_sparse) (n, 1, n, FALSE, TRUE, 0, CHOLMOD_PATTERN, Common) ; *Xset_Handle = Xset ; } Xset->sorted = FALSE ; Xset->stype = 0 ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (FALSE) ; } /* -------------------------------------------------------------- */ /* ensure Flag of size n, and 3*n Int workspace is available */ /* -------------------------------------------------------------- */ /* does no work if prior calls already allocated enough space */ CHOLMOD(allocate_work) (n, 3*n, 0, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (FALSE) ; } /* [ use Iwork (n:3n-1) for Ci and Yseti */ Iwork = Common->Iwork ; /* Iwork (0:n-1) is not used because it is used by check_perm, print_perm, check_sparse, and print_sparse */ Ci = Iwork + n ; Yseti = Ci + n ; /* reallocating workspace would break Ci and Yseti */ save_realloc_state = Common->no_workspace_reallocate ; Common->no_workspace_reallocate = TRUE ; /* -------------------------------------------------------------- */ /* C = permuted Bset, to correspond to the permutation of L */ /* -------------------------------------------------------------- */ /* C = IPerm (Bset) */ DEBUG (CHOLMOD(dump_sparse) (Bset, "Bset", Common)) ; Bsetp = Bset->p ; Bseti = Bset->i ; Bsetnz = Bset->nz ; blen = (Bset->packed) ? Bsetp [1] : Bsetnz [0] ; /* C = spones (P*B) or C = spones (B) if IPerm is NULL */ C = &C_header ; C->nrow = n ; C->ncol = 1 ; C->nzmax = n ; C->packed = TRUE ; C->stype = 0 ; C->itype = ITYPE ; C->xtype = CHOLMOD_PATTERN ; C->dtype = CHOLMOD_DOUBLE ; C->nz = NULL ; C->p = Cp ; C->i = Ci ; C->x = NULL ; C->z = NULL ; C->sorted = FALSE ; Cp [0] = 0 ; Cp [1] = blen ; for (p = 0 ; p < blen ; p++) { Int iold = Bseti [p] ; Ci [p] = IPerm ? IPerm [iold] : iold ; } DEBUG (CHOLMOD (dump_sparse) (C, "C", Common)) ; /* create a sparse column Yset from Iwork (n:2n-1) */ Yset = &Yset_header ; Yset->nrow = n ; Yset->ncol = 1 ; Yset->nzmax = n ; Yset->packed = TRUE ; Yset->stype = 0 ; Yset->itype = ITYPE ; Yset->xtype = CHOLMOD_PATTERN ; Yset->dtype = CHOLMOD_DOUBLE ; Yset->nz = NULL ; Yset->p = Ysetp ; Yset->i = Yseti ; Yset->x = NULL ; Yset->z = NULL ; Yset->sorted = FALSE ; Ysetp [0] = 0 ; Ysetp [1] = 0 ; DEBUG (CHOLMOD (dump_sparse) (Yset, "Yset empty", Common)) ; /* -------------------------------------------------------------- */ /* Yset = nonzero pattern of L\C, or just C itself */ /* -------------------------------------------------------------- */ /* this takes O(ysetlen) time */ if (sys == CHOLMOD_P || sys == CHOLMOD_Pt || sys == CHOLMOD_D) { Ysetp [1] = blen ; for (p = 0 ; p < blen ; p++) { Yseti [p] = Ci [p] ; } } else { if (!CHOLMOD(lsolve_pattern) (C, L, Yset, Common)) { Common->no_workspace_reallocate = save_realloc_state ; return (FALSE) ; } } DEBUG (CHOLMOD (dump_sparse) (Yset, "Yset", Common)) ; /* -------------------------------------------------------------- */ /* clear the parts of Y that we will use in the solve */ /* -------------------------------------------------------------- */ Yx = Y->x ; Yz = Y->z ; ysetlen = Ysetp [1] ; switch (L->xtype) { case CHOLMOD_REAL: for (p = 0 ; p < ysetlen ; p++) { i = Yseti [p] ; Yx [i] = 0 ; } break ; case CHOLMOD_COMPLEX: for (p = 0 ; p < ysetlen ; p++) { i = Yseti [p] ; Yx [2*i ] = 0 ; Yx [2*i+1] = 0 ; } break ; case CHOLMOD_ZOMPLEX: for (p = 0 ; p < ysetlen ; p++) { i = Yseti [p] ; Yx [i] = 0 ; Yz [i] = 0 ; } break ; } DEBUG (CHOLMOD (dump_dense) (Y, "Y (Yset) = 0", Common)) ; /* -------------------------------------------------------------- */ /* scatter and permute B into Y */ /* -------------------------------------------------------------- */ /* Y (C) = B (Bset) */ Bx = B->x ; Bz = B->z ; switch (L->xtype) { case CHOLMOD_REAL: for (p = 0 ; p < blen ; p++) { Int iold = Bseti [p] ; Int inew = Ci [p] ; Yx [inew] = Bx [iold] ; } break ; case CHOLMOD_COMPLEX: for (p = 0 ; p < blen ; p++) { Int iold = Bseti [p] ; Int inew = Ci [p] ; Yx [2*inew ] = Bx [2*iold ] ; Yx [2*inew+1] = Bx [2*iold+1] ; } break ; case CHOLMOD_ZOMPLEX: for (p = 0 ; p < blen ; p++) { Int iold = Bseti [p] ; Int inew = Ci [p] ; Yx [inew] = Bx [iold] ; Yz [inew] = Bz [iold] ; } break ; } DEBUG (CHOLMOD (dump_dense) (Y, "Y (C) = B (Bset)", Common)) ; /* -------------------------------------------------------------- */ /* solve Y = (L' \ (L \ Y'))', or other system, with template */ /* -------------------------------------------------------------- */ /* the solve only iterates over columns in Yseti [0...ysetlen-1] */ if (! (sys == CHOLMOD_P || sys == CHOLMOD_Pt)) { switch (L->xtype) { case CHOLMOD_REAL: r_simplicial_solver (sys, L, Y, Yseti, ysetlen) ; break ; case CHOLMOD_COMPLEX: c_simplicial_solver (sys, L, Y, Yseti, ysetlen) ; break ; case CHOLMOD_ZOMPLEX: z_simplicial_solver (sys, L, Y, Yseti, ysetlen) ; break ; } } DEBUG (CHOLMOD (dump_dense) (Y, "Y after solve", Common)) ; /* -------------------------------------------------------------- */ /* X = P'*Y, but only for rows in Yset, and create Xset */ /* -------------------------------------------------------------- */ /* X (Perm (Yset)) = Y (Yset) */ Xx = X->x ; Xz = X->z ; Xseti = Xset->i ; Xsetp = Xset->p ; switch (L->xtype) { case CHOLMOD_REAL: for (p = 0 ; p < ysetlen ; p++) { Int inew = Yseti [p] ; Int iold = Perm ? Perm [inew] : inew ; Xx [iold] = Yx [inew] ; Xseti [p] = iold ; } break ; case CHOLMOD_COMPLEX: for (p = 0 ; p < ysetlen ; p++) { Int inew = Yseti [p] ; Int iold = Perm ? Perm [inew] : inew ; Xx [2*iold ] = Yx [2*inew] ; Xx [2*iold+1] = Yx [2*inew+1] ; Xseti [p] = iold ; } break ; case CHOLMOD_ZOMPLEX: for (p = 0 ; p < ysetlen ; p++) { Int inew = Yseti [p] ; Int iold = Perm ? Perm [inew] : inew ; Xx [iold] = Yx [inew] ; Xz [iold] = Yz [inew] ; Xseti [p] = iold ; } break ; } Xsetp [0] = 0 ; Xsetp [1] = ysetlen ; DEBUG (CHOLMOD(dump_sparse) (Xset, "Xset", Common)) ; DEBUG (CHOLMOD(dump_dense) (X, "X", Common)) ; Common->no_workspace_reallocate = save_realloc_state ; /* done using Iwork (n:3n-1) for Ci and Yseti ] */ } else if (sys == CHOLMOD_P) { /* ------------------------------------------------------------------ */ /* x = P*b */ /* ------------------------------------------------------------------ */ perm (B, Perm, 0, nrhs, X) ; } else if (sys == CHOLMOD_Pt) { /* ------------------------------------------------------------------ */ /* x = P'*b */ /* ------------------------------------------------------------------ */ iperm (B, Perm, 0, nrhs, X) ; } else if (L->is_super) { /* ------------------------------------------------------------------ */ /* solve using a supernodal LL' factorization */ /* ------------------------------------------------------------------ */ #ifndef NSUPERNODAL /* allocate workspace */ cholmod_dense *E ; Int dual ; Common->blas_ok = TRUE ; dual = (L->xtype == CHOLMOD_REAL && B->xtype != CHOLMOD_REAL) ? 2 : 1 ; Y = CHOLMOD(ensure_dense) (Y_Handle, n, dual*nrhs, n, L->xtype, Common); E = CHOLMOD(ensure_dense) (E_Handle, dual*nrhs, L->maxesize, dual*nrhs, L->xtype, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (FALSE) ; } perm (B, Perm, 0, nrhs, Y) ; /* Y = P*B */ if (sys == CHOLMOD_A || sys == CHOLMOD_LDLt) { CHOLMOD(super_lsolve) (L, Y, E, Common) ; /* Y = L\Y */ CHOLMOD(super_ltsolve) (L, Y, E, Common) ; /* Y = L'\Y*/ } else if (sys == CHOLMOD_L || sys == CHOLMOD_LD) { CHOLMOD(super_lsolve) (L, Y, E, Common) ; /* Y = L\Y */ } else if (sys == CHOLMOD_Lt || sys == CHOLMOD_DLt) { CHOLMOD(super_ltsolve) (L, Y, E, Common) ; /* Y = L'\Y*/ } iperm (Y, Perm, 0, nrhs, X) ; /* X = P'*Y */ if (CHECK_BLAS_INT && !Common->blas_ok) { /* Integer overflow in the BLAS. This is probably impossible, * since the BLAS were used to create the supernodal factorization. * It might be possible for the calls to the BLAS to differ between * factorization and forward/backsolves, however. This statement * is untested; it does not appear in the compiled code if * CHECK_BLAS_INT is true (when the same integer is used in * CHOLMOD and the BLAS. */ return (FALSE) ; } #else /* CHOLMOD Supernodal module not installed */ ERROR (CHOLMOD_NOT_INSTALLED,"Supernodal module not installed") ; #endif } else { /* ------------------------------------------------------------------ */ /* solve using a simplicial LL' or LDL' factorization */ /* ------------------------------------------------------------------ */ if (L->xtype == CHOLMOD_REAL && B->xtype == CHOLMOD_REAL) { /* L, B, and Y are all real */ /* solve with up to 4 columns of B at a time */ ncols = 4 ; nr = MAX (4, nrhs) ; ytype = CHOLMOD_REAL ; } else if (L->xtype == CHOLMOD_REAL) { /* L is real and B is complex or zomplex */ /* solve with one column of B (real/imag), at a time */ ncols = 1 ; nr = 2 ; ytype = CHOLMOD_REAL ; } else { /* L is complex or zomplex, B is real/complex/zomplex, Y has the * same complexity as L. Solve with one column of B at a time. */ ncols = 1 ; nr = 1 ; ytype = L->xtype ; } Y = CHOLMOD(ensure_dense) (Y_Handle, nr, n, nr, ytype, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (FALSE) ; } for (k1 = 0 ; k1 < nrhs ; k1 += ncols) { /* -------------------------------------------------------------- */ /* Y = B (P, k1:k1+ncols-1)' = (P * B (:,...))' */ /* -------------------------------------------------------------- */ ptrans (B, Perm, k1, ncols, Y) ; /* -------------------------------------------------------------- */ /* solve Y = (L' \ (L \ Y'))', or other system, with template */ /* -------------------------------------------------------------- */ switch (L->xtype) { case CHOLMOD_REAL: r_simplicial_solver (sys, L, Y, NULL, 0) ; break ; case CHOLMOD_COMPLEX: c_simplicial_solver (sys, L, Y, NULL, 0) ; break ; case CHOLMOD_ZOMPLEX: z_simplicial_solver (sys, L, Y, NULL, 0) ; break ; } /* -------------------------------------------------------------- */ /* X (P, k1:k2+ncols-1) = Y' */ /* -------------------------------------------------------------- */ iptrans (Y, Perm, k1, ncols, X) ; } } DEBUG (CHOLMOD(dump_dense) (X, "X result", Common)) ; return (TRUE) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/cholmod_spsolve.c0000664000175000017500000002364314224052371022007 00000000000000/* ========================================================================== */ /* === Cholesky/cholmod_spsolve ============================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Given an LL' or LDL' factorization of A, solve one of the following systems: * * Ax=b 0: CHOLMOD_A also applies the permutation L->Perm * LDL'x=b 1: CHOLMOD_LDLt does not apply L->Perm * LDx=b 2: CHOLMOD_LD * DL'x=b 3: CHOLMOD_DLt * Lx=b 4: CHOLMOD_L * L'x=b 5: CHOLMOD_Lt * Dx=b 6: CHOLMOD_D * x=Pb 7: CHOLMOD_P apply a permutation (P is L->Perm) * x=P'b 8: CHOLMOD_Pt apply an inverse permutation * * where b and x are sparse. If L and b are real, then x is real. Otherwise, * x is complex or zomplex, depending on the Common->prefer_zomplex parameter. * All xtypes of x and b are supported (real, complex, and zomplex). */ #ifndef NCHOLESKY #include "cholmod_internal.h" #include "cholmod_cholesky.h" /* ========================================================================== */ /* === EXPAND_AS_NEEDED ===================================================== */ /* ========================================================================== */ /* Double the size of the sparse matrix X, if we have run out of space. */ #define EXPAND_AS_NEEDED \ if (xnz >= nzmax) \ { \ nzmax *= 2 ; \ CHOLMOD(reallocate_sparse) (nzmax, X, Common) ; \ if (Common->status < CHOLMOD_OK) \ { \ CHOLMOD(free_sparse) (&X, Common) ; \ CHOLMOD(free_dense) (&X4, Common) ; \ CHOLMOD(free_dense) (&B4, Common) ; \ return (NULL) ; \ } \ Xi = X->i ; \ Xx = X->x ; \ Xz = X->z ; \ } /* ========================================================================== */ /* === cholmod_spolve ======================================================= */ /* ========================================================================== */ cholmod_sparse *CHOLMOD(spsolve) /* returns the sparse solution X */ ( /* ---- input ---- */ int sys, /* system to solve */ cholmod_factor *L, /* factorization to use */ cholmod_sparse *B, /* right-hand-side */ /* --------------- */ cholmod_common *Common ) { double x, z ; cholmod_dense *X4, *B4 ; cholmod_sparse *X ; double *Bx, *Bz, *Xx, *Xz, *B4x, *B4z, *X4x, *X4z ; Int *Bi, *Bp, *Xp, *Xi, *Bnz ; Int n, nrhs, q, p, i, j, jfirst, jlast, packed, block, pend, j_n, xtype ; size_t xnz, nzmax ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (L, NULL) ; RETURN_IF_NULL (B, NULL) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, NULL) ; RETURN_IF_XTYPE_INVALID (B, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, NULL) ; if (L->n != B->nrow) { ERROR (CHOLMOD_INVALID, "dimensions of L and B do not match") ; return (NULL) ; } if (B->stype) { ERROR (CHOLMOD_INVALID, "B cannot be stored in symmetric mode") ; return (NULL) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace B4 and initial result X */ /* ---------------------------------------------------------------------- */ n = L->n ; nrhs = B->ncol ; /* X is real if both L and B are real, complex/zomplex otherwise */ xtype = (L->xtype == CHOLMOD_REAL && B->xtype == CHOLMOD_REAL) ? CHOLMOD_REAL : (Common->prefer_zomplex ? CHOLMOD_ZOMPLEX : CHOLMOD_COMPLEX) ; /* solve up to 4 columns at a time */ block = MIN (nrhs, 4) ; /* initial size of X is at most 4*n */ nzmax = n*block ; X = CHOLMOD(spzeros) (n, nrhs, nzmax, xtype, Common) ; B4 = CHOLMOD(zeros) (n, block, B->xtype, Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_sparse) (&X, Common) ; CHOLMOD(free_dense) (&B4, Common) ; return (NULL) ; } Bp = B->p ; Bi = B->i ; Bx = B->x ; Bz = B->z ; Bnz = B->nz ; packed = B->packed ; Xp = X->p ; Xi = X->i ; Xx = X->x ; Xz = X->z ; xnz = 0 ; B4x = B4->x ; B4z = B4->z ; /* ---------------------------------------------------------------------- */ /* solve in chunks of 4 columns at a time */ /* ---------------------------------------------------------------------- */ for (jfirst = 0 ; jfirst < nrhs ; jfirst += block) { /* ------------------------------------------------------------------ */ /* adjust the number of columns of B4 */ /* ------------------------------------------------------------------ */ jlast = MIN (nrhs, jfirst + block) ; B4->ncol = jlast - jfirst ; /* ------------------------------------------------------------------ */ /* scatter B(jfirst:jlast-1) into B4 */ /* ------------------------------------------------------------------ */ for (j = jfirst ; j < jlast ; j++) { p = Bp [j] ; pend = (packed) ? (Bp [j+1]) : (p + Bnz [j]) ; j_n = (j-jfirst)*n ; switch (B->xtype) { case CHOLMOD_REAL: for ( ; p < pend ; p++) { B4x [Bi [p] + j_n] = Bx [p] ; } break ; case CHOLMOD_COMPLEX: for ( ; p < pend ; p++) { q = Bi [p] + j_n ; B4x [2*q ] = Bx [2*p ] ; B4x [2*q+1] = Bx [2*p+1] ; } break ; case CHOLMOD_ZOMPLEX: for ( ; p < pend ; p++) { q = Bi [p] + j_n ; B4x [q] = Bx [p] ; B4z [q] = Bz [p] ; } break ; } } /* ------------------------------------------------------------------ */ /* solve the system (X4 = A\B4 or other system) */ /* ------------------------------------------------------------------ */ X4 = CHOLMOD(solve) (sys, L, B4, Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_sparse) (&X, Common) ; CHOLMOD(free_dense) (&B4, Common) ; CHOLMOD(free_dense) (&X4, Common) ; return (NULL) ; } ASSERT (X4->xtype == xtype) ; X4x = X4->x ; X4z = X4->z ; /* ------------------------------------------------------------------ */ /* append the solution onto X */ /* ------------------------------------------------------------------ */ for (j = jfirst ; j < jlast ; j++) { Xp [j] = xnz ; j_n = (j-jfirst)*n ; if ( xnz + n <= nzmax) { /* ---------------------------------------------------------- */ /* X is guaranteed to be large enough */ /* ---------------------------------------------------------- */ switch (xtype) { case CHOLMOD_REAL: for (i = 0 ; i < n ; i++) { x = X4x [i + j_n] ; if (IS_NONZERO (x)) { Xi [xnz] = i ; Xx [xnz] = x ; xnz++ ; } } break ; case CHOLMOD_COMPLEX: for (i = 0 ; i < n ; i++) { x = X4x [2*(i + j_n) ] ; z = X4x [2*(i + j_n)+1] ; if (IS_NONZERO (x) || IS_NONZERO (z)) { Xi [xnz] = i ; Xx [2*xnz ] = x ; Xx [2*xnz+1] = z ; xnz++ ; } } break ; case CHOLMOD_ZOMPLEX: for (i = 0 ; i < n ; i++) { x = X4x [i + j_n] ; z = X4z [i + j_n] ; if (IS_NONZERO (x) || IS_NONZERO (z)) { Xi [xnz] = i ; Xx [xnz] = x ; Xz [xnz] = z ; xnz++ ; } } break ; } } else { /* ---------------------------------------------------------- */ /* X may need to increase in size */ /* ---------------------------------------------------------- */ switch (xtype) { case CHOLMOD_REAL: for (i = 0 ; i < n ; i++) { x = X4x [i + j_n] ; if (IS_NONZERO (x)) { EXPAND_AS_NEEDED ; Xi [xnz] = i ; Xx [xnz] = x ; xnz++ ; } } break ; case CHOLMOD_COMPLEX: for (i = 0 ; i < n ; i++) { x = X4x [2*(i + j_n) ] ; z = X4x [2*(i + j_n)+1] ; if (IS_NONZERO (x) || IS_NONZERO (z)) { EXPAND_AS_NEEDED ; Xi [xnz] = i ; Xx [2*xnz ] = x ; Xx [2*xnz+1] = z ; xnz++ ; } } break ; case CHOLMOD_ZOMPLEX: for (i = 0 ; i < n ; i++) { x = X4x [i + j_n] ; z = X4z [i + j_n] ; if (IS_NONZERO (x) || IS_NONZERO (z)) { EXPAND_AS_NEEDED ; Xi [xnz] = i ; Xx [xnz] = x ; Xz [xnz] = z ; xnz++ ; } } break ; } } } CHOLMOD(free_dense) (&X4, Common) ; /* ------------------------------------------------------------------ */ /* clear B4 for next iteration */ /* ------------------------------------------------------------------ */ if (jlast < nrhs) { for (j = jfirst ; j < jlast ; j++) { p = Bp [j] ; pend = (packed) ? (Bp [j+1]) : (p + Bnz [j]) ; j_n = (j-jfirst)*n ; switch (B->xtype) { case CHOLMOD_REAL: for ( ; p < pend ; p++) { B4x [Bi [p] + j_n] = 0 ; } break ; case CHOLMOD_COMPLEX: for ( ; p < pend ; p++) { q = Bi [p] + j_n ; B4x [2*q ] = 0 ; B4x [2*q+1] = 0 ; } break ; case CHOLMOD_ZOMPLEX: for ( ; p < pend ; p++) { q = Bi [p] + j_n ; B4x [q] = 0 ; B4z [q] = 0 ; } break ; } } } } Xp [nrhs] = xnz ; /* ---------------------------------------------------------------------- */ /* reduce X in size, free workspace, and return result */ /* ---------------------------------------------------------------------- */ ASSERT (xnz <= X->nzmax) ; CHOLMOD(reallocate_sparse) (xnz, X, Common) ; ASSERT (Common->status == CHOLMOD_OK) ; CHOLMOD(free_dense) (&B4, Common) ; return (X) ; } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/License.txt0000664000175000017500000000204714224052371020561 00000000000000CHOLMOD/Cholesky module, Copyright (C) 2005-2006, Timothy A. Davis CHOLMOD is also available under other licenses; contact authors for details. http://www.suitesparse.com Note that this license is for the CHOLMOD/Cholesky module only. All CHOLMOD modules are licensed separately. -------------------------------------------------------------------------------- This Module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This Module 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this Module; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/lesser.txt0000664000175000017500000006350014224052371020475 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/t_cholmod_lsolve.c0000664000175000017500000006371214224052371022144 00000000000000/* ========================================================================== */ /* === Cholesky/t_cholmod_lsolve ============================================ */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2013, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Template routine to solve Lx=b with unit or non-unit diagonal, or * solve LDx=b. * * The numeric xtype of L and Y must match. Y contains b on input and x on * output, stored in row-form. Y is nrow-by-n, where nrow must equal 1 for the * complex or zomplex cases, and nrow <= 4 for the real case. * * This file is not compiled separately. It is included in t_cholmod_solve.c * instead. It contains no user-callable routines. * * workspace: none * * Supports real, complex, and zomplex factors. */ /* undefine all prior definitions */ #undef FORM_NAME #undef LSOLVE /* -------------------------------------------------------------------------- */ /* define the method */ /* -------------------------------------------------------------------------- */ #ifdef LL /* LL': solve Lx=b with non-unit diagonal */ #define FORM_NAME(prefix,rank) prefix ## ll_lsolve_ ## rank #elif defined (LD) /* LDL': solve LDx=b */ #define FORM_NAME(prefix,rank) prefix ## ldl_ldsolve_ ## rank #else /* LDL': solve Lx=b with unit diagonal */ #define FORM_NAME(prefix,rank) prefix ## ldl_lsolve_ ## rank #endif /* LSOLVE(k) defines the name of a routine for an n-by-k right-hand-side. */ #define LSOLVE(prefix,rank) FORM_NAME(prefix,rank) #ifdef REAL /* ========================================================================== */ /* === LSOLVE (1) =========================================================== */ /* ========================================================================== */ /* Solve Lx=b, where b has 1 column */ static void LSOLVE (PREFIX,1) ( cholmod_factor *L, double X [ ] /* n-by-1 in row form */ ) { double *Lx = L->x ; Int *Li = L->i ; Int *Lp = L->p ; Int *Lnz = L->nz ; Int j, n = L->n ; for (j = 0 ; j < n ; ) { /* get the start, end, and length of column j */ Int p = Lp [j] ; Int lnz = Lnz [j] ; Int pend = p + lnz ; /* find a chain of supernodes (up to j, j+1, and j+2) */ if (lnz < 4 || lnz != Lnz [j+1] + 1 || Li [p+1] != j+1) { /* -------------------------------------------------------------- */ /* solve with a single column of L */ /* -------------------------------------------------------------- */ double y = X [j] ; #ifdef LL y /= Lx [p] ; X [j] = y ; #elif defined (LD) X [j] = y / Lx [p] ; #endif for (p++ ; p < pend ; p++) { X [Li [p]] -= Lx [p] * y ; } j++ ; /* advance to next column of L */ } else if (lnz != Lnz [j+2] + 2 || Li [p+2] != j+2) { /* -------------------------------------------------------------- */ /* solve with a supernode of two columns of L */ /* -------------------------------------------------------------- */ double y [2] ; Int q = Lp [j+1] ; #ifdef LL y [0] = X [j] / Lx [p] ; y [1] = (X [j+1] - Lx [p+1] * y [0]) / Lx [q] ; X [j ] = y [0] ; X [j+1] = y [1] ; #elif defined (LD) y [0] = X [j] ; y [1] = X [j+1] - Lx [p+1] * y [0] ; X [j ] = y [0] / Lx [p] ; X [j+1] = y [1] / Lx [q] ; #else y [0] = X [j] ; y [1] = X [j+1] - Lx [p+1] * y [0] ; X [j+1] = y [1] ; #endif for (p += 2, q++ ; p < pend ; p++, q++) { X [Li [p]] -= Lx [p] * y [0] + Lx [q] * y [1] ; } j += 2 ; /* advance to next column of L */ } else { /* -------------------------------------------------------------- */ /* solve with a supernode of three columns of L */ /* -------------------------------------------------------------- */ double y [3] ; Int q = Lp [j+1] ; Int r = Lp [j+2] ; #ifdef LL y [0] = X [j] / Lx [p] ; y [1] = (X [j+1] - Lx [p+1] * y [0]) / Lx [q] ; y [2] = (X [j+2] - Lx [p+2] * y [0] - Lx [q+1] * y [1]) / Lx [r] ; X [j ] = y [0] ; X [j+1] = y [1] ; X [j+2] = y [2] ; #elif defined (LD) y [0] = X [j] ; y [1] = X [j+1] - Lx [p+1] * y [0] ; y [2] = X [j+2] - Lx [p+2] * y [0] - Lx [q+1] * y [1] ; X [j ] = y [0] / Lx [p] ; X [j+1] = y [1] / Lx [q] ; X [j+2] = y [2] / Lx [r] ; #else y [0] = X [j] ; y [1] = X [j+1] - Lx [p+1] * y [0] ; y [2] = X [j+2] - Lx [p+2] * y [0] - Lx [q+1] * y [1] ; X [j+1] = y [1] ; X [j+2] = y [2] ; #endif for (p += 3, q += 2, r++ ; p < pend ; p++, q++, r++) { X [Li [p]] -= Lx [p] * y [0] + Lx [q] * y [1] + Lx [r] * y [2] ; } j += 3 ; /* advance to next column of L */ } } } /* ========================================================================== */ /* === LSOLVE (2) =========================================================== */ /* ========================================================================== */ /* Solve Lx=b, where b has 2 columns */ static void LSOLVE (PREFIX,2) ( cholmod_factor *L, double X [ ][2] /* n-by-2 in row form */ ) { double *Lx = L->x ; Int *Li = L->i ; Int *Lp = L->p ; Int *Lnz = L->nz ; Int j, n = L->n ; for (j = 0 ; j < n ; ) { /* get the start, end, and length of column j */ Int p = Lp [j] ; Int lnz = Lnz [j] ; Int pend = p + lnz ; /* find a chain of supernodes (up to j, j+1, and j+2) */ if (lnz < 4 || lnz != Lnz [j+1] + 1 || Li [p+1] != j+1) { /* -------------------------------------------------------------- */ /* solve with a single column of L */ /* -------------------------------------------------------------- */ double y [2] ; y [0] = X [j][0] ; y [1] = X [j][1] ; #ifdef LL y [0] /= Lx [p] ; y [1] /= Lx [p] ; X [j][0] = y [0] ; X [j][1] = y [1] ; #elif defined (LD) X [j][0] = y [0] / Lx [p] ; X [j][1] = y [1] / Lx [p] ; #endif for (p++ ; p < pend ; p++) { Int i = Li [p] ; X [i][0] -= Lx [p] * y [0] ; X [i][1] -= Lx [p] * y [1] ; } j++ ; /* advance to next column of L */ } else if (lnz != Lnz [j+2] + 2 || Li [p+2] != j+2) { /* -------------------------------------------------------------- */ /* solve with a supernode of two columns of L */ /* -------------------------------------------------------------- */ double y [2][2] ; Int q = Lp [j+1] ; y [0][0] = X [j][0] ; y [0][1] = X [j][1] ; #ifdef LL y [0][0] /= Lx [p] ; y [0][1] /= Lx [p] ; y [1][0] = (X [j+1][0] - Lx [p+1] * y [0][0]) / Lx [q] ; y [1][1] = (X [j+1][1] - Lx [p+1] * y [0][1]) / Lx [q] ; X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; #elif defined (LD) y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; X [j ][0] = y [0][0] / Lx [p] ; X [j ][1] = y [0][1] / Lx [p] ; X [j+1][0] = y [1][0] / Lx [q] ; X [j+1][1] = y [1][1] / Lx [q] ; #else y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; #endif for (p += 2, q++ ; p < pend ; p++, q++) { Int i = Li [p] ; X [i][0] -= Lx [p] * y [0][0] + Lx [q] * y [1][0] ; X [i][1] -= Lx [p] * y [0][1] + Lx [q] * y [1][1] ; } j += 2 ; /* advance to next column of L */ } else { /* -------------------------------------------------------------- */ /* solve with a supernode of three columns of L */ /* -------------------------------------------------------------- */ double y [3][2] ; Int q = Lp [j+1] ; Int r = Lp [j+2] ; y [0][0] = X [j][0] ; y [0][1] = X [j][1] ; #ifdef LL y [0][0] /= Lx [p] ; y [0][1] /= Lx [p] ; y [1][0] = (X [j+1][0] - Lx[p+1] * y[0][0]) / Lx [q] ; y [1][1] = (X [j+1][1] - Lx[p+1] * y[0][1]) / Lx [q] ; y [2][0] = (X [j+2][0] - Lx[p+2] * y[0][0] - Lx[q+1]*y[1][0])/Lx[r]; y [2][1] = (X [j+2][1] - Lx[p+2] * y[0][1] - Lx[q+1]*y[1][1])/Lx[r]; X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; X [j+2][0] = y [2][0] ; X [j+2][1] = y [2][1] ; #elif defined (LD) y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; y [2][0] = X [j+2][0] - Lx [p+2] * y [0][0] - Lx [q+1] * y [1][0] ; y [2][1] = X [j+2][1] - Lx [p+2] * y [0][1] - Lx [q+1] * y [1][1] ; X [j ][0] = y [0][0] / Lx [p] ; X [j ][1] = y [0][1] / Lx [p] ; X [j+1][0] = y [1][0] / Lx [q] ; X [j+1][1] = y [1][1] / Lx [q] ; X [j+2][0] = y [2][0] / Lx [r] ; X [j+2][1] = y [2][1] / Lx [r] ; #else y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; y [2][0] = X [j+2][0] - Lx [p+2] * y [0][0] - Lx [q+1] * y [1][0] ; y [2][1] = X [j+2][1] - Lx [p+2] * y [0][1] - Lx [q+1] * y [1][1] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; X [j+2][0] = y [2][0] ; X [j+2][1] = y [2][1] ; #endif for (p += 3, q += 2, r++ ; p < pend ; p++, q++, r++) { Int i = Li [p] ; X[i][0] -= Lx[p] * y[0][0] + Lx[q] * y[1][0] + Lx[r] * y[2][0] ; X[i][1] -= Lx[p] * y[0][1] + Lx[q] * y[1][1] + Lx[r] * y[2][1] ; } j += 3 ; /* advance to next column of L */ } } } /* ========================================================================== */ /* === LSOLVE (3) =========================================================== */ /* ========================================================================== */ /* Solve Lx=b, where b has 3 columns */ static void LSOLVE (PREFIX,3) ( cholmod_factor *L, double X [ ][3] /* n-by-3 in row form */ ) { double *Lx = L->x ; Int *Li = L->i ; Int *Lp = L->p ; Int *Lnz = L->nz ; Int j, n = L->n ; for (j = 0 ; j < n ; ) { /* get the start, end, and length of column j */ Int p = Lp [j] ; Int lnz = Lnz [j] ; Int pend = p + lnz ; /* find a chain of supernodes (up to j, j+1, and j+2) */ if (lnz < 4 || lnz != Lnz [j+1] + 1 || Li [p+1] != j+1) { /* -------------------------------------------------------------- */ /* solve with a single column of L */ /* -------------------------------------------------------------- */ double y [3] ; y [0] = X [j][0] ; y [1] = X [j][1] ; y [2] = X [j][2] ; #ifdef LL y [0] /= Lx [p] ; y [1] /= Lx [p] ; y [2] /= Lx [p] ; X [j][0] = y [0] ; X [j][1] = y [1] ; X [j][2] = y [2] ; #elif defined (LD) X [j][0] = y [0] / Lx [p] ; X [j][1] = y [1] / Lx [p] ; X [j][2] = y [2] / Lx [p] ; #endif for (p++ ; p < pend ; p++) { Int i = Li [p] ; double lx = Lx [p] ; X [i][0] -= lx * y [0] ; X [i][1] -= lx * y [1] ; X [i][2] -= lx * y [2] ; } j++ ; /* advance to next column of L */ } else if (lnz != Lnz [j+2] + 2 || Li [p+2] != j+2) { /* -------------------------------------------------------------- */ /* solve with a supernode of two columns of L */ /* -------------------------------------------------------------- */ double y [2][3] ; Int q = Lp [j+1] ; y [0][0] = X [j][0] ; y [0][1] = X [j][1] ; y [0][2] = X [j][2] ; #ifdef LL y [0][0] /= Lx [p] ; y [0][1] /= Lx [p] ; y [0][2] /= Lx [p] ; y [1][0] = (X [j+1][0] - Lx [p+1] * y [0][0]) / Lx [q] ; y [1][1] = (X [j+1][1] - Lx [p+1] * y [0][1]) / Lx [q] ; y [1][2] = (X [j+1][2] - Lx [p+1] * y [0][2]) / Lx [q] ; X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j ][2] = y [0][2] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; X [j+1][2] = y [1][2] ; #elif defined (LD) y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; y [1][2] = X [j+1][2] - Lx [p+1] * y [0][2] ; X [j ][0] = y [0][0] / Lx [p] ; X [j ][1] = y [0][1] / Lx [p] ; X [j ][2] = y [0][2] / Lx [p] ; X [j+1][0] = y [1][0] / Lx [q] ; X [j+1][1] = y [1][1] / Lx [q] ; X [j+1][2] = y [1][2] / Lx [q] ; #else y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; y [1][2] = X [j+1][2] - Lx [p+1] * y [0][2] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; X [j+1][2] = y [1][2] ; #endif for (p += 2, q++ ; p < pend ; p++, q++) { Int i = Li [p] ; double lx [2] ; lx [0] = Lx [p] ; lx [1] = Lx [q] ; X [i][0] -= lx [0] * y [0][0] + lx [1] * y [1][0] ; X [i][1] -= lx [0] * y [0][1] + lx [1] * y [1][1] ; X [i][2] -= lx [0] * y [0][2] + lx [1] * y [1][2] ; } j += 2 ; /* advance to next column of L */ } else { /* -------------------------------------------------------------- */ /* solve with a supernode of three columns of L */ /* -------------------------------------------------------------- */ double y [3][3] ; Int q = Lp [j+1] ; Int r = Lp [j+2] ; y [0][0] = X [j][0] ; y [0][1] = X [j][1] ; y [0][2] = X [j][2] ; #ifdef LL y [0][0] /= Lx [p] ; y [0][1] /= Lx [p] ; y [0][2] /= Lx [p] ; y [1][0] = (X [j+1][0] - Lx[p+1] * y[0][0]) / Lx [q] ; y [1][1] = (X [j+1][1] - Lx[p+1] * y[0][1]) / Lx [q] ; y [1][2] = (X [j+1][2] - Lx[p+1] * y[0][2]) / Lx [q] ; y [2][0] = (X [j+2][0] - Lx[p+2] * y[0][0] - Lx[q+1]*y[1][0])/Lx[r]; y [2][1] = (X [j+2][1] - Lx[p+2] * y[0][1] - Lx[q+1]*y[1][1])/Lx[r]; y [2][2] = (X [j+2][2] - Lx[p+2] * y[0][2] - Lx[q+1]*y[1][2])/Lx[r]; X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j ][2] = y [0][2] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; X [j+1][2] = y [1][2] ; X [j+2][0] = y [2][0] ; X [j+2][1] = y [2][1] ; X [j+2][2] = y [2][2] ; #elif defined (LD) y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; y [1][2] = X [j+1][2] - Lx [p+1] * y [0][2] ; y [2][0] = X [j+2][0] - Lx [p+2] * y [0][0] - Lx [q+1] * y [1][0] ; y [2][1] = X [j+2][1] - Lx [p+2] * y [0][1] - Lx [q+1] * y [1][1] ; y [2][2] = X [j+2][2] - Lx [p+2] * y [0][2] - Lx [q+1] * y [1][2] ; X [j ][0] = y [0][0] / Lx [p] ; X [j ][1] = y [0][1] / Lx [p] ; X [j ][2] = y [0][2] / Lx [p] ; X [j+1][0] = y [1][0] / Lx [q] ; X [j+1][1] = y [1][1] / Lx [q] ; X [j+1][2] = y [1][2] / Lx [q] ; X [j+2][0] = y [2][0] / Lx [r] ; X [j+2][1] = y [2][1] / Lx [r] ; X [j+2][2] = y [2][2] / Lx [r] ; #else y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; y [1][2] = X [j+1][2] - Lx [p+1] * y [0][2] ; y [2][0] = X [j+2][0] - Lx [p+2] * y [0][0] - Lx [q+1] * y [1][0] ; y [2][1] = X [j+2][1] - Lx [p+2] * y [0][1] - Lx [q+1] * y [1][1] ; y [2][2] = X [j+2][2] - Lx [p+2] * y [0][2] - Lx [q+1] * y [1][2] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; X [j+1][2] = y [1][2] ; X [j+2][0] = y [2][0] ; X [j+2][1] = y [2][1] ; X [j+2][2] = y [2][2] ; #endif for (p += 3, q += 2, r++ ; p < pend ; p++, q++, r++) { Int i = Li [p] ; double lx [3] ; lx [0] = Lx [p] ; lx [1] = Lx [q] ; lx [2] = Lx [r] ; X [i][0] -= lx[0] * y[0][0] + lx[1] * y[1][0] + lx[2] * y[2][0]; X [i][1] -= lx[0] * y[0][1] + lx[1] * y[1][1] + lx[2] * y[2][1]; X [i][2] -= lx[0] * y[0][2] + lx[1] * y[1][2] + lx[2] * y[2][2]; } j += 3 ; /* advance to next column of L */ } } } /* ========================================================================== */ /* === LSOLVE (4) =========================================================== */ /* ========================================================================== */ /* Solve Lx=b, where b has 4 columns */ static void LSOLVE (PREFIX,4) ( cholmod_factor *L, double X [ ][4] /* n-by-4 in row form */ ) { double *Lx = L->x ; Int *Li = L->i ; Int *Lp = L->p ; Int *Lnz = L->nz ; Int j, n = L->n ; for (j = 0 ; j < n ; ) { /* get the start, end, and length of column j */ Int p = Lp [j] ; Int lnz = Lnz [j] ; Int pend = p + lnz ; /* find a chain of supernodes (up to j, j+1, and j+2) */ if (lnz < 4 || lnz != Lnz [j+1] + 1 || Li [p+1] != j+1) { /* -------------------------------------------------------------- */ /* solve with a single column of L */ /* -------------------------------------------------------------- */ double y [4] ; y [0] = X [j][0] ; y [1] = X [j][1] ; y [2] = X [j][2] ; y [3] = X [j][3] ; #ifdef LL y [0] /= Lx [p] ; y [1] /= Lx [p] ; y [2] /= Lx [p] ; y [3] /= Lx [p] ; X [j][0] = y [0] ; X [j][1] = y [1] ; X [j][2] = y [2] ; X [j][3] = y [3] ; #elif defined (LD) X [j][0] = y [0] / Lx [p] ; X [j][1] = y [1] / Lx [p] ; X [j][2] = y [2] / Lx [p] ; X [j][3] = y [3] / Lx [p] ; #endif for (p++ ; p < pend ; p++) { Int i = Li [p] ; double lx = Lx [p] ; X [i][0] -= lx * y [0] ; X [i][1] -= lx * y [1] ; X [i][2] -= lx * y [2] ; X [i][3] -= lx * y [3] ; } j++ ; /* advance to next column of L */ } else if (lnz != Lnz [j+2] + 2 || Li [p+2] != j+2) { /* -------------------------------------------------------------- */ /* solve with a supernode of two columns of L */ /* -------------------------------------------------------------- */ double y [2][4] ; Int q = Lp [j+1] ; y [0][0] = X [j][0] ; y [0][1] = X [j][1] ; y [0][2] = X [j][2] ; y [0][3] = X [j][3] ; #ifdef LL y [0][0] /= Lx [p] ; y [0][1] /= Lx [p] ; y [0][2] /= Lx [p] ; y [0][3] /= Lx [p] ; y [1][0] = (X [j+1][0] - Lx [p+1] * y [0][0]) / Lx [q] ; y [1][1] = (X [j+1][1] - Lx [p+1] * y [0][1]) / Lx [q] ; y [1][2] = (X [j+1][2] - Lx [p+1] * y [0][2]) / Lx [q] ; y [1][3] = (X [j+1][3] - Lx [p+1] * y [0][3]) / Lx [q] ; X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j ][2] = y [0][2] ; X [j ][3] = y [0][3] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; X [j+1][2] = y [1][2] ; X [j+1][3] = y [1][3] ; #elif defined (LD) y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; y [1][2] = X [j+1][2] - Lx [p+1] * y [0][2] ; y [1][3] = X [j+1][3] - Lx [p+1] * y [0][3] ; X [j ][0] = y [0][0] / Lx [p] ; X [j ][1] = y [0][1] / Lx [p] ; X [j ][2] = y [0][2] / Lx [p] ; X [j ][3] = y [0][3] / Lx [p] ; X [j+1][0] = y [1][0] / Lx [q] ; X [j+1][1] = y [1][1] / Lx [q] ; X [j+1][2] = y [1][2] / Lx [q] ; X [j+1][3] = y [1][3] / Lx [q] ; #else y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; y [1][2] = X [j+1][2] - Lx [p+1] * y [0][2] ; y [1][3] = X [j+1][3] - Lx [p+1] * y [0][3] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; X [j+1][2] = y [1][2] ; X [j+1][3] = y [1][3] ; #endif for (p += 2, q++ ; p < pend ; p++, q++) { Int i = Li [p] ; double lx [2] ; lx [0] = Lx [p] ; lx [1] = Lx [q] ; X [i][0] -= lx [0] * y [0][0] + lx [1] * y [1][0] ; X [i][1] -= lx [0] * y [0][1] + lx [1] * y [1][1] ; X [i][2] -= lx [0] * y [0][2] + lx [1] * y [1][2] ; X [i][3] -= lx [0] * y [0][3] + lx [1] * y [1][3] ; } j += 2 ; /* advance to next column of L */ } else { /* -------------------------------------------------------------- */ /* solve with a supernode of three columns of L */ /* -------------------------------------------------------------- */ double y [3][4] ; Int q = Lp [j+1] ; Int r = Lp [j+2] ; y [0][0] = X [j][0] ; y [0][1] = X [j][1] ; y [0][2] = X [j][2] ; y [0][3] = X [j][3] ; #ifdef LL y [0][0] /= Lx [p] ; y [0][1] /= Lx [p] ; y [0][2] /= Lx [p] ; y [0][3] /= Lx [p] ; y [1][0] = (X [j+1][0] - Lx[p+1] * y[0][0]) / Lx [q] ; y [1][1] = (X [j+1][1] - Lx[p+1] * y[0][1]) / Lx [q] ; y [1][2] = (X [j+1][2] - Lx[p+1] * y[0][2]) / Lx [q] ; y [1][3] = (X [j+1][3] - Lx[p+1] * y[0][3]) / Lx [q] ; y [2][0] = (X [j+2][0] - Lx[p+2] * y[0][0] - Lx[q+1]*y[1][0])/Lx[r]; y [2][1] = (X [j+2][1] - Lx[p+2] * y[0][1] - Lx[q+1]*y[1][1])/Lx[r]; y [2][2] = (X [j+2][2] - Lx[p+2] * y[0][2] - Lx[q+1]*y[1][2])/Lx[r]; y [2][3] = (X [j+2][3] - Lx[p+2] * y[0][3] - Lx[q+1]*y[1][3])/Lx[r]; X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j ][2] = y [0][2] ; X [j ][3] = y [0][3] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; X [j+1][2] = y [1][2] ; X [j+1][3] = y [1][3] ; X [j+2][0] = y [2][0] ; X [j+2][1] = y [2][1] ; X [j+2][2] = y [2][2] ; X [j+2][3] = y [2][3] ; #elif defined (LD) y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; y [1][2] = X [j+1][2] - Lx [p+1] * y [0][2] ; y [1][3] = X [j+1][3] - Lx [p+1] * y [0][3] ; y [2][0] = X [j+2][0] - Lx [p+2] * y [0][0] - Lx [q+1] * y [1][0] ; y [2][1] = X [j+2][1] - Lx [p+2] * y [0][1] - Lx [q+1] * y [1][1] ; y [2][2] = X [j+2][2] - Lx [p+2] * y [0][2] - Lx [q+1] * y [1][2] ; y [2][3] = X [j+2][3] - Lx [p+2] * y [0][3] - Lx [q+1] * y [1][3] ; X [j ][0] = y [0][0] / Lx [p] ; X [j ][1] = y [0][1] / Lx [p] ; X [j ][2] = y [0][2] / Lx [p] ; X [j ][3] = y [0][3] / Lx [p] ; X [j+1][0] = y [1][0] / Lx [q] ; X [j+1][1] = y [1][1] / Lx [q] ; X [j+1][2] = y [1][2] / Lx [q] ; X [j+1][3] = y [1][3] / Lx [q] ; X [j+2][0] = y [2][0] / Lx [r] ; X [j+2][1] = y [2][1] / Lx [r] ; X [j+2][2] = y [2][2] / Lx [r] ; X [j+2][3] = y [2][3] / Lx [r] ; #else y [1][0] = X [j+1][0] - Lx [p+1] * y [0][0] ; y [1][1] = X [j+1][1] - Lx [p+1] * y [0][1] ; y [1][2] = X [j+1][2] - Lx [p+1] * y [0][2] ; y [1][3] = X [j+1][3] - Lx [p+1] * y [0][3] ; y [2][0] = X [j+2][0] - Lx [p+2] * y [0][0] - Lx [q+1] * y [1][0] ; y [2][1] = X [j+2][1] - Lx [p+2] * y [0][1] - Lx [q+1] * y [1][1] ; y [2][2] = X [j+2][2] - Lx [p+2] * y [0][2] - Lx [q+1] * y [1][2] ; y [2][3] = X [j+2][3] - Lx [p+2] * y [0][3] - Lx [q+1] * y [1][3] ; X [j+1][0] = y [1][0] ; X [j+1][1] = y [1][1] ; X [j+1][2] = y [1][2] ; X [j+1][3] = y [1][3] ; X [j+2][0] = y [2][0] ; X [j+2][1] = y [2][1] ; X [j+2][2] = y [2][2] ; X [j+2][3] = y [2][3] ; #endif for (p += 3, q += 2, r++ ; p < pend ; p++, q++, r++) { Int i = Li [p] ; double lx [3] ; lx [0] = Lx [p] ; lx [1] = Lx [q] ; lx [2] = Lx [r] ; X [i][0] -= lx[0] * y[0][0] + lx[1] * y[1][0] + lx[2] * y[2][0]; X [i][1] -= lx[0] * y[0][1] + lx[1] * y[1][1] + lx[2] * y[2][1]; X [i][2] -= lx[0] * y[0][2] + lx[1] * y[1][2] + lx[2] * y[2][2]; X [i][3] -= lx[0] * y[0][3] + lx[1] * y[1][3] + lx[2] * y[2][3]; } j += 3 ; /* advance to next column of L */ } } } #endif /* ========================================================================== */ /* === LSOLVE (k) =========================================================== */ /* ========================================================================== */ static void LSOLVE (PREFIX,k) ( cholmod_factor *L, cholmod_dense *Y, /* nr-by-n where nr is 1 to 4 */ Int *Yseti, Int ysetlen ) { double yx [2] ; #ifdef ZOMPLEX double yz [1] ; double *Lz = L->z ; double *Xz = Y->z ; #endif double *Lx = L->x ; double *Xx = Y->x ; Int *Li = L->i ; Int *Lp = L->p ; Int *Lnz = L->nz ; Int n = L->n, jj, jjiters ; ASSERT (L->xtype == Y->xtype) ; /* L and Y must have the same xtype */ ASSERT (L->n == Y->ncol) ; /* dimensions must match */ ASSERT (Y->nrow == Y->d) ; /* leading dimension of Y = # rows of Y */ ASSERT (L->xtype != CHOLMOD_PATTERN) ; /* L is not symbolic */ ASSERT (!(L->is_super)) ; /* L is simplicial LL' or LDL' */ #ifdef REAL if (Yseti == NULL) { /* ------------------------------------------------------------------ */ /* real case, no Yseti, with 1 to 4 RHS's and dynamic supernodes */ /* ------------------------------------------------------------------ */ ASSERT (Y->nrow <= 4) ; switch (Y->nrow) { case 1: LSOLVE (PREFIX,1) (L, Y->x) ; break ; case 2: LSOLVE (PREFIX,2) (L, Y->x) ; break ; case 3: LSOLVE (PREFIX,3) (L, Y->x) ; break ; case 4: LSOLVE (PREFIX,4) (L, Y->x) ; break ; } } else #endif { /* ------------------------------------------------------------------ */ /* solve a complex linear system or solve with Yseti */ /* ------------------------------------------------------------------ */ ASSERT (Y->nrow == 1) ; jjiters = Yseti ? ysetlen : n ; for (jj = 0 ; jj < jjiters ; jj++) { Int j = Yseti ? Yseti [jj] : jj ; /* get the start, end, and length of column j */ Int p = Lp [j] ; Int lnz = Lnz [j] ; Int pend = p + lnz ; /* y = X [j] ; */ ASSIGN (yx,yz,0, Xx,Xz,j) ; #ifdef LL /* y /= Lx [p] ; */ /* X [j] = y ; */ DIV_REAL (yx,yz,0, yx,yz,0, Lx,p) ; ASSIGN (Xx,Xz,j, yx,yz,0) ; #elif defined (LD) /* X [j] = y / Lx [p] ; */ DIV_REAL (Xx,Xz,j, yx,yz,0, Lx,p) ; #endif for (p++ ; p < pend ; p++) { /* X [Li [p]] -= Lx [p] * y ; */ Int i = Li [p] ; MULTSUB (Xx,Xz,i, Lx,Lz,p, yx,yz,0) ; } } } } /* prepare for the next inclusion of this file in cholmod_solve.c */ #undef LL #undef LD JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/t_cholmod_ltsolve.c0000664000175000017500000005463314224052371022332 00000000000000/* ========================================================================== */ /* === Cholesky/t_cholmod_ltsolve =========================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2013, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Template routine to solve L'x=b with unit or non-unit diagonal, or * solve DL'x=b. * * The numeric xtype of L and Y must match. Y contains b on input and x on * output, stored in row-form. Y is nrow-by-n, where nrow must equal 1 for the * complex or zomplex cases, and nrow <= 4 for the real case. * * This file is not compiled separately. It is included in t_cholmod_solve.c * instead. It contains no user-callable routines. * * workspace: none * * Supports real, complex, and zomplex factors. */ /* undefine all prior definitions */ #undef FORM_NAME #undef LSOLVE #undef DIAG /* -------------------------------------------------------------------------- */ /* define the method */ /* -------------------------------------------------------------------------- */ #ifdef LL /* LL': solve Lx=b with non-unit diagonal */ #define FORM_NAME(prefix,rank) prefix ## ll_ltsolve_ ## rank #define DIAG #elif defined (LD) /* LDL': solve LDx=b */ #define FORM_NAME(prefix,rank) prefix ## ldl_dltsolve_ ## rank #define DIAG #else /* LDL': solve Lx=b with unit diagonal */ #define FORM_NAME(prefix,rank) prefix ## ldl_ltsolve_ ## rank #endif /* LSOLVE(k) defines the name of a routine for an n-by-k right-hand-side. */ #define LSOLVE(prefix,rank) FORM_NAME(prefix,rank) #ifdef REAL /* ========================================================================== */ /* === LSOLVE (1) =========================================================== */ /* ========================================================================== */ /* Solve L'x=b, where b has 1 column */ static void LSOLVE (PREFIX,1) ( cholmod_factor *L, double X [ ] /* n-by-1 in row form */ ) { double *Lx = L->x ; Int *Li = L->i ; Int *Lp = L->p ; Int *Lnz = L->nz ; Int j, n = L->n ; for (j = n-1 ; j >= 0 ; ) { /* get the start, end, and length of column j */ Int p = Lp [j] ; Int lnz = Lnz [j] ; Int pend = p + lnz ; /* find a chain of supernodes (up to j, j-1, and j-2) */ if (j < 4 || lnz != Lnz [j-1] - 1 || Li [Lp [j-1]+1] != j) { /* -------------------------------------------------------------- */ /* solve with a single column of L */ /* -------------------------------------------------------------- */ double y = X [j] ; #ifdef DIAG double d = Lx [p] ; #endif #ifdef LD y /= d ; #endif for (p++ ; p < pend ; p++) { y -= Lx [p] * X [Li [p]] ; } #ifdef LL X [j] = y / d ; #else X [j] = y ; #endif j-- ; /* advance to the next column of L */ } else if (lnz != Lnz [j-2]-2 || Li [Lp [j-2]+2] != j) { /* -------------------------------------------------------------- */ /* solve with a supernode of two columns of L */ /* -------------------------------------------------------------- */ double y [2], t ; Int q = Lp [j-1] ; #ifdef DIAG double d [2] ; d [0] = Lx [p] ; d [1] = Lx [q] ; #endif t = Lx [q+1] ; #ifdef LD y [0] = X [j ] / d [0] ; y [1] = X [j-1] / d [1] ; #else y [0] = X [j ] ; y [1] = X [j-1] ; #endif for (p++, q += 2 ; p < pend ; p++, q++) { Int i = Li [p] ; y [0] -= Lx [p] * X [i] ; y [1] -= Lx [q] * X [i] ; } #ifdef LL y [0] /= d [0] ; y [1] = (y [1] - t * y [0]) / d [1] ; #else y [1] -= t * y [0] ; #endif X [j ] = y [0] ; X [j-1] = y [1] ; j -= 2 ; /* advance to the next column of L */ } else { /* -------------------------------------------------------------- */ /* solve with a supernode of three columns of L */ /* -------------------------------------------------------------- */ double y [3], t [3] ; Int q = Lp [j-1] ; Int r = Lp [j-2] ; #ifdef DIAG double d [3] ; d [0] = Lx [p] ; d [1] = Lx [q] ; d [2] = Lx [r] ; #endif t [0] = Lx [q+1] ; t [1] = Lx [r+1] ; t [2] = Lx [r+2] ; #ifdef LD y [0] = X [j] / d [0] ; y [1] = X [j-1] / d [1] ; y [2] = X [j-2] / d [2] ; #else y [0] = X [j] ; y [1] = X [j-1] ; y [2] = X [j-2] ; #endif for (p++, q += 2, r += 3 ; p < pend ; p++, q++, r++) { Int i = Li [p] ; y [0] -= Lx [p] * X [i] ; y [1] -= Lx [q] * X [i] ; y [2] -= Lx [r] * X [i] ; } #ifdef LL y [0] /= d [0] ; y [1] = (y [1] - t [0] * y [0]) / d [1] ; y [2] = (y [2] - t [2] * y [0] - t [1] * y [1]) / d [2] ; #else y [1] -= t [0] * y [0] ; y [2] -= t [2] * y [0] + t [1] * y [1] ; #endif X [j-2] = y [2] ; X [j-1] = y [1] ; X [j ] = y [0] ; j -= 3 ; /* advance to the next column of L */ } } } /* ========================================================================== */ /* === LSOLVE (2) =========================================================== */ /* ========================================================================== */ /* Solve L'x=b, where b has 2 columns */ static void LSOLVE (PREFIX,2) ( cholmod_factor *L, double X [ ][2] /* n-by-2 in row form */ ) { double *Lx = L->x ; Int *Li = L->i ; Int *Lp = L->p ; Int *Lnz = L->nz ; Int j, n = L->n ; for (j = n-1 ; j >= 0 ; ) { /* get the start, end, and length of column j */ Int p = Lp [j] ; Int lnz = Lnz [j] ; Int pend = p + lnz ; /* find a chain of supernodes (up to j, j-1, and j-2) */ if (j < 4 || lnz != Lnz [j-1] - 1 || Li [Lp [j-1]+1] != j) { /* -------------------------------------------------------------- */ /* solve with a single column of L */ /* -------------------------------------------------------------- */ double y [2] ; #ifdef DIAG double d = Lx [p] ; #endif #ifdef LD y [0] = X [j][0] / d ; y [1] = X [j][1] / d ; #else y [0] = X [j][0] ; y [1] = X [j][1] ; #endif for (p++ ; p < pend ; p++) { Int i = Li [p] ; y [0] -= Lx [p] * X [i][0] ; y [1] -= Lx [p] * X [i][1] ; } #ifdef LL X [j][0] = y [0] / d ; X [j][1] = y [1] / d ; #else X [j][0] = y [0] ; X [j][1] = y [1] ; #endif j-- ; /* advance to the next column of L */ } else if (lnz != Lnz [j-2]-2 || Li [Lp [j-2]+2] != j) { /* -------------------------------------------------------------- */ /* solve with a supernode of two columns of L */ /* -------------------------------------------------------------- */ double y [2][2], t ; Int q = Lp [j-1] ; #ifdef DIAG double d [2] ; d [0] = Lx [p] ; d [1] = Lx [q] ; #endif t = Lx [q+1] ; #ifdef LD y [0][0] = X [j ][0] / d [0] ; y [0][1] = X [j ][1] / d [0] ; y [1][0] = X [j-1][0] / d [1] ; y [1][1] = X [j-1][1] / d [1] ; #else y [0][0] = X [j ][0] ; y [0][1] = X [j ][1] ; y [1][0] = X [j-1][0] ; y [1][1] = X [j-1][1] ; #endif for (p++, q += 2 ; p < pend ; p++, q++) { Int i = Li [p] ; y [0][0] -= Lx [p] * X [i][0] ; y [0][1] -= Lx [p] * X [i][1] ; y [1][0] -= Lx [q] * X [i][0] ; y [1][1] -= Lx [q] * X [i][1] ; } #ifdef LL y [0][0] /= d [0] ; y [0][1] /= d [0] ; y [1][0] = (y [1][0] - t * y [0][0]) / d [1] ; y [1][1] = (y [1][1] - t * y [0][1]) / d [1] ; #else y [1][0] -= t * y [0][0] ; y [1][1] -= t * y [0][1] ; #endif X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j-1][0] = y [1][0] ; X [j-1][1] = y [1][1] ; j -= 2 ; /* advance to the next column of L */ } else { /* -------------------------------------------------------------- */ /* solve with a supernode of three columns of L */ /* -------------------------------------------------------------- */ double y [3][2], t [3] ; Int q = Lp [j-1] ; Int r = Lp [j-2] ; #ifdef DIAG double d [3] ; d [0] = Lx [p] ; d [1] = Lx [q] ; d [2] = Lx [r] ; #endif t [0] = Lx [q+1] ; t [1] = Lx [r+1] ; t [2] = Lx [r+2] ; #ifdef LD y [0][0] = X [j ][0] / d [0] ; y [0][1] = X [j ][1] / d [0] ; y [1][0] = X [j-1][0] / d [1] ; y [1][1] = X [j-1][1] / d [1] ; y [2][0] = X [j-2][0] / d [2] ; y [2][1] = X [j-2][1] / d [2] ; #else y [0][0] = X [j ][0] ; y [0][1] = X [j ][1] ; y [1][0] = X [j-1][0] ; y [1][1] = X [j-1][1] ; y [2][0] = X [j-2][0] ; y [2][1] = X [j-2][1] ; #endif for (p++, q += 2, r += 3 ; p < pend ; p++, q++, r++) { Int i = Li [p] ; y [0][0] -= Lx [p] * X [i][0] ; y [0][1] -= Lx [p] * X [i][1] ; y [1][0] -= Lx [q] * X [i][0] ; y [1][1] -= Lx [q] * X [i][1] ; y [2][0] -= Lx [r] * X [i][0] ; y [2][1] -= Lx [r] * X [i][1] ; } #ifdef LL y [0][0] /= d [0] ; y [0][1] /= d [0] ; y [1][0] = (y [1][0] - t [0] * y [0][0]) / d [1] ; y [1][1] = (y [1][1] - t [0] * y [0][1]) / d [1] ; y [2][0] = (y [2][0] - t [2] * y [0][0] - t [1] * y [1][0]) / d [2]; y [2][1] = (y [2][1] - t [2] * y [0][1] - t [1] * y [1][1]) / d [2]; #else y [1][0] -= t [0] * y [0][0] ; y [1][1] -= t [0] * y [0][1] ; y [2][0] -= t [2] * y [0][0] + t [1] * y [1][0] ; y [2][1] -= t [2] * y [0][1] + t [1] * y [1][1] ; #endif X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j-1][0] = y [1][0] ; X [j-1][1] = y [1][1] ; X [j-2][0] = y [2][0] ; X [j-2][1] = y [2][1] ; j -= 3 ; /* advance to the next column of L */ } } } /* ========================================================================== */ /* === LSOLVE (3) =========================================================== */ /* ========================================================================== */ /* Solve L'x=b, where b has 3 columns */ static void LSOLVE (PREFIX,3) ( cholmod_factor *L, double X [ ][3] /* n-by-3 in row form */ ) { double *Lx = L->x ; Int *Li = L->i ; Int *Lp = L->p ; Int *Lnz = L->nz ; Int j, n = L->n ; for (j = n-1 ; j >= 0 ; ) { /* get the start, end, and length of column j */ Int p = Lp [j] ; Int lnz = Lnz [j] ; Int pend = p + lnz ; /* find a chain of supernodes (up to j, j-1, and j-2) */ if (j < 4 || lnz != Lnz [j-1] - 1 || Li [Lp [j-1]+1] != j) { /* -------------------------------------------------------------- */ /* solve with a single column of L */ /* -------------------------------------------------------------- */ double y [3] ; #ifdef DIAG double d = Lx [p] ; #endif #ifdef LD y [0] = X [j][0] / d ; y [1] = X [j][1] / d ; y [2] = X [j][2] / d ; #else y [0] = X [j][0] ; y [1] = X [j][1] ; y [2] = X [j][2] ; #endif for (p++ ; p < pend ; p++) { Int i = Li [p] ; y [0] -= Lx [p] * X [i][0] ; y [1] -= Lx [p] * X [i][1] ; y [2] -= Lx [p] * X [i][2] ; } #ifdef LL X [j][0] = y [0] / d ; X [j][1] = y [1] / d ; X [j][2] = y [2] / d ; #else X [j][0] = y [0] ; X [j][1] = y [1] ; X [j][2] = y [2] ; #endif j-- ; /* advance to the next column of L */ } else if (lnz != Lnz [j-2]-2 || Li [Lp [j-2]+2] != j) { /* -------------------------------------------------------------- */ /* solve with a supernode of two columns of L */ /* -------------------------------------------------------------- */ double y [2][3], t ; Int q = Lp [j-1] ; #ifdef DIAG double d [2] ; d [0] = Lx [p] ; d [1] = Lx [q] ; #endif t = Lx [q+1] ; #ifdef LD y [0][0] = X [j ][0] / d [0] ; y [0][1] = X [j ][1] / d [0] ; y [0][2] = X [j ][2] / d [0] ; y [1][0] = X [j-1][0] / d [1] ; y [1][1] = X [j-1][1] / d [1] ; y [1][2] = X [j-1][2] / d [1] ; #else y [0][0] = X [j ][0] ; y [0][1] = X [j ][1] ; y [0][2] = X [j ][2] ; y [1][0] = X [j-1][0] ; y [1][1] = X [j-1][1] ; y [1][2] = X [j-1][2] ; #endif for (p++, q += 2 ; p < pend ; p++, q++) { Int i = Li [p] ; y [0][0] -= Lx [p] * X [i][0] ; y [0][1] -= Lx [p] * X [i][1] ; y [0][2] -= Lx [p] * X [i][2] ; y [1][0] -= Lx [q] * X [i][0] ; y [1][1] -= Lx [q] * X [i][1] ; y [1][2] -= Lx [q] * X [i][2] ; } #ifdef LL y [0][0] /= d [0] ; y [0][1] /= d [0] ; y [0][2] /= d [0] ; y [1][0] = (y [1][0] - t * y [0][0]) / d [1] ; y [1][1] = (y [1][1] - t * y [0][1]) / d [1] ; y [1][2] = (y [1][2] - t * y [0][2]) / d [1] ; #else y [1][0] -= t * y [0][0] ; y [1][1] -= t * y [0][1] ; y [1][2] -= t * y [0][2] ; #endif X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j ][2] = y [0][2] ; X [j-1][0] = y [1][0] ; X [j-1][1] = y [1][1] ; X [j-1][2] = y [1][2] ; j -= 2 ; /* advance to the next column of L */ } else { /* -------------------------------------------------------------- */ /* solve with a supernode of three columns of L */ /* -------------------------------------------------------------- */ double y [3][3], t [3] ; Int q = Lp [j-1] ; Int r = Lp [j-2] ; #ifdef DIAG double d [3] ; d [0] = Lx [p] ; d [1] = Lx [q] ; d [2] = Lx [r] ; #endif t [0] = Lx [q+1] ; t [1] = Lx [r+1] ; t [2] = Lx [r+2] ; #ifdef LD y [0][0] = X [j ][0] / d [0] ; y [0][1] = X [j ][1] / d [0] ; y [0][2] = X [j ][2] / d [0] ; y [1][0] = X [j-1][0] / d [1] ; y [1][1] = X [j-1][1] / d [1] ; y [1][2] = X [j-1][2] / d [1] ; y [2][0] = X [j-2][0] / d [2] ; y [2][1] = X [j-2][1] / d [2] ; y [2][2] = X [j-2][2] / d [2] ; #else y [0][0] = X [j ][0] ; y [0][1] = X [j ][1] ; y [0][2] = X [j ][2] ; y [1][0] = X [j-1][0] ; y [1][1] = X [j-1][1] ; y [1][2] = X [j-1][2] ; y [2][0] = X [j-2][0] ; y [2][1] = X [j-2][1] ; y [2][2] = X [j-2][2] ; #endif for (p++, q += 2, r += 3 ; p < pend ; p++, q++, r++) { Int i = Li [p] ; y [0][0] -= Lx [p] * X [i][0] ; y [0][1] -= Lx [p] * X [i][1] ; y [0][2] -= Lx [p] * X [i][2] ; y [1][0] -= Lx [q] * X [i][0] ; y [1][1] -= Lx [q] * X [i][1] ; y [1][2] -= Lx [q] * X [i][2] ; y [2][0] -= Lx [r] * X [i][0] ; y [2][1] -= Lx [r] * X [i][1] ; y [2][2] -= Lx [r] * X [i][2] ; } #ifdef LL y [0][0] /= d [0] ; y [0][1] /= d [0] ; y [0][2] /= d [0] ; y [1][0] = (y [1][0] - t [0] * y [0][0]) / d [1] ; y [1][1] = (y [1][1] - t [0] * y [0][1]) / d [1] ; y [1][2] = (y [1][2] - t [0] * y [0][2]) / d [1] ; y [2][0] = (y [2][0] - t [2] * y [0][0] - t [1] * y [1][0]) / d [2]; y [2][1] = (y [2][1] - t [2] * y [0][1] - t [1] * y [1][1]) / d [2]; y [2][2] = (y [2][2] - t [2] * y [0][2] - t [1] * y [1][2]) / d [2]; #else y [1][0] -= t [0] * y [0][0] ; y [1][1] -= t [0] * y [0][1] ; y [1][2] -= t [0] * y [0][2] ; y [2][0] -= t [2] * y [0][0] + t [1] * y [1][0] ; y [2][1] -= t [2] * y [0][1] + t [1] * y [1][1] ; y [2][2] -= t [2] * y [0][2] + t [1] * y [1][2] ; #endif X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j ][2] = y [0][2] ; X [j-1][0] = y [1][0] ; X [j-1][1] = y [1][1] ; X [j-1][2] = y [1][2] ; X [j-2][0] = y [2][0] ; X [j-2][1] = y [2][1] ; X [j-2][2] = y [2][2] ; j -= 3 ; /* advance to the next column of L */ } } } /* ========================================================================== */ /* === LSOLVE (4) =========================================================== */ /* ========================================================================== */ /* Solve L'x=b, where b has 4 columns */ static void LSOLVE (PREFIX,4) ( cholmod_factor *L, double X [ ][4] /* n-by-4 in row form */ ) { double *Lx = L->x ; Int *Li = L->i ; Int *Lp = L->p ; Int *Lnz = L->nz ; Int j, n = L->n ; for (j = n-1 ; j >= 0 ; ) { /* get the start, end, and length of column j */ Int p = Lp [j] ; Int lnz = Lnz [j] ; Int pend = p + lnz ; /* find a chain of supernodes (up to j, j-1, and j-2) */ if (j < 4 || lnz != Lnz [j-1] - 1 || Li [Lp [j-1]+1] != j) { /* -------------------------------------------------------------- */ /* solve with a single column of L */ /* -------------------------------------------------------------- */ double y [4] ; #ifdef DIAG double d = Lx [p] ; #endif #ifdef LD y [0] = X [j][0] / d ; y [1] = X [j][1] / d ; y [2] = X [j][2] / d ; y [3] = X [j][3] / d ; #else y [0] = X [j][0] ; y [1] = X [j][1] ; y [2] = X [j][2] ; y [3] = X [j][3] ; #endif for (p++ ; p < pend ; p++) { Int i = Li [p] ; y [0] -= Lx [p] * X [i][0] ; y [1] -= Lx [p] * X [i][1] ; y [2] -= Lx [p] * X [i][2] ; y [3] -= Lx [p] * X [i][3] ; } #ifdef LL X [j][0] = y [0] / d ; X [j][1] = y [1] / d ; X [j][2] = y [2] / d ; X [j][3] = y [3] / d ; #else X [j][0] = y [0] ; X [j][1] = y [1] ; X [j][2] = y [2] ; X [j][3] = y [3] ; #endif j-- ; /* advance to the next column of L */ } else /* if (j == 1 || lnz != Lnz [j-2]-2 || Li [Lp [j-2]+2] != j) */ { /* -------------------------------------------------------------- */ /* solve with a supernode of two columns of L */ /* -------------------------------------------------------------- */ double y [2][4], t ; Int q = Lp [j-1] ; #ifdef DIAG double d [2] ; d [0] = Lx [p] ; d [1] = Lx [q] ; #endif t = Lx [q+1] ; #ifdef LD y [0][0] = X [j ][0] / d [0] ; y [0][1] = X [j ][1] / d [0] ; y [0][2] = X [j ][2] / d [0] ; y [0][3] = X [j ][3] / d [0] ; y [1][0] = X [j-1][0] / d [1] ; y [1][1] = X [j-1][1] / d [1] ; y [1][2] = X [j-1][2] / d [1] ; y [1][3] = X [j-1][3] / d [1] ; #else y [0][0] = X [j ][0] ; y [0][1] = X [j ][1] ; y [0][2] = X [j ][2] ; y [0][3] = X [j ][3] ; y [1][0] = X [j-1][0] ; y [1][1] = X [j-1][1] ; y [1][2] = X [j-1][2] ; y [1][3] = X [j-1][3] ; #endif for (p++, q += 2 ; p < pend ; p++, q++) { Int i = Li [p] ; y [0][0] -= Lx [p] * X [i][0] ; y [0][1] -= Lx [p] * X [i][1] ; y [0][2] -= Lx [p] * X [i][2] ; y [0][3] -= Lx [p] * X [i][3] ; y [1][0] -= Lx [q] * X [i][0] ; y [1][1] -= Lx [q] * X [i][1] ; y [1][2] -= Lx [q] * X [i][2] ; y [1][3] -= Lx [q] * X [i][3] ; } #ifdef LL y [0][0] /= d [0] ; y [0][1] /= d [0] ; y [0][2] /= d [0] ; y [0][3] /= d [0] ; y [1][0] = (y [1][0] - t * y [0][0]) / d [1] ; y [1][1] = (y [1][1] - t * y [0][1]) / d [1] ; y [1][2] = (y [1][2] - t * y [0][2]) / d [1] ; y [1][3] = (y [1][3] - t * y [0][3]) / d [1] ; #else y [1][0] -= t * y [0][0] ; y [1][1] -= t * y [0][1] ; y [1][2] -= t * y [0][2] ; y [1][3] -= t * y [0][3] ; #endif X [j ][0] = y [0][0] ; X [j ][1] = y [0][1] ; X [j ][2] = y [0][2] ; X [j ][3] = y [0][3] ; X [j-1][0] = y [1][0] ; X [j-1][1] = y [1][1] ; X [j-1][2] = y [1][2] ; X [j-1][3] = y [1][3] ; j -= 2 ; /* advance to the next column of L */ } /* NOTE: with 4 right-hand-sides, it suffices to exploit dynamic * supernodes of just size 1 and 2. 3-column supernodes are not * needed. */ } } #endif /* ========================================================================== */ /* === LSOLVE (k) =========================================================== */ /* ========================================================================== */ static void LSOLVE (PREFIX,k) ( cholmod_factor *L, cholmod_dense *Y, /* nr-by-n where nr is 1 to 4 */ Int *Yseti, Int ysetlen ) { #ifdef DIAG double d [1] ; #endif double yx [2] ; #ifdef ZOMPLEX double yz [1] ; double *Lz = L->z ; double *Xz = Y->z ; #endif double *Lx = L->x ; double *Xx = Y->x ; Int *Li = L->i ; Int *Lp = L->p ; Int *Lnz = L->nz ; Int n = L->n, jj, jjiters ; ASSERT (L->xtype == Y->xtype) ; /* L and Y must have the same xtype */ ASSERT (L->n == Y->ncol) ; /* dimensions must match */ ASSERT (Y->nrow == Y->d) ; /* leading dimension of Y = # rows of Y */ ASSERT (L->xtype != CHOLMOD_PATTERN) ; /* L is not symbolic */ ASSERT (!(L->is_super)) ; /* L is simplicial LL' or LDL' */ #ifdef REAL if (Yseti == NULL) { /* ------------------------------------------------------------------ */ /* real case, no Yseti, with 1 to 4 RHS's and dynamic supernodes */ /* ------------------------------------------------------------------ */ ASSERT (Y->nrow <= 4) ; switch (Y->nrow) { case 1: LSOLVE (PREFIX,1) (L, Y->x) ; break ; case 2: LSOLVE (PREFIX,2) (L, Y->x) ; break ; case 3: LSOLVE (PREFIX,3) (L, Y->x) ; break ; case 4: LSOLVE (PREFIX,4) (L, Y->x) ; break ; } } else #endif { /* ------------------------------------------------------------------ */ /* solve a complex linear system or solve with Yseti */ /* ------------------------------------------------------------------ */ ASSERT (Y->nrow == 1) ; jjiters = Yseti ? ysetlen : n ; for (jj = jjiters-1 ; jj >= 0 ; jj--) { Int j = Yseti ? Yseti [jj] : jj ; /* get the start, end, and length of column j */ Int p = Lp [j] ; Int lnz = Lnz [j] ; Int pend = p + lnz ; /* y = X [j] ; */ ASSIGN (yx,yz,0, Xx,Xz,j) ; #ifdef DIAG /* d = Lx [p] ; */ ASSIGN_REAL (d,0, Lx,p) ; #endif #ifdef LD /* y /= d ; */ DIV_REAL (yx,yz,0, yx,yz,0, d,0) ; #endif for (p++ ; p < pend ; p++) { /* y -= conj (Lx [p]) * X [Li [p]] ; */ Int i = Li [p] ; MULTSUBCONJ (yx,yz,0, Lx,Lz,p, Xx,Xz,i) ; } #ifdef LL /* X [j] = y / d ; */ DIV_REAL (Xx,Xz,j, yx,yz,0, d,0) ; #else /* X [j] = y ; */ ASSIGN (Xx,Xz,j, yx,yz,0) ; #endif } } } /* prepare for the next inclusion of this file in cholmod_solve.c */ #undef LL #undef LD JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/t_cholmod_rowfac.c0000664000175000017500000003237014224052371022115 00000000000000/* ========================================================================== */ /* === Cholesky/t_cholmod_rowfac ============================================ */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Template routine for cholmod_rowfac. Supports any numeric xtype * (real, complex, or zomplex). * * workspace: Iwork (n), Flag (n), Xwork (n if real, 2*n if complex) */ #include "cholmod_template.h" #ifdef MASK static int TEMPLATE (cholmod_rowfac_mask) #else static int TEMPLATE (cholmod_rowfac) #endif ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,f)' */ double beta [2], /* factorize beta*I+A or beta*I+AA' (beta [0] only) */ size_t kstart, /* first row to factorize */ size_t kend, /* last row to factorize is kend-1 */ #ifdef MASK /* These inputs are used for cholmod_rowfac_mask only */ Int *mask, /* size A->nrow. if mask[i] >= maskmark then W(i) is set to zero */ Int maskmark, Int *RLinkUp, /* size A->nrow. link list of rows to compute */ #endif /* ---- in/out --- */ cholmod_factor *L, /* --------------- */ cholmod_common *Common ) { double yx [2], lx [2], fx [2], dk [1], di [1], fl = 0 ; #ifdef ZOMPLEX double yz [1], lz [1], fz [1] ; #endif double *Ax, *Az, *Lx, *Lz, *Wx, *Wz, *Fx, *Fz ; Int *Ap, *Anz, *Ai, *Lp, *Lnz, *Li, *Lnext, *Flag, *Stack, *Fp, *Fi, *Fnz, *Iwork ; Int i, p, k, t, pf, pfend, top, s, mark, pend, n, lnz, is_ll, multadds, use_dbound, packed, stype, Fpacked, sorted, nzmax, len, parent ; #ifndef REAL Int dk_imaginary ; #endif /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ PRINT1 (("\nin cholmod_rowfac, kstart %d kend %d stype %d\n", kstart, kend, A->stype)) ; DEBUG (CHOLMOD(dump_factor) (L, "Initial L", Common)) ; n = A->nrow ; stype = A->stype ; if (stype > 0) { /* symmetric upper case: F is not needed. It may be NULL */ Fp = NULL ; Fi = NULL ; Fx = NULL ; Fz = NULL ; Fnz = NULL ; Fpacked = TRUE ; } else { /* unsymmetric case: F is required. */ Fp = F->p ; Fi = F->i ; Fx = F->x ; Fz = F->z ; Fnz = F->nz ; Fpacked = F->packed ; } Ap = A->p ; /* size A->ncol+1, column pointers of A */ Ai = A->i ; /* size nz = Ap [A->ncol], row indices of A */ Ax = A->x ; /* size nz, numeric values of A */ Az = A->z ; Anz = A->nz ; packed = A->packed ; sorted = A->sorted ; use_dbound = IS_GT_ZERO (Common->dbound) ; /* get the current factors L (and D for LDL'); allocate space if needed */ is_ll = L->is_ll ; if (L->xtype == CHOLMOD_PATTERN) { /* ------------------------------------------------------------------ */ /* L is symbolic only; allocate and initialize L (and D for LDL') */ /* ------------------------------------------------------------------ */ /* workspace: none */ CHOLMOD(change_factor) (A->xtype, is_ll, FALSE, FALSE, TRUE, L, Common); if (Common->status < CHOLMOD_OK) { /* out of memory */ return (FALSE) ; } ASSERT (L->minor == (size_t) n) ; } else if (kstart == 0 && kend == (size_t) n) { /* ------------------------------------------------------------------ */ /* refactorization; reset L->nz and L->minor to restart factorization */ /* ------------------------------------------------------------------ */ L->minor = n ; Lnz = L->nz ; for (k = 0 ; k < n ; k++) { Lnz [k] = 1 ; } } ASSERT (is_ll == L->is_ll) ; ASSERT (L->xtype != CHOLMOD_PATTERN) ; DEBUG (CHOLMOD(dump_factor) (L, "L ready", Common)) ; DEBUG (CHOLMOD(dump_sparse) (A, "A ready", Common)) ; DEBUG (if (stype == 0) CHOLMOD(dump_sparse) (F, "F ready", Common)) ; /* inputs, can be modified on output: */ Lp = L->p ; /* size n+1 */ ASSERT (Lp != NULL) ; /* outputs, contents defined on input for incremental case only: */ Lnz = L->nz ; /* size n */ Lnext = L->next ; /* size n+2 */ Li = L->i ; /* size L->nzmax, can change in size */ Lx = L->x ; /* size L->nzmax or 2*L->nzmax, can change in size */ Lz = L->z ; /* size L->nzmax for zomplex case, can change in size */ nzmax = L->nzmax ; ASSERT (Lnz != NULL && Li != NULL && Lx != NULL) ; /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Iwork = Common->Iwork ; Stack = Iwork ; /* size n (i/i/l) */ Flag = Common->Flag ; /* size n, Flag [i] < mark must hold */ Wx = Common->Xwork ; /* size n if real, 2*n if complex or * zomplex. Xwork [i] == 0 must hold. */ Wz = Wx + n ; /* size n for zomplex case only */ mark = Common->mark ; ASSERT ((Int) Common->xworksize >= (L->xtype == CHOLMOD_REAL ? 1:2)*n) ; /* ---------------------------------------------------------------------- */ /* compute LDL' or LL' factorization by rows */ /* ---------------------------------------------------------------------- */ #ifdef MASK #define NEXT(k) k = RLinkUp [k] #else #define NEXT(k) k++ #endif for (k = kstart ; k < ((Int) kend) ; NEXT(k)) { PRINT1 (("\n===============K "ID" Lnz [k] "ID"\n", k, Lnz [k])) ; /* ------------------------------------------------------------------ */ /* compute pattern of kth row of L and scatter kth input column */ /* ------------------------------------------------------------------ */ /* column k of L is currently empty */ ASSERT (Lnz [k] == 1) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 2*n, Common)) ; top = n ; /* Stack is empty */ Flag [k] = mark ; /* do not include diagonal entry in Stack */ /* use Li [Lp [i]+1] for etree */ #define PARENT(i) (Lnz [i] > 1) ? (Li [Lp [i] + 1]) : EMPTY if (stype > 0) { /* scatter kth col of triu (beta*I+AA'), get pattern L(k,:) */ p = Ap [k] ; pend = (packed) ? (Ap [k+1]) : (p + Anz [k]) ; /* W [i] = Ax [i] ; scatter column of A */ #define SCATTER ASSIGN(Wx,Wz,i, Ax,Az,p) SUBTREE ; #undef SCATTER } else { /* scatter kth col of triu (beta*I+AA'), get pattern L(k,:) */ pf = Fp [k] ; pfend = (Fpacked) ? (Fp [k+1]) : (pf + Fnz [k]) ; for ( ; pf < pfend ; pf++) { /* get nonzero entry F (t,k) */ t = Fi [pf] ; /* fk = Fx [pf] */ ASSIGN (fx, fz, 0, Fx, Fz, pf) ; p = Ap [t] ; pend = (packed) ? (Ap [t+1]) : (p + Anz [t]) ; multadds = 0 ; /* W [i] += Ax [p] * fx ; scatter column of A*A' */ #define SCATTER MULTADD (Wx,Wz,i, Ax,Az,p, fx,fz,0) ; multadds++ ; SUBTREE ; #undef SCATTER #ifdef REAL fl += 2 * ((double) multadds) ; #else fl += 8 * ((double) multadds) ; #endif } } #undef PARENT /* ------------------------------------------------------------------ */ /* if mask is present, set the corresponding entries in W to zero */ /* ------------------------------------------------------------------ */ #ifdef MASK /* remove the dead element of Wx */ if (mask != NULL) { #if 0 /* older version */ for (p = n; p > top;) { i = Stack [--p] ; if ( mask [i] >= 0 ) { CLEAR (Wx,Wz,i) ; /* set W(i) to zero */ } } #endif for (s = top ; s < n ; s++) { i = Stack [s] ; if (mask [i] >= maskmark) { CLEAR (Wx,Wz,i) ; /* set W(i) to zero */ } } } #endif /* nonzero pattern of kth row of L is now in Stack [top..n-1]. * Flag [Stack [top..n-1]] is equal to mark, but no longer needed */ /* mark = CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; /* ------------------------------------------------------------------ */ /* compute kth row of L and store in column form */ /* ------------------------------------------------------------------ */ /* Solve L (0:k-1, 0:k-1) * y (0:k-1) = b (0:k-1) where * b (0:k) = A (0:k,k) or A(0:k,:) * F(:,k) is in W and Stack. * * For LDL' factorization: * L (k, 0:k-1) = y (0:k-1) ./ D (0:k-1) * D (k) = b (k) - L (k, 0:k-1) * y (0:k-1) * * For LL' factorization: * L (k, 0:k-1) = y (0:k-1) * L (k,k) = sqrt (b (k) - L (k, 0:k-1) * L (0:k-1, k)) */ /* dk = W [k] + beta */ ADD_REAL (dk,0, Wx,k, beta,0) ; #ifndef REAL /* In the unsymmetric case, the imaginary part of W[k] must be real, * since F is assumed to be the complex conjugate transpose of A. In * the symmetric case, W[k] is the diagonal of A. If the imaginary part * of W[k] is nonzero, then the Cholesky factorization cannot be * computed; A is not positive definite */ dk_imaginary = (stype > 0) ? (IMAG_IS_NONZERO (Wx,Wz,k)) : FALSE ; #endif /* W [k] = 0.0 ; */ CLEAR (Wx,Wz,k) ; for (s = top ; s < n ; s++) { /* get i for each nonzero entry L(k,i) */ i = Stack [s] ; /* y = W [i] ; */ ASSIGN (yx,yz,0, Wx,Wz,i) ; /* W [i] = 0.0 ; */ CLEAR (Wx,Wz,i) ; lnz = Lnz [i] ; p = Lp [i] ; ASSERT (lnz > 0 && Li [p] == i) ; pend = p + lnz ; /* di = Lx [p] ; the diagonal entry L or D(i,i), which is real */ ASSIGN_REAL (di,0, Lx,p) ; if (i >= (Int) L->minor || IS_ZERO (di [0])) { /* For the LL' factorization, L(i,i) is zero. For the LDL', * D(i,i) is zero. Skip column i of L, and set L(k,i) = 0. */ CLEAR (lx,lz,0) ; p = pend ; } else if (is_ll) { #ifdef REAL fl += 2 * ((double) (pend - p - 1)) + 3 ; #else fl += 8 * ((double) (pend - p - 1)) + 6 ; #endif /* forward solve using L (i:(k-1),i) */ /* divide by L(i,i), which must be real and nonzero */ /* y /= di [0] */ DIV_REAL (yx,yz,0, yx,yz,0, di,0) ; for (p++ ; p < pend ; p++) { /* W [Li [p]] -= Lx [p] * y ; */ MULTSUB (Wx,Wz,Li[p], Lx,Lz,p, yx,yz,0) ; } /* do not scale L; compute dot product for L(k,k) */ /* L(k,i) = conj(y) ; */ ASSIGN_CONJ (lx,lz,0, yx,yz,0) ; /* d -= conj(y) * y ; */ LLDOT (dk,0, yx,yz,0) ; } else { #ifdef REAL fl += 2 * ((double) (pend - p - 1)) + 3 ; #else fl += 8 * ((double) (pend - p - 1)) + 6 ; #endif /* forward solve using D (i,i) and L ((i+1):(k-1),i) */ for (p++ ; p < pend ; p++) { /* W [Li [p]] -= Lx [p] * y ; */ MULTSUB (Wx,Wz,Li[p], Lx,Lz,p, yx,yz,0) ; } /* Scale L (k,0:k-1) for LDL' factorization, compute D (k,k)*/ #ifdef REAL /* L(k,i) = y/d */ lx [0] = yx [0] / di [0] ; /* d -= L(k,i) * y */ dk [0] -= lx [0] * yx [0] ; #else /* L(k,i) = conj(y) ; */ ASSIGN_CONJ (lx,lz,0, yx,yz,0) ; /* L(k,i) /= di ; */ DIV_REAL (lx,lz,0, lx,lz,0, di,0) ; /* d -= conj(y) * y / di */ LDLDOT (dk,0, yx,yz,0, di,0) ; #endif } /* determine if column i of L can hold the new L(k,i) entry */ if (p >= Lp [Lnext [i]]) { /* column i needs to grow */ PRINT1 (("Factor Colrealloc "ID", old Lnz "ID"\n", i, Lnz [i])); if (!CHOLMOD(reallocate_column) (i, lnz + 1, L, Common)) { /* out of memory, L is now simplicial symbolic */ for (i = 0 ; i < n ; i++) { /* W [i] = 0 ; */ CLEAR (Wx,Wz,i) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, n, Common)) ; return (FALSE) ; } Li = L->i ; /* L->i, L->x, L->z may have moved */ Lx = L->x ; Lz = L->z ; p = Lp [i] + lnz ; /* contents of L->p changed */ ASSERT (p < Lp [Lnext [i]]) ; } /* store L (k,i) in the column form matrix of L */ Li [p] = k ; /* Lx [p] = L(k,i) ; */ ASSIGN (Lx,Lz,p, lx,lz,0) ; Lnz [i]++ ; } /* ------------------------------------------------------------------ */ /* ensure abs (d) >= dbound if dbound is given, and store it in L */ /* ------------------------------------------------------------------ */ p = Lp [k] ; Li [p] = k ; if (k >= (Int) L->minor) { /* the matrix is already not positive definite */ dk [0] = 0 ; } else if (use_dbound) { /* modify the diagonal to force LL' or LDL' to exist */ dk [0] = CHOLMOD(dbound) (is_ll ? fabs (dk [0]) : dk [0], Common) ; } else if ((is_ll ? (IS_LE_ZERO (dk [0])) : (IS_ZERO (dk [0]))) #ifndef REAL || dk_imaginary #endif ) { /* the matrix has just been found to be not positive definite */ dk [0] = 0 ; L->minor = k ; ERROR (CHOLMOD_NOT_POSDEF, "not positive definite") ; } if (is_ll) { /* this is counted as one flop, below */ dk [0] = sqrt (dk [0]) ; } /* Lx [p] = D(k,k) = d ; real part only */ ASSIGN_REAL (Lx,p, dk,0) ; CLEAR_IMAG (Lx,Lz,p) ; } #undef NEXT if (is_ll) fl += MAX ((Int) kend - (Int) kstart, 0) ; /* count sqrt's */ Common->rowfacfl = fl ; DEBUG (CHOLMOD(dump_factor) (L, "final cholmod_rowfac", Common)) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, n, Common)) ; return (TRUE) ; } #undef PATTERN #undef REAL #undef COMPLEX #undef ZOMPLEX JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Cholesky/t_cholmod_solve.c0000664000175000017500000001242314224052371021761 00000000000000/* ========================================================================== */ /* === Cholesky/t_cholmod_solve ============================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Cholesky Module. Copyright (C) 2005-2013, Timothy A. Davis * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Template routine for cholmod_solve. Supports any numeric xtype (real, * complex, or zomplex). The xtypes of all matrices (L and Y) must match. */ #include "cholmod_template.h" /* ========================================================================== */ /* === simplicial template solvers ========================================== */ /* ========================================================================== */ /* LL': solve Lx=b with non-unit diagonal */ #define LL #include "t_cholmod_lsolve.c" /* LDL': solve LDx=b */ #define LD #include "t_cholmod_lsolve.c" /* LDL': solve Lx=b with unit diagonal */ #include "t_cholmod_lsolve.c" /* LL': solve L'x=b with non-unit diagonal */ #define LL #include "t_cholmod_ltsolve.c" /* LDL': solve DL'x=b */ #define LD #include "t_cholmod_ltsolve.c" /* LDL': solve L'x=b with unit diagonal */ #include "t_cholmod_ltsolve.c" /* ========================================================================== */ /* === t_ldl_dsolve ========================================================= */ /* ========================================================================== */ /* Solve Dx=b for an LDL' factorization, where Y holds b' on input and x' on * output. * * The number of right-hand-sides (nrhs) is not restricted, even if Yseti * is present. */ static void TEMPLATE (ldl_dsolve) ( cholmod_factor *L, cholmod_dense *Y, /* nr-by-n with leading dimension nr */ Int *Yseti, Int ysetlen ) { double d [1] ; double *Lx, *Yx, *Yz ; Int *Lp ; Int n, nrhs, k, p, k1, k2, kk, kkiters ; ASSERT (L->xtype == Y->xtype) ; /* L and Y must have the same xtype */ ASSERT (L->n == Y->ncol) ; /* dimensions must match */ ASSERT (Y->nrow == Y->d) ; /* leading dimension of Y = # rows of Y */ ASSERT (L->xtype != CHOLMOD_PATTERN) ; /* L is not symbolic */ ASSERT (!(L->is_super) && !(L->is_ll)) ; /* L is simplicial LDL' */ nrhs = Y->nrow ; n = L->n ; Lp = L->p ; Lx = L->x ; Yx = Y->x ; Yz = Y->z ; kkiters = Yseti ? ysetlen : n ; for (kk = 0 ; kk < kkiters ; kk++) { k = Yseti ? Yseti [kk] : kk ; k1 = k*nrhs ; k2 = (k+1)*nrhs ; ASSIGN_REAL (d,0, Lx,Lp[k]) ; for (p = k1 ; p < k2 ; p++) { DIV_REAL (Yx,Yz,p, Yx,Yz,p, d,0) ; } } } /* ========================================================================== */ /* === t_simplicial_solver ================================================== */ /* ========================================================================== */ /* Solve a linear system, where Y' contains the (array-transposed) right-hand * side on input, and the solution on output. No permutations are applied; * these must have already been applied to Y on input. * * Yseti [0..ysetlen-1] is an optional list of indices from * cholmod_lsolve_pattern. The solve is performed only on the columns of L * corresponding to entries in Yseti. Ignored if NULL. If present, most * functions require that Y' consist of a single dense column. */ static void TEMPLATE (simplicial_solver) ( int sys, /* system to solve */ cholmod_factor *L, /* factor to use, a simplicial LL' or LDL' */ cholmod_dense *Y, /* right-hand-side on input, solution on output */ Int *Yseti, Int ysetlen ) { if (L->is_ll) { /* The factorization is LL' */ if (sys == CHOLMOD_A || sys == CHOLMOD_LDLt) { /* Solve Ax=b or LL'x=b */ TEMPLATE (ll_lsolve_k) (L, Y, Yseti, ysetlen) ; TEMPLATE (ll_ltsolve_k) (L, Y, Yseti, ysetlen) ; } else if (sys == CHOLMOD_L || sys == CHOLMOD_LD) { /* Solve Lx=b */ TEMPLATE (ll_lsolve_k) (L, Y, Yseti, ysetlen) ; } else if (sys == CHOLMOD_Lt || sys == CHOLMOD_DLt) { /* Solve L'x=b */ TEMPLATE (ll_ltsolve_k) (L, Y, Yseti, ysetlen) ; } } else { /* The factorization is LDL' */ if (sys == CHOLMOD_A || sys == CHOLMOD_LDLt) { /* Solve Ax=b or LDL'x=b */ TEMPLATE (ldl_lsolve_k) (L, Y, Yseti, ysetlen) ; TEMPLATE (ldl_dltsolve_k) (L, Y, Yseti, ysetlen) ; } else if (sys == CHOLMOD_LD) { /* Solve LDx=b */ TEMPLATE (ldl_ldsolve_k) (L, Y, Yseti, ysetlen) ; } else if (sys == CHOLMOD_L) { /* Solve Lx=b */ TEMPLATE (ldl_lsolve_k) (L, Y, Yseti, ysetlen) ; } else if (sys == CHOLMOD_Lt) { /* Solve L'x=b */ TEMPLATE (ldl_ltsolve_k) (L, Y, Yseti, ysetlen) ; } else if (sys == CHOLMOD_DLt) { /* Solve DL'x=b */ TEMPLATE (ldl_dltsolve_k) (L, Y, Yseti, ysetlen) ; } else if (sys == CHOLMOD_D) { /* Solve Dx=b */ TEMPLATE (ldl_dsolve) (L, Y, Yseti, ysetlen) ; } } } #undef PATTERN #undef REAL #undef COMPLEX #undef ZOMPLEX JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/0000755000175000017500000000000014400711326015616 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/Makefile.am0000664000175000017500000000117714224052371017604 00000000000000noinst_LTLIBRARIES = cholmodcore.la cholmodcore_la_SOURCES = cholmod_aat.c cholmod_copy.c \ cholmod_transpose.c cholmod_add.c cholmod_dense.c cholmod_triplet.c \ cholmod_band.c cholmod_error.c cholmod_change_factor.c \ cholmod_factor.c cholmod_common.c cholmod_memory.c cholmod_complex.c \ cholmod_sparse.c cholmodcore_la_CPPFLAGS = \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include cholmodcore_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt lesser.txt t_cholmod_change_factor.c \ t_cholmod_dense.c t_cholmod_transpose.c t_cholmod_triplet.c JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/Makefile.in0000644000175000017500000011704714400675236017626 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/CHOLMOD/Core ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) cholmodcore_la_LIBADD = am_cholmodcore_la_OBJECTS = cholmodcore_la-cholmod_aat.lo \ cholmodcore_la-cholmod_copy.lo \ cholmodcore_la-cholmod_transpose.lo \ cholmodcore_la-cholmod_add.lo cholmodcore_la-cholmod_dense.lo \ cholmodcore_la-cholmod_triplet.lo \ cholmodcore_la-cholmod_band.lo cholmodcore_la-cholmod_error.lo \ cholmodcore_la-cholmod_change_factor.lo \ cholmodcore_la-cholmod_factor.lo \ cholmodcore_la-cholmod_common.lo \ cholmodcore_la-cholmod_memory.lo \ cholmodcore_la-cholmod_complex.lo \ cholmodcore_la-cholmod_sparse.lo cholmodcore_la_OBJECTS = $(am_cholmodcore_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = cholmodcore_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(cholmodcore_la_LDFLAGS) $(LDFLAGS) -o \ $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/cholmodcore_la-cholmod_aat.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_add.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_band.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_change_factor.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_common.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_complex.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_copy.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_dense.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_error.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_factor.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_memory.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_sparse.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_transpose.Plo \ ./$(DEPDIR)/cholmodcore_la-cholmod_triplet.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(cholmodcore_la_SOURCES) DIST_SOURCES = $(cholmodcore_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = cholmodcore.la cholmodcore_la_SOURCES = cholmod_aat.c cholmod_copy.c \ cholmod_transpose.c cholmod_add.c cholmod_dense.c cholmod_triplet.c \ cholmod_band.c cholmod_error.c cholmod_change_factor.c \ cholmod_factor.c cholmod_common.c cholmod_memory.c cholmod_complex.c \ cholmod_sparse.c cholmodcore_la_CPPFLAGS = \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include cholmodcore_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt lesser.txt t_cholmod_change_factor.c \ t_cholmod_dense.c t_cholmod_transpose.c t_cholmod_triplet.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Core/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Core/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } cholmodcore.la: $(cholmodcore_la_OBJECTS) $(cholmodcore_la_DEPENDENCIES) $(EXTRA_cholmodcore_la_DEPENDENCIES) $(AM_V_CCLD)$(cholmodcore_la_LINK) $(cholmodcore_la_OBJECTS) $(cholmodcore_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_aat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_add.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_band.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_change_factor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_common.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_complex.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_copy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_dense.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_error.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_factor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_memory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_sparse.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_transpose.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodcore_la-cholmod_triplet.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< cholmodcore_la-cholmod_aat.lo: cholmod_aat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_aat.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_aat.Tpo -c -o cholmodcore_la-cholmod_aat.lo `test -f 'cholmod_aat.c' || echo '$(srcdir)/'`cholmod_aat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_aat.Tpo $(DEPDIR)/cholmodcore_la-cholmod_aat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_aat.c' object='cholmodcore_la-cholmod_aat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_aat.lo `test -f 'cholmod_aat.c' || echo '$(srcdir)/'`cholmod_aat.c cholmodcore_la-cholmod_copy.lo: cholmod_copy.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_copy.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_copy.Tpo -c -o cholmodcore_la-cholmod_copy.lo `test -f 'cholmod_copy.c' || echo '$(srcdir)/'`cholmod_copy.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_copy.Tpo $(DEPDIR)/cholmodcore_la-cholmod_copy.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_copy.c' object='cholmodcore_la-cholmod_copy.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_copy.lo `test -f 'cholmod_copy.c' || echo '$(srcdir)/'`cholmod_copy.c cholmodcore_la-cholmod_transpose.lo: cholmod_transpose.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_transpose.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_transpose.Tpo -c -o cholmodcore_la-cholmod_transpose.lo `test -f 'cholmod_transpose.c' || echo '$(srcdir)/'`cholmod_transpose.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_transpose.Tpo $(DEPDIR)/cholmodcore_la-cholmod_transpose.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_transpose.c' object='cholmodcore_la-cholmod_transpose.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_transpose.lo `test -f 'cholmod_transpose.c' || echo '$(srcdir)/'`cholmod_transpose.c cholmodcore_la-cholmod_add.lo: cholmod_add.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_add.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_add.Tpo -c -o cholmodcore_la-cholmod_add.lo `test -f 'cholmod_add.c' || echo '$(srcdir)/'`cholmod_add.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_add.Tpo $(DEPDIR)/cholmodcore_la-cholmod_add.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_add.c' object='cholmodcore_la-cholmod_add.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_add.lo `test -f 'cholmod_add.c' || echo '$(srcdir)/'`cholmod_add.c cholmodcore_la-cholmod_dense.lo: cholmod_dense.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_dense.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_dense.Tpo -c -o cholmodcore_la-cholmod_dense.lo `test -f 'cholmod_dense.c' || echo '$(srcdir)/'`cholmod_dense.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_dense.Tpo $(DEPDIR)/cholmodcore_la-cholmod_dense.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_dense.c' object='cholmodcore_la-cholmod_dense.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_dense.lo `test -f 'cholmod_dense.c' || echo '$(srcdir)/'`cholmod_dense.c cholmodcore_la-cholmod_triplet.lo: cholmod_triplet.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_triplet.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_triplet.Tpo -c -o cholmodcore_la-cholmod_triplet.lo `test -f 'cholmod_triplet.c' || echo '$(srcdir)/'`cholmod_triplet.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_triplet.Tpo $(DEPDIR)/cholmodcore_la-cholmod_triplet.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_triplet.c' object='cholmodcore_la-cholmod_triplet.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_triplet.lo `test -f 'cholmod_triplet.c' || echo '$(srcdir)/'`cholmod_triplet.c cholmodcore_la-cholmod_band.lo: cholmod_band.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_band.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_band.Tpo -c -o cholmodcore_la-cholmod_band.lo `test -f 'cholmod_band.c' || echo '$(srcdir)/'`cholmod_band.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_band.Tpo $(DEPDIR)/cholmodcore_la-cholmod_band.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_band.c' object='cholmodcore_la-cholmod_band.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_band.lo `test -f 'cholmod_band.c' || echo '$(srcdir)/'`cholmod_band.c cholmodcore_la-cholmod_error.lo: cholmod_error.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_error.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_error.Tpo -c -o cholmodcore_la-cholmod_error.lo `test -f 'cholmod_error.c' || echo '$(srcdir)/'`cholmod_error.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_error.Tpo $(DEPDIR)/cholmodcore_la-cholmod_error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_error.c' object='cholmodcore_la-cholmod_error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_error.lo `test -f 'cholmod_error.c' || echo '$(srcdir)/'`cholmod_error.c cholmodcore_la-cholmod_change_factor.lo: cholmod_change_factor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_change_factor.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_change_factor.Tpo -c -o cholmodcore_la-cholmod_change_factor.lo `test -f 'cholmod_change_factor.c' || echo '$(srcdir)/'`cholmod_change_factor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_change_factor.Tpo $(DEPDIR)/cholmodcore_la-cholmod_change_factor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_change_factor.c' object='cholmodcore_la-cholmod_change_factor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_change_factor.lo `test -f 'cholmod_change_factor.c' || echo '$(srcdir)/'`cholmod_change_factor.c cholmodcore_la-cholmod_factor.lo: cholmod_factor.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_factor.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_factor.Tpo -c -o cholmodcore_la-cholmod_factor.lo `test -f 'cholmod_factor.c' || echo '$(srcdir)/'`cholmod_factor.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_factor.Tpo $(DEPDIR)/cholmodcore_la-cholmod_factor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_factor.c' object='cholmodcore_la-cholmod_factor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_factor.lo `test -f 'cholmod_factor.c' || echo '$(srcdir)/'`cholmod_factor.c cholmodcore_la-cholmod_common.lo: cholmod_common.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_common.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_common.Tpo -c -o cholmodcore_la-cholmod_common.lo `test -f 'cholmod_common.c' || echo '$(srcdir)/'`cholmod_common.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_common.Tpo $(DEPDIR)/cholmodcore_la-cholmod_common.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_common.c' object='cholmodcore_la-cholmod_common.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_common.lo `test -f 'cholmod_common.c' || echo '$(srcdir)/'`cholmod_common.c cholmodcore_la-cholmod_memory.lo: cholmod_memory.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_memory.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_memory.Tpo -c -o cholmodcore_la-cholmod_memory.lo `test -f 'cholmod_memory.c' || echo '$(srcdir)/'`cholmod_memory.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_memory.Tpo $(DEPDIR)/cholmodcore_la-cholmod_memory.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_memory.c' object='cholmodcore_la-cholmod_memory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_memory.lo `test -f 'cholmod_memory.c' || echo '$(srcdir)/'`cholmod_memory.c cholmodcore_la-cholmod_complex.lo: cholmod_complex.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_complex.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_complex.Tpo -c -o cholmodcore_la-cholmod_complex.lo `test -f 'cholmod_complex.c' || echo '$(srcdir)/'`cholmod_complex.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_complex.Tpo $(DEPDIR)/cholmodcore_la-cholmod_complex.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_complex.c' object='cholmodcore_la-cholmod_complex.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_complex.lo `test -f 'cholmod_complex.c' || echo '$(srcdir)/'`cholmod_complex.c cholmodcore_la-cholmod_sparse.lo: cholmod_sparse.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodcore_la-cholmod_sparse.lo -MD -MP -MF $(DEPDIR)/cholmodcore_la-cholmod_sparse.Tpo -c -o cholmodcore_la-cholmod_sparse.lo `test -f 'cholmod_sparse.c' || echo '$(srcdir)/'`cholmod_sparse.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodcore_la-cholmod_sparse.Tpo $(DEPDIR)/cholmodcore_la-cholmod_sparse.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_sparse.c' object='cholmodcore_la-cholmod_sparse.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodcore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodcore_la-cholmod_sparse.lo `test -f 'cholmod_sparse.c' || echo '$(srcdir)/'`cholmod_sparse.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_aat.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_add.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_band.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_change_factor.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_common.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_complex.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_copy.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_dense.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_error.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_factor.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_memory.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_sparse.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_transpose.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_triplet.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_aat.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_add.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_band.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_change_factor.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_common.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_complex.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_copy.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_dense.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_error.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_factor.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_memory.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_sparse.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_transpose.Plo -rm -f ./$(DEPDIR)/cholmodcore_la-cholmod_triplet.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_aat.c0000664000175000017500000002071514224052371020165 00000000000000/* ========================================================================== */ /* === Core/cholmod_aat ===================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* C = A*A' or C = A(:,f)*A(:,f)' * * A can be packed or unpacked, sorted or unsorted, but must be stored with * both upper and lower parts (A->stype of zero). C is returned as packed, * C->stype of zero (both upper and lower parts present), and unsorted. See * cholmod_ssmult in the MatrixOps Module for a more general matrix-matrix * multiply. * * You can trivially convert C into a symmetric upper/lower matrix by * changing C->stype = 1 or -1 after calling this routine. * * workspace: * Flag (A->nrow), * Iwork (max (A->nrow, A->ncol)) if fset present, * Iwork (A->nrow) if no fset, * W (A->nrow) if mode > 0, * allocates temporary copy for A'. * * A can be pattern or real. Complex or zomplex cases are supported only * if the mode is <= 0 (in which case the numerical values are ignored). */ #include "cholmod_internal.h" #include "cholmod_core.h" cholmod_sparse *CHOLMOD(aat) ( /* ---- input ---- */ cholmod_sparse *A, /* input matrix; C=A*A' is constructed */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) * -2: pattern only, no diagonal, add 50% + n extra * space to C */ /* --------------- */ cholmod_common *Common ) { double fjt ; double *Ax, *Fx, *Cx, *W ; Int *Ap, *Anz, *Ai, *Fp, *Fi, *Cp, *Ci, *Flag ; cholmod_sparse *C, *F ; Int packed, j, i, pa, paend, pf, pfend, n, mark, cnz, t, p, values, diag, extra ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; values = (mode > 0) && (A->xtype != CHOLMOD_PATTERN) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; if (A->stype) { ERROR (CHOLMOD_INVALID, "matrix cannot be symmetric") ; return (NULL) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ diag = (mode >= 0) ; n = A->nrow ; CHOLMOD(allocate_work) (n, MAX (A->ncol, A->nrow), values ? n : 0, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n : 0, Common)) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ ASSERT (CHOLMOD(dump_sparse) (A, "A", Common) >= 0) ; /* get the A matrix */ Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; packed = A->packed ; /* get workspace */ W = Common->Xwork ; /* size n, unused if values is FALSE */ Flag = Common->Flag ; /* size n, Flag [0..n-1] < mark on input*/ /* ---------------------------------------------------------------------- */ /* F = A' or A(:,f)' */ /* ---------------------------------------------------------------------- */ /* workspace: Iwork (nrow if no fset; MAX (nrow,ncol) if fset)*/ F = CHOLMOD(ptranspose) (A, values, NULL, fset, fsize, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } Fp = F->p ; Fi = F->i ; Fx = F->x ; /* ---------------------------------------------------------------------- */ /* count the number of entries in the result C */ /* ---------------------------------------------------------------------- */ cnz = 0 ; for (j = 0 ; j < n ; j++) { /* clear the Flag array */ /* mark = CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; /* exclude the diagonal, if requested */ if (!diag) { Flag [j] = mark ; } /* for each nonzero F(t,j) in column j, do: */ pfend = Fp [j+1] ; for (pf = Fp [j] ; pf < pfend ; pf++) { /* F(t,j) is nonzero */ t = Fi [pf] ; /* add the nonzero pattern of A(:,t) to the pattern of C(:,j) */ pa = Ap [t] ; paend = (packed) ? (Ap [t+1]) : (pa + Anz [t]) ; for ( ; pa < paend ; pa++) { i = Ai [pa] ; if (Flag [i] != mark) { Flag [i] = mark ; cnz++ ; } } } if (cnz < 0) { break ; /* integer overflow case */ } } extra = (mode == -2) ? (cnz/2 + n) : 0 ; mark = CHOLMOD(clear_flag) (Common) ; /* ---------------------------------------------------------------------- */ /* check for integer overflow */ /* ---------------------------------------------------------------------- */ if (cnz < 0 || (cnz + extra) < 0) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; CHOLMOD(clear_flag) (Common) ; CHOLMOD(free_sparse) (&F, Common) ; return (NULL) ; /* problem too large */ } /* ---------------------------------------------------------------------- */ /* allocate C */ /* ---------------------------------------------------------------------- */ C = CHOLMOD(allocate_sparse) (n, n, cnz + extra, FALSE, TRUE, 0, values ? A->xtype : CHOLMOD_PATTERN, Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_sparse) (&F, Common) ; return (NULL) ; /* out of memory */ } Cp = C->p ; Ci = C->i ; Cx = C->x ; /* ---------------------------------------------------------------------- */ /* C = A*A' */ /* ---------------------------------------------------------------------- */ cnz = 0 ; if (values) { /* pattern and values */ for (j = 0 ; j < n ; j++) { /* clear the Flag array */ mark = CHOLMOD(clear_flag) (Common) ; /* start column j of C */ Cp [j] = cnz ; /* for each nonzero F(t,j) in column j, do: */ pfend = Fp [j+1] ; for (pf = Fp [j] ; pf < pfend ; pf++) { /* F(t,j) is nonzero */ t = Fi [pf] ; fjt = Fx [pf] ; /* add the nonzero pattern of A(:,t) to the pattern of C(:,j) * and scatter the values into W */ pa = Ap [t] ; paend = (packed) ? (Ap [t+1]) : (pa + Anz [t]) ; for ( ; pa < paend ; pa++) { i = Ai [pa] ; if (Flag [i] != mark) { Flag [i] = mark ; Ci [cnz++] = i ; } W [i] += Ax [pa] * fjt ; } } /* gather the values into C(:,j) */ for (p = Cp [j] ; p < cnz ; p++) { i = Ci [p] ; Cx [p] = W [i] ; W [i] = 0 ; } } } else { /* pattern only */ for (j = 0 ; j < n ; j++) { /* clear the Flag array */ mark = CHOLMOD(clear_flag) (Common) ; /* exclude the diagonal, if requested */ if (!diag) { Flag [j] = mark ; } /* start column j of C */ Cp [j] = cnz ; /* for each nonzero F(t,j) in column j, do: */ pfend = Fp [j+1] ; for (pf = Fp [j] ; pf < pfend ; pf++) { /* F(t,j) is nonzero */ t = Fi [pf] ; /* add the nonzero pattern of A(:,t) to the pattern of C(:,j) */ pa = Ap [t] ; paend = (packed) ? (Ap [t+1]) : (pa + Anz [t]) ; for ( ; pa < paend ; pa++) { i = Ai [pa] ; if (Flag [i] != mark) { Flag [i] = mark ; Ci [cnz++] = i ; } } } } } Cp [n] = cnz ; ASSERT (IMPLIES (mode != -2, MAX (1,cnz) == C->nzmax)) ; /* ---------------------------------------------------------------------- */ /* clear workspace and free temporary matrices and return result */ /* ---------------------------------------------------------------------- */ CHOLMOD(free_sparse) (&F, Common) ; CHOLMOD(clear_flag) (Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n : 0, Common)) ; DEBUG (i = CHOLMOD(dump_sparse) (C, "aat", Common)) ; ASSERT (IMPLIES (mode < 0, i == 0)) ; return (C) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_copy.c0000664000175000017500000002731514224052371020375 00000000000000/* ========================================================================== */ /* === Core/cholmod_copy ==================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* C = A, which allocates C and copies A into C, with possible change of * stype. The diagonal can optionally be removed. The numerical entries * can optionally be copied. This routine differs from cholmod_copy_sparse, * which makes an exact copy of a sparse matrix. * * A can be of any type (packed/unpacked, upper/lower/unsymmetric). C is * packed and can be of any stype (upper/lower/unsymmetric), except that if * A is rectangular C can only be unsymmetric. If the stype of A and C * differ, then the appropriate conversion is made. * * Symmetry of A (A->stype): * <0: lower: assume A is symmetric with just tril(A); the rest of A is ignored * 0 unsym: assume A is unsymmetric; consider all entries in A * >0 upper: assume A is symmetric with just triu(A); the rest of A is ignored * * Symmetry of C (stype parameter): * <0 lower: return just tril(C) * 0 unsym: return all of C * >0 upper: return just triu(C) * * In MATLAB: Using cholmod_copy: * ---------- ---------------------------- * C = A ; A unsymmetric, C unsymmetric * C = tril (A) ; A unsymmetric, C lower * C = triu (A) ; A unsymmetric, C upper * U = triu (A) ; L = tril (U',-1) ; C = L+U ; A upper, C unsymmetric * C = triu (A)' ; A upper, C lower * C = triu (A) ; A upper, C upper * L = tril (A) ; U = triu (L',1) ; C = L+U ; A lower, C unsymmetric * C = tril (A) ; A lower, C lower * C = tril (A)' ; A lower, C upper * * workspace: Iwork (max (nrow,ncol)) * * A can have an xtype of pattern or real. Complex and zomplex cases only * supported when mode <= 0 (in which case the numerical values are ignored). */ #include "cholmod_internal.h" #include "cholmod_core.h" /* ========================================================================== */ /* === copy_sym_to_unsym ==================================================== */ /* ========================================================================== */ /* Construct an unsymmetric copy of a symmetric sparse matrix. This does the * work for as C = cholmod_copy (A, 0, mode, Common) when A is symmetric. * In this case, extra space can be added to C. */ static cholmod_sparse *copy_sym_to_unsym ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to copy */ int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) * -2: pattern only, no diagonal, add 50% + n extra * space to C */ /* --------------- */ cholmod_common *Common ) { double aij ; double *Ax, *Cx ; Int *Ap, *Ai, *Anz, *Cp, *Ci, *Wj, *Iwork ; cholmod_sparse *C ; Int nrow, ncol, nz, packed, j, p, pend, i, pc, up, lo, values, diag, astype, extra ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ nrow = A->nrow ; ncol = A->ncol ; Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; packed = A->packed ; values = (mode > 0) && (A->xtype != CHOLMOD_PATTERN) ; diag = (mode >= 0) ; astype = SIGN (A->stype) ; up = (astype > 0) ; lo = (astype < 0) ; ASSERT (astype != 0) ; /* ---------------------------------------------------------------------- */ /* create an unsymmetric copy of a symmetric matrix */ /* ---------------------------------------------------------------------- */ Iwork = Common->Iwork ; Wj = Iwork ; /* size ncol (i/i/l) */ /* In MATLAB notation, for converting a symmetric/upper matrix: * U = triu (A) ; * L = tril (U',-1) ; * C = L + U ; * * For converting a symmetric/lower matrix to unsymmetric: * L = tril (A) ; * U = triu (L',1) ; * C = L + U ; */ ASSERT (up || lo) ; PRINT1 (("copy: convert symmetric to unsym\n")) ; /* count the number of entries in each column of C */ for (j = 0 ; j < ncol ; j++) { Wj [j] = 0 ; } for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i == j) { /* the diagonal entry A(i,i) will appear just once * (unless it is excluded with mode < 0) */ if (diag) { Wj [j]++ ; } } else if ((up && i < j) || (lo && i > j)) { /* upper case: A(i,j) is in the strictly upper part; * A(j,i) will be added to the strictly lower part of C. * lower case is the opposite. */ Wj [j]++ ; Wj [i]++ ; } } } nz = 0 ; for (j = 0 ; j < ncol ; j++) { nz += Wj [j] ; } extra = (mode == -2) ? (nz/2 + ncol) : 0 ; /* allocate C. C is sorted if and only if A is sorted */ C = CHOLMOD(allocate_sparse) (nrow, ncol, nz + extra, A->sorted, TRUE, 0, values ? A->xtype : CHOLMOD_PATTERN, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; } Cp = C->p ; Ci = C->i ; Cx = C->x ; /* construct the column pointers for C */ p = 0 ; for (j = 0 ; j < ncol ; j++) { Cp [j] = p ; p += Wj [j] ; } Cp [ncol] = p ; for (j = 0 ; j < ncol ; j++) { Wj [j] = Cp [j] ; } /* construct C */ if (values) { /* pattern and values */ ASSERT (diag) ; for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; aij = Ax [p] ; if (i == j) { /* add diagonal entry A(i,i) to column i */ pc = Wj [i]++ ; Ci [pc] = i ; Cx [pc] = aij ; } else if ((up && i < j) || (lo && i > j)) { /* add A(i,j) to column j */ pc = Wj [j]++ ; Ci [pc] = i ; Cx [pc] = aij ; /* add A(j,i) to column i */ pc = Wj [i]++ ; Ci [pc] = j ; Cx [pc] = aij ; } } } } else { /* pattern only, possibly excluding the diagonal */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i == j) { /* add diagonal entry A(i,i) to column i * (unless it is excluded with mode < 0) */ if (diag) { Ci [Wj [i]++] = i ; } } else if ((up && i < j) || (lo && i > j)) { /* add A(i,j) to column j */ Ci [Wj [j]++] = i ; /* add A(j,i) to column i */ Ci [Wj [i]++] = j ; } } } } /* ---------------------------------------------------------------------- */ /* return the result */ /* ---------------------------------------------------------------------- */ DEBUG (i = CHOLMOD(dump_sparse) (C, "copy_sym_to_unsym", Common)) ; PRINT1 (("mode %d nnzdiag "ID"\n", mode, i)) ; ASSERT (IMPLIES (mode < 0, i == 0)) ; return (C) ; } /* ========================================================================== */ /* === cholmod_copy ========================================================= */ /* ========================================================================== */ cholmod_sparse *CHOLMOD(copy) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to copy */ int stype, /* requested stype of C */ int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ /* --------------- */ cholmod_common *Common ) { cholmod_sparse *C ; Int nrow, ncol, up, lo, values, diag, astype ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; values = (mode > 0) && (A->xtype != CHOLMOD_PATTERN) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; nrow = A->nrow ; ncol = A->ncol ; if ((stype || A->stype) && nrow != ncol) { /* inputs invalid */ ERROR (CHOLMOD_INVALID, "matrix invalid") ; return (NULL) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ CHOLMOD(allocate_work) (0, MAX (nrow,ncol), 0, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ diag = (mode >= 0) ; astype = SIGN (A->stype) ; stype = SIGN (stype) ; up = (astype > 0) ; lo = (astype < 0) ; /* ---------------------------------------------------------------------- */ /* copy the matrix */ /* ---------------------------------------------------------------------- */ if (astype == stype) { /* ------------------------------------------------------------------ */ /* symmetry of A and C are the same */ /* ------------------------------------------------------------------ */ /* copy A into C, keeping the same symmetry. If A is symmetric * entries in the ignored part of A are not copied into C */ C = CHOLMOD(band) (A, -nrow, ncol, mode, Common) ; } else if (!astype) { /* ------------------------------------------------------------------ */ /* convert unsymmetric matrix A into a symmetric matrix C */ /* ------------------------------------------------------------------ */ if (stype > 0) { /* C = triu (A) */ C = CHOLMOD(band) (A, 0, ncol, mode, Common) ; } else { /* C = tril (A) */ C = CHOLMOD(band) (A, -nrow, 0, mode, Common) ; } if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } C->stype = stype ; } else if (astype == -stype) { /* ------------------------------------------------------------------ */ /* transpose a symmetric matrix */ /* ------------------------------------------------------------------ */ /* converting upper to lower or lower to upper */ /* workspace: Iwork (nrow) */ C = CHOLMOD(transpose) (A, values, Common) ; if (!diag) { /* remove diagonal, if requested */ CHOLMOD(band_inplace) (-nrow, ncol, -1, C, Common) ; } } else { /* ------------------------------------------------------------------ */ /* create an unsymmetric copy of a symmetric matrix */ /* ------------------------------------------------------------------ */ C = copy_sym_to_unsym (A, mode, Common) ; } /* ---------------------------------------------------------------------- */ /* return if error */ /* ---------------------------------------------------------------------- */ if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } /* ---------------------------------------------------------------------- */ /* return the result */ /* ---------------------------------------------------------------------- */ DEBUG (diag = CHOLMOD(dump_sparse) (C, "copy", Common)) ; PRINT1 (("mode %d nnzdiag "ID"\n", mode, diag)) ; ASSERT (IMPLIES (mode < 0, diag == 0)) ; return (C) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_transpose.c0000664000175000017500000007533714224052371021450 00000000000000/* ========================================================================== */ /* === Core/cholmod_transpose =============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Core utility routines for the cholmod_sparse object to * compute the transpose or permuted transpose of a matrix: * * Primary routines: * ----------------- * cholmod_transpose transpose sparse matrix * cholmod_ptranspose transpose and permute sparse matrix * cholmod_sort sort row indices in each column of sparse matrix * * Secondary routines: * ------------------- * cholmod_transpose_unsym transpose unsymmetric sparse matrix * cholmod_transpose_sym transpose symmetric sparse matrix * * All xtypes (pattern, real, complex, and zomplex) are supported. * * --------------------------------------- * Unsymmetric case: A->stype is zero. * --------------------------------------- * * Computes F = A', F = A (:,f)' or F = A (p,f)', except that the indexing by * f does not work the same as the MATLAB notation (see below). A->stype * is zero, which denotes that both the upper and lower triangular parts of * A are present (and used). A may in fact be symmetric in pattern and/or * value; A->stype just denotes which part of A are stored. A may be * rectangular. * * p is a permutation of 0:m-1, and f is a subset of 0:n-1, where A is m-by-n. * There can be no duplicate entries in p or f. * * The set f is held in fset and fsize. * fset = NULL means ":" in MATLAB. fsize is ignored. * fset != NULL means f = fset [0..fsize-1]. * fset != NULL and fsize = 0 means f is the empty set. * * Columns not in the set f are considered to be zero. That is, * if A is 5-by-10 then F = A (:,[3 4])' is not 2-by-5, but 10-by-5, and rows * 3 and 4 of F are equal to columns 3 and 4 of A (the other rows of F are * zero). More precisely, in MATLAB notation: * * [m n] = size (A) ; * F = A ; * notf = ones (1,n) ; * notf (f) = 0 ; * F (:, find (notf)) = 0 * F = F' * * If you want the MATLAB equivalent F=A(p,f) operation, use cholmod_submatrix * instead (which does not compute the transpose). * * F->nzmax must be large enough to hold the matrix F. It is not modified. * If F->nz is present then F->nz [j] = # of entries in column j of F. * * A can be sorted or unsorted, with packed or unpacked columns. * * If f is present and not sorted in ascending order, then F is unsorted * (that is, it may contain columns whose row indices do not appear in * ascending order). Otherwise, F is sorted (the row indices in each * column of F appear in strictly ascending order). * * F is returned in packed or unpacked form, depending on F->packed on input. * If F->packed is false, then F is returned in unpacked form (F->nz must be * present). Each row i of F is large enough to hold all the entries in row i * of A, even if f is provided. That is, F->i and * F->x [F->p [i] .. F->p [i] + F->nz [i] - 1] contain all entries in A (i,f), * but F->p [i+1] - F->p [i] is equal to the number of nonzeros in A (i,:), * not just A (i,f). * * The cholmod_transpose_unsym routine is the only operation in CHOLMOD that * can produce an unpacked matrix. * * --------------------------------------- * Symmetric case: A->stype is nonzero. * --------------------------------------- * * Computes F = A' or F = A(p,p)', the transpose or permuted transpose, where * A->stype is nonzero. * * If A->stype > 0, then A is a symmetric matrix where just the upper part * of the matrix is stored. Entries in the lower triangular part may be * present, but are ignored. A must be square. If F=A', then F is returned * sorted; otherwise F is unsorted for the F=A(p,p)' case. * * There can be no duplicate entries in p. * The fset and fsize parameters are not used. * * Three kinds of transposes are available, depending on the "values" parameter: * 0: do not transpose the numerical values; create a CHOLMOD_PATTERN matrix * 1: array transpose * 2: complex conjugate transpose (same as 2 if input is real or pattern) * * ----------------------------------------------------------------------------- * * For cholmod_transpose_unsym and cholmod_transpose_sym, the output matrix * F must already be pre-allocated by the caller, with the correct dimensions. * If F is not valid or has the wrong dimensions, it is not modified. * Otherwise, if F is too small, the transpose is not computed; the contents * of F->p contain the column pointers of the resulting matrix, where * F->p [F->ncol] > F->nzmax. In this case, the remaining contents of F are * not modified. F can still be properly free'd with cholmod_free_sparse. */ #include "cholmod_internal.h" #include "cholmod_core.h" /* ========================================================================== */ /* === TEMPLATE ============================================================= */ /* ========================================================================== */ #define PATTERN #include "t_cholmod_transpose.c" #define REAL #include "t_cholmod_transpose.c" #define COMPLEX #include "t_cholmod_transpose.c" #define COMPLEX #define NCONJUGATE #include "t_cholmod_transpose.c" #define ZOMPLEX #include "t_cholmod_transpose.c" #define ZOMPLEX #define NCONJUGATE #include "t_cholmod_transpose.c" /* ========================================================================== */ /* === cholmod_transpose_unsym ============================================== */ /* ========================================================================== */ /* Compute F = A', A (:,f)', or A (p,f)', where A is unsymmetric and F is * already allocated. See cholmod_transpose for a simpler routine. * * workspace: * Iwork (MAX (nrow,ncol)) if fset is present * Iwork (nrow) if fset is NULL * * The xtype of A and F must match, unless values is zero or F->xtype is * CHOLMOD_PATTERN (in which case only the pattern of A is transpose into F). */ int CHOLMOD(transpose_unsym) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to transpose */ int values, /* 2: complex conj. transpose, 1: array transpose, 0: do not transpose the numerical values */ Int *Perm, /* size nrow, if present (can be NULL) */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* ---- output --- */ cholmod_sparse *F, /* F = A', A(:,f)', or A(p,f)' */ /* --------------- */ cholmod_common *Common ) { Int *Fp, *Fnz, *Ap, *Ai, *Anz, *Wi ; Int nrow, ncol, permute, use_fset, Apacked, Fpacked, p, pend, i, j, k, Fsorted, nf, jj, jlast ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (F, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (F, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; if (A->nrow != F->ncol || A->ncol != F->nrow) { ERROR (CHOLMOD_INVALID, "F has the wrong dimensions") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ nf = fsize ; use_fset = (fset != NULL) ; nrow = A->nrow ; ncol = A->ncol ; Ap = A->p ; /* size A->ncol+1, column pointers of A */ Ai = A->i ; /* size nz = Ap [A->ncol], row indices of A */ Anz = A->nz ; Apacked = A->packed ; ASSERT (IMPLIES (!Apacked, Anz != NULL)) ; permute = (Perm != NULL) ; Fp = F->p ; /* size A->nrow+1, row pointers of F */ Fnz = F->nz ; Fpacked = F->packed ; ASSERT (IMPLIES (!Fpacked, Fnz != NULL)) ; nf = (use_fset) ? nf : ncol ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* s = nrow + ((fset != NULL) ? ncol : 0) */ s = CHOLMOD(add_size_t) (nrow, ((fset != NULL) ? ncol : 0), &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (0, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; /* out of memory */ } Wi = Common->Iwork ; /* size nrow (i/l/l) */ /* ---------------------------------------------------------------------- */ /* check Perm and fset */ /* ---------------------------------------------------------------------- */ if (permute) { for (i = 0 ; i < nrow ; i++) { Wi [i] = 1 ; } for (k = 0 ; k < nrow ; k++) { i = Perm [k] ; if (i < 0 || i > nrow || Wi [i] == 0) { ERROR (CHOLMOD_INVALID, "invalid permutation") ; return (FALSE) ; } Wi [i] = 0 ; } } if (use_fset) { for (j = 0 ; j < ncol ; j++) { Wi [j] = 1 ; } for (k = 0 ; k < nf ; k++) { j = fset [k] ; if (j < 0 || j > ncol || Wi [j] == 0) { ERROR (CHOLMOD_INVALID, "invalid fset") ; return (FALSE) ; } Wi [j] = 0 ; } } /* Perm and fset are now valid */ ASSERT (CHOLMOD(dump_perm) (Perm, nrow, nrow, "Perm", Common)) ; ASSERT (CHOLMOD(dump_perm) (fset, nf, ncol, "fset", Common)) ; /* ---------------------------------------------------------------------- */ /* count the entries in each row of A or A(:,f) */ /* ---------------------------------------------------------------------- */ for (i = 0 ; i < nrow ; i++) { Wi [i] = 0 ; } jlast = EMPTY ; Fsorted = TRUE ; if (use_fset) { /* count entries in each row of A(:,f) */ for (jj = 0 ; jj < nf ; jj++) { j = fset [jj] ; if (j <= jlast) { Fsorted = FALSE ; } p = Ap [j] ; pend = (Apacked) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { Wi [Ai [p]]++ ; } jlast = j ; } /* save the nz counts if F is unpacked, and recount all of A */ if (!Fpacked) { if (permute) { for (i = 0 ; i < nrow ; i++) { Fnz [i] = Wi [Perm [i]] ; } } else { for (i = 0 ; i < nrow ; i++) { Fnz [i] = Wi [i] ; } } for (i = 0 ; i < nrow ; i++) { Wi [i] = 0 ; } /* count entries in each row of A */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (Apacked) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { Wi [Ai [p]]++ ; } } } } else { /* count entries in each row of A */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (Apacked) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { Wi [Ai [p]]++ ; } } /* save the nz counts if F is unpacked */ if (!Fpacked) { if (permute) { for (i = 0 ; i < nrow ; i++) { Fnz [i] = Wi [Perm [i]] ; } } else { for (i = 0 ; i < nrow ; i++) { Fnz [i] = Wi [i] ; } } } } /* ---------------------------------------------------------------------- */ /* compute the row pointers */ /* ---------------------------------------------------------------------- */ p = 0 ; if (permute) { for (i = 0 ; i < nrow ; i++) { Fp [i] = p ; p += Wi [Perm [i]] ; } for (i = 0 ; i < nrow ; i++) { Wi [Perm [i]] = Fp [i] ; } } else { for (i = 0 ; i < nrow ; i++) { Fp [i] = p ; p += Wi [i] ; } for (i = 0 ; i < nrow ; i++) { Wi [i] = Fp [i] ; } } Fp [nrow] = p ; if (p > (Int) (F->nzmax)) { ERROR (CHOLMOD_INVALID, "F is too small") ; return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* transpose matrix, using template routine */ /* ---------------------------------------------------------------------- */ ok = FALSE ; if (values == 0 || F->xtype == CHOLMOD_PATTERN) { ok = p_cholmod_transpose_unsym (A, Perm, fset, nf, F, Common) ; } else if (F->xtype == CHOLMOD_REAL) { ok = r_cholmod_transpose_unsym (A, Perm, fset, nf, F, Common) ; } else if (F->xtype == CHOLMOD_COMPLEX) { if (values == 1) { /* array transpose */ ok = ct_cholmod_transpose_unsym (A, Perm, fset, nf, F, Common) ; } else { /* complex conjugate transpose */ ok = c_cholmod_transpose_unsym (A, Perm, fset, nf, F, Common) ; } } else if (F->xtype == CHOLMOD_ZOMPLEX) { if (values == 1) { /* array transpose */ ok = zt_cholmod_transpose_unsym (A, Perm, fset, nf, F, Common) ; } else { /* complex conjugate transpose */ ok = z_cholmod_transpose_unsym (A, Perm, fset, nf, F, Common) ; } } /* ---------------------------------------------------------------------- */ /* finalize result F */ /* ---------------------------------------------------------------------- */ if (ok) { F->sorted = Fsorted ; } ASSERT (CHOLMOD(dump_sparse) (F, "output F unsym", Common) >= 0) ; return (ok) ; } /* ========================================================================== */ /* === cholmod_transpose_sym ================================================ */ /* ========================================================================== */ /* Compute F = A' or A (p,p)', where A is symmetric and F is already allocated. * See cholmod_transpose for a simpler routine. * * workspace: Iwork (nrow) if Perm NULL, Iwork (2*nrow) if Perm non-NULL. */ int CHOLMOD(transpose_sym) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to transpose */ int values, /* 2: complex conj. transpose, 1: array transpose, 0: do not transpose the numerical values */ Int *Perm, /* size nrow, if present (can be NULL) */ /* ---- output --- */ cholmod_sparse *F, /* F = A' or A(p,p)' */ /* --------------- */ cholmod_common *Common ) { Int *Ap, *Anz, *Ai, *Fp, *Wi, *Pinv, *Iwork ; Int p, pend, packed, upper, permute, jold, n, i, j, k, iold ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (F, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (F, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; if (A->nrow != A->ncol || A->stype == 0) { /* this routine handles square symmetric matrices only */ ERROR (CHOLMOD_INVALID, "matrix must be symmetric") ; return (FALSE) ; } if (A->nrow != F->ncol || A->ncol != F->nrow) { ERROR (CHOLMOD_INVALID, "F has the wrong dimensions") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ permute = (Perm != NULL) ; n = A->nrow ; Ap = A->p ; /* size A->ncol+1, column pointers of A */ Ai = A->i ; /* size nz = Ap [A->ncol], row indices of A */ Anz = A->nz ; packed = A->packed ; ASSERT (IMPLIES (!packed, Anz != NULL)) ; upper = (A->stype > 0) ; Fp = F->p ; /* size A->nrow+1, row pointers of F */ /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* s = (Perm != NULL) ? 2*n : n */ s = CHOLMOD(add_size_t) (n, ((Perm != NULL) ? n : 0), &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (0, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; /* out of memory */ } /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Iwork = Common->Iwork ; Wi = Iwork ; /* size n (i/l/l) */ Pinv = Iwork + n ; /* size n (i/i/l) , unused if Perm NULL */ /* ---------------------------------------------------------------------- */ /* check Perm and construct inverse permutation */ /* ---------------------------------------------------------------------- */ if (permute) { for (i = 0 ; i < n ; i++) { Pinv [i] = EMPTY ; } for (k = 0 ; k < n ; k++) { i = Perm [k] ; if (i < 0 || i > n || Pinv [i] != EMPTY) { ERROR (CHOLMOD_INVALID, "invalid permutation") ; return (FALSE) ; } Pinv [i] = k ; } } /* Perm is now valid */ ASSERT (CHOLMOD(dump_perm) (Perm, n, n, "Perm", Common)) ; /* ---------------------------------------------------------------------- */ /* count the entries in each row of F */ /* ---------------------------------------------------------------------- */ for (i = 0 ; i < n ; i++) { Wi [i] = 0 ; } if (packed) { if (permute) { if (upper) { /* packed, permuted, upper */ for (j = 0 ; j < n ; j++) { jold = Perm [j] ; pend = Ap [jold+1] ; for (p = Ap [jold] ; p < pend ; p++) { iold = Ai [p] ; if (iold <= jold) { i = Pinv [iold] ; Wi [MIN (i, j)]++ ; } } } } else { /* packed, permuted, lower */ for (j = 0 ; j < n ; j++) { jold = Perm [j] ; pend = Ap [jold+1] ; for (p = Ap [jold] ; p < pend ; p++) { iold = Ai [p] ; if (iold >= jold) { i = Pinv [iold] ; Wi [MAX (i, j)]++ ; } } } } } else { if (upper) { /* packed, unpermuted, upper */ for (j = 0 ; j < n ; j++) { pend = Ap [j+1] ; for (p = Ap [j] ; p < pend ; p++) { i = Ai [p] ; if (i <= j) { Wi [i]++ ; } } } } else { /* packed, unpermuted, lower */ for (j = 0 ; j < n ; j++) { pend = Ap [j+1] ; for (p = Ap [j] ; p < pend ; p++) { i = Ai [p] ; if (i >= j) { Wi [i]++ ; } } } } } } else { if (permute) { if (upper) { /* unpacked, permuted, upper */ for (j = 0 ; j < n ; j++) { jold = Perm [j] ; p = Ap [jold] ; pend = p + Anz [jold] ; for ( ; p < pend ; p++) { iold = Ai [p] ; if (iold <= jold) { i = Pinv [iold] ; Wi [MIN (i, j)]++ ; } } } } else { /* unpacked, permuted, lower */ for (j = 0 ; j < n ; j++) { jold = Perm [j] ; p = Ap [jold] ; pend = p + Anz [jold] ; for ( ; p < pend ; p++) { iold = Ai [p] ; if (iold >= jold) { i = Pinv [iold] ; Wi [MAX (i, j)]++ ; } } } } } else { if (upper) { /* unpacked, unpermuted, upper */ for (j = 0 ; j < n ; j++) { p = Ap [j] ; pend = p + Anz [j] ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i <= j) { Wi [i]++ ; } } } } else { /* unpacked, unpermuted, lower */ for (j = 0 ; j < n ; j++) { p = Ap [j] ; pend = p + Anz [j] ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i >= j) { Wi [i]++ ; } } } } } } /* ---------------------------------------------------------------------- */ /* compute the row pointers */ /* ---------------------------------------------------------------------- */ p = 0 ; for (i = 0 ; i < n ; i++) { Fp [i] = p ; p += Wi [i] ; } Fp [n] = p ; for (i = 0 ; i < n ; i++) { Wi [i] = Fp [i] ; } if (p > (Int) (F->nzmax)) { ERROR (CHOLMOD_INVALID, "F is too small") ; return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* transpose matrix, using template routine */ /* ---------------------------------------------------------------------- */ ok = FALSE ; if (values == 0 || F->xtype == CHOLMOD_PATTERN) { PRINT2 (("\n:::: p_transpose_sym Perm %p\n", Perm)) ; ok = p_cholmod_transpose_sym (A, Perm, F, Common) ; } else if (F->xtype == CHOLMOD_REAL) { PRINT2 (("\n:::: r_transpose_sym Perm %p\n", Perm)) ; ok = r_cholmod_transpose_sym (A, Perm, F, Common) ; } else if (F->xtype == CHOLMOD_COMPLEX) { if (values == 1) { /* array transpose */ PRINT2 (("\n:::: ct_transpose_sym Perm %p\n", Perm)) ; ok = ct_cholmod_transpose_sym (A, Perm, F, Common) ; } else { /* complex conjugate transpose */ PRINT2 (("\n:::: c_transpose_sym Perm %p\n", Perm)) ; ok = c_cholmod_transpose_sym (A, Perm, F, Common) ; } } else if (F->xtype == CHOLMOD_ZOMPLEX) { if (values == 1) { /* array transpose */ PRINT2 (("\n:::: zt_transpose_sym Perm %p\n", Perm)) ; ok = zt_cholmod_transpose_sym (A, Perm, F, Common) ; } else { /* complex conjugate transpose */ PRINT2 (("\n:::: z_transpose_sym Perm %p\n", Perm)) ; ok = z_cholmod_transpose_sym (A, Perm, F, Common) ; } } /* ---------------------------------------------------------------------- */ /* finalize result F */ /* ---------------------------------------------------------------------- */ /* F is sorted if there is no permutation vector */ if (ok) { F->sorted = !permute ; F->packed = TRUE ; F->stype = - SIGN (A->stype) ; /* flip the stype */ ASSERT (CHOLMOD(dump_sparse) (F, "output F sym", Common) >= 0) ; } return (ok) ; } /* ========================================================================== */ /* === cholmod_transpose ==================================================== */ /* ========================================================================== */ /* Returns A'. See also cholmod_ptranspose below. */ cholmod_sparse *CHOLMOD(transpose) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to transpose */ int values, /* 2: complex conj. transpose, 1: array transpose, 0: do not transpose the numerical values (returns its result as CHOLMOD_PATTERN) */ /* --------------- */ cholmod_common *Common ) { return (CHOLMOD(ptranspose) (A, values, NULL, NULL, 0, Common)) ; } /* ========================================================================== */ /* === cholmod_ptranspose =================================================== */ /* ========================================================================== */ /* Return A' or A(p,p)' if A is symmetric. Return A', A(:,f)', or A(p,f)' if * A is unsymmetric. * * workspace: * Iwork (MAX (nrow,ncol)) if unsymmetric and fset is non-NULL * Iwork (nrow) if unsymmetric and fset is NULL * Iwork (2*nrow) if symmetric and Perm is non-NULL. * Iwork (nrow) if symmetric and Perm is NULL. * * A simple worst-case upper bound on the workspace is nrow+ncol. */ cholmod_sparse *CHOLMOD(ptranspose) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to transpose */ int values, /* 2: complex conj. transpose, 1: array transpose, 0: do not transpose the numerical values */ Int *Perm, /* if non-NULL, F = A(p,f) or A(p,p) */ Int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* --------------- */ cholmod_common *Common ) { Int *Ap, *Anz ; cholmod_sparse *F ; Int nrow, ncol, use_fset, j, jj, fnz, packed, stype, nf, xtype ; size_t ineed ; int ok = TRUE ; nf = fsize ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, NULL) ; stype = A->stype ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ nrow = A->nrow ; ncol = A->ncol ; if (stype != 0) { use_fset = FALSE ; if (Perm != NULL) { ineed = CHOLMOD(mult_size_t) (A->nrow, 2, &ok) ; } else { ineed = A->nrow ; } } else { use_fset = (fset != NULL) ; if (use_fset) { ineed = MAX (A->nrow, A->ncol) ; } else { ineed = A->nrow ; } } if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (NULL) ; } CHOLMOD(allocate_work) (0, ineed, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Ap = A->p ; Anz = A->nz ; packed = A->packed ; ASSERT (IMPLIES (!packed, Anz != NULL)) ; xtype = values ? A->xtype : CHOLMOD_PATTERN ; /* ---------------------------------------------------------------------- */ /* allocate F */ /* ---------------------------------------------------------------------- */ /* determine # of nonzeros in F */ if (stype != 0) { /* F=A' or F=A(p,p)', fset is ignored */ fnz = CHOLMOD(nnz) (A, Common) ; } else { nf = (use_fset) ? nf : ncol ; if (use_fset) { fnz = 0 ; /* F=A(:,f)' or F=A(p,f)' */ for (jj = 0 ; jj < nf ; jj++) { /* The fset is not yet checked; it will be thoroughly checked * in cholmod_transpose_unsym. For now, just make sure we don't * access Ap and Anz out of bounds. */ j = fset [jj] ; if (j >= 0 && j < ncol) { fnz += packed ? (Ap [j+1] - Ap [j]) : MAX (0, Anz [j]) ; } } } else { /* F=A' or F=A(p,:)' */ fnz = CHOLMOD(nnz) (A, Common) ; } } /* F is ncol-by-nrow, fnz nonzeros, sorted unless f is present and unsorted, * packed, of opposite stype as A, and with/without numerical values */ F = CHOLMOD(allocate_sparse) (ncol, nrow, fnz, TRUE, TRUE, -SIGN(stype), xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } /* ---------------------------------------------------------------------- */ /* transpose and optionally permute the matrix A */ /* ---------------------------------------------------------------------- */ if (stype != 0) { /* F = A (p,p)', using upper or lower triangular part of A only */ ok = CHOLMOD(transpose_sym) (A, values, Perm, F, Common) ; } else { /* F = A (p,f)' */ ok = CHOLMOD(transpose_unsym) (A, values, Perm, fset, nf, F, Common) ; } /* ---------------------------------------------------------------------- */ /* return the matrix F, or NULL if an error occured */ /* ---------------------------------------------------------------------- */ if (!ok) { CHOLMOD(free_sparse) (&F, Common) ; } return (F) ; } /* ========================================================================== */ /* === cholmod_sort ========================================================= */ /* ========================================================================== */ /* Sort the columns of A, in place. Returns A in packed form, even if it * starts as unpacked. Removes entries in the ignored part of a symmetric * matrix. * * workspace: Iwork (max (nrow,ncol)). Allocates additional workspace for a * temporary copy of A'. */ int CHOLMOD(sort) ( /* ---- in/out --- */ cholmod_sparse *A, /* matrix to sort */ /* --------------- */ cholmod_common *Common ) { Int *Ap ; cholmod_sparse *F ; Int anz, ncol, nrow, stype ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; Common->status = CHOLMOD_OK ; nrow = A->nrow ; if (nrow <= 1) { /* a 1-by-n sparse matrix must be sorted */ A->sorted = TRUE ; return (TRUE) ; } /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ ncol = A->ncol ; CHOLMOD(allocate_work) (0, MAX (nrow, ncol), 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; /* out of memory */ } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ anz = CHOLMOD(nnz) (A, Common) ; stype = A->stype ; /* ---------------------------------------------------------------------- */ /* sort the columns of the matrix */ /* ---------------------------------------------------------------------- */ /* allocate workspace for transpose: ncol-by-nrow, same # of nonzeros as A, * sorted, packed, same stype as A, and of the same numeric type as A. */ F = CHOLMOD(allocate_sparse) (ncol, nrow, anz, TRUE, TRUE, stype, A->xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; /* out of memory */ } if (stype != 0) { /* F = A', upper or lower triangular part only */ CHOLMOD(transpose_sym) (A, 1, NULL, F, Common) ; A->packed = TRUE ; /* A = F' */ CHOLMOD(transpose_sym) (F, 1, NULL, A, Common) ; } else { /* F = A' */ CHOLMOD(transpose_unsym) (A, 1, NULL, NULL, 0, F, Common) ; A->packed = TRUE ; /* A = F' */ CHOLMOD(transpose_unsym) (F, 1, NULL, NULL, 0, A, Common) ; } ASSERT (A->sorted && A->packed) ; ASSERT (CHOLMOD(dump_sparse) (A, "Asorted", Common) >= 0) ; /* ---------------------------------------------------------------------- */ /* reduce A in size, if needed. This must succeed. */ /* ---------------------------------------------------------------------- */ Ap = A->p ; anz = Ap [ncol] ; ASSERT ((size_t) anz <= A->nzmax) ; CHOLMOD(reallocate_sparse) (anz, A, Common) ; ASSERT (Common->status >= CHOLMOD_OK) ; /* ---------------------------------------------------------------------- */ /* free workspace */ /* ---------------------------------------------------------------------- */ CHOLMOD(free_sparse) (&F, Common) ; return (TRUE) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_add.c0000664000175000017500000002024014224052371020141 00000000000000/* ========================================================================== */ /* === Core/cholmod_add ===================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* C = alpha*A + beta*B, or spones(A+B). Result is packed, with sorted or * unsorted columns. This routine is much faster and takes less memory if C * is allowed to have unsorted columns. * * If A and B are both symmetric (in upper form) then C is the same. Likewise, * if A and B are both symmetric (in lower form) then C is the same. * Otherwise, C is unsymmetric. A and B must have the same dimension. * * workspace: Flag (nrow), W (nrow) if values, Iwork (max (nrow,ncol)). * allocates temporary copies for A and B if they are symmetric. * allocates temporary copy of C if it is to be returned sorted. * * A and B can have an xtype of pattern or real. Complex or zomplex cases * are supported only if the "values" input parameter is FALSE. */ #include "cholmod_internal.h" #include "cholmod_core.h" cholmod_sparse *CHOLMOD(add) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to add */ cholmod_sparse *B, /* matrix to add */ double alpha [2], /* scale factor for A */ double beta [2], /* scale factor for B */ int values, /* if TRUE compute the numerical values of C */ int sorted, /* if TRUE, sort columns of C */ /* --------------- */ cholmod_common *Common ) { double *Ax, *Bx, *Cx, *W ; Int apacked, up, lo, nrow, ncol, bpacked, nzmax, pa, paend, pb, pbend, i, j, p, mark, nz ; Int *Ap, *Ai, *Anz, *Bp, *Bi, *Bnz, *Flag, *Cp, *Ci ; cholmod_sparse *A2, *B2, *C ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; RETURN_IF_NULL (B, NULL) ; values = values && (A->xtype != CHOLMOD_PATTERN) && (B->xtype != CHOLMOD_PATTERN) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; RETURN_IF_XTYPE_INVALID (B, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; if (A->nrow != B->nrow || A->ncol != B->ncol) { /* A and B must have the same dimensions */ ERROR (CHOLMOD_INVALID, "A and B dimesions do not match") ; return (NULL) ; } /* A and B must have the same numerical type if values is TRUE (both must * be CHOLMOD_REAL, this is implicitly checked above) */ Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ nrow = A->nrow ; ncol = A->ncol ; CHOLMOD(allocate_work) (nrow, MAX (nrow,ncol), values ? nrow : 0, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ if (nrow <= 1) { /* C will be implicitly sorted, so no need to sort it here */ sorted = FALSE ; } /* convert A or B to unsymmetric, if necessary */ A2 = NULL ; B2 = NULL ; if (A->stype != B->stype) { if (A->stype) { /* workspace: Iwork (max (nrow,ncol)) */ A2 = CHOLMOD(copy) (A, 0, values, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } A = A2 ; } if (B->stype) { /* workspace: Iwork (max (nrow,ncol)) */ B2 = CHOLMOD(copy) (B, 0, values, Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_sparse) (&A2, Common) ; return (NULL) ; /* out of memory */ } B = B2 ; } } /* get the A matrix */ ASSERT (A->stype == B->stype) ; up = (A->stype > 0) ; lo = (A->stype < 0) ; Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; apacked = A->packed ; /* get the B matrix */ Bp = B->p ; Bnz = B->nz ; Bi = B->i ; Bx = B->x ; bpacked = B->packed ; /* get workspace */ W = Common->Xwork ; /* size nrow, used if values is TRUE */ Flag = Common->Flag ; /* size nrow, Flag [0..nrow-1] < mark on input */ /* ---------------------------------------------------------------------- */ /* allocate the result C */ /* ---------------------------------------------------------------------- */ /* If integer overflow occurs, nzmax < 0 and the allocate fails properly * (likewise in most other matrix manipulation routines). */ nzmax = CHOLMOD(nnz) (A, Common) + CHOLMOD(nnz) (B, Common) ; C = CHOLMOD(allocate_sparse) (nrow, ncol, nzmax, FALSE, TRUE, SIGN (A->stype), values ? A->xtype : CHOLMOD_PATTERN, Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; return (NULL) ; /* out of memory */ } Cp = C->p ; Ci = C->i ; Cx = C->x ; /* ---------------------------------------------------------------------- */ /* compute C = alpha*A + beta*B */ /* ---------------------------------------------------------------------- */ nz = 0 ; for (j = 0 ; j < ncol ; j++) { Cp [j] = nz ; /* clear the Flag array */ /* mark = CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; /* scatter B into W */ pb = Bp [j] ; pbend = (bpacked) ? (Bp [j+1]) : (pb + Bnz [j]) ; for (p = pb ; p < pbend ; p++) { i = Bi [p] ; if ((up && i > j) || (lo && i < j)) { continue ; } Flag [i] = mark ; if (values) { W [i] = beta [0] * Bx [p] ; } } /* add A and gather from W into C(:,j) */ pa = Ap [j] ; paend = (apacked) ? (Ap [j+1]) : (pa + Anz [j]) ; for (p = pa ; p < paend ; p++) { i = Ai [p] ; if ((up && i > j) || (lo && i < j)) { continue ; } Flag [i] = EMPTY ; Ci [nz] = i ; if (values) { Cx [nz] = W [i] + alpha [0] * Ax [p] ; W [i] = 0 ; } nz++ ; } /* gather remaining entries into C(:,j), using pattern of B */ for (p = pb ; p < pbend ; p++) { i = Bi [p] ; if ((up && i > j) || (lo && i < j)) { continue ; } if (Flag [i] == mark) { Ci [nz] = i ; if (values) { Cx [nz] = W [i] ; W [i] = 0 ; } nz++ ; } } } Cp [ncol] = nz ; /* ---------------------------------------------------------------------- */ /* reduce C in size and free temporary matrices */ /* ---------------------------------------------------------------------- */ ASSERT (MAX (1,nz) <= C->nzmax) ; CHOLMOD(reallocate_sparse) (nz, C, Common) ; ASSERT (Common->status >= CHOLMOD_OK) ; /* clear the Flag array */ mark = CHOLMOD(clear_flag) (Common) ; CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; /* ---------------------------------------------------------------------- */ /* sort C, if requested */ /* ---------------------------------------------------------------------- */ if (sorted) { /* workspace: Iwork (max (nrow,ncol)) */ if (!CHOLMOD(sort) (C, Common)) { CHOLMOD(free_sparse) (&C, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } } } /* ---------------------------------------------------------------------- */ /* return result */ /* ---------------------------------------------------------------------- */ ASSERT (CHOLMOD(dump_sparse) (C, "add", Common) >= 0) ; return (C) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_dense.c0000664000175000017500000004756414224052371020531 00000000000000/* ========================================================================== */ /* === Core/cholmod_dense =================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2013, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Core utility routines for the cholmod_dense object: * * The solve routines and some of the MatrixOps and Modify routines use dense * matrices as inputs. These are held in column-major order. With a leading * dimension of d, the entry in row i and column j is held in x [i+j*d]. * * Primary routines: * ----------------- * cholmod_allocate_dense allocate a dense matrix * cholmod_free_dense free a dense matrix * * Secondary routines: * ------------------- * cholmod_zeros allocate a dense matrix of all zeros * cholmod_ones allocate a dense matrix of all ones * cholmod_eye allocate a dense identity matrix * cholmod_sparse_to_dense create a dense matrix copy of a sparse matrix * cholmod_dense_to_sparse create a sparse matrix copy of a dense matrix * cholmod_copy_dense create a copy of a dense matrix * cholmod_copy_dense2 copy a dense matrix (pre-allocated) * * All routines in this file can handle the real, complex, and zomplex cases. * Pattern-only dense matrices are not supported. cholmod_sparse_to_dense can * take a pattern-only input sparse matrix, however, and cholmod_dense_to_sparse * can generate a pattern-only output sparse matrix. */ #include "cholmod_internal.h" #include "cholmod_core.h" /* ========================================================================== */ /* === TEMPLATE ============================================================= */ /* ========================================================================== */ #define PATTERN #include "t_cholmod_dense.c" #define REAL #include "t_cholmod_dense.c" #define COMPLEX #include "t_cholmod_dense.c" #define ZOMPLEX #include "t_cholmod_dense.c" /* ========================================================================== */ /* === cholmod_allocate_dense =============================================== */ /* ========================================================================== */ /* Allocate a dense matrix with leading dimension d. The space is not * initialized. */ cholmod_dense *CHOLMOD(allocate_dense) ( /* ---- input ---- */ size_t nrow, /* # of rows of matrix */ size_t ncol, /* # of columns of matrix */ size_t d, /* leading dimension */ int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) { cholmod_dense *X ; size_t nzmax, nzmax0 ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; if (d < nrow) { ERROR (CHOLMOD_INVALID, "leading dimension invalid") ; return (NULL) ; } if (xtype < CHOLMOD_REAL || xtype > CHOLMOD_ZOMPLEX) { ERROR (CHOLMOD_INVALID, "xtype invalid") ; return (NULL) ; } /* ensure the dimensions do not cause integer overflow */ (void) CHOLMOD(add_size_t) (ncol, 2, &ok) ; /* nzmax = MAX (1, d*ncol) ; */ nzmax = CHOLMOD(mult_size_t) (d, ncol, &ok) ; nzmax = MAX (1, nzmax) ; if (!ok || nrow > Int_max || ncol > Int_max || nzmax > Int_max) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (NULL) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate header */ /* ---------------------------------------------------------------------- */ X = CHOLMOD(malloc) (sizeof (cholmod_dense), 1, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } PRINT1 (("cholmod_allocate_dense %d-by-%d nzmax %d xtype %d\n", nrow, ncol, nzmax, xtype)) ; X->nrow = nrow ; X->ncol = ncol ; X->nzmax = nzmax ; X->xtype = xtype ; X->dtype = DTYPE ; X->x = NULL ; X->z = NULL ; X->d = d ; /* ---------------------------------------------------------------------- */ /* allocate the matrix itself */ /* ---------------------------------------------------------------------- */ nzmax0 = 0 ; CHOLMOD(realloc_multiple) (nzmax, 0, xtype, NULL, NULL, &(X->x), &(X->z), &nzmax0, Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_dense) (&X, Common) ; return (NULL) ; /* out of memory */ } return (X) ; } /* ========================================================================== */ /* === cholmod_zeros ======================================================== */ /* ========================================================================== */ /* Allocate a dense matrix and set it to zero */ cholmod_dense *CHOLMOD(zeros) ( /* ---- input ---- */ size_t nrow, /* # of rows of matrix */ size_t ncol, /* # of columns of matrix */ int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) { cholmod_dense *X ; double *Xx, *Xz ; Int i, nz ; /* ---------------------------------------------------------------------- */ /* allocate a dense matrix and set it to zero */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; X = CHOLMOD(allocate_dense) (nrow, ncol, nrow, xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* NULL Common, out of memory, or inputs invalid */ } Xx = X->x ; Xz = X->z ; nz = MAX (1, X->nzmax) ; switch (xtype) { case CHOLMOD_REAL: for (i = 0 ; i < nz ; i++) { Xx [i] = 0 ; } break ; case CHOLMOD_COMPLEX: for (i = 0 ; i < 2*nz ; i++) { Xx [i] = 0 ; } break ; case CHOLMOD_ZOMPLEX: for (i = 0 ; i < nz ; i++) { Xx [i] = 0 ; } for (i = 0 ; i < nz ; i++) { Xz [i] = 0 ; } break ; } return (X) ; } /* ========================================================================== */ /* === cholmod_ones ========================================================= */ /* ========================================================================== */ /* Allocate a dense matrix and set it to zero */ cholmod_dense *CHOLMOD(ones) ( /* ---- input ---- */ size_t nrow, /* # of rows of matrix */ size_t ncol, /* # of columns of matrix */ int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) { cholmod_dense *X ; double *Xx, *Xz ; Int i, nz ; /* ---------------------------------------------------------------------- */ /* allocate a dense matrix and set it to all ones */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; X = CHOLMOD(allocate_dense) (nrow, ncol, nrow, xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* NULL Common, out of memory, or inputs invalid */ } Xx = X->x ; Xz = X->z ; nz = MAX (1, X->nzmax) ; switch (xtype) { case CHOLMOD_REAL: for (i = 0 ; i < nz ; i++) { Xx [i] = 1 ; } break ; case CHOLMOD_COMPLEX: for (i = 0 ; i < nz ; i++) { Xx [2*i ] = 1 ; Xx [2*i+1] = 0 ; } break ; case CHOLMOD_ZOMPLEX: for (i = 0 ; i < nz ; i++) { Xx [i] = 1 ; } for (i = 0 ; i < nz ; i++) { Xz [i] = 0 ; } break ; } return (X) ; } /* ========================================================================== */ /* === cholmod_eye ========================================================== */ /* ========================================================================== */ /* Allocate a dense matrix and set it to the identity matrix */ cholmod_dense *CHOLMOD(eye) ( /* ---- input ---- */ size_t nrow, /* # of rows of matrix */ size_t ncol, /* # of columns of matrix */ int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) { cholmod_dense *X ; double *Xx, *Xz ; Int i, n, nz ; /* ---------------------------------------------------------------------- */ /* allocate a dense matrix and set it to the identity matrix */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; X = CHOLMOD(zeros) (nrow, ncol, xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* NULL Common, out of memory, or inputs invalid */ } nz = MAX (1, nrow*ncol) ; Xx = X->x ; Xz = X->z ; n = MIN (nrow, ncol) ; switch (xtype) { case CHOLMOD_REAL: case CHOLMOD_ZOMPLEX: for (i = 0 ; i < n ; i++) { Xx [i + i*nrow] = 1 ; } break ; case CHOLMOD_COMPLEX: for (i = 0 ; i < n ; i++) { Xx [2 * (i + i*nrow)] = 1 ; } break ; } return (X) ; } /* ========================================================================== */ /* === cholmod_free_dense =================================================== */ /* ========================================================================== */ /* free a dense matrix * * workspace: none */ int CHOLMOD(free_dense) ( /* ---- in/out --- */ cholmod_dense **XHandle, /* dense matrix to deallocate, NULL on output */ /* --------------- */ cholmod_common *Common ) { cholmod_dense *X ; RETURN_IF_NULL_COMMON (FALSE) ; if (XHandle == NULL) { /* nothing to do */ return (TRUE) ; } X = *XHandle ; if (X == NULL) { /* nothing to do */ return (TRUE) ; } switch (X->xtype) { case CHOLMOD_REAL: X->x = CHOLMOD(free) (X->nzmax, sizeof (double), X->x, Common) ; break ; case CHOLMOD_COMPLEX: X->x = CHOLMOD(free) (X->nzmax, 2*sizeof (double), X->x, Common) ; break ; case CHOLMOD_ZOMPLEX: X->x = CHOLMOD(free) (X->nzmax, sizeof (double), X->x, Common) ; X->z = CHOLMOD(free) (X->nzmax, sizeof (double), X->z, Common) ; break ; } *XHandle = CHOLMOD(free) (1, sizeof (cholmod_dense), (*XHandle), Common) ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_ensure_dense ================================================= */ /* ========================================================================== */ /* Ensure that the input matrix has a certain size and type. If not, free * the existing matrix and reallocate one of the right size and type. * Returns a pointer to the cholmod_dense matrix, possibly reallocated. * Also modifies the input matrix handle, XHandle, if necessary. */ cholmod_dense *CHOLMOD(ensure_dense) ( /* ---- input/output ---- */ cholmod_dense **XHandle, /* matrix handle to check */ /* ---- input ---- */ size_t nrow, /* # of rows of matrix */ size_t ncol, /* # of columns of matrix */ size_t d, /* leading dimension */ int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) { cholmod_dense *X ; RETURN_IF_NULL_COMMON (NULL) ; if (XHandle == NULL) { ERROR (CHOLMOD_INVALID, "matrix invalid") ; return (NULL) ; } X = *XHandle ; if (X == NULL || X->nrow != nrow || X->ncol != ncol || X->d != d || X->xtype != xtype) { /* Matrix X is not allocated, or has the wrong size. Free it and * reallocate it in the right size and shape. If an error occurs * (out of memory or inputs nrow, etc invalid), then the error is * set in cholmod_allocate_dense and X is returned as NULL. */ CHOLMOD(free_dense) (XHandle, Common) ; X = CHOLMOD(allocate_dense) (nrow, ncol, d, xtype, Common) ; *XHandle = X ; } return (X) ; } /* ========================================================================== */ /* === cholmod_sparse_to_dense ============================================== */ /* ========================================================================== */ /* Convert a sparse matrix to a dense matrix. * The output dense matrix has the same xtype as the input sparse matrix, * except that a pattern-only sparse matrix A is converted into a real dense * matrix X, with 1's and 0's. All xtypes are supported. */ cholmod_dense *CHOLMOD(sparse_to_dense) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) { cholmod_dense *X = NULL ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, NULL) ; if (A->stype && A->nrow != A->ncol) { ERROR (CHOLMOD_INVALID, "matrix invalid") ; return (NULL) ; } Common->status = CHOLMOD_OK ; ASSERT (CHOLMOD(dump_sparse) (A, "A", Common) >= 0) ; /* ---------------------------------------------------------------------- */ /* convert the matrix, using template routine */ /* ---------------------------------------------------------------------- */ switch (A->xtype) { case CHOLMOD_PATTERN: X = p_cholmod_sparse_to_dense (A, Common) ; break ; case CHOLMOD_REAL: X = r_cholmod_sparse_to_dense (A, Common) ; break ; case CHOLMOD_COMPLEX: X = c_cholmod_sparse_to_dense (A, Common) ; break ; case CHOLMOD_ZOMPLEX: X = z_cholmod_sparse_to_dense (A, Common) ; break ; } return (X) ; } /* ========================================================================== */ /* === cholmod_dense_to_sparse ============================================== */ /* ========================================================================== */ /* Convert a dense matrix to a sparse matrix, similar to the MATLAB statements: * * C = sparse (X) values = TRUE * C = spones (sparse (X)) values = FALSE * * except that X must be double (it can be of many different types in MATLAB) * * The resulting sparse matrix C has the same numeric xtype as the input dense * matrix X, unless "values" is FALSE (in which case C is real, where C(i,j)=1 * if (i,j) is an entry in X. */ cholmod_sparse *CHOLMOD(dense_to_sparse) ( /* ---- input ---- */ cholmod_dense *X, /* matrix to copy */ int values, /* TRUE if values to be copied, FALSE otherwise */ /* --------------- */ cholmod_common *Common ) { cholmod_sparse *C = NULL ; DEBUG (CHOLMOD(dump_dense) (X, "X", Common)) ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (X, NULL) ; RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, NULL) ; if (X->d < X->nrow) { ERROR (CHOLMOD_INVALID, "matrix invalid") ; return (NULL) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* convert the matrix, using template routine */ /* ---------------------------------------------------------------------- */ switch (X->xtype) { case CHOLMOD_REAL: C = r_cholmod_dense_to_sparse (X, values, Common) ; break ; case CHOLMOD_COMPLEX: C = c_cholmod_dense_to_sparse (X, values, Common) ; break ; case CHOLMOD_ZOMPLEX: C = z_cholmod_dense_to_sparse (X, values, Common) ; break ; } return (C) ; } /* ========================================================================== */ /* === cholmod_copy_dense2 ================================================== */ /* ========================================================================== */ /* Y = X, where X and Y are both already allocated. The leading dimensions of * X and Y may differ, but both must be >= the # of rows in X and Y. * Entries in rows nrow to d-1 are not copied from X, since the space might not * be initialized. Y->nzmax is unchanged. X->nzmax is typically * (X->d)*(X->ncol), but a user might modify that condition outside of any * CHOLMOD routine. * * The two dense matrices X and Y must have the same numeric xtype. */ int CHOLMOD(copy_dense2) ( /* ---- input ---- */ cholmod_dense *X, /* matrix to copy */ /* ---- output --- */ cholmod_dense *Y, /* copy of matrix X */ /* --------------- */ cholmod_common *Common ) { /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (X, FALSE) ; RETURN_IF_NULL (Y, FALSE) ; RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (Y, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; if (X->nrow != Y->nrow || X->ncol != Y->ncol || X->xtype != Y->xtype) { ERROR (CHOLMOD_INVALID, "X and Y must have same dimensions and xtype") ; return (FALSE) ; } if (X->d < X->nrow || Y->d < Y->nrow || (X->d * X->ncol) > X->nzmax || (Y->d * Y->ncol) > Y->nzmax) { ERROR (CHOLMOD_INVALID, "X and/or Y invalid") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* copy the matrix, using template routine */ /* ---------------------------------------------------------------------- */ switch (X->xtype) { case CHOLMOD_REAL: r_cholmod_copy_dense2 (X, Y) ; break ; case CHOLMOD_COMPLEX: c_cholmod_copy_dense2 (X, Y) ; break ; case CHOLMOD_ZOMPLEX: z_cholmod_copy_dense2 (X, Y) ; break ; } return (TRUE) ; } /* ========================================================================== */ /* === cholmod_copy_dense =================================================== */ /* ========================================================================== */ /* Y = X, copy a dense matrix */ cholmod_dense *CHOLMOD(copy_dense) ( /* ---- input ---- */ cholmod_dense *X, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) { cholmod_dense *Y ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (X, NULL) ; RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, NULL) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate result */ /* ---------------------------------------------------------------------- */ Y = CHOLMOD(allocate_dense) (X->nrow, X->ncol, X->d, X->xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory or X invalid */ } /* ---------------------------------------------------------------------- */ /* Y = X */ /* ---------------------------------------------------------------------- */ /* This cannot fail (X and Y are allocated, and have the same nrow, ncol * d, and xtype) */ CHOLMOD(copy_dense2) (X, Y, Common) ; /* ---------------------------------------------------------------------- */ /* return result */ /* ---------------------------------------------------------------------- */ return (Y) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_triplet.c0000664000175000017500000005605114224052371021105 00000000000000/* ========================================================================== */ /* === Core/cholmod_triplet ================================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Core utility routines for the cholmod_triplet object: * * A sparse matrix held in triplet form is the simplest one for a user to * create. It consists of a list of nz entries in arbitrary order, held in * three arrays: i, j, and x, each of length nk. The kth entry is in row i[k], * column j[k], with value x[k]. There may be duplicate values; if A(i,j) * appears more than once, its value is the sum of the entries with those row * and column indices. * * Primary routines: * ----------------- * cholmod_allocate_triplet allocate a triplet matrix * cholmod_free_triplet free a triplet matrix * * Secondary routines: * ------------------- * cholmod_reallocate_triplet reallocate a triplet matrix * cholmod_sparse_to_triplet create a triplet matrix copy of a sparse matrix * cholmod_triplet_to_sparse create a sparse matrix copy of a triplet matrix * cholmod_copy_triplet create a copy of a triplet matrix * * The relationship between an m-by-n cholmod_sparse matrix A and a * cholmod_triplet matrix (i, j, and x) is identical to how they are used in * the MATLAB "sparse" and "find" functions: * * [i j x] = find (A) * [m n] = size (A) * A = sparse (i,j,x,m,n) * * with the exception that the cholmod_sparse matrix may be "unpacked", may * have either sorted or unsorted columns (depending on the option selected), * and may be symmetric with just the upper or lower triangular part stored. * Likewise, the cholmod_triplet matrix may contain just the entries in the * upper or lower triangular part of a symmetric matrix. * * MATLAB sparse matrices are always "packed", always have sorted columns, * and always store both parts of a symmetric matrix. In some cases, MATLAB * behaves like CHOLMOD by ignoring entries in the upper or lower triangular * part of a matrix that is otherwise assumed to be symmetric (such as the * input to chol). In CHOLMOD, that option is a characteristic of the object. * In MATLAB, that option is based on how a matrix is used as the input to * a function. * * The triplet matrix is provided to give the user a simple way of constructing * a sparse matrix. There are very few operations supported for triplet * matrices. The assumption is that they will be converted to cholmod_sparse * matrix form first. * * Adding two triplet matrices simply involves concatenating the contents of * the three arrays (i, j, and x). To permute a triplet matrix, just replace * the row and column indices with their permuted values. For example, if * P is a permutation vector, then P [k] = j means row/column j is the kth * row/column in C=P*A*P'. In MATLAB notation, C=A(p,p). If Pinv is an array * of size n and T is the triplet form of A, then: * * Ti = T->i ; * Tj = T->j ; * for (k = 0 ; k < n ; k++) Pinv [P [k]] = k ; * for (k = 0 ; k < nz ; k++) Ti [k] = Pinv [Ti [k]] ; * for (k = 0 ; k < nz ; k++) Tj [k] = Pinv [Tj [k]] ; * * overwrites T with the triplet form of C=P*A*P'. The conversion * * C = cholmod_triplet_to_sparse (T, 0, &Common) ; * * will then return the matrix C = P*A*P'. * * Note that T->stype > 0 means that entries in the lower triangular part of * T are transposed into the upper triangular part when T is converted to * sparse matrix (cholmod_sparse) form with cholmod_triplet_to_sparse. The * opposite is true for T->stype < 0. * * Since the triplet matrix T is so simple to generate, it's quite easy * to remove entries that you do not want, prior to converting T to the * cholmod_sparse form. So if you include these entries in T, CHOLMOD * assumes that there must be a reason (such as the one above). Thus, * no entry in a triplet matrix is ever ignored. * * Other operations, such as extacting a submatrix, horizontal and vertical * concatenation, multiply a triplet matrix times a dense matrix, are also * simple. Multiplying two triplet matrices is not trivial; the simplest * method is to convert them to cholmod_sparse matrices first. * * Supports all xtypes (pattern, real, complex, and zomplex). */ #include "cholmod_internal.h" #include "cholmod_core.h" /* ========================================================================== */ /* === TEMPLATE ============================================================= */ /* ========================================================================== */ #define PATTERN #include "t_cholmod_triplet.c" #define REAL #include "t_cholmod_triplet.c" #define COMPLEX #include "t_cholmod_triplet.c" #define ZOMPLEX #include "t_cholmod_triplet.c" /* ========================================================================== */ /* === cholmod_allocate_triplet ============================================= */ /* ========================================================================== */ /* allocate space for a triplet matrix * * workspace: none */ cholmod_triplet *CHOLMOD(allocate_triplet) ( /* ---- input ---- */ size_t nrow, /* # of rows of T */ size_t ncol, /* # of columns of T */ size_t nzmax, /* max # of nonzeros of T */ int stype, /* stype of T */ int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) { cholmod_triplet *T ; size_t nzmax0 ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; if (xtype < CHOLMOD_PATTERN || xtype > CHOLMOD_ZOMPLEX) { ERROR (CHOLMOD_INVALID, "xtype invalid") ; return (NULL) ; } /* ensure the dimensions do not cause integer overflow */ (void) CHOLMOD(add_size_t) (ncol, 2, &ok) ; if (!ok || nrow > Int_max || ncol > Int_max || nzmax > Int_max) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (NULL) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate header */ /* ---------------------------------------------------------------------- */ T = CHOLMOD(malloc) (sizeof (cholmod_triplet), 1, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } PRINT1 (("cholmod_allocate_triplet %d-by-%d nzmax %d xtype %d\n", nrow, ncol, nzmax, xtype)) ; nzmax = MAX (1, nzmax) ; T->nrow = nrow ; T->ncol = ncol ; T->nzmax = nzmax ; T->nnz = 0 ; T->stype = stype ; T->itype = ITYPE ; T->xtype = xtype ; T->dtype = DTYPE ; T->j = NULL ; T->i = NULL ; T->x = NULL ; T->z = NULL ; /* ---------------------------------------------------------------------- */ /* allocate the matrix itself */ /* ---------------------------------------------------------------------- */ nzmax0 = 0 ; CHOLMOD(realloc_multiple) (nzmax, 2, xtype, &(T->i), &(T->j), &(T->x), &(T->z), &nzmax0, Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_triplet) (&T, Common) ; return (NULL) ; /* out of memory */ } return (T) ; } /* ========================================================================== */ /* === cholmod_free_triplet ================================================= */ /* ========================================================================== */ /* free a triplet matrix * * workspace: none */ int CHOLMOD(free_triplet) ( /* ---- in/out --- */ cholmod_triplet **THandle, /* matrix to deallocate, NULL on output */ /* --------------- */ cholmod_common *Common ) { Int nz ; cholmod_triplet *T ; RETURN_IF_NULL_COMMON (FALSE) ; if (THandle == NULL) { /* nothing to do */ return (TRUE) ; } T = *THandle ; if (T == NULL) { /* nothing to do */ return (TRUE) ; } nz = T->nzmax ; T->j = CHOLMOD(free) (nz, sizeof (Int), T->j, Common) ; T->i = CHOLMOD(free) (nz, sizeof (Int), T->i, Common) ; if (T->xtype == CHOLMOD_REAL) { T->x = CHOLMOD(free) (nz, sizeof (double), T->x, Common) ; } else if (T->xtype == CHOLMOD_COMPLEX) { T->x = CHOLMOD(free) (nz, 2*sizeof (double), T->x, Common) ; } else if (T->xtype == CHOLMOD_ZOMPLEX) { T->x = CHOLMOD(free) (nz, sizeof (double), T->x, Common) ; T->z = CHOLMOD(free) (nz, sizeof (double), T->z, Common) ; } *THandle = CHOLMOD(free) (1, sizeof (cholmod_triplet), (*THandle), Common) ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_reallocate_triplet =========================================== */ /* ========================================================================== */ /* Change the size of T->i, T->j, and T->x, or allocate them if their current * size is zero. T->x is not modified if T->xtype is CHOLMOD_PATTERN. * * workspace: none */ int CHOLMOD(reallocate_triplet) ( /* ---- input ---- */ size_t nznew, /* new # of entries in T */ /* ---- in/out --- */ cholmod_triplet *T, /* triplet matrix to modify */ /* --------------- */ cholmod_common *Common ) { /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (T, FALSE) ; RETURN_IF_XTYPE_INVALID (T, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; Common->status = CHOLMOD_OK ; PRINT1 (("realloc triplet %d to %d, xtype: %d\n", T->nzmax, nznew, T->xtype)) ; /* ---------------------------------------------------------------------- */ /* resize the matrix */ /* ---------------------------------------------------------------------- */ CHOLMOD(realloc_multiple) (MAX (1,nznew), 2, T->xtype, &(T->i), &(T->j), &(T->x), &(T->z), &(T->nzmax), Common) ; return (Common->status == CHOLMOD_OK) ; } /* ========================================================================== */ /* === cholmod_triplet_to_sparse ============================================ */ /* ========================================================================== */ /* Convert a set of triplets into a cholmod_sparse matrix. In MATLAB notation, * for unsymmetric matrices: * * A = sparse (Ti, Tj, Tx, nrow, ncol, nzmax) ; * * For the symmetric upper case: * * A = sparse (min(Ti,Tj), max(Ti,Tj), Tx, nrow, ncol, nzmax) ; * * For the symmetric lower case: * * A = sparse (max(Ti,Tj), min(Ti,Tj), Tx, nrow, ncol, nzmax) ; * * If Tx is NULL, then A->x is not allocated, and only the pattern of A is * computed. A is returned in packed form, and can be of any stype * (upper/lower/unsymmetric). It has enough space to hold the values in T, * or nzmax, whichever is larger. * * workspace: Iwork (max (nrow,ncol)) * allocates a temporary copy of its output matrix. * * The resulting sparse matrix has the same xtype as the input triplet matrix. */ cholmod_sparse *CHOLMOD(triplet_to_sparse) ( /* ---- input ---- */ cholmod_triplet *T, /* matrix to copy */ size_t nzmax, /* allocate at least this much space in output matrix */ /* --------------- */ cholmod_common *Common ) { cholmod_sparse *R, *A = NULL ; Int *Wj, *Rp, *Ri, *Rnz, *Ti, *Tj ; Int i, j, p, k, stype, nrow, ncol, nz, ok ; size_t anz = 0 ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (T, NULL) ; Ti = T->i ; Tj = T->j ; RETURN_IF_NULL (Ti, NULL) ; RETURN_IF_NULL (Tj, NULL) ; RETURN_IF_XTYPE_INVALID (T, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, NULL) ; stype = SIGN (T->stype) ; if (stype && T->nrow != T->ncol) { /* inputs invalid */ ERROR (CHOLMOD_INVALID, "matrix invalid") ; return (NULL) ; } Common->status = CHOLMOD_OK ; DEBUG (CHOLMOD(dump_triplet) (T, "T", Common)) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ nrow = T->nrow ; ncol = T->ncol ; nz = T->nnz ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ CHOLMOD(allocate_work) (0, MAX (nrow, ncol), 0, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } /* ---------------------------------------------------------------------- */ /* allocate temporary matrix R */ /* ---------------------------------------------------------------------- */ R = CHOLMOD(allocate_sparse) (ncol, nrow, nz, FALSE, FALSE, -stype, T->xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } Rp = R->p ; Ri = R->i ; Rnz = R->nz ; /* ---------------------------------------------------------------------- */ /* count the entries in each row of A (also counting duplicates) */ /* ---------------------------------------------------------------------- */ for (i = 0 ; i < nrow ; i++) { Rnz [i] = 0 ; } if (stype > 0) { for (k = 0 ; k < nz ; k++) { i = Ti [k] ; j = Tj [k] ; if (i < 0 || i >= nrow || j < 0 || j >= ncol) { ERROR (CHOLMOD_INVALID, "index out of range") ; break ; } /* A will be symmetric with just the upper triangular part stored. * Create a matrix R that is lower triangular. Entries in the * upper part of R are transposed to the lower part. */ Rnz [MIN (i,j)]++ ; } } else if (stype < 0) { for (k = 0 ; k < nz ; k++) { i = Ti [k] ; j = Tj [k] ; if (i < 0 || i >= nrow || j < 0 || j >= ncol) { ERROR (CHOLMOD_INVALID, "index out of range") ; break ; } /* A will be symmetric with just the lower triangular part stored. * Create a matrix R that is upper triangular. Entries in the * lower part of R are transposed to the upper part. */ Rnz [MAX (i,j)]++ ; } } else { for (k = 0 ; k < nz ; k++) { i = Ti [k] ; j = Tj [k] ; if (i < 0 || i >= nrow || j < 0 || j >= ncol) { ERROR (CHOLMOD_INVALID, "index out of range") ; break ; } /* constructing an unsymmetric matrix */ Rnz [i]++ ; } } if (Common->status < CHOLMOD_OK) { /* triplet matrix is invalid */ CHOLMOD(free_sparse) (&R, Common) ; return (NULL) ; } /* ---------------------------------------------------------------------- */ /* construct the row pointers */ /* ---------------------------------------------------------------------- */ p = 0 ; for (i = 0 ; i < nrow ; i++) { Rp [i] = p ; p += Rnz [i] ; } Rp [nrow] = p ; /* use Wj (i/l/l) as temporary row pointers */ Wj = Common->Iwork ; /* size MAX (nrow,ncol) FUTURE WORK: (i/l/l) */ for (i = 0 ; i < nrow ; i++) { Wj [i] = Rp [i] ; } /* ---------------------------------------------------------------------- */ /* construct triplet matrix, using template routine */ /* ---------------------------------------------------------------------- */ switch (T->xtype) { case CHOLMOD_PATTERN: anz = p_cholmod_triplet_to_sparse (T, R, Common) ; break ; case CHOLMOD_REAL: anz = r_cholmod_triplet_to_sparse (T, R, Common) ; break ; case CHOLMOD_COMPLEX: anz = c_cholmod_triplet_to_sparse (T, R, Common) ; break ; case CHOLMOD_ZOMPLEX: anz = z_cholmod_triplet_to_sparse (T, R, Common) ; break ; } /* ---------------------------------------------------------------------- */ /* A = R' (array transpose, not complex conjugate transpose) */ /* ---------------------------------------------------------------------- */ /* workspace: Iwork (R->nrow), which is A->ncol */ ASSERT (CHOLMOD(dump_sparse) (R, "R", Common) >= 0) ; A = CHOLMOD(allocate_sparse) (nrow, ncol, MAX (anz, nzmax), TRUE, TRUE, stype, T->xtype, Common) ; if (stype) { ok = CHOLMOD(transpose_sym) (R, 1, NULL, A, Common) ; } else { ok = CHOLMOD(transpose_unsym) (R, 1, NULL, NULL, 0, A, Common) ; } CHOLMOD(free_sparse) (&R, Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_sparse) (&A, Common) ; } /* ---------------------------------------------------------------------- */ /* return result */ /* ---------------------------------------------------------------------- */ ASSERT (CHOLMOD(dump_sparse) (A, "A = triplet(T) result", Common) >= 0) ; return (A) ; } /* ========================================================================== */ /* === cholmod_sparse_to_triplet ============================================ */ /* ========================================================================== */ /* Converts a sparse column-oriented matrix to triplet form. * The resulting triplet matrix has the same xtype as the sparse matrix. * * workspace: none */ cholmod_triplet *CHOLMOD(sparse_to_triplet) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) { double *Ax, *Az, *Tx, *Tz ; Int *Ap, *Ai, *Ti, *Tj, *Anz ; cholmod_triplet *T ; Int i, xtype, p, pend, k, j, nrow, ncol, nz, stype, packed, up, lo, both ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, NULL) ; stype = SIGN (A->stype) ; nrow = A->nrow ; ncol = A->ncol ; if (stype && nrow != ncol) { /* inputs invalid */ ERROR (CHOLMOD_INVALID, "matrix invalid") ; return (NULL) ; } Ax = A->x ; Az = A->z ; xtype = A->xtype ; Common->status = CHOLMOD_OK ; ASSERT (CHOLMOD(dump_sparse) (A, "A", Common) >= 0) ; /* ---------------------------------------------------------------------- */ /* allocate triplet matrix */ /* ---------------------------------------------------------------------- */ nz = CHOLMOD(nnz) (A, Common) ; T = CHOLMOD(allocate_triplet) (nrow, ncol, nz, A->stype, A->xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } /* ---------------------------------------------------------------------- */ /* convert to a sparse matrix */ /* ---------------------------------------------------------------------- */ Ap = A->p ; Ai = A->i ; Anz = A->nz ; packed = A->packed ; Ti = T->i ; Tj = T->j ; Tx = T->x ; Tz = T->z ; T->stype = A->stype ; both = (A->stype == 0) ; up = (A->stype > 0) ; lo = (A->stype < 0) ; k = 0 ; for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (both || (up && i <= j) || (lo && i >= j)) { Ti [k] = Ai [p] ; Tj [k] = j ; if (xtype == CHOLMOD_REAL) { Tx [k] = Ax [p] ; } else if (xtype == CHOLMOD_COMPLEX) { Tx [2*k ] = Ax [2*p ] ; Tx [2*k+1] = Ax [2*p+1] ; } else if (xtype == CHOLMOD_ZOMPLEX) { Tx [k] = Ax [p] ; Tz [k] = Az [p] ; } k++ ; ASSERT (k <= nz) ; } } } T->nnz = k ; /* ---------------------------------------------------------------------- */ /* return result */ /* ---------------------------------------------------------------------- */ ASSERT (CHOLMOD(dump_triplet) (T, "T", Common)) ; return (T) ; } /* ========================================================================== */ /* === cholmod_copy_triplet ================================================= */ /* ========================================================================== */ /* Create an exact copy of a triplet matrix, except that entries in unused * space are not copied (they might not be initialized, and copying them would * cause program checkers such as purify and valgrind to complain). * The output triplet matrix has the same xtype as the input triplet matrix. */ cholmod_triplet *CHOLMOD(copy_triplet) ( /* ---- input ---- */ cholmod_triplet *T, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) { double *Tx, *Tz, *Cx, *Cz ; Int *Ci, *Cj, *Ti, *Tj ; cholmod_triplet *C ; Int xtype, k, nz ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (T, NULL) ; RETURN_IF_XTYPE_INVALID (T, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, NULL) ; nz = T->nnz ; Ti = T->i ; Tj = T->j ; Tx = T->x ; Tz = T->z ; xtype = T->xtype ; RETURN_IF_NULL (Ti, NULL) ; RETURN_IF_NULL (Tj, NULL) ; Common->status = CHOLMOD_OK ; DEBUG (CHOLMOD(dump_triplet) (T, "T input", Common)) ; /* ---------------------------------------------------------------------- */ /* allocate copy */ /* ---------------------------------------------------------------------- */ C = CHOLMOD(allocate_triplet) (T->nrow, T->ncol, T->nzmax, T->stype, xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } /* ---------------------------------------------------------------------- */ /* copy the triplet matrix */ /* ---------------------------------------------------------------------- */ Ci = C->i ; Cj = C->j ; Cx = C->x ; Cz = C->z ; C->nnz = nz ; for (k = 0 ; k < nz ; k++) { Ci [k] = Ti [k] ; } for (k = 0 ; k < nz ; k++) { Cj [k] = Tj [k] ; } if (xtype == CHOLMOD_REAL) { for (k = 0 ; k < nz ; k++) { Cx [k] = Tx [k] ; } } else if (xtype == CHOLMOD_COMPLEX) { for (k = 0 ; k < nz ; k++) { Cx [2*k ] = Tx [2*k ] ; Cx [2*k+1] = Tx [2*k+1] ; } } else if (xtype == CHOLMOD_ZOMPLEX) { for (k = 0 ; k < nz ; k++) { Cx [k] = Tx [k] ; Cz [k] = Tz [k] ; } } /* ---------------------------------------------------------------------- */ /* return the result */ /* ---------------------------------------------------------------------- */ ASSERT (CHOLMOD(dump_triplet) (C, "C triplet copy", Common)) ; return (C) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_band.c0000664000175000017500000002332014224052371020317 00000000000000/* ========================================================================== */ /* === Core/cholmod_band ==================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* C = tril (triu (A,k1), k2) * * C is a matrix consisting of the diagonals of A from k1 to k2. * * k=0 is the main diagonal of A, k=1 is the superdiagonal, k=-1 is the * subdiagonal, and so on. If A is m-by-n, then: * * k1=-m C = tril (A,k2) * k2=n C = triu (A,k1) * k1=0 and k2=0 C = diag(A), except C is a matrix, not a vector * * Values of k1 and k2 less than -m are treated as -m, and values greater * than n are treated as n. * * A can be of any symmetry (upper, lower, or unsymmetric); C is returned in * the same form, and packed. If A->stype > 0, entries in the lower * triangular part of A are ignored, and the opposite is true if * A->stype < 0. If A has sorted columns, then so does C. * C has the same size as A. * * If inplace is TRUE, then the matrix A is modified in place. * Only packed matrices can be converted in place. * * C can be returned as a numerical valued matrix (if A has numerical values * and mode > 0), as a pattern-only (mode == 0), or as a pattern-only but with * the diagonal entries removed (mode < 0). * * workspace: none * * A can have an xtype of pattern or real. Complex and zomplex cases supported * only if mode <= 0 (in which case the numerical values are ignored). */ #include "cholmod_internal.h" #include "cholmod_core.h" static cholmod_sparse *band /* returns C, or NULL if failure */ ( /* ---- input or in/out if inplace is TRUE --- */ cholmod_sparse *A, /* ---- input ---- */ SuiteSparse_long k1, /* ignore entries below the k1-st diagonal */ SuiteSparse_long k2, /* ignore entries above the k2-nd diagonal */ int mode, /* >0: numerical, 0: pattern, <0: pattern (no diagonal) */ int inplace, /* if TRUE, then convert A in place */ /* --------------- */ cholmod_common *Common ) { double *Ax, *Cx ; Int packed, nz, j, p, pend, i, ncol, nrow, jlo, jhi, ilo, ihi, sorted, values, diag ; Int *Ap, *Anz, *Ai, *Cp, *Ci ; cholmod_sparse *C ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; values = (mode > 0) && (A->xtype != CHOLMOD_PATTERN) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; packed = A->packed ; diag = (mode >= 0) ; if (inplace && !packed) { /* cannot operate on an unpacked matrix in place */ ERROR (CHOLMOD_INVALID, "cannot operate on unpacked matrix in-place") ; return (NULL) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ PRINT1 (("k1 %ld k2 %ld\n", k1, k2)) ; Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; sorted = A->sorted ; if (A->stype > 0) { /* ignore any entries in strictly lower triangular part of A */ k1 = MAX (k1, 0) ; } if (A->stype < 0) { /* ignore any entries in strictly upper triangular part of A */ k2 = MIN (k2, 0) ; } ncol = A->ncol ; nrow = A->nrow ; /* ensure k1 and k2 are in the range -nrow to +ncol to * avoid possible integer overflow if k1 and k2 are huge */ k1 = MAX (-nrow, k1) ; k1 = MIN (k1, ncol) ; k2 = MAX (-nrow, k2) ; k2 = MIN (k2, ncol) ; /* consider columns jlo to jhi. columns outside this range are empty */ jlo = MAX (k1, 0) ; jhi = MIN (k2+nrow, ncol) ; if (k1 > k2) { /* nothing to do */ jlo = ncol ; jhi = ncol ; } /* ---------------------------------------------------------------------- */ /* allocate C, or operate on A in place */ /* ---------------------------------------------------------------------- */ if (inplace) { /* convert A in place */ C = A ; } else { /* count the number of entries in the result C */ nz = 0 ; if (sorted) { for (j = jlo ; j < jhi ; j++) { ilo = j-k2 ; ihi = j-k1 ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i > ihi) { break ; } if (i >= ilo && (diag || i != j)) { nz++ ; } } } } else { for (j = jlo ; j < jhi ; j++) { ilo = j-k2 ; ihi = j-k1 ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i >= ilo && i <= ihi && (diag || i != j)) { nz++ ; } } } } /* allocate C; A will not be modified. C is sorted if A is sorted */ C = CHOLMOD(allocate_sparse) (A->nrow, ncol, nz, sorted, TRUE, A->stype, values ? A->xtype : CHOLMOD_PATTERN, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } } Cp = C->p ; Ci = C->i ; Cx = C->x ; /* ---------------------------------------------------------------------- */ /* construct C */ /* ---------------------------------------------------------------------- */ /* columns 0 to jlo-1 are empty */ for (j = 0 ; j < jlo ; j++) { Cp [j] = 0 ; } nz = 0 ; if (sorted) { if (values) { /* pattern and values */ ASSERT (diag) ; for (j = jlo ; j < jhi ; j++) { ilo = j-k2 ; ihi = j-k1 ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; Cp [j] = nz ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i > ihi) { break ; } if (i >= ilo) { Ci [nz] = i ; Cx [nz] = Ax [p] ; nz++ ; } } } } else { /* pattern only, perhaps with no diagonal */ for (j = jlo ; j < jhi ; j++) { ilo = j-k2 ; ihi = j-k1 ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; Cp [j] = nz ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i > ihi) { break ; } if (i >= ilo && (diag || i != j)) { Ci [nz++] = i ; } } } } } else { if (values) { /* pattern and values */ ASSERT (diag) ; for (j = jlo ; j < jhi ; j++) { ilo = j-k2 ; ihi = j-k1 ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; Cp [j] = nz ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i >= ilo && i <= ihi) { Ci [nz] = i ; Cx [nz] = Ax [p] ; nz++ ; } } } } else { /* pattern only, perhaps with no diagonal */ for (j = jlo ; j < jhi ; j++) { ilo = j-k2 ; ihi = j-k1 ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; Cp [j] = nz ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i >= ilo && i <= ihi && (diag || i != j)) { Ci [nz++] = i ; } } } } } /* columns jhi to ncol-1 are empty */ for (j = jhi ; j <= ncol ; j++) { Cp [j] = nz ; } /* ---------------------------------------------------------------------- */ /* reduce A in size if done in place */ /* ---------------------------------------------------------------------- */ if (inplace) { /* free the unused parts of A, and reduce A->i and A->x in size */ ASSERT (MAX (1,nz) <= A->nzmax) ; CHOLMOD(reallocate_sparse) (nz, A, Common) ; ASSERT (Common->status >= CHOLMOD_OK) ; } /* ---------------------------------------------------------------------- */ /* return the result C */ /* ---------------------------------------------------------------------- */ DEBUG (i = CHOLMOD(dump_sparse) (C, "band", Common)) ; ASSERT (IMPLIES (mode < 0, i == 0)) ; return (C) ; } /* ========================================================================== */ /* === cholmod_band ========================================================= */ /* ========================================================================== */ cholmod_sparse *CHOLMOD(band) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to extract band matrix from */ SuiteSparse_long k1, /* ignore entries below the k1-st diagonal */ SuiteSparse_long k2, /* ignore entries above the k2-nd diagonal */ int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ /* --------------- */ cholmod_common *Common ) { return (band (A, k1, k2, mode, FALSE, Common)) ; } /* ========================================================================== */ /* === cholmod_band_inplace ================================================= */ /* ========================================================================== */ int CHOLMOD(band_inplace) ( /* ---- input ---- */ SuiteSparse_long k1, /* ignore entries below the k1-st diagonal */ SuiteSparse_long k2, /* ignore entries above the k2-nd diagonal */ int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ /* ---- in/out --- */ cholmod_sparse *A, /* matrix from which entries not in band are removed */ /* --------------- */ cholmod_common *Common ) { return (band (A, k1, k2, mode, TRUE, Common) != NULL) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_error.c0000664000175000017500000000704014224052371020545 00000000000000/* ========================================================================== */ /* === Core/cholmod_error =================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* CHOLMOD error-handling routine. */ #include "cholmod_internal.h" #include "cholmod_core.h" /* ========================================================================== */ /* ==== cholmod_error ======================================================= */ /* ========================================================================== */ /* An error has occurred. Set the status, optionally print an error message, * and call the user error-handling routine (if it exists). If * Common->try_catch is TRUE, then CHOLMOD is inside a try/catch block. * The status is set, but no message is printed and the user error handler * is not called. This is not (yet) an error, since CHOLMOD may recover. * * In the current version, this try/catch mechanism is used internally only in * cholmod_analyze, which tries multiple ordering methods and picks the best * one. If one or more ordering method fails, it keeps going. Only one * ordering needs to succeed for cholmod_analyze to succeed. */ int CHOLMOD(error) ( /* ---- input ---- */ int status, /* error status */ const char *file, /* name of source code file where error occured */ int line, /* line number in source code file where error occured*/ const char *message, /* error message */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->status = status ; if (!(Common->try_catch)) { #ifndef NPRINT /* print a warning or error message */ if (SuiteSparse_config.printf_func != NULL) { if (status > 0 && Common->print > 1) { SuiteSparse_config.printf_func ("CHOLMOD warning:") ; if (message != NULL) { SuiteSparse_config.printf_func (" %s.", message) ; } if (file != NULL) { SuiteSparse_config.printf_func (" file: %s", file) ; SuiteSparse_config.printf_func (" line: %d", line) ; } SuiteSparse_config.printf_func ("\n") ; fflush (stdout) ; fflush (stderr) ; } else if (Common->print > 0) { SuiteSparse_config.printf_func ("CHOLMOD error:") ; if (message != NULL) { SuiteSparse_config.printf_func (" %s.", message) ; } if (file != NULL) { SuiteSparse_config.printf_func (" file: %s", file) ; SuiteSparse_config.printf_func (" line: %d", line) ; } SuiteSparse_config.printf_func ("\n") ; fflush (stdout) ; fflush (stderr) ; } } #endif /* call the user error handler, if it exists */ if (Common->error_handler != NULL) { Common->error_handler (status, file, line, message) ; } } return (TRUE) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_change_factor.c0000664000175000017500000011335514224052371022206 00000000000000/* ========================================================================== */ /* === Core/cholmod_change_factor =========================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Change the numeric/symbolic, LL/LDL, simplicial/super, packed/unpacked, * monotonic/non-monotonic status of a cholmod_factor object. * * There are four basic classes of factor types: * * (1) simplicial symbolic: Consists of two size-n arrays: the fill-reducing * permutation (L->Perm) and the nonzero count for each column of L * (L->ColCount). All other factor types also include this information. * L->ColCount may be exact (obtained from the analysis routines), or * it may be a guess. During factorization, and certainly after update/ * downdate, the columns of L can have a different number of nonzeros. * L->ColCount is used to allocate space. L->ColCount is exact for the * supernodal factorizations. The nonzero pattern of L is not kept. * * (2) simplicial numeric: These represent L in a compressed column form. The * variants of this type are: * * LDL': L is unit diagonal. Row indices in column j are located in * L->i [L->p [j] ... L->p [j] + L->nz [j]], and corresponding numeric * values are in the same locations in L->x. The total number of * entries is the sum of L->nz [j]. The unit diagonal is not stored; * D is stored on the diagonal of L instead. L->p may or may not be * monotonic. The order of storage of the columns in L->i and L->x is * given by a doubly-linked list (L->prev and L->next). L->p is of * size n+1, but only the first n entries are used (it is used if L * is converted to a sparse matrix via cholmod_factor_to_sparse). * * For the complex case, L->x is stored interleaved with real/imag * parts, and is of size 2*lnz*sizeof(double). For the zomplex case, * L->x is of size lnz*sizeof(double) and holds the real part; L->z * is the same size and holds the imaginary part. * * LL': This is identical to the LDL' form, except that the non-unit * diagonal of L is stored as the first entry in each column of L. * * (3) supernodal symbolic: A representation of the nonzero pattern of the * supernodes for a supernodal factorization. There are L->nsuper * supernodes. Columns L->super [k] to L->super [k+1]-1 are in the kth * supernode. The row indices for the kth supernode are in * L->s [L->pi [k] ... L->pi [k+1]-1]. The numerical values are not * allocated (L->x), but when they are they will be located in * L->x [L->px [k] ... L->px [k+1]-1], and the L->px array is defined * in this factor type. * * For the complex case, L->x is stored interleaved with real/imag parts, * and is of size 2*L->xsize*sizeof(double). The zomplex supernodal case * is not supported, since it is not compatible with LAPACK and the BLAS. * * (4) supernodal numeric: Always an LL' factorization. L is non-unit * diagonal. L->x contains the numerical values of the supernodes, as * described above for the supernodal symbolic factor. * For the complex case, L->x is stored interleaved, and is of size * 2*L->xsize*sizeof(double). The zomplex supernodal case is not * supported, since it is not compatible with LAPACK and the BLAS. * * FUTURE WORK: support a supernodal LDL' factor. * * * In all cases, the row indices in each column (L->i for simplicial L and * L->s for supernodal L) are kept sorted from low indices to high indices. * This means the diagonal of L (or D for LDL' factors) is always kept as the * first entry in each column. * * The cholmod_change_factor routine can do almost all possible conversions. * It cannot do the following conversions: * * (1) Simplicial numeric types cannot be converted to a supernodal * symbolic type. This would simultaneously deallocate the * simplicial pattern and numeric values and reallocate uninitialized * space for the supernodal pattern. This isn't useful for the user, * and not needed by CHOLMOD's own routines either. * * (2) Only a symbolic factor (simplicial to supernodal) can be converted * to a supernodal numeric factor. * * Some conversions are meant only to be used internally by other CHOLMOD * routines, and should not be performed by the end user. They allocate space * whose contents are undefined: * * (1) converting from simplicial symbolic to supernodal symbolic. * (2) converting any factor to supernodal numeric. * * workspace: no conversion routine uses workspace in Common. No temporary * workspace is allocated. * * Supports all xtypes, except that there is no supernodal zomplex L. * * The to_xtype parameter is used only when converting from symbolic to numeric * or numeric to symbolic. It cannot be used to convert a numeric xtype (real, * complex, or zomplex) to a different numeric xtype. For that conversion, * use cholmod_factor_xtype instead. */ #include "cholmod_internal.h" #include "cholmod_core.h" static void natural_list (cholmod_factor *L) ; /* ========================================================================== */ /* === TEMPLATE ============================================================= */ /* ========================================================================== */ #define REAL #include "t_cholmod_change_factor.c" #define COMPLEX #include "t_cholmod_change_factor.c" #define ZOMPLEX #include "t_cholmod_change_factor.c" /* ========================================================================== */ /* === L_is_packed ========================================================== */ /* ========================================================================== */ /* Return TRUE if the columns of L are packed, FALSE otherwise. For debugging * only. */ #ifndef NDEBUG static int L_is_packed (cholmod_factor *L, cholmod_common *Common) { Int j ; Int *Lnz = L->nz ; Int *Lp = L->p ; Int n = L->n ; if (L->xtype == CHOLMOD_PATTERN || L->is_super) { return (TRUE) ; } if (Lnz == NULL || Lp == NULL) { return (TRUE) ; } for (j = 0 ; j < n ; j++) { PRINT3 (("j: "ID" Lnz "ID" Lp[j+1] "ID" Lp[j] "ID"\n", j, Lnz [j], Lp [j+1], Lp [j])) ; if (Lnz [j] != (Lp [j+1] - Lp [j])) { PRINT2 (("L is not packed\n")) ; return (FALSE) ; } } return (TRUE) ; } #endif /* ========================================================================== */ /* === natural_list ========================================================= */ /* ========================================================================== */ /* Create a naturally-ordered doubly-linked list of columns. */ static void natural_list (cholmod_factor *L) { Int head, tail, n, j ; Int *Lnext, *Lprev ; Lnext = L->next ; Lprev = L->prev ; ASSERT (Lprev != NULL && Lnext != NULL) ; n = L->n ; head = n+1 ; tail = n ; Lnext [head] = 0 ; Lprev [head] = EMPTY ; Lnext [tail] = EMPTY ; Lprev [tail] = n-1 ; for (j = 0 ; j < n ; j++) { Lnext [j] = j+1 ; Lprev [j] = j-1 ; } Lprev [0] = head ; L->is_monotonic = TRUE ; } /* ========================================================================== */ /* === allocate_simplicial_numeric ========================================== */ /* ========================================================================== */ /* Allocate O(n) arrays for simplicial numeric factorization. Initializes * the link lists only. Does not allocate the L->i, L->x, or L->z arrays. */ static int allocate_simplicial_numeric ( cholmod_factor *L, cholmod_common *Common ) { Int n ; Int *Lp, *Lnz, *Lprev, *Lnext ; size_t n1, n2 ; PRINT1 (("Allocate simplicial\n")) ; ASSERT (L->xtype == CHOLMOD_PATTERN || L->is_super) ; ASSERT (L->p == NULL) ; ASSERT (L->nz == NULL) ; ASSERT (L->prev == NULL) ; ASSERT (L->next == NULL) ; n = L->n ; /* this cannot cause size_t overflow */ n1 = ((size_t) n) + 1 ; n2 = ((size_t) n) + 2 ; Lp = CHOLMOD(malloc) (n1, sizeof (Int), Common) ; Lnz = CHOLMOD(malloc) (n, sizeof (Int), Common) ; Lprev = CHOLMOD(malloc) (n2, sizeof (Int), Common) ; Lnext = CHOLMOD(malloc) (n2, sizeof (Int), Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free) (n1, sizeof (Int), Lp, Common) ; CHOLMOD(free) (n, sizeof (Int), Lnz, Common) ; CHOLMOD(free) (n2, sizeof (Int), Lprev, Common) ; CHOLMOD(free) (n2, sizeof (Int), Lnext, Common) ; PRINT1 (("Allocate simplicial failed\n")) ; return (FALSE) ; /* out of memory */ } /* ============================================== commit the changes to L */ L->p = Lp ; L->nz = Lnz ; L->prev = Lprev ; L->next = Lnext ; /* initialize a doubly linked list for columns in natural order */ natural_list (L) ; PRINT1 (("Allocate simplicial done\n")) ; return (TRUE) ; } /* ========================================================================== */ /* === simplicial_symbolic_to_super_symbolic ================================ */ /* ========================================================================== */ /* Convert a simplicial symbolic factor supernodal symbolic factor. Does not * initialize the new space. */ static int simplicial_symbolic_to_super_symbolic ( cholmod_factor *L, cholmod_common *Common ) { Int nsuper, xsize, ssize ; Int *Lsuper, *Lpi, *Lpx, *Ls ; size_t nsuper1 ; ASSERT (L->xtype == CHOLMOD_PATTERN && !(L->is_super)) ; xsize = L->xsize ; ssize = L->ssize ; nsuper = L->nsuper ; nsuper1 = ((size_t) nsuper) + 1 ; PRINT1 (("simple sym to super sym: ssize "ID" xsize "ID" nsuper "ID"" " status %d\n", ssize, xsize, nsuper, Common->status)) ; /* O(nsuper) arrays, where nsuper <= n */ Lsuper = CHOLMOD(malloc) (nsuper1, sizeof (Int), Common) ; Lpi = CHOLMOD(malloc) (nsuper1, sizeof (Int), Common) ; Lpx = CHOLMOD(malloc) (nsuper1, sizeof (Int), Common) ; /* O(ssize) array, where ssize <= nnz(L), and usually much smaller */ Ls = CHOLMOD(malloc) (ssize, sizeof (Int), Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free) (nsuper1, sizeof (Int), Lsuper, Common) ; CHOLMOD(free) (nsuper1, sizeof (Int), Lpi, Common) ; CHOLMOD(free) (nsuper1, sizeof (Int), Lpx, Common) ; CHOLMOD(free) (ssize, sizeof (Int), Ls, Common) ; return (FALSE) ; /* out of memory */ } /* ============================================== commit the changes to L */ ASSERT (Lsuper != NULL && Lpi != NULL && Lpx != NULL && Ls != NULL) ; L->maxcsize = 0 ; L->maxesize = 0 ; L->super = Lsuper ; L->pi = Lpi ; L->px = Lpx ; L->s = Ls ; Ls [0] = EMPTY ; /* supernodal pattern undefined */ L->is_super = TRUE ; L->is_ll = TRUE ; /* supernodal LDL' not supported */ L->xtype = CHOLMOD_PATTERN ; L->dtype = DTYPE ; L->minor = L->n ; return (TRUE) ; } /* ========================================================================== */ /* === any_to_simplicial_symbolic =========================================== */ /* ========================================================================== */ /* Convert any factor L to a simplicial symbolic factor, leaving only L->Perm * and L->ColCount. Cannot fail. Any of the components of L (except Perm and * ColCount) may already be free'd. */ static void any_to_simplicial_symbolic ( cholmod_factor *L, int to_ll, cholmod_common *Common ) { Int n, lnz, xs, ss, s, e ; size_t n1, n2 ; /* ============================================== commit the changes to L */ n = L->n ; lnz = L->nzmax ; s = L->nsuper + 1 ; xs = (L->is_super) ? ((Int) (L->xsize)) : (lnz) ; e = (L->xtype == CHOLMOD_COMPLEX ? 2 : 1) ; ss = L->ssize ; /* this cannot cause size_t overflow */ n1 = ((size_t) n) + 1 ; n2 = ((size_t) n) + 2 ; /* free all but the symbolic analysis (Perm and ColCount) */ L->p = CHOLMOD(free) (n1, sizeof (Int), L->p, Common) ; L->i = CHOLMOD(free) (lnz, sizeof (Int), L->i, Common) ; L->x = CHOLMOD(free) (xs, e*sizeof (double), L->x, Common) ; L->z = CHOLMOD(free) (lnz, sizeof (double), L->z, Common) ; L->nz = CHOLMOD(free) (n, sizeof (Int), L->nz, Common) ; L->next = CHOLMOD(free) (n2, sizeof (Int), L->next, Common) ; L->prev = CHOLMOD(free) (n2, sizeof (Int), L->prev, Common) ; L->super = CHOLMOD(free) (s, sizeof (Int), L->super, Common) ; L->pi = CHOLMOD(free) (s, sizeof (Int), L->pi, Common) ; L->px = CHOLMOD(free) (s, sizeof (Int), L->px, Common) ; L->s = CHOLMOD(free) (ss, sizeof (Int), L->s, Common) ; L->nzmax = 0 ; L->is_super = FALSE ; L->xtype = CHOLMOD_PATTERN ; L->dtype = DTYPE ; L->minor = n ; L->is_ll = to_ll ; } /* ========================================================================== */ /* === ll_super_to_super_symbolic =========================================== */ /* ========================================================================== */ /* Convert a numerical supernodal L to symbolic supernodal. Cannot fail. */ static void ll_super_to_super_symbolic ( cholmod_factor *L, cholmod_common *Common ) { /* ============================================== commit the changes to L */ /* free all but the supernodal numerical factor */ ASSERT (L->xtype != CHOLMOD_PATTERN && L->is_super && L->is_ll) ; DEBUG (CHOLMOD(dump_factor) (L, "start to super symbolic", Common)) ; L->x = CHOLMOD(free) (L->xsize, (L->xtype == CHOLMOD_COMPLEX ? 2 : 1) * sizeof (double), L->x, Common) ; L->xtype = CHOLMOD_PATTERN ; L->dtype = DTYPE ; L->minor = L->n ; L->is_ll = TRUE ; /* supernodal LDL' not supported */ DEBUG (CHOLMOD(dump_factor) (L, "done to super symbolic", Common)) ; } /* ========================================================================== */ /* === simplicial_symbolic_to_simplicial_numeric ============================ */ /* ========================================================================== */ /* Convert a simplicial symbolic L to a simplicial numeric L; allocate space * for L using L->ColCount from symbolic analysis, and set L to identity. * * If packed < 0, then this routine is creating a copy of another factor * (via cholmod_copy_factor). In this case, the space is not initialized. */ static void simplicial_symbolic_to_simplicial_numeric ( cholmod_factor *L, int to_ll, int packed, int to_xtype, cholmod_common *Common ) { double grow0, grow1, xlen, xlnz ; double *Lx, *Lz ; Int *Li, *Lp, *Lnz, *ColCount ; Int n, grow, grow2, p, j, lnz, len, ok, e ; ASSERT (L->xtype == CHOLMOD_PATTERN && !(L->is_super)) ; if (!allocate_simplicial_numeric (L, Common)) { PRINT1 (("out of memory, allocate simplicial numeric\n")) ; return ; /* out of memory */ } ASSERT (L->ColCount != NULL && L->nz != NULL && L->p != NULL) ; ASSERT (L->x == NULL && L->z == NULL && L->i == NULL) ; ColCount = L->ColCount ; Lnz = L->nz ; Lp = L->p ; ok = TRUE ; n = L->n ; if (packed < 0) { /* ------------------------------------------------------------------ */ /* used by cholmod_copy_factor to allocate a copy of a factor object */ /* ------------------------------------------------------------------ */ lnz = L->nzmax ; L->nzmax = 0 ; } else if (packed) { /* ------------------------------------------------------------------ */ /* LDL' or LL' packed */ /* ------------------------------------------------------------------ */ PRINT1 (("convert to packed LL' or LDL'\n")) ; lnz = 0 ; for (j = 0 ; ok && j < n ; j++) { /* ensure len is in the range 1 to n-j */ len = ColCount [j] ; len = MAX (1, len) ; len = MIN (len, n-j) ; lnz += len ; ok = (lnz >= 0) ; } for (j = 0 ; j <= n ; j++) { Lp [j] = j ; } for (j = 0 ; j < n ; j++) { Lnz [j] = 1 ; } } else { /* ------------------------------------------------------------------ */ /* LDL' unpacked */ /* ------------------------------------------------------------------ */ PRINT1 (("convert to unpacked\n")) ; /* compute new lnzmax */ /* if any parameter is NaN, grow is false */ grow0 = Common->grow0 ; grow1 = Common->grow1 ; grow2 = Common->grow2 ; grow0 = IS_NAN (grow0) ? 1 : grow0 ; grow1 = IS_NAN (grow1) ? 1 : grow1 ; /* fl.pt. compare, but no NaN's: */ grow = (grow0 >= 1.0) && (grow1 >= 1.0) && (grow2 > 0) ; PRINT1 (("init, grow1 %g grow2 "ID"\n", grow1, grow2)) ; /* initialize Lp and Lnz for each column */ lnz = 0 ; for (j = 0 ; ok && j < n ; j++) { Lp [j] = lnz ; Lnz [j] = 1 ; /* ensure len is in the range 1 to n-j */ len = ColCount [j] ; len = MAX (1, len) ; len = MIN (len, n-j) ; /* compute len in double to avoid integer overflow */ PRINT1 (("ColCount ["ID"] = "ID"\n", j, len)) ; if (grow) { xlen = (double) len ; xlen = grow1 * xlen + grow2 ; xlen = MIN (xlen, n-j) ; len = (Int) xlen ; } ASSERT (len >= 1 && len <= n-j) ; lnz += len ; ok = (lnz >= 0) ; } if (ok) { Lp [n] = lnz ; if (grow) { /* add extra space */ xlnz = (double) lnz ; xlnz *= grow0 ; xlnz = MIN (xlnz, Size_max) ; xlnz = MIN (xlnz, ((double) n * (double) n + (double) n) / 2) ; lnz = (Int) xlnz ; } } } lnz = MAX (1, lnz) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; } /* allocate L->i, L->x, and L->z */ PRINT1 (("resizing from zero size to lnz "ID"\n", lnz)) ; ASSERT (L->nzmax == 0) ; e = (to_xtype == CHOLMOD_COMPLEX ? 2 : 1) ; if (!ok || !CHOLMOD(realloc_multiple) (lnz, 1, to_xtype, &(L->i), NULL, &(L->x), &(L->z), &(L->nzmax), Common)) { L->p = CHOLMOD(free) (n+1, sizeof (Int), L->p, Common) ; L->nz = CHOLMOD(free) (n, sizeof (Int), L->nz, Common) ; L->prev = CHOLMOD(free) (n+2, sizeof (Int), L->prev, Common) ; L->next = CHOLMOD(free) (n+2, sizeof (Int), L->next, Common) ; L->i = CHOLMOD(free) (lnz, sizeof (Int), L->i, Common) ; L->x = CHOLMOD(free) (lnz, e*sizeof (double), L->x, Common) ; L->z = CHOLMOD(free) (lnz, sizeof (double), L->z, Common) ; PRINT1 (("cannot realloc simplicial numeric\n")) ; return ; /* out of memory */ } /* ============================================== commit the changes to L */ /* initialize L to be the identity matrix */ L->xtype = to_xtype ; L->dtype = DTYPE ; L->minor = n ; Li = L->i ; Lx = L->x ; Lz = L->z ; #if 0 if (lnz == 1) { /* the user won't expect to access this entry, but some CHOLMOD * routines may. Set it to zero so that valgrind doesn't complain. */ switch (to_xtype) { case CHOLMOD_REAL: Lx [0] = 0 ; break ; case CHOLMOD_COMPLEX: Lx [0] = 0 ; Lx [1] = 0 ; break ; case CHOLMOD_ZOMPLEX: Lx [0] = 0 ; Lz [0] = 0 ; break ; } } #endif if (packed >= 0) { /* create the unit diagonal for either the LL' or LDL' case */ switch (L->xtype) { case CHOLMOD_REAL: for (j = 0 ; j < n ; j++) { ASSERT (Lp [j] < Lp [j+1]) ; p = Lp [j] ; Li [p] = j ; Lx [p] = 1 ; } break ; case CHOLMOD_COMPLEX: for (j = 0 ; j < n ; j++) { ASSERT (Lp [j] < Lp [j+1]) ; p = Lp [j] ; Li [p] = j ; Lx [2*p ] = 1 ; Lx [2*p+1] = 0 ; } break ; case CHOLMOD_ZOMPLEX: for (j = 0 ; j < n ; j++) { ASSERT (Lp [j] < Lp [j+1]) ; p = Lp [j] ; Li [p] = j ; Lx [p] = 1 ; Lz [p] = 0 ; } break ; } } L->is_ll = to_ll ; PRINT1 (("done convert simplicial symbolic to numeric\n")) ; } /* ========================================================================== */ /* === change_simplicial_numeric ============================================ */ /* ========================================================================== */ /* Change LL' to LDL', LDL' to LL', or leave as-is. * * If to_packed is TRUE, then the columns of L are packed and made monotonic * (to_monotonic is ignored; it is implicitly TRUE). * * If to_monotonic is TRUE but to_packed is FALSE, the columns of L are made * monotonic but not packed. * * If both to_packed and to_monotonic are FALSE, then the columns of L are * left as-is, and the conversion is done in place. * * If L is already monotonic, or if it is to be left non-monotonic, then this * conversion always succeeds. * * When converting an LDL' to LL' factorization, any column with a negative * or zero diagonal entry is not modified so that conversion back to LDL' will * succeed. This can result in a matrix L with a negative entry on the diagonal * If the kth entry on the diagonal of D is negative, it and the kth column of * L are left unchanged. A subsequent conversion back to an LDL' form will also * leave the column unchanged, so the correct LDL' factorization will be * restored. L->minor is set to the smallest k for which D (k,k) is negative. */ static void change_simplicial_numeric ( cholmod_factor *L, int to_ll, int to_packed, int to_monotonic, cholmod_common *Common ) { double grow0, grow1, xlen, xlnz ; void *newLi, *newLx, *newLz ; double *Lx, *Lz ; Int *Lp, *Li, *Lnz ; Int make_monotonic, grow2, n, j, lnz, len, grow, ok, make_ll, make_ldl ; size_t nzmax0 ; PRINT1 (("\n===Change simplicial numeric: %d %d %d\n", to_ll, to_packed, to_monotonic)) ; DEBUG (CHOLMOD(dump_factor) (L, "change simplicial numeric", Common)) ; ASSERT (L->xtype != CHOLMOD_PATTERN && !(L->is_super)) ; make_monotonic = ((to_packed || to_monotonic) && !(L->is_monotonic)) ; make_ll = (to_ll && !(L->is_ll)) ; make_ldl = (!to_ll && L->is_ll) ; n = L->n ; Lp = L->p ; Li = L->i ; Lx = L->x ; Lz = L->z ; Lnz = L->nz ; grow = FALSE ; grow0 = Common->grow0 ; grow1 = Common->grow1 ; grow2 = Common->grow2 ; grow0 = IS_NAN (grow0) ? 1 : grow0 ; grow1 = IS_NAN (grow1) ? 1 : grow1 ; ok = TRUE ; newLi = NULL ; newLx = NULL ; newLz = NULL ; lnz = 0 ; if (make_monotonic) { /* ------------------------------------------------------------------ */ /* Columns out of order, but will be reordered and optionally packed. */ /* ------------------------------------------------------------------ */ PRINT1 (("L is non-monotonic\n")) ; /* compute new L->nzmax */ if (!to_packed) { /* if any parameter is NaN, grow is false */ /* fl.pt. comparisons below are false if any parameter is NaN */ grow = (grow0 >= 1.0) && (grow1 >= 1.0) && (grow2 > 0) ; } for (j = 0 ; ok && j < n ; j++) { len = Lnz [j] ; ASSERT (len >= 1 && len <= n-j) ; /* compute len in double to avoid integer overflow */ if (grow) { xlen = (double) len ; xlen = grow1 * xlen + grow2 ; xlen = MIN (xlen, n-j) ; len = (Int) xlen ; } ASSERT (len >= Lnz [j] && len <= n-j) ; PRINT2 (("j: "ID" Lnz[j] "ID" len "ID" p "ID"\n", j, Lnz [j], len, lnz)) ; lnz += len ; ok = (lnz >= 0) ; } if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return ; } if (grow) { xlnz = (double) lnz ; xlnz *= grow0 ; xlnz = MIN (xlnz, Size_max) ; xlnz = MIN (xlnz, ((double) n * (double) n + (double) n) / 2) ; lnz = (Int) xlnz ; } lnz = MAX (1, lnz) ; PRINT1 (("final lnz "ID"\n", lnz)) ; nzmax0 = 0 ; CHOLMOD(realloc_multiple) (lnz, 1, L->xtype, &newLi, NULL, &newLx, &newLz, &nzmax0, Common) ; if (Common->status < CHOLMOD_OK) { return ; /* out of memory */ } } /* ============================================== commit the changes to L */ /* ---------------------------------------------------------------------- */ /* convert the simplicial L, using template routine */ /* ---------------------------------------------------------------------- */ switch (L->xtype) { case CHOLMOD_REAL: r_change_simplicial_numeric (L, to_ll, to_packed, newLi, newLx, newLz, lnz, grow, grow1, grow2, make_ll, make_monotonic, make_ldl, Common) ; break ; case CHOLMOD_COMPLEX: c_change_simplicial_numeric (L, to_ll, to_packed, newLi, newLx, newLz, lnz, grow, grow1, grow2, make_ll, make_monotonic, make_ldl, Common) ; break ; case CHOLMOD_ZOMPLEX: z_change_simplicial_numeric (L, to_ll, to_packed, newLi, newLx, newLz, lnz, grow, grow1, grow2, make_ll, make_monotonic, make_ldl, Common) ; break ; } DEBUG (CHOLMOD(dump_factor) (L, "L simplicial changed", Common)) ; } /* ========================================================================== */ /* === ll_super_to_simplicial_numeric ======================================= */ /* ========================================================================== */ /* Convert a supernodal numeric factorization to any simplicial numeric one. * Leaves L->xtype unchanged (real or complex, not zomplex since there is * no supernodal zomplex L). */ static void ll_super_to_simplicial_numeric ( cholmod_factor *L, int to_packed, int to_ll, cholmod_common *Common ) { Int *Ls, *Lpi, *Lpx, *Super, *Li ; Int n, lnz, s, nsuper, psi, psend, nsrow, nscol, k1, k2, erows ; DEBUG (CHOLMOD(dump_factor) (L, "start LL super to simplicial", Common)) ; PRINT1 (("super -> simplicial (%d %d)\n", to_packed, to_ll)) ; ASSERT (L->xtype != CHOLMOD_PATTERN && L->is_ll && L->is_super) ; ASSERT (L->x != NULL && L->i == NULL) ; n = L->n ; nsuper = L->nsuper ; Lpi = L->pi ; Lpx = L->px ; Ls = L->s ; Super = L->super ; /* Int overflow cannot occur since supernodal L already exists */ if (to_packed) { /* count the number of nonzeros in L. Each supernode is of the form * * l . . . For this example, nscol = 4 (# columns). nsrow = 9. * l l . . The "." entries are allocated in the supernodal * l l l . factor, but not used. They are not copied to the * l l l l simplicial factor. Some "l" and "e" entries may be * e e e e numerically zero and even symbolically zero if a * e e e e tight simplicial factorization or resymbol were * e e e e done, because of numerical cancellation and relaxed * e e e e supernode amalgamation, respectively. * e e e e */ lnz = 0 ; for (s = 0 ; s < nsuper ; s++) { k1 = Super [s] ; k2 = Super [s+1] ; psi = Lpi [s] ; psend = Lpi [s+1] ; nsrow = psend - psi ; nscol = k2 - k1 ; ASSERT (nsrow >= nscol) ; erows = nsrow - nscol ; /* lower triangular part, including the diagonal, * counting the "l" terms in the figure above. */ lnz += nscol * (nscol+1) / 2 ; /* rectangular part, below the diagonal block (the "e" terms) */ lnz += nscol * erows ; } ASSERT (lnz <= (Int) (L->xsize)) ; } else { /* Li will be the same size as Lx */ lnz = L->xsize ; } ASSERT (lnz >= 0) ; PRINT1 (("simplicial lnz = "ID" to_packed: %d to_ll: %d L->xsize %g\n", lnz, to_ll, to_packed, (double) L->xsize)) ; Li = CHOLMOD(malloc) (lnz, sizeof (Int), Common) ; if (Common->status < CHOLMOD_OK) { return ; /* out of memory */ } if (!allocate_simplicial_numeric (L, Common)) { CHOLMOD(free) (lnz, sizeof (Int), Li, Common) ; return ; /* out of memory */ } /* ============================================== commit the changes to L */ L->i = Li ; L->nzmax = lnz ; /* ---------------------------------------------------------------------- */ /* convert the supernodal L, using template routine */ /* ---------------------------------------------------------------------- */ switch (L->xtype) { case CHOLMOD_REAL: r_ll_super_to_simplicial_numeric (L, to_packed, to_ll, Common) ; break ; case CHOLMOD_COMPLEX: c_ll_super_to_simplicial_numeric (L, to_packed, to_ll, Common) ; break ; } /* ---------------------------------------------------------------------- */ /* free unused parts of L */ /* ---------------------------------------------------------------------- */ L->super = CHOLMOD(free) (nsuper+1, sizeof (Int), L->super, Common) ; L->pi = CHOLMOD(free) (nsuper+1, sizeof (Int), L->pi, Common) ; L->px = CHOLMOD(free) (nsuper+1, sizeof (Int), L->px, Common) ; L->s = CHOLMOD(free) (L->ssize, sizeof (Int), L->s, Common) ; L->ssize = 0 ; L->xsize = 0 ; L->nsuper = 0 ; L->maxesize = 0 ; L->maxcsize = 0 ; L->is_super = FALSE ; DEBUG (CHOLMOD(dump_factor) (L, "done LL super to simplicial", Common)) ; } /* ========================================================================== */ /* === super_symbolic_to_ll_super =========================================== */ /* ========================================================================== */ /* Convert a supernodal symbolic factorization to a supernodal numeric * factorization by allocating L->x. Contents of L->x are undefined. */ static int super_symbolic_to_ll_super ( int to_xtype, cholmod_factor *L, cholmod_common *Common ) { double *Lx ; Int wentry = (to_xtype == CHOLMOD_REAL) ? 1 : 2 ; PRINT1 (("convert super sym to num\n")) ; ASSERT (L->xtype == CHOLMOD_PATTERN && L->is_super) ; Lx = CHOLMOD(malloc) (L->xsize, wentry * sizeof (double), Common) ; PRINT1 (("xsize %g\n", (double) L->xsize)) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; /* out of memory */ } /* ============================================== commit the changes to L */ if (L->xsize == 1) { /* the caller won't expect to access this entry, but some CHOLMOD * routines may. Set it to zero so that valgrind doesn't complain. */ switch (to_xtype) { case CHOLMOD_REAL: Lx [0] = 0 ; break ; case CHOLMOD_COMPLEX: Lx [0] = 0 ; Lx [1] = 0 ; break ; } } L->x = Lx ; L->xtype = to_xtype ; L->dtype = DTYPE ; L->minor = L->n ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_change_factor ================================================ */ /* ========================================================================== */ /* Convert a factor L. Some conversions simply allocate uninitialized space * that meant to be filled later. * * If the conversion fails, the factor is left in its original form, with one * exception. Converting a supernodal symbolic factor to a simplicial numeric * one (with L=D=I) may leave the factor in simplicial symbolic form. * * Memory allocated for each conversion is listed below. */ int CHOLMOD(change_factor) ( /* ---- input ---- */ int to_xtype, /* convert to CHOLMOD_PATTERN, _REAL, _COMPLEX, or * _ZOMPLEX */ int to_ll, /* TRUE: convert to LL', FALSE: LDL' */ int to_super, /* TRUE: convert to supernodal, FALSE: simplicial */ int to_packed, /* TRUE: pack simplicial columns, FALSE: do not pack */ int to_monotonic, /* TRUE: put simplicial columns in order, FALSE: not */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) { /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; if (to_xtype < CHOLMOD_PATTERN || to_xtype > CHOLMOD_ZOMPLEX) { ERROR (CHOLMOD_INVALID, "xtype invalid") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; PRINT1 (("-----convert from (%d,%d,%d,%d,%d) to (%d,%d,%d,%d,%d)\n", L->xtype, L->is_ll, L->is_super, L_is_packed (L, Common), L->is_monotonic, to_xtype, to_ll, to_super, to_packed, to_monotonic)) ; /* ensure all parameters are TRUE/FALSE */ to_ll = BOOLEAN (to_ll) ; to_super = BOOLEAN (to_super) ; ASSERT (BOOLEAN (L->is_ll) == L->is_ll) ; ASSERT (BOOLEAN (L->is_super) == L->is_super) ; if (to_super && to_xtype == CHOLMOD_ZOMPLEX) { ERROR (CHOLMOD_INVALID, "supernodal zomplex L not supported") ; return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* convert */ /* ---------------------------------------------------------------------- */ if (to_xtype == CHOLMOD_PATTERN) { /* ------------------------------------------------------------------ */ /* convert to symbolic */ /* ------------------------------------------------------------------ */ if (!to_super) { /* -------------------------------------------------------------- */ /* convert any factor into a simplicial symbolic factor */ /* -------------------------------------------------------------- */ any_to_simplicial_symbolic (L, to_ll, Common) ; /* cannot fail */ } else { /* -------------------------------------------------------------- */ /* convert to a supernodal symbolic factor */ /* -------------------------------------------------------------- */ if (L->xtype != CHOLMOD_PATTERN && L->is_super) { /* convert from supernodal numeric to supernodal symbolic. * this preserves symbolic pattern of L, discards numeric * values */ ll_super_to_super_symbolic (L, Common) ; /* cannot fail */ } else if (L->xtype == CHOLMOD_PATTERN && !(L->is_super)) { /* convert from simplicial symbolic to supernodal symbolic. * contents of supernodal pattern are uninitialized. Not meant * for the end user. */ simplicial_symbolic_to_super_symbolic (L, Common) ; } else { /* cannot convert from simplicial numeric to supernodal * symbolic */ ERROR (CHOLMOD_INVALID, "cannot convert L to supernodal symbolic") ; } } } else { /* ------------------------------------------------------------------ */ /* convert to numeric */ /* ------------------------------------------------------------------ */ if (to_super) { /* -------------------------------------------------------------- */ /* convert to supernodal numeric factor */ /* -------------------------------------------------------------- */ if (L->xtype == CHOLMOD_PATTERN) { if (L->is_super) { /* Convert supernodal symbolic to supernodal numeric. * Contents of supernodal numeric values are uninitialized. * This is used by cholmod_super_numeric. Not meant for * the end user. */ super_symbolic_to_ll_super (to_xtype, L, Common) ; } else { /* Convert simplicial symbolic to supernodal numeric. * Contents not defined. This is used by * Core/cholmod_copy_factor only. Not meant for the end * user. */ if (!simplicial_symbolic_to_super_symbolic (L, Common)) { /* failure, convert back to simplicial symbolic */ any_to_simplicial_symbolic (L, to_ll, Common) ; } else { /* conversion to super symbolic OK, allocate numeric * part */ super_symbolic_to_ll_super (to_xtype, L, Common) ; } } } else { /* nothing to do if L is already in supernodal numeric form */ if (!(L->is_super)) { ERROR (CHOLMOD_INVALID, "cannot convert simplicial L to supernodal") ; } /* FUTURE WORK: convert to/from supernodal LL' and LDL' */ } } else { /* -------------------------------------------------------------- */ /* convert any factor to simplicial numeric */ /* -------------------------------------------------------------- */ if (L->xtype == CHOLMOD_PATTERN && !(L->is_super)) { /* ---------------------------------------------------------- */ /* convert simplicial symbolic to simplicial numeric (L=I,D=I)*/ /* ---------------------------------------------------------- */ simplicial_symbolic_to_simplicial_numeric (L, to_ll, to_packed, to_xtype, Common) ; } else if (L->xtype != CHOLMOD_PATTERN && L->is_super) { /* ---------------------------------------------------------- */ /* convert a supernodal LL' to simplicial numeric */ /* ---------------------------------------------------------- */ ll_super_to_simplicial_numeric (L, to_packed, to_ll, Common) ; } else if (L->xtype == CHOLMOD_PATTERN && L->is_super) { /* ---------------------------------------------------------- */ /* convert a supernodal symbolic to simplicial numeric (L=D=I)*/ /* ---------------------------------------------------------- */ any_to_simplicial_symbolic (L, to_ll, Common) ; /* if the following fails, it leaves the factor in simplicial * symbolic form */ simplicial_symbolic_to_simplicial_numeric (L, to_ll, to_packed, to_xtype, Common) ; } else { /* ---------------------------------------------------------- */ /* change a simplicial numeric factor */ /* ---------------------------------------------------------- */ /* change LL' to LDL', LDL' to LL', or leave as-is. pack the * columns of L, or leave as-is. Ensure the columns are * monotonic, or leave as-is. */ change_simplicial_numeric (L, to_ll, to_packed, to_monotonic, Common) ; } } } /* ---------------------------------------------------------------------- */ /* return result */ /* ---------------------------------------------------------------------- */ return (Common->status >= CHOLMOD_OK) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_factor.c0000664000175000017500000006554414224052371020707 00000000000000/* ========================================================================== */ /* === Core/cholmod_factor ================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2013, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Core utility routines for the cholmod_factor object: * * The data structure for an LL' or LDL' factorization is too complex to * describe in one sentence. This object can hold the symbolic analysis alone, * or in combination with a "simplicial" (similar to a sparse matrix) or * "supernodal" form of the numerical factorization. Only the routine to free * a factor is primary, since a factor object is created by the factorization * routine (cholmod_factorize). It must be freed with cholmod_free_factor. * * Primary routine: * ---------------- * cholmod_free_factor free a factor * * Secondary routines: * ------------------- * cholmod_allocate_factor allocate a symbolic factor (LL' or LDL') * cholmod_reallocate_factor change the # entries in a factor * cholmod_change_factor change the type of factor (e.g., LDL' to LL') * cholmod_pack_factor pack the columns of a factor * cholmod_reallocate_column resize a single column of a factor * cholmod_factor_to_sparse create a sparse matrix copy of a factor * cholmod_copy_factor create a copy of a factor * * Note that there is no cholmod_sparse_to_factor routine to create a factor * as a copy of a sparse matrix. It could be done, after a fashion, but a * lower triangular sparse matrix would not necessarily have a chordal graph, * which would break the many CHOLMOD routines that rely on this property. * * The cholmod_factor_to_sparse routine is provided so that matrix operations * in the MatrixOps module may be applied to L. Those operations operate on * cholmod_sparse objects, and they are not guaranteed to maintain the chordal * property of L. Such a modified L cannot be safely converted back to a * cholmod_factor object. */ #include "cholmod_internal.h" #include "cholmod_core.h" /* ========================================================================== */ /* === cholmod_allocate_factor ============================================== */ /* ========================================================================== */ /* Allocate a simplicial symbolic factor, with L->Perm and L->ColCount allocated * and initialized to "empty" values (Perm [k] = k, and ColCount[k] = 1). * The integer and numerical parts of L are not allocated. L->xtype is returned * as CHOLMOD_PATTERN and L->is_super are returned as FALSE. L->is_ll is also * returned FALSE, but this may be modified when the matrix is factorized. * * This is sufficient (but far from ideal) for input to cholmod_factorize, * since the simplicial LL' or LDL' factorization (cholmod_rowfac) can * reallocate the columns of L as needed. The primary purpose of this routine * is to allocate space for a symbolic factorization, for the "expert" user to * do his or her own symbolic analysis. The typical user should use * cholmod_analyze instead of this routine. * * workspace: none */ cholmod_factor *CHOLMOD(allocate_factor) ( /* ---- input ---- */ size_t n, /* L is n-by-n */ /* --------------- */ cholmod_common *Common ) { Int j ; Int *Perm, *ColCount ; cholmod_factor *L ; int ok = TRUE ; RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; /* ensure the dimension does not cause integer overflow */ (void) CHOLMOD(add_size_t) (n, 2, &ok) ; if (!ok || n > Int_max) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (NULL) ; } L = CHOLMOD(malloc) (sizeof (cholmod_factor), 1, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } L->n = n ; L->is_ll = FALSE ; L->is_super = FALSE ; L->is_monotonic = TRUE ; L->itype = ITYPE ; L->xtype = CHOLMOD_PATTERN ; L->dtype = DTYPE ; /* allocate the purely symbolic part of L */ L->ordering = CHOLMOD_NATURAL ; L->Perm = CHOLMOD(malloc) (n, sizeof (Int), Common) ; L->IPerm = NULL ; /* only created by cholmod_solve2 when needed */ L->ColCount = CHOLMOD(malloc) (n, sizeof (Int), Common) ; /* simplicial part of L is empty */ L->nzmax = 0 ; L->p = NULL ; L->i = NULL ; L->x = NULL ; L->z = NULL ; L->nz = NULL ; L->next = NULL ; L->prev = NULL ; /* supernodal part of L is also empty */ L->nsuper = 0 ; L->ssize = 0 ; L->xsize = 0 ; L->maxesize = 0 ; L->maxcsize = 0 ; L->super = NULL ; L->pi = NULL ; L->px = NULL ; L->s = NULL ; L->useGPU = 0; /* L has not been factorized */ L->minor = n ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_factor) (&L, Common) ; return (NULL) ; /* out of memory */ } /* initialize Perm and ColCount */ Perm = L->Perm ; for (j = 0 ; j < ((Int) n) ; j++) { Perm [j] = j ; } ColCount = L->ColCount ; for (j = 0 ; j < ((Int) n) ; j++) { ColCount [j] = 1 ; } return (L) ; } /* ========================================================================== */ /* === cholmod_free_factor ================================================== */ /* ========================================================================== */ /* Free a factor object. * * workspace: none */ int CHOLMOD(free_factor) ( /* ---- in/out --- */ cholmod_factor **LHandle, /* factor to free, NULL on output */ /* --------------- */ cholmod_common *Common ) { Int n, lnz, xs, ss, s ; cholmod_factor *L ; RETURN_IF_NULL_COMMON (FALSE) ; if (LHandle == NULL) { /* nothing to do */ return (TRUE) ; } L = *LHandle ; if (L == NULL) { /* nothing to do */ return (TRUE) ; } n = L->n ; lnz = L->nzmax ; s = L->nsuper + 1 ; xs = (L->is_super) ? ((Int) (L->xsize)) : (lnz) ; ss = L->ssize ; /* symbolic part of L */ CHOLMOD(free) (n, sizeof (Int), L->Perm, Common) ; CHOLMOD(free) (n, sizeof (Int), L->IPerm, Common) ; CHOLMOD(free) (n, sizeof (Int), L->ColCount, Common) ; /* simplicial form of L */ CHOLMOD(free) (n+1, sizeof (Int), L->p, Common) ; CHOLMOD(free) (lnz, sizeof (Int), L->i, Common) ; CHOLMOD(free) (n, sizeof (Int), L->nz, Common) ; CHOLMOD(free) (n+2, sizeof (Int), L->next, Common) ; CHOLMOD(free) (n+2, sizeof (Int), L->prev, Common) ; /* supernodal form of L */ CHOLMOD(free) (s, sizeof (Int), L->pi, Common) ; CHOLMOD(free) (s, sizeof (Int), L->px, Common) ; CHOLMOD(free) (s, sizeof (Int), L->super, Common) ; CHOLMOD(free) (ss, sizeof (Int), L->s, Common) ; /* numerical values for both simplicial and supernodal L */ if (L->xtype == CHOLMOD_REAL) { CHOLMOD(free) (xs, sizeof (double), L->x, Common) ; } else if (L->xtype == CHOLMOD_COMPLEX) { CHOLMOD(free) (xs, 2*sizeof (double), L->x, Common) ; } else if (L->xtype == CHOLMOD_ZOMPLEX) { CHOLMOD(free) (xs, sizeof (double), L->x, Common) ; CHOLMOD(free) (xs, sizeof (double), L->z, Common) ; } *LHandle = CHOLMOD(free) (1, sizeof (cholmod_factor), (*LHandle), Common) ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_reallocate_factor ============================================ */ /* ========================================================================== */ /* Change the size of L->i and L->x, or allocate them if their current size * is zero. L must be simplicial. * * workspace: none */ int CHOLMOD(reallocate_factor) ( /* ---- input ---- */ size_t nznew, /* new # of entries in L */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) { /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; PRINT1 (("realloc factor: xtype %d\n", L->xtype)) ; if (L->is_super) { /* L must be simplicial, and not symbolic */ ERROR (CHOLMOD_INVALID, "L invalid") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; PRINT1 (("realloc factor %g to %g\n", (double) L->nzmax, (double) nznew)) ; /* ---------------------------------------------------------------------- */ /* resize (or allocate) the L->i and L->x components of the factor */ /* ---------------------------------------------------------------------- */ CHOLMOD(realloc_multiple) (nznew, 1, L->xtype, &(L->i), NULL, &(L->x), &(L->z), &(L->nzmax), Common) ; return (Common->status == CHOLMOD_OK) ; } /* ========================================================================== */ /* === cholmod_reallocate_column =========================================== */ /* ========================================================================== */ /* Column j needs more space, reallocate it at the end of L->i and L->x. * If the reallocation fails, the factor is converted to a simplicial * symbolic factor (no pattern, just L->Perm and L->ColCount). * * workspace: none */ int CHOLMOD(reallocate_column) ( /* ---- input ---- */ size_t j, /* the column to reallocate */ size_t need, /* required size of column j */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) { double xneed ; double *Lx, *Lz ; Int *Lp, *Lprev, *Lnext, *Li, *Lnz ; Int n, pold, pnew, len, k, tail ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; if (L->is_super) { ERROR (CHOLMOD_INVALID, "L must be simplicial") ; return (FALSE) ; } n = L->n ; if (j >= L->n || need == 0) { ERROR (CHOLMOD_INVALID, "j invalid") ; return (FALSE) ; /* j out of range */ } Common->status = CHOLMOD_OK ; DEBUG (CHOLMOD(dump_factor) (L, "start colrealloc", Common)) ; /* ---------------------------------------------------------------------- */ /* increase the size of L if needed */ /* ---------------------------------------------------------------------- */ /* head = n+1 ; */ tail = n ; Lp = L->p ; Lnz = L->nz ; Lprev = L->prev ; Lnext = L->next ; ASSERT (Lnz != NULL) ; ASSERT (Lnext != NULL && Lprev != NULL) ; PRINT1 (("col %g need %g\n", (double) j, (double) need)) ; /* column j cannot have more than n-j entries if all entries are present */ need = MIN (need, n-j) ; /* compute need in double to avoid integer overflow */ if (Common->grow1 >= 1.0) { xneed = (double) need ; xneed = Common->grow1 * xneed + Common->grow2 ; xneed = MIN (xneed, n-j) ; need = (Int) xneed ; } PRINT1 (("really new need %g current %g\n", (double) need, (double) (Lp [Lnext [j]] - Lp [j]))) ; ASSERT (need >= 1 && need <= n-j) ; if (Lp [Lnext [j]] - Lp [j] >= (Int) need) { /* no need to reallocate the column, it's already big enough */ PRINT1 (("colrealloc: quick return %g %g\n", (double) (Lp [Lnext [j]] - Lp [j]), (double) need)) ; return (TRUE) ; } if (Lp [tail] + need > L->nzmax) { /* use double to avoid integer overflow */ xneed = (double) need ; if (Common->grow0 < 1.2) /* fl. pt. compare, false if NaN */ { /* if grow0 is less than 1.2 or NaN, don't use it */ xneed = 1.2 * (((double) L->nzmax) + xneed + 1) ; } else { xneed = Common->grow0 * (((double) L->nzmax) + xneed + 1) ; } if (xneed > Size_max || !CHOLMOD(reallocate_factor) ((Int) xneed, L, Common)) { /* out of memory, convert to simplicial symbolic */ CHOLMOD(change_factor) (CHOLMOD_PATTERN, L->is_ll, FALSE, TRUE, TRUE, L, Common) ; ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory; L now symbolic") ; return (FALSE) ; /* out of memory */ } PRINT1 (("\n=== GROW L from %g to %g\n", (double) L->nzmax, (double) xneed)) ; /* pack all columns so that each column has at most grow2 free space */ CHOLMOD(pack_factor) (L, Common) ; ASSERT (Common->status == CHOLMOD_OK) ; Common->nrealloc_factor++ ; } /* ---------------------------------------------------------------------- */ /* reallocate the column */ /* ---------------------------------------------------------------------- */ Common->nrealloc_col++ ; Li = L->i ; Lx = L->x ; Lz = L->z ; /* remove j from its current position in the list */ Lnext [Lprev [j]] = Lnext [j] ; Lprev [Lnext [j]] = Lprev [j] ; /* place j at the end of the list */ Lnext [Lprev [tail]] = j ; Lprev [j] = Lprev [tail] ; Lnext [j] = n ; Lprev [tail] = j ; /* L is no longer monotonic; columns are out-of-order */ L->is_monotonic = FALSE ; /* allocate space for column j */ pold = Lp [j] ; pnew = Lp [tail] ; Lp [j] = pnew ; Lp [tail] += need ; /* copy column j to the new space */ len = Lnz [j] ; for (k = 0 ; k < len ; k++) { Li [pnew + k] = Li [pold + k] ; } if (L->xtype == CHOLMOD_REAL) { for (k = 0 ; k < len ; k++) { Lx [pnew + k] = Lx [pold + k] ; } } else if (L->xtype == CHOLMOD_COMPLEX) { for (k = 0 ; k < len ; k++) { Lx [2*(pnew + k) ] = Lx [2*(pold + k) ] ; Lx [2*(pnew + k)+1] = Lx [2*(pold + k)+1] ; } } else if (L->xtype == CHOLMOD_ZOMPLEX) { for (k = 0 ; k < len ; k++) { Lx [pnew + k] = Lx [pold + k] ; Lz [pnew + k] = Lz [pold + k] ; } } DEBUG (CHOLMOD(dump_factor) (L, "colrealloc done", Common)) ; /* successful reallocation of column j of L */ return (TRUE) ; } /* ========================================================================== */ /* === cholmod_pack_factor ================================================== */ /* ========================================================================== */ /* Pack the columns of a simplicial LDL' or LL' factor. This can be followed * by a call to cholmod_reallocate_factor to reduce the size of L to the exact * size required by the factor, if desired. Alternatively, you can leave the * size of L->i and L->x the same, to allow space for future updates/rowadds. * * Each column is reduced in size so that it has at most Common->grow2 free * space at the end of the column. * * Does nothing and returns silently if given any other type of factor. * * Does NOT force the columns of L to be monotonic. It thus differs from * cholmod_change_factor (xtype, -, FALSE, TRUE, TRUE, L, Common), which * packs the columns and ensures that they appear in monotonic order. */ int CHOLMOD(pack_factor) ( /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) { double *Lx, *Lz ; Int *Lp, *Li, *Lnz, *Lnext ; Int pnew, j, k, pold, len, n, head, tail, grow2 ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; Common->status = CHOLMOD_OK ; DEBUG (CHOLMOD(dump_factor) (L, "start pack", Common)) ; PRINT1 (("PACK factor %d\n", L->is_super)) ; if (L->xtype == CHOLMOD_PATTERN || L->is_super) { /* nothing to do unless L is simplicial numeric */ return (TRUE) ; } /* ---------------------------------------------------------------------- */ /* pack */ /* ---------------------------------------------------------------------- */ grow2 = Common->grow2 ; PRINT1 (("\nPACK grow2 "ID"\n", grow2)) ; pnew = 0 ; n = L->n ; Lp = L->p ; Li = L->i ; Lx = L->x ; Lz = L->z ; Lnz = L->nz ; Lnext = L->next ; head = n+1 ; tail = n ; for (j = Lnext [head] ; j != tail ; j = Lnext [j]) { /* pack column j */ pold = Lp [j] ; len = Lnz [j] ; ASSERT (len > 0) ; PRINT2 (("col "ID" pnew "ID" pold "ID"\n", j, pnew, pold)) ; if (pnew < pold) { PRINT2 ((" pack this column\n")) ; for (k = 0 ; k < len ; k++) { Li [pnew + k] = Li [pold + k] ; } if (L->xtype == CHOLMOD_REAL) { for (k = 0 ; k < len ; k++) { Lx [pnew + k] = Lx [pold + k] ; } } else if (L->xtype == CHOLMOD_COMPLEX) { for (k = 0 ; k < len ; k++) { Lx [2*(pnew + k) ] = Lx [2*(pold + k) ] ; Lx [2*(pnew + k)+1] = Lx [2*(pold + k)+1] ; } } else if (L->xtype == CHOLMOD_ZOMPLEX) { for (k = 0 ; k < len ; k++) { Lx [pnew + k] = Lx [pold + k] ; Lz [pnew + k] = Lz [pold + k] ; } } Lp [j] = pnew ; } len = MIN (len + grow2, n - j) ; pnew = MIN (Lp [j] + len, Lp [Lnext [j]]) ; } PRINT2 (("final pnew = "ID"\n", pnew)) ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_factor_to_sparse ============================================= */ /* ========================================================================== */ /* Constructs a column-oriented sparse matrix containing the pattern and values * of a simplicial or supernodal numerical factor, and then converts the factor * into a simplicial symbolic factor. If L is already packed, monotonic, * and simplicial (which is the case when cholmod_factorize uses the simplicial * Cholesky factorization algorithm) then this routine requires only O(1) * memory and takes O(1) time. * * Only operates on numeric factors (real, complex, or zomplex). Does not * change the numeric L->xtype (the resulting sparse matrix has the same xtype * as L). If this routine fails, L is left unmodified. */ cholmod_sparse *CHOLMOD(factor_to_sparse) ( /* ---- in/out --- */ cholmod_factor *L, /* factor to copy, converted to symbolic on output */ /* --------------- */ cholmod_common *Common ) { cholmod_sparse *Lsparse ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (L, NULL) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, NULL) ; Common->status = CHOLMOD_OK ; DEBUG (CHOLMOD(dump_factor) (L, "start convert to matrix", Common)) ; /* ---------------------------------------------------------------------- */ /* convert to packed, monotonic, simplicial, numeric */ /* ---------------------------------------------------------------------- */ /* leave as LL or LDL' */ if (!CHOLMOD(change_factor) (L->xtype, L->is_ll, FALSE, TRUE, TRUE, L, Common)) { ERROR (CHOLMOD_INVALID, "cannot convert L") ; return (NULL) ; } /* ---------------------------------------------------------------------- */ /* create Lsparse */ /* ---------------------------------------------------------------------- */ /* allocate the header for Lsparse, the sparse matrix version of L */ Lsparse = CHOLMOD(malloc) (sizeof (cholmod_sparse), 1, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } /* transfer the contents from L to Lsparse */ Lsparse->nrow = L->n ; Lsparse->ncol = L->n ; Lsparse->p = L->p ; Lsparse->i = L->i ; Lsparse->x = L->x ; Lsparse->z = L->z ; Lsparse->nz = NULL ; Lsparse->stype = 0 ; Lsparse->itype = L->itype ; Lsparse->xtype = L->xtype ; Lsparse->dtype = L->dtype ; Lsparse->sorted = TRUE ; Lsparse->packed = TRUE ; Lsparse->nzmax = L->nzmax ; ASSERT (CHOLMOD(dump_sparse) (Lsparse, "Lsparse", Common) >= 0) ; /* ---------------------------------------------------------------------- */ /* convert L to symbolic, but do not free contents transfered to Lsparse */ /* ---------------------------------------------------------------------- */ L->p = NULL ; L->i = NULL ; L->x = NULL ; L->z = NULL ; L->xtype = CHOLMOD_PATTERN ; CHOLMOD(change_factor) (CHOLMOD_PATTERN, FALSE, FALSE, TRUE, TRUE, L, Common) ; return (Lsparse) ; } /* ========================================================================== */ /* === cholmod_copy_factor ================================================== */ /* ========================================================================== */ /* Create an exact copy of a factor, with one exception: * * Entries in unused space are not copied (they might not be initialized, * and copying them would cause program checkers such as purify and * valgrind to complain). * * Note that a supernodal L cannot be zomplex. */ cholmod_factor *CHOLMOD(copy_factor) ( /* ---- input ---- */ cholmod_factor *L, /* factor to copy */ /* --------------- */ cholmod_common *Common ) { cholmod_factor *L2 ; double *Lx, *L2x, *Lz, *L2z ; Int *Perm, *ColCount, *Lp, *Li, *Lnz, *Lnext, *Lprev, *Lsuper, *Lpi, *Lpx, *Ls, *Perm2, *ColCount2, *L2p, *L2i, *L2nz, *L2next, *L2prev, *L2super, *L2pi, *L2px, *L2s ; Int n, j, p, pend, s, xsize, ssize, nsuper ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (L, NULL) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, NULL) ; Common->status = CHOLMOD_OK ; DEBUG (CHOLMOD(dump_factor) (L, "start copy", Common)) ; n = L->n ; /* ---------------------------------------------------------------------- */ /* allocate a simplicial symbolic factor */ /* ---------------------------------------------------------------------- */ /* allocates L2->Perm and L2->ColCount */ L2 = CHOLMOD(allocate_factor) (n, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } ASSERT (L2->xtype == CHOLMOD_PATTERN && !(L2->is_super)) ; Perm = L->Perm ; ColCount = L->ColCount ; Perm2 = L2->Perm ; ColCount2 = L2->ColCount ; L2->ordering = L->ordering ; for (j = 0 ; j < n ; j++) { Perm2 [j] = Perm [j] ; } for (j = 0 ; j < n ; j++) { ColCount2 [j] = ColCount [j] ; } L2->is_ll = L->is_ll ; /* ---------------------------------------------------------------------- */ /* copy the rest of the factor */ /* ---------------------------------------------------------------------- */ if (L->xtype != CHOLMOD_PATTERN && !(L->super)) { /* ------------------------------------------------------------------ */ /* allocate a simplicial numeric factor */ /* ------------------------------------------------------------------ */ /* allocate L2->p, L2->nz, L2->prev, L2->next, L2->i, and L2->x. * packed = -1 so that cholmod_change_factor allocates space of * size L2->nzmax */ L2->nzmax = L->nzmax ; if (!CHOLMOD(change_factor) (L->xtype, L->is_ll, FALSE, -1, TRUE, L2, Common)) { CHOLMOD(free_factor) (&L2, Common) ; return (NULL) ; /* out of memory */ } ASSERT (MAX (1, L->nzmax) == L2->nzmax) ; /* ------------------------------------------------------------------ */ /* copy the contents of a simplicial numeric factor */ /* ------------------------------------------------------------------ */ Lp = L->p ; Li = L->i ; Lx = L->x ; Lz = L->z ; Lnz = L->nz ; Lnext = L->next ; Lprev = L->prev ; L2p = L2->p ; L2i = L2->i ; L2x = L2->x ; L2z = L2->z ; L2nz = L2->nz ; L2next = L2->next ; L2prev = L2->prev ; L2->xtype = L->xtype ; L2->dtype = L->dtype ; for (j = 0 ; j <= n ; j++) { L2p [j] = Lp [j] ; } for (j = 0 ; j < n+2 ; j++) { L2prev [j] = Lprev [j] ; } for (j = 0 ; j < n+2 ; j++) { L2next [j] = Lnext [j] ; } for (j = 0 ; j < n ; j++) { L2nz [j] = Lnz [j] ; } for (j = 0 ; j < n ; j++) { p = Lp [j] ; pend = p + Lnz [j] ; for ( ; p < pend ; p++) { L2i [p] = Li [p] ; } p = Lp [j] ; if (L->xtype == CHOLMOD_REAL) { for ( ; p < pend ; p++) { L2x [p] = Lx [p] ; } } else if (L->xtype == CHOLMOD_COMPLEX) { for ( ; p < pend ; p++) { L2x [2*p ] = Lx [2*p ] ; L2x [2*p+1] = Lx [2*p+1] ; } } else if (L->xtype == CHOLMOD_ZOMPLEX) { for ( ; p < pend ; p++) { L2x [p] = Lx [p] ; L2z [p] = Lz [p] ; } } } } else if (L->is_super) { /* ------------------------------------------------------------------ */ /* copy a supernodal factor */ /* ------------------------------------------------------------------ */ xsize = L->xsize ; ssize = L->ssize ; nsuper = L->nsuper ; L2->xsize = xsize ; L2->ssize = ssize ; L2->nsuper = nsuper ; /* allocate L2->super, L2->pi, L2->px, and L2->s. Allocate L2->x if * L is numeric */ if (!CHOLMOD(change_factor) (L->xtype, TRUE, TRUE, TRUE, TRUE, L2, Common)) { CHOLMOD(free_factor) (&L2, Common) ; return (NULL) ; /* out of memory */ } ASSERT (L2->s != NULL) ; /* ------------------------------------------------------------------ */ /* copy the contents of a supernodal factor */ /* ------------------------------------------------------------------ */ Lsuper = L->super ; Lpi = L->pi ; Lpx = L->px ; Ls = L->s ; Lx = L->x ; L2super = L2->super ; L2pi = L2->pi ; L2px = L2->px ; L2s = L2->s ; L2x = L2->x ; L2->maxcsize = L->maxcsize ; L2->maxesize = L->maxesize ; for (s = 0 ; s <= nsuper ; s++) { L2super [s] = Lsuper [s] ; } for (s = 0 ; s <= nsuper ; s++) { L2pi [s] = Lpi [s] ; } for (s = 0 ; s <= nsuper ; s++) { L2px [s] = Lpx [s] ; } L2s [0] = 0 ; for (p = 0 ; p < ssize ; p++) { L2s [p] = Ls [p] ; } if (L->xtype == CHOLMOD_REAL) { for (p = 0 ; p < xsize ; p++) { L2x [p] = Lx [p] ; } } else if (L->xtype == CHOLMOD_COMPLEX) { for (p = 0 ; p < 2*xsize ; p++) { L2x [p] = Lx [p] ; } } } L2->minor = L->minor ; L2->is_monotonic = L->is_monotonic ; DEBUG (CHOLMOD(dump_factor) (L2, "L2 got copied", Common)) ; ASSERT (L2->xtype == L->xtype && L2->is_super == L->is_super) ; return (L2) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_common.c0000664000175000017500000005742414224052371020717 00000000000000/* ========================================================================== */ /* === Core/cholmod_common ================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Core utility routines for the cholmod_common object: * * Primary routines: * ----------------- * cholmod_start the first call to CHOLMOD * cholmod_finish the last call to CHOLMOD * * Secondary routines: * ------------------- * cholmod_defaults restore (most) default control parameters * cholmod_allocate_work allocate (or reallocate) workspace in Common * cholmod_free_work free workspace in Common * cholmod_clear_flag clear Common->Flag in workspace * cholmod_maxrank column dimension of Common->Xwork workspace * * The Common object is unique. It cannot be allocated or deallocated by * CHOLMOD, since it contains the definition of the memory management routines * used (pointers to malloc, free, realloc, and calloc, or their equivalent). * The Common object contains workspace that is used between calls to * CHOLMOD routines. This workspace allocated by CHOLMOD as needed, by * cholmod_allocate_work and cholmod_free_work. */ #include "cholmod_internal.h" #include "cholmod_core.h" /* ========================================================================== */ /* === cholmod_start ======================================================== */ /* ========================================================================== */ /* Initialize Common default parameters and statistics. Sets workspace * pointers to NULL. * * This routine must be called just once, prior to calling any other CHOLMOD * routine. Do not call this routine after any other CHOLMOD routine (except * cholmod_finish, to start a new CHOLMOD session), or a memory leak will * occur. * * workspace: none */ int CHOLMOD(start) ( cholmod_common *Common ) { int k ; if (Common == NULL) { return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* user error handling routine */ /* ---------------------------------------------------------------------- */ Common->error_handler = NULL ; /* ---------------------------------------------------------------------- */ /* integer and numerical types */ /* ---------------------------------------------------------------------- */ Common->itype = ITYPE ; Common->dtype = DTYPE ; /* ---------------------------------------------------------------------- */ /* default control parameters */ /* ---------------------------------------------------------------------- */ CHOLMOD(defaults) (Common) ; Common->try_catch = FALSE ; /* ---------------------------------------------------------------------- */ /* memory management routines */ /* ---------------------------------------------------------------------- */ /* moved to SuiteSparse_config */ /* ---------------------------------------------------------------------- */ /* complex arithmetic routines */ /* ---------------------------------------------------------------------- */ /* moved to SuiteSparse_config */ /* ---------------------------------------------------------------------- */ /* print routine */ /* ---------------------------------------------------------------------- */ /* moved to SuiteSparse_config */ /* ---------------------------------------------------------------------- */ /* workspace */ /* ---------------------------------------------------------------------- */ /* This code assumes the workspace held in Common is not initialized. If * it is, then a memory leak will occur because the pointers are * overwritten with NULL. */ Common->nrow = 0 ; Common->mark = EMPTY ; Common->xworksize = 0 ; Common->iworksize = 0 ; Common->Flag = NULL ; Common->Head = NULL ; Common->Iwork = NULL ; Common->Xwork = NULL ; Common->no_workspace_reallocate = FALSE ; /* ---------------------------------------------------------------------- */ /* statistics */ /* ---------------------------------------------------------------------- */ /* fl and lnz are computed in cholmod_analyze and cholmod_rowcolcounts */ Common->fl = EMPTY ; Common->lnz = EMPTY ; /* modfl is computed in cholmod_updown, cholmod_rowadd, and cholmod_rowdel*/ Common->modfl = EMPTY ; /* all routines use status as their error-report code */ Common->status = CHOLMOD_OK ; Common->malloc_count = 0 ; /* # calls to malloc minus # calls to free */ Common->memory_usage = 0 ; /* peak memory usage (in bytes) */ Common->memory_inuse = 0 ; /* current memory in use (in bytes) */ Common->nrealloc_col = 0 ; Common->nrealloc_factor = 0 ; Common->ndbounds_hit = 0 ; Common->rowfacfl = 0 ; Common->aatfl = EMPTY ; /* Common->called_nd is TRUE if cholmod_analyze called or NESDIS */ Common->called_nd = FALSE ; Common->blas_ok = TRUE ; /* false if BLAS int overflow occurs */ /* ---------------------------------------------------------------------- */ /* default SuiteSparseQR knobs and statististics */ /* ---------------------------------------------------------------------- */ for (k = 0 ; k < 10 ; k++) Common->SPQR_istat [k] = 0 ; Common->SPQR_flopcount_bound = 0 ; /* upper bound on flop count */ Common->SPQR_tol_used = 0 ; /* tolerance used */ Common->SPQR_norm_E_fro = 0 ; /* Frobenius norm of dropped entries */ Common->SPQR_grain = 1 ; /* no Intel TBB multitasking, by default */ Common->SPQR_small = 1e6 ; /* target min task size for TBB */ Common->SPQR_shrink = 1 ; /* controls SPQR shrink realloc */ Common->SPQR_nthreads = 0 ; /* 0: let TBB decide how many threads to use */ Common->SPQR_flopcount = 0 ; /* flop count for SPQR */ Common->SPQR_analyze_time = 0 ; /* analysis time for SPQR */ Common->SPQR_factorize_time = 0 ; /* factorize time for SPQR */ Common->SPQR_solve_time = 0 ; /* backsolve time for SPQR */ /* ---------------------------------------------------------------------- */ /* GPU initializations */ /* ---------------------------------------------------------------------- */ /* these are destroyed by cholmod_gpu_deallocate and cholmod_gpu_end */ Common->cublasHandle = NULL ; Common->cublasEventPotrf [0] = NULL ; Common->cublasEventPotrf [1] = NULL ; Common->cublasEventPotrf [2] = NULL ; for (k = 0 ; k < CHOLMOD_HOST_SUPERNODE_BUFFERS ; k++) { Common->gpuStream [k] = NULL ; Common->updateCBuffersFree [k] = NULL ; } Common->updateCKernelsComplete = NULL; /* these are destroyed by cholmod_gpu_deallocate */ Common->dev_mempool = NULL; Common->dev_mempool_size = 0; Common->host_pinned_mempool = NULL; Common->host_pinned_mempool_size = 0; Common->syrkStart = 0 ; Common->cholmod_cpu_gemm_time = 0 ; Common->cholmod_cpu_syrk_time = 0 ; Common->cholmod_cpu_trsm_time = 0 ; Common->cholmod_cpu_potrf_time = 0 ; Common->cholmod_gpu_gemm_time = 0 ; Common->cholmod_gpu_syrk_time = 0 ; Common->cholmod_gpu_trsm_time = 0 ; Common->cholmod_gpu_potrf_time = 0 ; Common->cholmod_assemble_time = 0 ; Common->cholmod_assemble_time2 = 0 ; Common->cholmod_cpu_gemm_calls = 0 ; Common->cholmod_cpu_syrk_calls = 0 ; Common->cholmod_cpu_trsm_calls = 0 ; Common->cholmod_cpu_potrf_calls = 0 ; Common->cholmod_gpu_gemm_calls = 0 ; Common->cholmod_gpu_syrk_calls = 0 ; Common->cholmod_gpu_trsm_calls = 0 ; Common->cholmod_gpu_potrf_calls = 0 ; Common->maxGpuMemBytes = 0; Common->maxGpuMemFraction = 0.0; /* SPQR statistics and settings */ Common->gpuMemorySize = 1 ; /* default: no GPU memory available */ Common->gpuKernelTime = 0.0 ; Common->gpuFlops = 0 ; Common->gpuNumKernelLaunches = 0 ; DEBUG_INIT ("cholmod start", Common) ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_defaults ===================================================== */ /* ========================================================================== */ /* Set Common default parameters, except for the function pointers. * * workspace: none */ int CHOLMOD(defaults) ( cholmod_common *Common ) { Int i ; RETURN_IF_NULL_COMMON (FALSE) ; /* ---------------------------------------------------------------------- */ /* default control parameters */ /* ---------------------------------------------------------------------- */ Common->dbound = 0.0 ; Common->grow0 = 1.2 ; Common->grow1 = 1.2 ; Common->grow2 = 5 ; Common->maxrank = 8 ; Common->final_asis = TRUE ; Common->final_super = TRUE ; Common->final_ll = FALSE ; Common->final_pack = TRUE ; Common->final_monotonic = TRUE ; Common->final_resymbol = FALSE ; /* use simplicial factorization if flop/nnz(L) < 40, supernodal otherwise */ Common->supernodal = CHOLMOD_AUTO ; Common->supernodal_switch = 40 ; Common->nrelax [0] = 4 ; Common->nrelax [1] = 16 ; Common->nrelax [2] = 48 ; Common->zrelax [0] = 0.8 ; Common->zrelax [1] = 0.1 ; Common->zrelax [2] = 0.05 ; Common->prefer_zomplex = FALSE ; Common->prefer_upper = TRUE ; Common->prefer_binary = FALSE ; Common->quick_return_if_not_posdef = FALSE ; /* METIS workarounds */ Common->metis_memory = 0.0 ; /* > 0 for memory guard (2 is reasonable) */ Common->metis_nswitch = 3000 ; Common->metis_dswitch = 0.66 ; Common->print = 3 ; Common->precise = FALSE ; /* ---------------------------------------------------------------------- */ /* default ordering methods */ /* ---------------------------------------------------------------------- */ /* Note that if the Partition module is not installed, the CHOLMOD_METIS * and CHOLMOD_NESDIS methods will not be available. cholmod_analyze will * report the CHOLMOD_NOT_INSTALLED error, and safely skip over them. */ #if (CHOLMOD_MAXMETHODS < 9) #error "CHOLMOD_MAXMETHODS must be 9 or more (defined in cholmod_core.h)." #endif /* default strategy: try given, AMD, and then METIS if AMD reports high * fill-in. NESDIS can be used instead, if Common->default_nesdis is TRUE. */ Common->nmethods = 0 ; /* use default strategy */ Common->default_nesdis = FALSE ; /* use METIS in default strategy */ Common->current = 0 ; /* current method being tried */ Common->selected = 0 ; /* the best method selected */ /* first, fill each method with default parameters */ for (i = 0 ; i <= CHOLMOD_MAXMETHODS ; i++) { /* CHOLMOD's default method is AMD for A or AA' */ Common->method [i].ordering = CHOLMOD_AMD ; /* CHOLMOD nested dissection and minimum degree parameter */ Common->method [i].prune_dense = 10.0 ; /* dense row/col control */ /* min degree parameters (AMD, COLAMD, SYMAMD, CAMD, CCOLAMD, CSYMAMD)*/ Common->method [i].prune_dense2 = -1 ; /* COLAMD dense row control */ Common->method [i].aggressive = TRUE ; /* aggressive absorption */ Common->method [i].order_for_lu = FALSE ;/* order for Cholesky not LU */ /* CHOLMOD's nested dissection (METIS + constrained AMD) */ Common->method [i].nd_small = 200 ; /* small graphs aren't cut */ Common->method [i].nd_compress = TRUE ; /* compress graph & subgraphs */ Common->method [i].nd_camd = 1 ; /* use CAMD */ Common->method [i].nd_components = FALSE ; /* lump connected comp. */ Common->method [i].nd_oksep = 1.0 ; /* sep ok if < oksep*n */ /* statistics for each method are not yet computed */ Common->method [i].fl = EMPTY ; Common->method [i].lnz = EMPTY ; } Common->postorder = TRUE ; /* follow ordering with weighted postorder */ /* Next, define some methods. The first five use default parameters. */ Common->method [0].ordering = CHOLMOD_GIVEN ; /* skip if UserPerm NULL */ Common->method [1].ordering = CHOLMOD_AMD ; Common->method [2].ordering = CHOLMOD_METIS ; Common->method [3].ordering = CHOLMOD_NESDIS ; Common->method [4].ordering = CHOLMOD_NATURAL ; /* CHOLMOD's nested dissection with large leaves of separator tree */ Common->method [5].ordering = CHOLMOD_NESDIS ; Common->method [5].nd_small = 20000 ; /* CHOLMOD's nested dissection with tiny leaves, and no AMD ordering */ Common->method [6].ordering = CHOLMOD_NESDIS ; Common->method [6].nd_small = 4 ; Common->method [6].nd_camd = 0 ; /* no CSYMAMD or CAMD */ /* CHOLMOD's nested dissection with no dense node removal */ Common->method [7].ordering = CHOLMOD_NESDIS ; Common->method [7].prune_dense = -1. ; /* COLAMD for A*A', AMD for A */ Common->method [8].ordering = CHOLMOD_COLAMD ; /* ---------------------------------------------------------------------- */ /* GPU configuration and statistics */ /* ---------------------------------------------------------------------- */ #ifdef DLONG Common->useGPU = EMPTY ; #else /* GPU acceleration is not supported for int version of CHOLMOD */ Common->useGPU = 0 ; #endif return (TRUE) ; } /* ========================================================================== */ /* === cholmod_finish ======================================================= */ /* ========================================================================== */ /* The last call to CHOLMOD must be cholmod_finish. You may call this routine * more than once, and can safely call any other CHOLMOD routine after calling * it (including cholmod_start). * * The statistics and parameter settings in Common are preserved. The * workspace in Common is freed. This routine is just another name for * cholmod_free_work. */ int CHOLMOD(finish) ( cholmod_common *Common ) { return (CHOLMOD(free_work) (Common)) ; } /* ========================================================================== */ /* === cholmod_allocate_work ================================================ */ /* ========================================================================== */ /* Allocate and initialize workspace for CHOLMOD routines, or increase the size * of already-allocated workspace. If enough workspace is already allocated, * then nothing happens. * * workspace: Flag (nrow), Head (nrow+1), Iwork (iworksize), Xwork (xworksize) */ int CHOLMOD(allocate_work) ( /* ---- input ---- */ size_t nrow, /* # of rows in the matrix A */ size_t iworksize, /* size of Iwork */ size_t xworksize, /* size of Xwork */ /* --------------- */ cholmod_common *Common ) { double *W ; Int *Head ; Int i ; size_t nrow1 ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* Allocate Flag (nrow) and Head (nrow+1) */ /* ---------------------------------------------------------------------- */ nrow = MAX (1, nrow) ; /* nrow1 = nrow + 1 */ nrow1 = CHOLMOD(add_size_t) (nrow, 1, &ok) ; if (!ok) { /* nrow+1 causes size_t overflow ; problem is too large */ Common->status = CHOLMOD_TOO_LARGE ; CHOLMOD(free_work) (Common) ; return (FALSE) ; } if (nrow > Common->nrow) { if (Common->no_workspace_reallocate) { /* CHOLMOD is not allowed to change the workspace here */ Common->status = CHOLMOD_INVALID ; return (FALSE) ; } /* free the old workspace (if any) and allocate new space */ Common->Flag = CHOLMOD(free) (Common->nrow, sizeof (Int), Common->Flag, Common) ; Common->Head = CHOLMOD(free) (Common->nrow+1,sizeof (Int), Common->Head, Common) ; Common->Flag = CHOLMOD(malloc) (nrow, sizeof (Int), Common) ; Common->Head = CHOLMOD(malloc) (nrow1, sizeof (Int), Common) ; /* record the new size of Flag and Head */ Common->nrow = nrow ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_work) (Common) ; return (FALSE) ; } /* initialize Flag and Head */ Common->mark = EMPTY ; CHOLMOD(clear_flag) (Common) ; Head = Common->Head ; for (i = 0 ; i <= (Int) (nrow) ; i++) { Head [i] = EMPTY ; } } /* ---------------------------------------------------------------------- */ /* Allocate Iwork (iworksize) */ /* ---------------------------------------------------------------------- */ iworksize = MAX (1, iworksize) ; if (iworksize > Common->iworksize) { if (Common->no_workspace_reallocate) { /* CHOLMOD is not allowed to change the workspace here */ Common->status = CHOLMOD_INVALID ; return (FALSE) ; } /* free the old workspace (if any) and allocate new space. * integer overflow safely detected in cholmod_malloc */ CHOLMOD(free) (Common->iworksize, sizeof (Int), Common->Iwork, Common) ; Common->Iwork = CHOLMOD(malloc) (iworksize, sizeof (Int), Common) ; /* record the new size of Iwork */ Common->iworksize = iworksize ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_work) (Common) ; return (FALSE) ; } /* note that Iwork does not need to be initialized */ } /* ---------------------------------------------------------------------- */ /* Allocate Xwork (xworksize) and set it to ((double) 0.) */ /* ---------------------------------------------------------------------- */ /* make sure xworksize is >= 1 */ xworksize = MAX (1, xworksize) ; if (xworksize > Common->xworksize) { if (Common->no_workspace_reallocate) { /* CHOLMOD is not allowed to change the workspace here */ Common->status = CHOLMOD_INVALID ; return (FALSE) ; } /* free the old workspace (if any) and allocate new space */ CHOLMOD(free) (Common->xworksize, sizeof (double), Common->Xwork, Common) ; Common->Xwork = CHOLMOD(malloc) (xworksize, sizeof (double), Common) ; /* record the new size of Xwork */ Common->xworksize = xworksize ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_work) (Common) ; return (FALSE) ; } /* initialize Xwork */ W = Common->Xwork ; for (i = 0 ; i < (Int) xworksize ; i++) { W [i] = 0. ; } } return (TRUE) ; } /* ========================================================================== */ /* === cholmod_free_work ==================================================== */ /* ========================================================================== */ /* Deallocate the CHOLMOD workspace. * * workspace: deallocates all workspace in Common */ int CHOLMOD(free_work) ( cholmod_common *Common ) { RETURN_IF_NULL_COMMON (FALSE) ; Common->Flag = CHOLMOD(free) (Common->nrow, sizeof (Int), Common->Flag, Common) ; Common->Head = CHOLMOD(free) (Common->nrow+1, sizeof (Int), Common->Head, Common) ; Common->Iwork = CHOLMOD(free) (Common->iworksize, sizeof (Int), Common->Iwork, Common) ; Common->Xwork = CHOLMOD(free) (Common->xworksize, sizeof (double), Common->Xwork, Common) ; Common->nrow = 0 ; Common->iworksize = 0 ; Common->xworksize = 0 ; #ifdef GPU_BLAS CHOLMOD(gpu_deallocate) (Common) ; #endif return (TRUE) ; } /* ========================================================================== */ /* === cholmod_clear_flag =================================================== */ /* ========================================================================== */ /* Increment mark to ensure Flag [0..nrow-1] < mark. If integer overflow * occurs, or mark was initially negative, reset the entire array. This is * not an error condition, but an intended function of the Flag workspace. * * workspace: Flag (nrow). Does not modify Flag if nrow is zero. */ SuiteSparse_long CHOLMOD(clear_flag) ( cholmod_common *Common ) { Int i, nrow, *Flag ; RETURN_IF_NULL_COMMON (-1) ; Common->mark++ ; if (Common->mark <= 0) { nrow = Common->nrow ; Flag = Common->Flag ; PRINT2 (("reset Flag: nrow "ID"\n", nrow)) ; PRINT2 (("reset Flag: mark %ld\n", Common->mark)) ; for (i = 0 ; i < nrow ; i++) { Flag [i] = EMPTY ; } Common->mark = 0 ; } return (Common->mark) ; } /* ========================================================================== */ /* ==== cholmod_maxrank ===================================================== */ /* ========================================================================== */ /* Find a valid value of Common->maxrank. Returns 0 if error, or 2, 4, or 8 * if successful. */ size_t CHOLMOD(maxrank) /* returns validated value of Common->maxrank */ ( /* ---- input ---- */ size_t n, /* A and L will have n rows */ /* --------------- */ cholmod_common *Common ) { size_t maxrank ; RETURN_IF_NULL_COMMON (0) ; maxrank = Common->maxrank ; if (n > 0) { /* Ensure maxrank*n*sizeof(double) does not result in integer overflow. * If n is so large that 2*n*sizeof(double) results in integer overflow * (n = 268,435,455 if an Int is 32 bits), then maxrank will be 0 or 1, * but maxrank will be set to 2 below. 2*n will not result in integer * overflow, and CHOLMOD will run out of memory or safely detect integer * overflow elsewhere. */ maxrank = MIN (maxrank, Size_max / (n * sizeof (double))) ; } if (maxrank <= 2) { maxrank = 2 ; } else if (maxrank <= 4) { maxrank = 4 ; } else { maxrank = 8 ; } return (maxrank) ; } /* ========================================================================== */ /* === cholmod_dbound ======================================================= */ /* ========================================================================== */ /* Ensure the absolute value of a diagonal entry, D (j,j), is greater than * Common->dbound. This routine is not meant for the user to call. It is used * by the various LDL' factorization and update/downdate routines. The * default value of Common->dbound is zero, and in that case this routine is not * called at all. No change is made if D (j,j) is NaN. CHOLMOD does not call * this routine if Common->dbound is NaN. */ double CHOLMOD(dbound) /* returns modified diagonal entry of D */ ( /* ---- input ---- */ double dj, /* diagonal entry of D, for LDL' factorization */ /* --------------- */ cholmod_common *Common ) { double dbound ; RETURN_IF_NULL_COMMON (0) ; if (!IS_NAN (dj)) { dbound = Common->dbound ; if (dj < 0) { if (dj > -dbound) { dj = -dbound ; Common->ndbounds_hit++ ; if (Common->status == CHOLMOD_OK) { ERROR (CHOLMOD_DSMALL, "diagonal below threshold") ; } } } else { if (dj < dbound) { dj = dbound ; Common->ndbounds_hit++ ; if (Common->status == CHOLMOD_OK) { ERROR (CHOLMOD_DSMALL, "diagonal below threshold") ; } } } } return (dj) ; } /* ========================================================================== */ /* === scorecomp ============================================================ */ /* ========================================================================== */ /* For sorting descendant supernodes with qsort */ int CHOLMOD(score_comp) (struct cholmod_descendant_score_t *i, struct cholmod_descendant_score_t *j) { if ((*i).score < (*j).score) { return (1) ; } else { return (-1) ; } } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_memory.c0000664000175000017500000004120514224052371020725 00000000000000/* ========================================================================== */ /* === Core/cholmod_memory ================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2013, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Core memory management routines: * * Primary routines: * ----------------- * cholmod_malloc malloc wrapper * cholmod_free free wrapper * * Secondary routines: * ------------------- * cholmod_calloc calloc wrapper * cholmod_realloc realloc wrapper * cholmod_realloc_multiple realloc wrapper for multiple objects * * The user may make use of these, just like malloc and free. You can even * malloc an object and safely free it with cholmod_free, and visa versa * (except that the memory usage statistics will be corrupted). These routines * do differ from malloc and free. If cholmod_free is given a NULL pointer, * for example, it does nothing (unlike the ANSI free). cholmod_realloc does * not return NULL if given a non-NULL pointer and a nonzero size, even if it * fails (it sets an error code in Common->status instead). * * CHOLMOD keeps track of the amount of memory it has allocated, and so the * cholmod_free routine includes as a parameter the size of the object being * freed. This is only used for memory usage statistics, which are very useful * in finding memory leaks in your program. If you, the user of CHOLMOD, pass * the wrong size, the only consequence is that the memory usage statistics * will be invalid. This will causes assertions to fail if CHOLMOD is * compiled with debugging enabled, but otherwise it will cause no errors. * * The cholmod_free_* routines for each CHOLMOD object keep track of the size * of the blocks they free, so they do not require you to pass their sizes * as a parameter. * * If a block of size zero is requested, these routines allocate a block of * size one instead. */ #include "cholmod_internal.h" #include "cholmod_core.h" /* ========================================================================== */ /* === cholmod_add_size_t =================================================== */ /* ========================================================================== */ /* Safely compute a+b, and check for integer overflow. If overflow occurs, * return 0 and set OK to FALSE. Also return 0 if OK is FALSE on input. */ size_t CHOLMOD(add_size_t) (size_t a, size_t b, int *ok) { size_t s = a + b ; (*ok) = (*ok) && (s >= a) ; return ((*ok) ? s : 0) ; } /* ========================================================================== */ /* === cholmod_mult_size_t ================================================== */ /* ========================================================================== */ /* Safely compute a*k, where k should be small, and check for integer overflow. * If overflow occurs, return 0 and set OK to FALSE. Also return 0 if OK is * FALSE on input. */ size_t CHOLMOD(mult_size_t) (size_t a, size_t k, int *ok) { size_t p = 0, s ; while (*ok) { if (k % 2) { p = p + a ; (*ok) = (*ok) && (p >= a) ; } k = k / 2 ; if (!k) return (p) ; s = a + a ; (*ok) = (*ok) && (s >= a) ; a = s ; } return (0) ; } /* ========================================================================== */ /* === cholmod_malloc ======================================================= */ /* ========================================================================== */ /* Wrapper around malloc routine. Allocates space of size MAX(1,n)*size, where * size is normally a sizeof (...). * * This routine, cholmod_calloc, and cholmod_realloc do not set Common->status * to CHOLMOD_OK on success, so that a sequence of cholmod_malloc's, _calloc's, * or _realloc's can be used. If any of them fails, the Common->status will * hold the most recent error status. * * Usage, for a pointer to int: * * p = cholmod_malloc (n, sizeof (int), Common) * * Uses a pointer to the malloc routine (or its equivalent) defined in Common. */ void *CHOLMOD(malloc) /* returns pointer to the newly malloc'd block */ ( /* ---- input ---- */ size_t n, /* number of items */ size_t size, /* size of each item */ /* --------------- */ cholmod_common *Common ) { void *p ; size_t s ; /* int ok = TRUE ; */ RETURN_IF_NULL_COMMON (NULL) ; if (size == 0) { ERROR (CHOLMOD_INVALID, "sizeof(item) must be > 0") ; p = NULL ; } else if (n >= (Size_max / size) || n >= Int_max) { /* object is too big to allocate without causing integer overflow */ ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; p = NULL ; } else { /* call malloc, or its equivalent */ p = SuiteSparse_malloc (n, size) ; if (p == NULL) { /* failure: out of memory */ ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory") ; } else { /* success: increment the count of objects allocated */ Common->malloc_count++ ; Common->memory_inuse += (n * size) ; Common->memory_usage = MAX (Common->memory_usage, Common->memory_inuse) ; PRINTM (("cholmod_malloc %p %g cnt: %g inuse %g\n", p, (double) n*size, (double) Common->malloc_count, (double) Common->memory_inuse)) ; } } return (p) ; } /* ========================================================================== */ /* === cholmod_free ========================================================= */ /* ========================================================================== */ /* Wrapper around free routine. Returns NULL, which can be assigned to the * pointer being freed, as in: * * p = cholmod_free (n, sizeof (int), p, Common) ; * * In CHOLMOD, the syntax: * * cholmod_free (n, sizeof (int), p, Common) ; * * is used if p is a local pointer and the routine is returning shortly. * Uses a pointer to the free routine (or its equivalent) defined in Common. * Nothing is freed if the pointer is NULL. */ void *CHOLMOD(free) /* always returns NULL */ ( /* ---- input ---- */ size_t n, /* number of items */ size_t size, /* size of each item */ /* ---- in/out --- */ void *p, /* block of memory to free */ /* --------------- */ cholmod_common *Common ) { RETURN_IF_NULL_COMMON (NULL) ; if (p != NULL) { /* only free the object if the pointer is not NULL */ /* call free, or its equivalent */ SuiteSparse_free (p) ; Common->malloc_count-- ; Common->memory_inuse -= (n * size) ; PRINTM (("cholmod_free %p %g cnt: %g inuse %g\n", p, (double) n*size, (double) Common->malloc_count, (double) Common->memory_inuse)) ; /* This assertion will fail if the user calls cholmod_malloc and * cholmod_free with mismatched memory sizes. It shouldn't fail * otherwise. */ ASSERT (IMPLIES (Common->malloc_count == 0, Common->memory_inuse == 0)); } /* return NULL, and the caller should assign this to p. This avoids * freeing the same pointer twice. */ return (NULL) ; } /* ========================================================================== */ /* === cholmod_calloc ======================================================= */ /* ========================================================================== */ /* Wrapper around calloc routine. * * Uses a pointer to the calloc routine (or its equivalent) defined in Common. * This routine is identical to malloc, except that it zeros the newly allocated * block to zero. */ void *CHOLMOD(calloc) /* returns pointer to the newly calloc'd block */ ( /* ---- input ---- */ size_t n, /* number of items */ size_t size, /* size of each item */ /* --------------- */ cholmod_common *Common ) { void *p ; RETURN_IF_NULL_COMMON (NULL) ; if (size == 0) { ERROR (CHOLMOD_INVALID, "sizeof(item) must be > 0") ; p = NULL ; } else if (n >= (Size_max / size) || n >= Int_max) { /* object is too big to allocate without causing integer overflow */ ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; p = NULL ; } else { /* call calloc, or its equivalent */ p = SuiteSparse_calloc (n, size) ; if (p == NULL) { /* failure: out of memory */ ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory") ; } else { /* success: increment the count of objects allocated */ Common->malloc_count++ ; Common->memory_inuse += (n * size) ; Common->memory_usage = MAX (Common->memory_usage, Common->memory_inuse) ; PRINTM (("cholmod_malloc %p %g cnt: %g inuse %g\n", p, (double) n*size, (double) Common->malloc_count, (double) Common->memory_inuse)) ; } } return (p) ; } /* ========================================================================== */ /* === cholmod_realloc ====================================================== */ /* ========================================================================== */ /* Wrapper around realloc routine. Given a pointer p to a block of size * (*n)*size memory, it changes the size of the block pointed to by p to be * MAX(1,nnew)*size in size. It may return a pointer different than p. This * should be used as (for a pointer to int): * * p = cholmod_realloc (nnew, sizeof (int), p, *n, Common) ; * * If p is NULL, this is the same as p = cholmod_malloc (...). * A size of nnew=0 is treated as nnew=1. * * If the realloc fails, p is returned unchanged and Common->status is set * to CHOLMOD_OUT_OF_MEMORY. If successful, Common->status is not modified, * and p is returned (possibly changed) and pointing to a large block of memory. * * Uses a pointer to the realloc routine (or its equivalent) defined in Common. */ void *CHOLMOD(realloc) /* returns pointer to reallocated block */ ( /* ---- input ---- */ size_t nnew, /* requested # of items in reallocated block */ size_t size, /* size of each item */ /* ---- in/out --- */ void *p, /* block of memory to realloc */ size_t *n, /* current size on input, nnew on output if successful*/ /* --------------- */ cholmod_common *Common ) { size_t nold = (*n) ; void *pnew ; size_t s ; int ok = TRUE ; RETURN_IF_NULL_COMMON (NULL) ; if (size == 0) { ERROR (CHOLMOD_INVALID, "sizeof(item) must be > 0") ; p = NULL ; } else if (p == NULL) { /* A fresh object is being allocated. */ PRINT1 (("realloc fresh: %d %d\n", nnew, size)) ; p = CHOLMOD(malloc) (nnew, size, Common) ; *n = (p == NULL) ? 0 : nnew ; } else if (nold == nnew) { /* Nothing to do. Do not change p or n. */ PRINT1 (("realloc nothing: %d %d\n", nnew, size)) ; } else if (nnew >= (Size_max / size) || nnew >= Int_max) { /* failure: nnew is too big. Do not change p or n. */ ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; } else { /* The object exists, and is changing to some other nonzero size. */ /* call realloc, or its equivalent */ PRINT1 (("realloc : %d to %d, %d\n", nold, nnew, size)) ; pnew = SuiteSparse_realloc (nnew, nold, size, p, &ok) ; if (ok) { /* success: return revised p and change the size of the block */ PRINTM (("cholmod_free %p %g cnt: %g inuse %g\n" "cholmod_malloc %p %g cnt: %g inuse %g\n", p, (double) nold*size, (double) Common->malloc_count-1, (double) (Common->memory_inuse - nold*size), pnew, (double) nnew*size, (double) Common->malloc_count, (double) (Common->memory_inuse + (nnew-nold)*size))) ; p = pnew ; *n = nnew ; Common->memory_inuse += ((nnew-nold) * size) ; } else { /* Increasing the size of the block has failed. * Do not change n. */ ERROR (CHOLMOD_OUT_OF_MEMORY, "out of memory") ; } Common->memory_usage = MAX (Common->memory_usage, Common->memory_inuse); } return (p) ; } /* ========================================================================== */ /* === cholmod_realloc_multiple ============================================= */ /* ========================================================================== */ /* reallocate multiple blocks of memory, all of the same size (up to two integer * and two real blocks). Either reallocations all succeed, or all are returned * in the original size (they are freed if the original size is zero). The nnew * blocks are of size 1 or more. */ int CHOLMOD(realloc_multiple) ( /* ---- input ---- */ size_t nnew, /* requested # of items in reallocated blocks */ int nint, /* number of int/SuiteSparse_long blocks */ int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ /* ---- in/out --- */ void **Iblock, /* int or SuiteSparse_long block */ void **Jblock, /* int or SuiteSparse_long block */ void **Xblock, /* complex or double block */ void **Zblock, /* zomplex case only: double block */ size_t *nold_p, /* current size of the I,J,X,Z blocks on input, * nnew on output if successful */ /* --------------- */ cholmod_common *Common ) { double *xx, *zz ; size_t i, j, x, z, nold ; RETURN_IF_NULL_COMMON (FALSE) ; if (xtype < CHOLMOD_PATTERN || xtype > CHOLMOD_ZOMPLEX) { ERROR (CHOLMOD_INVALID, "invalid xtype") ; return (FALSE) ; } nold = *nold_p ; if (nint < 1 && xtype == CHOLMOD_PATTERN) { /* nothing to do */ return (TRUE) ; } i = nold ; j = nold ; x = nold ; z = nold ; if (nint > 0) { *Iblock = CHOLMOD(realloc) (nnew, sizeof (Int), *Iblock, &i, Common) ; } if (nint > 1) { *Jblock = CHOLMOD(realloc) (nnew, sizeof (Int), *Jblock, &j, Common) ; } switch (xtype) { case CHOLMOD_REAL: *Xblock = CHOLMOD(realloc) (nnew, sizeof (double), *Xblock, &x, Common) ; break ; case CHOLMOD_COMPLEX: *Xblock = CHOLMOD(realloc) (nnew, 2*sizeof (double), *Xblock, &x, Common) ; break ; case CHOLMOD_ZOMPLEX: *Xblock = CHOLMOD(realloc) (nnew, sizeof (double), *Xblock, &x, Common) ; *Zblock = CHOLMOD(realloc) (nnew, sizeof (double), *Zblock, &z, Common) ; break ; } if (Common->status < CHOLMOD_OK) { /* one or more realloc's failed. Resize all back down to nold. */ if (nold == 0) { if (nint > 0) { *Iblock = CHOLMOD(free) (i, sizeof (Int), *Iblock, Common) ; } if (nint > 1) { *Jblock = CHOLMOD(free) (j, sizeof (Int), *Jblock, Common) ; } switch (xtype) { case CHOLMOD_REAL: *Xblock = CHOLMOD(free) (x, sizeof (double), *Xblock, Common) ; break ; case CHOLMOD_COMPLEX: *Xblock = CHOLMOD(free) (x, 2*sizeof (double), *Xblock, Common) ; break ; case CHOLMOD_ZOMPLEX: *Xblock = CHOLMOD(free) (x, sizeof (double), *Xblock, Common) ; *Zblock = CHOLMOD(free) (x, sizeof (double), *Zblock, Common) ; break ; } } else { if (nint > 0) { *Iblock = CHOLMOD(realloc) (nold, sizeof (Int), *Iblock, &i, Common) ; } if (nint > 1) { *Jblock = CHOLMOD(realloc) (nold, sizeof (Int), *Jblock, &j, Common) ; } switch (xtype) { case CHOLMOD_REAL: *Xblock = CHOLMOD(realloc) (nold, sizeof (double), *Xblock, &x, Common) ; break ; case CHOLMOD_COMPLEX: *Xblock = CHOLMOD(realloc) (nold, 2*sizeof (double), *Xblock, &x, Common) ; break ; case CHOLMOD_ZOMPLEX: *Xblock = CHOLMOD(realloc) (nold, sizeof (double), *Xblock, &x, Common) ; *Zblock = CHOLMOD(realloc) (nold, sizeof (double), *Zblock, &z, Common) ; break ; } } return (FALSE) ; } if (nold == 0) { /* New space was allocated. Clear the first entry so that valgrind * doesn't complain about its access in change_complexity * (Core/cholmod_complex.c). */ xx = *Xblock ; zz = *Zblock ; switch (xtype) { case CHOLMOD_REAL: xx [0] = 0 ; break ; case CHOLMOD_COMPLEX: xx [0] = 0 ; xx [1] = 0 ; break ; case CHOLMOD_ZOMPLEX: xx [0] = 0 ; zz [0] = 0 ; break ; } } /* all realloc's succeeded, change size to reflect realloc'ed size. */ *nold_p = nnew ; return (TRUE) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_complex.c0000664000175000017500000003561214224052371021071 00000000000000/* ========================================================================== */ /* === Core/cholmod_complex ================================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* If you convert a matrix that contains uninitialized data, valgrind will * complain. This can occur in a factor L which has gaps (a partial * factorization, or after updates that change the nonzero pattern), an * unpacked sparse matrix, a dense matrix with leading dimension d > # of rows, * or any matrix (dense, sparse, triplet, or factor) with more space allocated * than is used. You can safely ignore any of these complaints by valgrind. */ #include "cholmod_internal.h" #include "cholmod_core.h" /* ========================================================================== */ /* === cholmod_hypot ======================================================== */ /* ========================================================================== */ double CHOLMOD(hypot) (double x, double y) { return (SuiteSparse_config.hypot_func (x, y)) ; } /* ========================================================================== */ /* === cholmod_divcomplex =================================================== */ /* ========================================================================== */ /* c = a/b where c, a, and b are complex. The real and imaginary parts are * passed as separate arguments to this routine. The NaN case is ignored * for the double relop br >= bi. Returns 1 if the denominator is zero, * 0 otherwise. Note that this return value is the single exception to the * rule that all CHOLMOD routines that return int return TRUE if successful * or FALSE otherise. * * This uses ACM Algo 116, by R. L. Smith, 1962, which tries to avoid * underflow and overflow. * * c can be the same variable as a or b. * * Default value of the SuiteSparse_config.divcomplex_func pointer is * SuiteSparse_divcomplex, located in SuiteSparse_config.c. */ int CHOLMOD(divcomplex) ( double ar, double ai, /* real and imaginary parts of a */ double br, double bi, /* real and imaginary parts of b */ double *cr, double *ci /* real and imaginary parts of c */ ) { return (SuiteSparse_config.divcomplex_func (ar, ai, br, bi, cr, ci)) ; } /* ========================================================================== */ /* === change_complexity ==================================================== */ /* ========================================================================== */ /* X and Z represent an array of size nz, with numeric xtype given by xtype_in. * * If xtype_in is: * CHOLMOD_PATTERN: X and Z must be NULL. * CHOLMOD_REAL: X is of size nz, Z must be NULL. * CHOLMOD_COMPLEX: X is of size 2*nz, Z must be NULL. * CHOLMOD_ZOMPLEX: X is of size nz, Z is of size nz. * * The array is changed into the numeric xtype given by xtype_out, with the * same definitions of X and Z above. Note that the input conditions, above, * are not checked. These are checked in the caller routine. * * Returns TRUE if successful, FALSE otherwise. X and Z are not modified if * not successful. */ static int change_complexity ( /* ---- input ---- */ Int nz, /* size of X and/or Z */ int xtype_in, /* xtype of X and Z on input */ int xtype_out, /* requested xtype of X and Z on output */ int xtype1, /* xtype_out must be in the range [xtype1 .. xtype2] */ int xtype2, /* ---- in/out --- */ void **XX, /* old X on input, new X on output */ void **ZZ, /* old Z on input, new Z on output */ /* --------------- */ cholmod_common *Common ) { double *Xold, *Zold, *Xnew, *Znew ; Int k ; size_t nz2 ; if (xtype_out < xtype1 || xtype_out > xtype2) { ERROR (CHOLMOD_INVALID, "invalid xtype") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; Xold = *XX ; Zold = *ZZ ; switch (xtype_in) { /* ------------------------------------------------------------------ */ /* converting from pattern */ /* ------------------------------------------------------------------ */ case CHOLMOD_PATTERN: switch (xtype_out) { /* ---------------------------------------------------------- */ /* pattern -> real */ /* ---------------------------------------------------------- */ case CHOLMOD_REAL: /* allocate X and set to all ones */ Xnew = CHOLMOD(malloc) (nz, sizeof (double), Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } for (k = 0 ; k < nz ; k++) { Xnew [k] = 1 ; } *XX = Xnew ; break ; /* ---------------------------------------------------------- */ /* pattern -> complex */ /* ---------------------------------------------------------- */ case CHOLMOD_COMPLEX: /* allocate X and set to all ones */ Xnew = CHOLMOD(malloc) (nz, 2*sizeof (double), Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } for (k = 0 ; k < nz ; k++) { Xnew [2*k ] = 1 ; Xnew [2*k+1] = 0 ; } *XX = Xnew ; break ; /* ---------------------------------------------------------- */ /* pattern -> zomplex */ /* ---------------------------------------------------------- */ case CHOLMOD_ZOMPLEX: /* allocate X and Z and set to all ones */ Xnew = CHOLMOD(malloc) (nz, sizeof (double), Common) ; Znew = CHOLMOD(malloc) (nz, sizeof (double), Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free) (nz, sizeof (double), Xnew, Common) ; CHOLMOD(free) (nz, sizeof (double), Znew, Common) ; return (FALSE) ; } for (k = 0 ; k < nz ; k++) { Xnew [k] = 1 ; Znew [k] = 0 ; } *XX = Xnew ; *ZZ = Znew ; break ; } break ; /* ------------------------------------------------------------------ */ /* converting from real */ /* ------------------------------------------------------------------ */ case CHOLMOD_REAL: switch (xtype_out) { /* ---------------------------------------------------------- */ /* real -> pattern */ /* ---------------------------------------------------------- */ case CHOLMOD_PATTERN: /* free X */ *XX = CHOLMOD(free) (nz, sizeof (double), *XX, Common) ; break ; /* ---------------------------------------------------------- */ /* real -> complex */ /* ---------------------------------------------------------- */ case CHOLMOD_COMPLEX: /* allocate a new X and copy the old X */ Xnew = CHOLMOD(malloc) (nz, 2*sizeof (double), Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } for (k = 0 ; k < nz ; k++) { Xnew [2*k ] = Xold [k] ; Xnew [2*k+1] = 0 ; } CHOLMOD(free) (nz, sizeof (double), *XX, Common) ; *XX = Xnew ; break ; /* ---------------------------------------------------------- */ /* real -> zomplex */ /* ---------------------------------------------------------- */ case CHOLMOD_ZOMPLEX: /* allocate a new Z and set it to zero */ Znew = CHOLMOD(malloc) (nz, sizeof (double), Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } for (k = 0 ; k < nz ; k++) { Znew [k] = 0 ; } *ZZ = Znew ; break ; } break ; /* ------------------------------------------------------------------ */ /* converting from complex */ /* ------------------------------------------------------------------ */ case CHOLMOD_COMPLEX: switch (xtype_out) { /* ---------------------------------------------------------- */ /* complex -> pattern */ /* ---------------------------------------------------------- */ case CHOLMOD_PATTERN: /* free X */ *XX = CHOLMOD(free) (nz, 2*sizeof (double), *XX, Common) ; break ; /* ---------------------------------------------------------- */ /* complex -> real */ /* ---------------------------------------------------------- */ case CHOLMOD_REAL: /* pack the real part of X, discarding the imaginary part */ for (k = 0 ; k < nz ; k++) { Xold [k] = Xold [2*k] ; } /* shrink X in half (this cannot fail) */ nz2 = 2*nz ; *XX = CHOLMOD(realloc) (nz, sizeof (double), *XX, &nz2, Common) ; break ; /* ---------------------------------------------------------- */ /* complex -> zomplex */ /* ---------------------------------------------------------- */ case CHOLMOD_ZOMPLEX: /* allocate X and Z and copy the old X into them */ Xnew = CHOLMOD(malloc) (nz, sizeof (double), Common) ; Znew = CHOLMOD(malloc) (nz, sizeof (double), Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free) (nz, sizeof (double), Xnew, Common) ; CHOLMOD(free) (nz, sizeof (double), Znew, Common) ; return (FALSE) ; } for (k = 0 ; k < nz ; k++) { Xnew [k] = Xold [2*k ] ; Znew [k] = Xold [2*k+1] ; } CHOLMOD(free) (nz, 2*sizeof (double), *XX, Common) ; *XX = Xnew ; *ZZ = Znew ; break ; } break ; /* ------------------------------------------------------------------ */ /* converting from zomplex */ /* ------------------------------------------------------------------ */ case CHOLMOD_ZOMPLEX: switch (xtype_out) { /* ---------------------------------------------------------- */ /* zomplex -> pattern */ /* ---------------------------------------------------------- */ case CHOLMOD_PATTERN: /* free X and Z */ *XX = CHOLMOD(free) (nz, sizeof (double), *XX, Common) ; *ZZ = CHOLMOD(free) (nz, sizeof (double), *ZZ, Common) ; break ; /* ---------------------------------------------------------- */ /* zomplex -> real */ /* ---------------------------------------------------------- */ case CHOLMOD_REAL: /* free the imaginary part */ *ZZ = CHOLMOD(free) (nz, sizeof (double), *ZZ, Common) ; break ; /* ---------------------------------------------------------- */ /* zomplex -> complex */ /* ---------------------------------------------------------- */ case CHOLMOD_COMPLEX: Xnew = CHOLMOD(malloc) (nz, 2*sizeof (double), Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } for (k = 0 ; k < nz ; k++) { Xnew [2*k ] = Xold [k] ; Xnew [2*k+1] = Zold [k] ; } CHOLMOD(free) (nz, sizeof (double), *XX, Common) ; CHOLMOD(free) (nz, sizeof (double), *ZZ, Common) ; *XX = Xnew ; *ZZ = NULL ; break ; } break ; } return (TRUE) ; } /* ========================================================================== */ /* === cholmod_sparse_xtype ================================================= */ /* ========================================================================== */ /* Change the numeric xtype of a sparse matrix. Supports any type on input * and output (pattern, real, complex, or zomplex). */ int CHOLMOD(sparse_xtype) ( /* ---- input ---- */ int to_xtype, /* requested xtype */ /* ---- in/out --- */ cholmod_sparse *A, /* sparse matrix to change */ /* --------------- */ cholmod_common *Common ) { Int ok ; RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; ok = change_complexity (A->nzmax, A->xtype, to_xtype, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, &(A->x), &(A->z), Common) ; if (ok) { A->xtype = to_xtype ; } return (ok) ; } /* ========================================================================== */ /* === cholmod_triplet_xtype ================================================ */ /* ========================================================================== */ /* Change the numeric xtype of a triplet matrix. Supports any type on input * and output (pattern, real, complex, or zomplex). */ int CHOLMOD(triplet_xtype) ( /* ---- input ---- */ int to_xtype, /* requested xtype */ /* ---- in/out --- */ cholmod_triplet *T, /* triplet matrix to change */ /* --------------- */ cholmod_common *Common ) { Int ok ; RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (T, FALSE) ; RETURN_IF_XTYPE_INVALID (T, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; ok = change_complexity (T->nzmax, T->xtype, to_xtype, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, &(T->x), &(T->z), Common) ; if (ok) { T->xtype = to_xtype ; } return (ok) ; } /* ========================================================================== */ /* === cholmod_dense_xtype ================================================= */ /* ========================================================================== */ /* Change the numeric xtype of a dense matrix. Supports real, complex or * zomplex on input and output */ int CHOLMOD(dense_xtype) ( /* ---- input ---- */ int to_xtype, /* requested xtype */ /* ---- in/out --- */ cholmod_dense *X, /* dense matrix to change */ /* --------------- */ cholmod_common *Common ) { Int ok ; RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (X, FALSE) ; RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; ok = change_complexity (X->nzmax, X->xtype, to_xtype, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, &(X->x), &(X->z), Common) ; if (ok) { X->xtype = to_xtype ; } return (ok) ; } /* ========================================================================== */ /* === cholmod_factor_xtype ================================================= */ /* ========================================================================== */ /* Change the numeric xtype of a factor. Supports real, complex or zomplex on * input and output. Supernodal zomplex factors are not supported. */ int CHOLMOD(factor_xtype) ( /* ---- input ---- */ int to_xtype, /* requested xtype */ /* ---- in/out --- */ cholmod_factor *L, /* factor to change */ /* --------------- */ cholmod_common *Common ) { Int ok ; RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; if (L->is_super && (L->xtype == CHOLMOD_ZOMPLEX || to_xtype == CHOLMOD_ZOMPLEX)) { ERROR (CHOLMOD_INVALID, "invalid xtype for supernodal L") ; return (FALSE) ; } ok = change_complexity ((L->is_super ? L->xsize : L->nzmax), L->xtype, to_xtype, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, &(L->x), &(L->z), Common) ; if (ok) { L->xtype = to_xtype ; } return (ok) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/cholmod_sparse.c0000664000175000017500000004277214224052371020724 00000000000000/* ========================================================================== */ /* === Core/cholmod_sparse ================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Core utility routines for the cholmod_sparse object: * * A sparse matrix is held in compressed column form. In the basic type * ("packed", which corresponds to a MATLAB sparse matrix), an n-by-n matrix * with nz entries is held in three arrays: p of size n+1, i of size nz, and x * of size nz. Row indices of column j are held in i [p [j] ... p [j+1]-1] and * in the same locations in x. There may be no duplicate entries in a column. * Row indices in each column may be sorted or unsorted (CHOLMOD keeps track). * * Primary routines: * ----------------- * cholmod_allocate_sparse allocate a sparse matrix * cholmod_free_sparse free a sparse matrix * * Secondary routines: * ------------------- * cholmod_reallocate_sparse change the size (# entries) of sparse matrix * cholmod_nnz number of nonzeros in a sparse matrix * cholmod_speye sparse identity matrix * cholmod_spzeros sparse zero matrix * cholmod_copy_sparse create a copy of a sparse matrix * * All xtypes are supported (pattern, real, complex, and zomplex) */ #include "cholmod_internal.h" #include "cholmod_core.h" /* ========================================================================== */ /* === cholmod_allocate_sparse ============================================== */ /* ========================================================================== */ /* Allocate space for a matrix. A->i and A->x are not initialized. A->p * (and A->nz if A is not packed) are set to zero, so a matrix containing no * entries (all zero) is returned. See also cholmod_spzeros. * * workspace: none */ cholmod_sparse *CHOLMOD(allocate_sparse) ( /* ---- input ---- */ size_t nrow, /* # of rows of A */ size_t ncol, /* # of columns of A */ size_t nzmax, /* max # of nonzeros of A */ int sorted, /* TRUE if columns of A sorted, FALSE otherwise */ int packed, /* TRUE if A will be packed, FALSE otherwise */ int stype, /* stype of A */ int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) { cholmod_sparse *A ; Int *Ap, *Anz ; size_t nzmax0 ; Int j ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; if (stype != 0 && nrow != ncol) { ERROR (CHOLMOD_INVALID, "rectangular matrix with stype != 0 invalid") ; return (NULL) ; } if (xtype < CHOLMOD_PATTERN || xtype > CHOLMOD_ZOMPLEX) { ERROR (CHOLMOD_INVALID, "xtype invalid") ; return (NULL) ; } /* ensure the dimensions do not cause integer overflow */ (void) CHOLMOD(add_size_t) (ncol, 2, &ok) ; if (!ok || nrow > Int_max || ncol > Int_max || nzmax > Int_max) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (NULL) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate header */ /* ---------------------------------------------------------------------- */ A = CHOLMOD(malloc) (sizeof (cholmod_sparse), 1, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } PRINT1 (("cholmod_allocate_sparse %d-by-%d nzmax %d sorted %d packed %d" " xtype %d\n", nrow, ncol, nzmax, sorted, packed, xtype)) ; nzmax = MAX (1, nzmax) ; A->nrow = nrow ; A->ncol = ncol ; A->nzmax = nzmax ; A->packed = packed ; /* default is packed (A->nz not present) */ A->stype = stype ; A->itype = ITYPE ; A->xtype = xtype ; A->dtype = DTYPE ; A->nz = NULL ; A->p = NULL ; A->i = NULL ; A->x = NULL ; A->z = NULL ; /* A 1-by-m matrix always has sorted columns */ A->sorted = (nrow <= 1) ? TRUE : sorted ; /* ---------------------------------------------------------------------- */ /* allocate the matrix itself */ /* ---------------------------------------------------------------------- */ /* allocate O(ncol) space */ A->p = CHOLMOD(malloc) (((size_t) ncol)+1, sizeof (Int), Common) ; if (!packed) { A->nz = CHOLMOD(malloc) (ncol, sizeof (Int), Common) ; } /* allocate O(nz) space */ nzmax0 = 0 ; CHOLMOD(realloc_multiple) (nzmax, 1, xtype, &(A->i), NULL, &(A->x), &(A->z), &nzmax0, Common) ; if (Common->status < CHOLMOD_OK) { CHOLMOD(free_sparse) (&A, Common) ; return (NULL) ; /* out of memory */ } /* ---------------------------------------------------------------------- */ /* initialize A->p and A->nz so that A is an empty matrix */ /* ---------------------------------------------------------------------- */ Ap = A->p ; for (j = 0 ; j <= (Int) ncol ; j++) { Ap [j] = 0 ; } if (!packed) { Anz = A->nz ; for (j = 0 ; j < (Int) ncol ; j++) { Anz [j] = 0 ; } } return (A) ; } /* ========================================================================== */ /* === cholmod_free_sparse ================================================== */ /* ========================================================================== */ /* free a sparse matrix * * workspace: none */ int CHOLMOD(free_sparse) ( /* ---- in/out --- */ cholmod_sparse **AHandle, /* matrix to deallocate, NULL on output */ /* --------------- */ cholmod_common *Common ) { Int n, nz ; cholmod_sparse *A ; RETURN_IF_NULL_COMMON (FALSE) ; if (AHandle == NULL) { /* nothing to do */ return (TRUE) ; } A = *AHandle ; if (A == NULL) { /* nothing to do */ return (TRUE) ; } n = A->ncol ; nz = A->nzmax ; A->p = CHOLMOD(free) (n+1, sizeof (Int), A->p, Common) ; A->i = CHOLMOD(free) (nz, sizeof (Int), A->i, Common) ; A->nz = CHOLMOD(free) (n, sizeof (Int), A->nz, Common) ; switch (A->xtype) { case CHOLMOD_REAL: A->x = CHOLMOD(free) (nz, sizeof (double), A->x, Common) ; break ; case CHOLMOD_COMPLEX: A->x = CHOLMOD(free) (nz, 2*sizeof (double), A->x, Common) ; break ; case CHOLMOD_ZOMPLEX: A->x = CHOLMOD(free) (nz, sizeof (double), A->x, Common) ; A->z = CHOLMOD(free) (nz, sizeof (double), A->z, Common) ; break ; } *AHandle = CHOLMOD(free) (1, sizeof (cholmod_sparse), (*AHandle), Common) ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_reallocate_sparse ============================================ */ /* ========================================================================== */ /* Change the size of A->i, A->x, and A->z, or allocate them if their current * size is zero. A->x and A->z are not modified if A->xtype is CHOLMOD_PATTERN. * A->z is not modified unless A->xtype is CHOLMOD_ZOMPLEX. * * workspace: none */ int CHOLMOD(reallocate_sparse) ( /* ---- input ---- */ size_t nznew, /* new # of entries in A */ /* ---- in/out --- */ cholmod_sparse *A, /* matrix to reallocate */ /* --------------- */ cholmod_common *Common ) { /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; Common->status = CHOLMOD_OK ; PRINT1 (("realloc matrix %d to %d, xtype: %d\n", A->nzmax, nznew, A->xtype)) ; /* ---------------------------------------------------------------------- */ /* resize the matrix */ /* ---------------------------------------------------------------------- */ CHOLMOD(realloc_multiple) (MAX (1,nznew), 1, A->xtype, &(A->i), NULL, &(A->x), &(A->z), &(A->nzmax), Common) ; return (Common->status == CHOLMOD_OK) ; } /* ========================================================================== */ /* === cholmod_speye ======================================================== */ /* ========================================================================== */ /* Return a sparse identity matrix. */ cholmod_sparse *CHOLMOD(speye) ( /* ---- input ---- */ size_t nrow, /* # of rows of A */ size_t ncol, /* # of columns of A */ int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) { double *Ax, *Az ; cholmod_sparse *A ; Int *Ap, *Ai ; Int j, n ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate the matrix */ /* ---------------------------------------------------------------------- */ n = MIN (nrow, ncol) ; A = CHOLMOD(allocate_sparse) (nrow, ncol, n, TRUE, TRUE, 0, xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory or inputs invalid */ } /* ---------------------------------------------------------------------- */ /* create the identity matrix */ /* ---------------------------------------------------------------------- */ Ap = A->p ; Ai = A->i ; Ax = A->x ; Az = A->z ; for (j = 0 ; j < n ; j++) { Ap [j] = j ; } for (j = n ; j <= ((Int) ncol) ; j++) { Ap [j] = n ; } for (j = 0 ; j < n ; j++) { Ai [j] = j ; } switch (xtype) { case CHOLMOD_REAL: for (j = 0 ; j < n ; j++) { Ax [j] = 1 ; } break ; case CHOLMOD_COMPLEX: for (j = 0 ; j < n ; j++) { Ax [2*j ] = 1 ; Ax [2*j+1] = 0 ; } break ; case CHOLMOD_ZOMPLEX: for (j = 0 ; j < n ; j++) { Ax [j] = 1 ; } for (j = 0 ; j < n ; j++) { Az [j] = 0 ; } break ; } return (A) ; } /* ========================================================================== */ /* === cholmod_spzeros ====================================================== */ /* ========================================================================== */ /* Return a sparse zero matrix. */ cholmod_sparse *CHOLMOD(spzeros) ( /* ---- input ---- */ size_t nrow, /* # of rows of A */ size_t ncol, /* # of columns of A */ size_t nzmax, /* max # of nonzeros of A */ int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) { /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate the matrix */ /* ---------------------------------------------------------------------- */ return (CHOLMOD(allocate_sparse) (nrow, ncol, nzmax, TRUE, TRUE, 0, xtype, Common)) ; } /* ========================================================================== */ /* === cholmod_nnz ========================================================== */ /* ========================================================================== */ /* Return the number of entries in a sparse matrix. * * workspace: none * integer overflow cannot occur, since the matrix is already allocated. */ SuiteSparse_long CHOLMOD(nnz) ( /* ---- input ---- */ cholmod_sparse *A, /* --------------- */ cholmod_common *Common ) { Int *Ap, *Anz ; size_t nz ; Int j, ncol ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (A, EMPTY) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, EMPTY) ; Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* return nnz (A) */ /* ---------------------------------------------------------------------- */ ncol = A->ncol ; if (A->packed) { Ap = A->p ; RETURN_IF_NULL (Ap, EMPTY) ; nz = Ap [ncol] ; } else { Anz = A->nz ; RETURN_IF_NULL (Anz, EMPTY) ; nz = 0 ; for (j = 0 ; j < ncol ; j++) { nz += MAX (0, Anz [j]) ; } } return (nz) ; } /* ========================================================================== */ /* === cholmod_copy_sparse ================================================== */ /* ========================================================================== */ /* C = A. Create an exact copy of a sparse matrix, with one exception. * Entries in unused space are not copied (they might not be initialized, * and copying them would cause program checkers such as purify and * valgrind to complain). The xtype of the resulting matrix C is the same as * the xtype of the input matrix A. * * See also Core/cholmod_copy, which copies a matrix with possible changes * in stype, presence of diagonal entries, pattern vs. numerical values, * real and/or imaginary parts, and so on. */ cholmod_sparse *CHOLMOD(copy_sparse) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) { double *Ax, *Cx, *Az, *Cz ; Int *Ap, *Ai, *Anz, *Cp, *Ci, *Cnz ; cholmod_sparse *C ; Int p, pend, j, ncol, packed, nzmax, nz, xtype ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, NULL) ; if (A->stype != 0 && A->nrow != A->ncol) { ERROR (CHOLMOD_INVALID, "rectangular matrix with stype != 0 invalid") ; return (NULL) ; } Common->status = CHOLMOD_OK ; ASSERT (CHOLMOD(dump_sparse) (A, "A original", Common) >= 0) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ ncol = A->ncol ; nzmax = A->nzmax ; packed = A->packed ; Ap = A->p ; Ai = A->i ; Ax = A->x ; Az = A->z ; Anz = A->nz ; xtype = A->xtype ; /* ---------------------------------------------------------------------- */ /* allocate the copy */ /* ---------------------------------------------------------------------- */ C = CHOLMOD(allocate_sparse) (A->nrow, A->ncol, A->nzmax, A->sorted, A->packed, A->stype, A->xtype, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } Cp = C->p ; Ci = C->i ; Cx = C->x ; Cz = C->z ; Cnz = C->nz ; /* ---------------------------------------------------------------------- */ /* copy the matrix */ /* ---------------------------------------------------------------------- */ for (j = 0 ; j <= ncol ; j++) { Cp [j] = Ap [j] ; } if (packed) { nz = Ap [ncol] ; for (p = 0 ; p < nz ; p++) { Ci [p] = Ai [p] ; } switch (xtype) { case CHOLMOD_REAL: for (p = 0 ; p < nz ; p++) { Cx [p] = Ax [p] ; } break ; case CHOLMOD_COMPLEX: for (p = 0 ; p < 2*nz ; p++) { Cx [p] = Ax [p] ; } break ; case CHOLMOD_ZOMPLEX: for (p = 0 ; p < nz ; p++) { Cx [p] = Ax [p] ; Cz [p] = Az [p] ; } break ; } } else { for (j = 0 ; j < ncol ; j++) { Cnz [j] = Anz [j] ; } switch (xtype) { case CHOLMOD_PATTERN: for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = p + Anz [j] ; for ( ; p < pend ; p++) { Ci [p] = Ai [p] ; } } break ; case CHOLMOD_REAL: for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = p + Anz [j] ; for ( ; p < pend ; p++) { Ci [p] = Ai [p] ; Cx [p] = Ax [p] ; } } break ; case CHOLMOD_COMPLEX: for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = p + Anz [j] ; for ( ; p < pend ; p++) { Ci [p] = Ai [p] ; Cx [2*p ] = Ax [2*p ] ; Cx [2*p+1] = Ax [2*p+1] ; } } break ; case CHOLMOD_ZOMPLEX: for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = p + Anz [j] ; for ( ; p < pend ; p++) { Ci [p] = Ai [p] ; Cx [p] = Ax [p] ; Cz [p] = Az [p] ; } } break ; } } /* ---------------------------------------------------------------------- */ /* return the result */ /* ---------------------------------------------------------------------- */ ASSERT (CHOLMOD(dump_sparse) (C, "C copy", Common) >= 0) ; return (C) ; } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/License.txt0000664000175000017500000000207214224052371017666 00000000000000CHOLMOD/Core Module. Copyright (C) 2005-2006, Univ. of Florida. Author: Timothy A. Davis CHOLMOD is also available under other licenses; contact authors for details. http://www.suitesparse.com Note that this license is for the CHOLMOD/Core module only. All CHOLMOD modules are licensed separately. -------------------------------------------------------------------------------- This Module is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This Module 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this Module; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/lesser.txt0000664000175000017500000006350014224052371017604 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/t_cholmod_change_factor.c0000664000175000017500000003751314224052371022532 00000000000000/* ========================================================================== */ /* === Core/t_cholmod_change_factor ========================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Template routine for cholmod_change_factor. All xtypes supported. */ #include "cholmod_template.h" /* ========================================================================== */ /* === t_change_simplicial_numeric ========================================== */ /* ========================================================================== */ static void TEMPLATE (change_simplicial_numeric) ( cholmod_factor *L, Int to_ll, Int to_packed, Int *newLi, double *newLx, double *newLz, Int lnz, Int grow, double grow1, Int grow2, Int make_ll, Int make_monotonic, Int make_ldl, cholmod_common *Common ) { double xlen, dj [1], ljj [1], lj2 [1] ; double *Lx, *Lz ; Int *Lp, *Li, *Lnz ; Int n, j, len, pnew, pold, k, p, pend ; n = L->n ; Lp = L->p ; Li = L->i ; Lx = L->x ; Lz = L->z ; Lnz = L->nz ; if (make_ll) { L->minor = n ; } if (make_monotonic) { /* ------------------------------------------------------------------ */ /* reorder the columns to make them monotonic */ /* ------------------------------------------------------------------ */ pnew = 0 ; for (j = 0 ; j < n ; j++) { /* copy and pack column j */ len = Lnz [j] ; PRINT2 (("j: "ID" Lnz[j] "ID" len "ID" p "ID"\n", j, Lnz [j], len, pnew)) ; pold = Lp [j] ; ASSERT (Li [pold] == j) ; if (make_ll) { /* ---------------------------------------------------------- */ /* copy and convert LDL' to LL' */ /* ---------------------------------------------------------- */ /* dj = Lx [pold] ; */ ASSIGN_REAL (dj,0, Lx,pold) ; if (IS_LE_ZERO (dj [0])) { /* Conversion has failed; matrix is not positive definite. * Do not modify the column so that the LDL' factorization * can be restored if desired, by converting back to LDL'. * Continue the conversion, but flag the error. */ if (L->minor == (size_t) n) { ERROR (CHOLMOD_NOT_POSDEF, "L not positive definite") ; L->minor = j ; } for (k = 0 ; k < len ; k++) { newLi [pnew + k] = Li [pold + k] ; /* newLx [pnew + k] = Lx [pold + k] ; */ ASSIGN (newLx, newLz, pnew+k, Lx, Lz, pold+k) ; } } else { ljj [0] = sqrt (dj [0]) ; newLi [pnew] = j ; /* newLx [pnew] = ljj ; */ ASSIGN_REAL (newLx, pnew, ljj, 0) ; CLEAR_IMAG (newLx, newLz, pnew) ; for (k = 1 ; k < len ; k++) { newLi [pnew + k] = Li [pold + k] ; /* newLx [pnew + k] = Lx [pold + k] * ljj ; */ MULT_REAL (newLx, newLz, pnew+k, Lx, Lz, pold+k, ljj,0); } } } else if (make_ldl) { /* ---------------------------------------------------------- */ /* copy and convert LL' to LDL' */ /* ---------------------------------------------------------- */ /* ljj = Lx [pold] ; */ ASSIGN_REAL (ljj, 0, Lx, pold) ; if (ljj [0] <= 0) { /* matrix is not positive-definite; copy column as-is */ for (k = 0 ; k < len ; k++) { newLi [pnew + k] = Li [pold + k] ; /* newLx [pnew + k] = Lx [pold + k] ; */ ASSIGN (newLx, newLz, pnew+k, Lx, Lz, pold+k) ; } } else { newLi [pnew] = j ; /* newLx [pnew] = ljj*ljj ; */ lj2 [0] = ljj [0] * ljj [0] ; ASSIGN_REAL (newLx, pnew, lj2, 0) ; CLEAR_IMAG (newLx, newLz, pnew) ; for (k = 1 ; k < len ; k++) { newLi [pnew + k] = Li [pold + k] ; /* newLx [pnew + k] = Lx [pold + k] / ljj ; */ DIV_REAL (newLx, newLz, pnew+k, Lx, Lz, pold+k, ljj,0) ; } } } else { /* ---------------------------------------------------------- */ /* copy and leave LL' or LDL' as-is */ /* ---------------------------------------------------------- */ for (k = 0 ; k < len ; k++) { newLi [pnew + k] = Li [pold + k] ; /* newLx [pnew + k] = Lx [pold + k] ; */ ASSIGN (newLx, newLz, pnew+k, Lx, Lz, pold+k) ; } } Lp [j] = pnew ; /* compute len in double to avoid integer overflow */ if (grow) { xlen = (double) len ; xlen = grow1 * xlen + grow2 ; xlen = MIN (xlen, n-j) ; len = (Int) xlen ; } ASSERT (len >= Lnz [j] && len <= n-j) ; pnew += len ; ASSERT (pnew > 0) ; /* integer overflow case already covered */ } Lp [n] = pnew ; PRINT1 (("final pnew = "ID", lnz "ID" lnzmax %g\n", pnew, lnz, (double) L->nzmax)) ; ASSERT (pnew <= lnz) ; /* free the old L->i and L->x and replace with the new ones */ CHOLMOD(free) (L->nzmax, sizeof (Int), L->i, Common) ; #ifdef REAL CHOLMOD(free) (L->nzmax, sizeof (double), L->x, Common) ; #elif defined (COMPLEX) CHOLMOD(free) (L->nzmax, 2*sizeof (double), L->x, Common) ; #else CHOLMOD(free) (L->nzmax, sizeof (double), L->x, Common) ; CHOLMOD(free) (L->nzmax, sizeof (double), L->z, Common) ; #endif L->i = newLi ; L->x = newLx ; L->z = newLz ; L->nzmax = lnz ; /* reconstruct the link list */ natural_list (L) ; } else if (to_packed) { /* ------------------------------------------------------------------ */ /* already monotonic, just pack the columns of L */ /* ------------------------------------------------------------------ */ pnew = 0 ; if (make_ll) { /* -------------------------------------------------------------- */ /* pack and convert LDL' to LL' */ /* -------------------------------------------------------------- */ for (j = 0 ; j < n ; j++) { /* pack column j */ pold = Lp [j] ; len = Lnz [j] ; ASSERT (len > 0) ; ASSERT (Li [pold] == j) ; PRINT2 (("col "ID" pnew "ID" pold "ID"\n", j, pnew, pold)) ; /* dj = Lx [pold] ; */ ASSIGN_REAL (dj,0, Lx,pold) ; if (IS_LE_ZERO (dj [0])) { /* Conversion has failed; matrix is not positive definite. * Do not modify the column so that the LDL' factorization * can be restored if desired, by converting back to LDL'. * Continue the conversion, but flag the error. */ if (L->minor == (size_t) n) { ERROR (CHOLMOD_NOT_POSDEF, "L not positive definite") ; L->minor = j ; } for (k = 0 ; k < len ; k++) { Li [pnew + k] = Li [pold + k] ; /* Lx [pnew + k] = Lx [pold + k] ; */ ASSIGN (Lx, Lz, pnew+k, Lx, Lz, pold+k) ; } } else { ljj [0] = sqrt (dj [0]) ; Li [pnew] = j ; /* Lx [pnew] = ljj ; */ ASSIGN_REAL (Lx, pnew, ljj, 0) ; CLEAR_IMAG (Lx, Lz, pnew) ; for (k = 1 ; k < len ; k++) { Li [pnew + k] = Li [pold + k] ; /* Lx [pnew + k] = Lx [pold + k] * ljj ; */ MULT_REAL (Lx, Lz, pnew+k, Lx, Lz, pold+k, ljj,0) ; } } Lp [j] = pnew ; pnew += len ; } } else if (make_ldl) { /* -------------------------------------------------------------- */ /* pack and convert LL' to LDL' */ /* -------------------------------------------------------------- */ for (j = 0 ; j < n ; j++) { /* pack column j */ pold = Lp [j] ; len = Lnz [j] ; /* ljj = Lx [pold] ; */ ASSIGN_REAL (ljj, 0, Lx, pold) ; ASSERT (len > 0) ; PRINT2 (("col "ID" pnew "ID" pold "ID"\n", j, pnew, pold)) ; if (ljj [0] <= 0) { /* matrix is not positive-definite; pack column as-is */ for (k = 0 ; k < len ; k++) { Li [pnew + k] = Li [pold + k] ; /* Lx [pnew + k] = Lx [pold + k] ; */ ASSIGN (Lx, Lz, pnew+k, Lx, Lz, pold+k) ; } } else { Li [pnew] = Li [pold] ; /* Lx [pnew] = ljj*ljj ; */ lj2 [0] = ljj [0] * ljj [0] ; ASSIGN_REAL (Lx, pnew, lj2, 0) ; CLEAR_IMAG (Lx, Lz, pnew) ; for (k = 1 ; k < len ; k++) { Li [pnew + k] = Li [pold + k] ; /* Lx [pnew + k] = Lx [pold + k] / ljj ; */ DIV_REAL (Lx, Lz, pnew+k, Lx, Lz, pold+k, ljj,0) ; } } Lp [j] = pnew ; pnew += len ; } } else { /* ---------------------------------------------------------- */ /* pack and leave LL' or LDL' as-is */ /* ---------------------------------------------------------- */ for (j = 0 ; j < n ; j++) { /* pack column j */ pold = Lp [j] ; len = Lnz [j] ; ASSERT (len > 0) ; PRINT2 (("col "ID" pnew "ID" pold "ID"\n", j, pnew, pold)) ; if (pnew < pold) { PRINT2 ((" pack this column\n")) ; for (k = 0 ; k < len ; k++) { Li [pnew + k] = Li [pold + k] ; /* Lx [pnew + k] = Lx [pold + k] ; */ ASSIGN (Lx, Lz, pnew+k, Lx, Lz, pold+k) ; } Lp [j] = pnew ; } pnew += len ; } } Lp [n] = pnew ; PRINT2 (("Lp [n] = "ID"\n", pnew)) ; } else if (make_ll) { /* ------------------------------------------------------------------ */ /* convert LDL' to LL', but do so in-place */ /* ------------------------------------------------------------------ */ for (j = 0 ; j < n ; j++) { p = Lp [j] ; pend = p + Lnz [j] ; /* dj = Lx [p] ; */ ASSIGN_REAL (dj,0, Lx,p) ; if (IS_LE_ZERO (dj [0])) { /* Conversion has failed; matrix is not positive definite. * Do not modify the column so that the LDL' factorization * can be restored if desired, by converting back to LDL'. * Continue the conversion, but flag the error. */ if (L->minor == (size_t) n) { ERROR (CHOLMOD_NOT_POSDEF, "L not positive definite") ; L->minor = j ; } } else { ljj [0] = sqrt (dj [0]) ; /* Lx [p] = ljj ; */ ASSIGN_REAL (Lx,p, ljj,0) ; CLEAR_IMAG (Lx, Lz, p) ; for (p++ ; p < pend ; p++) { /* Lx [p] *= ljj ; */ MULT_REAL (Lx,Lz,p, Lx,Lz,p, ljj,0) ; } } } } else if (make_ldl) { /* ------------------------------------------------------------------ */ /* convert LL' to LDL', but do so in-place */ /* ------------------------------------------------------------------ */ for (j = 0 ; j < n ; j++) { p = Lp [j] ; pend = p + Lnz [j] ; /* ljj = Lx [p] ; */ ASSIGN_REAL (ljj, 0, Lx, p) ; if (ljj [0] > 0) { /* Lx [p] = ljj*ljj ; */ lj2 [0] = ljj [0] * ljj [0] ; ASSIGN_REAL (Lx, p, lj2, 0) ; CLEAR_IMAG (Lx, Lz, p) ; for (p++ ; p < pend ; p++) { /* Lx [p] /= ljj ; */ DIV_REAL (Lx,Lz,p, Lx,Lz,p, ljj,0) ; } } } } L->is_ll = to_ll ; DEBUG (CHOLMOD(dump_factor) (L, "done change simplicial numeric", Common)) ; } /* ========================================================================== */ /* === t_ll_super_to_simplicial_numeric ===================================== */ /* ========================================================================== */ /* A supernodal L can only be real or complex, not zomplex */ #ifndef ZOMPLEX static void TEMPLATE (ll_super_to_simplicial_numeric) ( cholmod_factor *L, Int to_packed, Int to_ll, cholmod_common *Common ) { double ljj [1], lj2 [1] ; double *Lx ; Int *Ls, *Lpi, *Lpx, *Super, *Lp, *Li, *Lnz ; Int n, lnz, s, nsuper, p, psi, psx, psend, nsrow, nscol, ii, jj, j, k1, k2, q ; L->is_ll = to_ll ; Lp = L->p ; Li = L->i ; Lx = L->x ; Lnz = L->nz ; lnz = L->nzmax ; n = L->n ; nsuper = L->nsuper ; Lpi = L->pi ; Lpx = L->px ; Ls = L->s ; Super = L->super ; p = 0 ; for (s = 0 ; s < nsuper ; s++) { k1 = Super [s] ; k2 = Super [s+1] ; psi = Lpi [s] ; psend = Lpi [s+1] ; psx = Lpx [s] ; nsrow = psend - psi ; nscol = k2 - k1 ; for (jj = 0 ; jj < nscol ; jj++) { /* column j of L starts here */ j = jj + k1 ; if (to_ll) { if (to_packed) { /* ------------------------------------------------------ */ /* convert to LL' packed */ /* ------------------------------------------------------ */ Lp [j] = p ; PRINT2 (("Col j "ID" p "ID"\n", j, p)) ; for (ii = jj ; ii < nsrow ; ii++) { /* get L(i,j) from supernode and store in column j */ ASSERT (p < (Int) (L->xsize) && p <= psx+ii+jj*nsrow) ; Li [p] = Ls [psi + ii] ; /* Lx [p] = Lx [psx + ii + jj*nsrow] ; */ q = psx + ii + jj*nsrow ; ASSIGN (Lx,-,p, Lx,-,q) ; PRINT2 ((" i "ID" ", Li [p])) ; XPRINT2 (Lx,-,q) ; PRINT2 (("\n")) ; p++ ; } Lnz [j] = p - Lp [j] ; } else { /* ------------------------------------------------------ */ /* convert to LL' unpacked */ /* ------------------------------------------------------ */ p = psx + jj + jj*nsrow ; Lp [j] = p ; Li [p] = j ; Lnz [j] = nsrow - jj ; p++ ; for (ii = jj + 1 ; ii < nsrow ; ii++) { /* get L(i,j) from supernode and store in column j */ Li [psx + ii + jj*nsrow] = Ls [psi + ii] ; } } } else { if (to_packed) { /* ------------------------------------------------------ */ /* convert to LDL' packed */ /* ------------------------------------------------------ */ Lp [j] = p ; PRINT2 (("Col j "ID" p "ID"\n", Lp [j], p)) ; /* ljj = Lx [psx + jj + jj*nsrow] ; */ ASSIGN_REAL (ljj, 0, Lx, psx + jj + jj*nsrow) ; if (ljj [0] <= 0) { /* the matrix is not positive definite; do not divide */ /* Lx [p] = ljj ; */ ASSIGN_REAL (Lx, p, ljj, 0) ; CLEAR_IMAG (Lx, Lz, p) ; ljj [0] = 1 ; } else { lj2 [0] = ljj [0] * ljj [0] ; /* Lx [p] = ljj*ljj ; */ ASSIGN_REAL (Lx, p, lj2, 0) ; CLEAR_IMAG (Lx, Lz, p) ; } Li [p] = j ; p++ ; for (ii = jj + 1 ; ii < nsrow ; ii++) { /* get L(i,j) from supernode and store in column j */ ASSERT (p < (Int) (L->xsize) && p <= psx+ii+jj*nsrow) ; Li [p] = Ls [psi + ii] ; /* Lx [p] = Lx [psx + ii + jj*nsrow] / ljj ; */ q = psx + ii + jj*nsrow ; DIV_REAL (Lx, Lz, p, Lx, Lz, q, ljj,0) ; PRINT2 ((" i "ID" %g\n", Li [p], Lx [p])) ; p++ ; } Lnz [j] = p - Lp [j] ; } else { /* ------------------------------------------------------ */ /* convert to LDL' unpacked */ /* ------------------------------------------------------ */ p = psx + jj + jj*nsrow ; Lp [j] = p ; /* ljj = Lx [p] ; */ ASSIGN_REAL (ljj,0, Lx,p) ; if (ljj [0] <= 0) { /* the matrix is not positive definite; do not divide */ /* Lx [p] = ljj ; */ ASSIGN_REAL (Lx, p, ljj, 0) ; CLEAR_IMAG (Lx, Lz, p) ; ljj [0] = 1 ; } else { lj2 [0] = ljj [0] * ljj [0] ; /* Lx [p] = ljj*ljj ; */ ASSIGN_REAL (Lx, p, lj2, 0) ; CLEAR_IMAG (Lx, Lz, p) ; } Li [p] = j ; Lnz [j] = nsrow - jj ; p++ ; for (ii = jj + 1 ; ii < nsrow ; ii++) { /* get L(i,j) from supernode and store in column j */ Li [psx + ii + jj*nsrow] = Ls [psi + ii] ; /* Lx [psx + ii + jj*nsrow] /= ljj ; */ q = psx + ii + jj*nsrow ; DIV_REAL (Lx, Lz, q, Lx, Lz, q, ljj,0) ; } } } } } if (to_packed) { Lp [n] = p ; PRINT1 (("Final Lp "ID" n "ID" lnz "ID"\n", p, n, lnz)) ; ASSERT (Lp [n] == lnz) ; ASSERT (lnz <= (Int) (L->xsize)) ; /* reduce size of L->x to match L->i. This cannot fail. */ L->x = CHOLMOD(realloc) (lnz, #ifdef COMPLEX 2 * #endif sizeof (double), L->x, &(L->xsize), Common) ; ASSERT (lnz == (Int) (L->xsize)) ; Common->status = CHOLMOD_OK ; } else { Lp [n] = Lpx [nsuper] ; ASSERT (MAX (1,Lp [n]) == (Int) (L->xsize)) ; ASSERT (MAX (1,Lp [n]) == (Int) (L->nzmax)) ; } } #endif #undef PATTERN #undef REAL #undef COMPLEX #undef ZOMPLEX JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/t_cholmod_dense.c0000664000175000017500000001621114224052371021035 00000000000000/* ========================================================================== */ /* === Core/t_cholmod_dense ================================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Template routine for cholmod_dense. All xtypes supported, except that there * are no dense matrices with an xtype of pattern. */ #include "cholmod_template.h" /* ========================================================================== */ /* === t_cholmod_sparse_to_dense ============================================ */ /* ========================================================================== */ static cholmod_dense *TEMPLATE (cholmod_sparse_to_dense) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) { double *Ax, *Xx, *Az, *Xz ; Int *Ap, *Ai, *Anz ; cholmod_dense *X ; Int i, j, p, pend, nrow, ncol, packed ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ nrow = A->nrow ; ncol = A->ncol ; packed = A->packed ; Ap = A->p ; Ai = A->i ; Ax = A->x ; Az = A->z ; Anz = A->nz ; /* ---------------------------------------------------------------------- */ /* allocate result */ /* ---------------------------------------------------------------------- */ X = CHOLMOD(zeros) (nrow, ncol, XTYPE2, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } Xx = X->x ; Xz = X->z ; /* ---------------------------------------------------------------------- */ /* copy into dense matrix */ /* ---------------------------------------------------------------------- */ if (A->stype < 0) { /* A is symmetric with lower stored, but both parts of X are present */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i >= j) { ASSIGN2 (Xx, Xz, i+j*nrow, Ax, Az, p) ; ASSIGN2_CONJ (Xx, Xz, j+i*nrow, Ax, Az, p) ; } } } } else if (A->stype > 0) { /* A is symmetric with upper stored, but both parts of X are present */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i <= j) { ASSIGN2 (Xx, Xz, i+j*nrow, Ax, Az, p) ; ASSIGN2_CONJ (Xx, Xz, j+i*nrow, Ax, Az, p) ; } } } } else { /* both parts of A and X are present */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; ASSIGN2 (Xx, Xz, i+j*nrow, Ax, Az, p) ; } } } return (X) ; } #ifndef PATTERN /* There are no dense matrices of xtype CHOLMOD_PATTERN */ /* ========================================================================== */ /* === t_cholmod_dense_to_sparse ============================================ */ /* ========================================================================== */ static cholmod_sparse *TEMPLATE (cholmod_dense_to_sparse) ( /* ---- input ---- */ cholmod_dense *X, /* matrix to copy */ int values, /* TRUE if values to be copied, FALSE otherwise */ /* --------------- */ cholmod_common *Common ) { double *Xx, *Cx, *Xz, *Cz ; Int *Ci, *Cp ; cholmod_sparse *C ; Int i, j, p, d, nrow, ncol, nz ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ nrow = X->nrow ; ncol = X->ncol ; d = X->d ; Xx = X->x ; Xz = X->z ; /* ---------------------------------------------------------------------- */ /* count the number of nonzeros in the result */ /* ---------------------------------------------------------------------- */ nz = 0 ; for (j = 0 ; j < ncol ; j++) { for (i = 0 ; i < nrow ; i++) { if (ENTRY_IS_NONZERO (Xx, Xz, i+j*d)) { nz++ ; } } } /* ---------------------------------------------------------------------- */ /* allocate the result C */ /* ---------------------------------------------------------------------- */ C = CHOLMOD(allocate_sparse) (nrow, ncol, nz, TRUE, TRUE, 0, values ? XTYPE : CHOLMOD_PATTERN, Common) ; if (Common->status < CHOLMOD_OK) { return (NULL) ; /* out of memory */ } Cp = C->p ; Ci = C->i ; Cx = C->x ; Cz = C->z ; /* ---------------------------------------------------------------------- */ /* copy the dense matrix X into the sparse matrix C */ /* ---------------------------------------------------------------------- */ p = 0 ; for (j = 0 ; j < ncol ; j++) { Cp [j] = p ; for (i = 0 ; i < nrow ; i++) { if (ENTRY_IS_NONZERO (Xx, Xz, i+j*d)) { Ci [p] = i ; if (values) { ASSIGN (Cx, Cz, p, Xx, Xz, i+j*d) ; } p++ ; } } } ASSERT (p == nz) ; Cp [ncol] = nz ; /* ---------------------------------------------------------------------- */ /* return result */ /* ---------------------------------------------------------------------- */ ASSERT (CHOLMOD(dump_sparse) (C, "C", Common) >= 0) ; return (C) ; } /* ========================================================================== */ /* === t_cholmod_copy_dense2 ================================================ */ /* ========================================================================== */ /* Y = X, where X and Y are both already allocated. */ static int TEMPLATE (cholmod_copy_dense2) ( /* ---- input ---- */ cholmod_dense *X, /* matrix to copy */ /* ---- output --- */ cholmod_dense *Y /* copy of matrix X */ ) { double *Xx, *Xz, *Yx, *Yz ; Int i, j, nrow, ncol, dy, dx ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Xx = X->x ; Xz = X->z ; Yx = Y->x ; Yz = Y->z ; dx = X->d ; dy = Y->d ; nrow = X->nrow ; ncol = X->ncol ; /* ---------------------------------------------------------------------- */ /* copy */ /* ---------------------------------------------------------------------- */ CLEAR (Yx, Yz, 0) ; for (j = 0 ; j < ncol ; j++) { for (i = 0 ; i < nrow ; i++) { ASSIGN (Yx, Yz, i+j*dy, Xx, Xz, i+j*dx) ; } } return (TRUE) ; } #endif #undef PATTERN #undef REAL #undef COMPLEX #undef ZOMPLEX JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/t_cholmod_transpose.c0000664000175000017500000002124414224052371021757 00000000000000/* ========================================================================== */ /* === Core/t_cholmod_transpose ============================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Template routine for cholmod_transpose. All xtypes are supported. For * complex matrices, either the array tranpose or complex conjugate transpose * can be computed. */ #include "cholmod_template.h" /* ========================================================================== */ /* === t_cholmod_transpose_unsym ============================================ */ /* ========================================================================== */ /* Compute F = A', A (:,f)', or A (p,f)', where A is unsymmetric and F is * already allocated. The complex case performs either the array transpose * or complex conjugate transpose. * * workspace: * Iwork (MAX (nrow,ncol)) if fset is present * Iwork (nrow) if fset is NULL */ static int TEMPLATE (cholmod_transpose_unsym) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to transpose */ Int *Perm, /* size nrow, if present (can be NULL) */ Int *fset, /* subset of 0:(A->ncol)-1 */ Int nf, /* size of fset */ /* ---- output --- */ cholmod_sparse *F, /* F = A', A(:,f)', or A(p,f)' */ /* --------------- */ cholmod_common *Common ) { double *Ax, *Az, *Fx, *Fz ; Int *Ap, *Anz, *Ai, *Fp, *Fnz, *Fj, *Wi, *Iwork ; Int j, p, pend, nrow, ncol, Apacked, use_fset, fp, Fpacked, jj, permute ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ /* ensure the xtype of A and F match (ignored if this is pattern version) */ if (!XTYPE_OK (A->xtype)) { ERROR (CHOLMOD_INVALID, "real/complex mismatch") ; return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ use_fset = (fset != NULL) ; nrow = A->nrow ; ncol = A->ncol ; Ap = A->p ; /* size A->ncol+1, column pointers of A */ Ai = A->i ; /* size nz = Ap [A->ncol], row indices of A */ Ax = A->x ; /* size nz, real values of A */ Az = A->z ; /* size nz, imag values of A */ Anz = A->nz ; Apacked = A->packed ; ASSERT (IMPLIES (!Apacked, Anz != NULL)) ; permute = (Perm != NULL) ; Fp = F->p ; /* size A->nrow+1, row pointers of F */ Fj = F->i ; /* size nz, column indices of F */ Fx = F->x ; /* size nz, real values of F */ Fz = F->z ; /* size nz, imag values of F */ Fnz = F->nz ; Fpacked = F->packed ; ASSERT (IMPLIES (!Fpacked, Fnz != NULL)) ; nf = (use_fset) ? nf : ncol ; /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Iwork = Common->Iwork ; Wi = Iwork ; /* size nrow (i/l/l) */ /* ---------------------------------------------------------------------- */ /* construct the transpose */ /* ---------------------------------------------------------------------- */ for (jj = 0 ; jj < nf ; jj++) { j = (use_fset) ? (fset [jj]) : jj ; p = Ap [j] ; pend = (Apacked) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { fp = Wi [Ai [p]]++ ; Fj [fp] = j ; #ifdef NCONJUGATE ASSIGN (Fx, Fz, fp, Ax, Az, p) ; #else ASSIGN_CONJ (Fx, Fz, fp, Ax, Az, p) ; #endif } } return (TRUE) ; } /* ========================================================================== */ /* === t_cholmod_transpose_sym ============================================== */ /* ========================================================================== */ /* Compute F = A' or A (p,p)', where A is symmetric and F is already allocated. * The complex case performs either the array transpose or complex conjugate * transpose. * * workspace: Iwork (nrow) if Perm NULL, Iwork (2*nrow) if Perm non-NULL. */ static int TEMPLATE (cholmod_transpose_sym) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to transpose */ Int *Perm, /* size n, if present (can be NULL) */ /* ---- output --- */ cholmod_sparse *F, /* F = A' or A(p,p)' */ /* --------------- */ cholmod_common *Common ) { double *Ax, *Az, *Fx, *Fz ; Int *Ap, *Anz, *Ai, *Fp, *Fj, *Wi, *Pinv, *Iwork ; Int p, pend, packed, fp, upper, permute, jold, n, i, j, iold ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ /* ensure the xtype of A and F match (ignored if this is pattern version) */ if (!XTYPE_OK (A->xtype)) { ERROR (CHOLMOD_INVALID, "real/complex mismatch") ; return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ permute = (Perm != NULL) ; n = A->nrow ; Ap = A->p ; /* size A->ncol+1, column pointers of A */ Ai = A->i ; /* size nz = Ap [A->ncol], row indices of A */ Ax = A->x ; /* size nz, real values of A */ Az = A->z ; /* size nz, imag values of A */ Anz = A->nz ; packed = A->packed ; ASSERT (IMPLIES (!packed, Anz != NULL)) ; upper = (A->stype > 0) ; Fp = F->p ; /* size A->nrow+1, row pointers of F */ Fj = F->i ; /* size nz, column indices of F */ Fx = F->x ; /* size nz, real values of F */ Fz = F->z ; /* size nz, imag values of F */ /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Iwork = Common->Iwork ; Wi = Iwork ; /* size n (i/l/l) */ Pinv = Iwork + n ; /* size n (i/i/l) , unused if Perm NULL */ /* ---------------------------------------------------------------------- */ /* construct the transpose */ /* ---------------------------------------------------------------------- */ if (permute) { if (upper) { /* permuted, upper */ for (j = 0 ; j < n ; j++) { jold = Perm [j] ; p = Ap [jold] ; pend = (packed) ? Ap [jold+1] : p + Anz [jold] ; for ( ; p < pend ; p++) { iold = Ai [p] ; if (iold <= jold) { i = Pinv [iold] ; if (i < j) { fp = Wi [i]++ ; Fj [fp] = j ; #ifdef NCONJUGATE ASSIGN (Fx, Fz, fp, Ax, Az, p) ; #else ASSIGN_CONJ (Fx, Fz, fp, Ax, Az, p) ; #endif } else { fp = Wi [j]++ ; Fj [fp] = i ; ASSIGN (Fx, Fz, fp, Ax, Az, p) ; } } } } } else { /* permuted, lower */ for (j = 0 ; j < n ; j++) { jold = Perm [j] ; p = Ap [jold] ; pend = (packed) ? Ap [jold+1] : p + Anz [jold] ; for ( ; p < pend ; p++) { iold = Ai [p] ; if (iold >= jold) { i = Pinv [iold] ; if (i > j) { fp = Wi [i]++ ; Fj [fp] = j ; #ifdef NCONJUGATE ASSIGN (Fx, Fz, fp, Ax, Az, p) ; #else ASSIGN_CONJ (Fx, Fz, fp, Ax, Az, p) ; #endif } else { fp = Wi [j]++ ; Fj [fp] = i ; ASSIGN (Fx, Fz, fp, Ax, Az, p) ; } } } } } } else { if (upper) { /* unpermuted, upper */ for (j = 0 ; j < n ; j++) { p = Ap [j] ; pend = (packed) ? Ap [j+1] : p + Anz [j] ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i <= j) { fp = Wi [i]++ ; Fj [fp] = j ; #ifdef NCONJUGATE ASSIGN (Fx, Fz, fp, Ax, Az, p) ; #else ASSIGN_CONJ (Fx, Fz, fp, Ax, Az, p) ; #endif } } } } else { /* unpermuted, lower */ for (j = 0 ; j < n ; j++) { p = Ap [j] ; pend = (packed) ? Ap [j+1] : p + Anz [j] ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i >= j) { fp = Wi [i]++ ; Fj [fp] = j ; #ifdef NCONJUGATE ASSIGN (Fx, Fz, fp, Ax, Az, p) ; #else ASSIGN_CONJ (Fx, Fz, fp, Ax, Az, p) ; #endif } } } } } return (TRUE) ; } #undef PATTERN #undef REAL #undef COMPLEX #undef ZOMPLEX #undef NCONJUGATE JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Core/t_cholmod_triplet.c0000664000175000017500000001110314224052371021415 00000000000000/* ========================================================================== */ /* === Core/t_cholmod_triplet =============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Core Module. Copyright (C) 2005-2006, * Univ. of Florida. Author: Timothy A. Davis * The CHOLMOD/Core Module is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Template routine for cholmod_triplet. All xtypes supported */ #include "cholmod_template.h" /* ========================================================================== */ /* === t_cholmod_triplet_to_sparse ========================================== */ /* ========================================================================== */ static size_t TEMPLATE (cholmod_triplet_to_sparse) ( /* ---- input ---- */ cholmod_triplet *T, /* matrix to copy */ /* ---- in/out --- */ cholmod_sparse *R, /* output matrix */ /* --------------- */ cholmod_common *Common ) { double *Rx, *Rz, *Tx, *Tz ; Int *Wj, *Rp, *Ri, *Rnz, *Ti, *Tj ; Int i, j, p, p1, p2, pdest, pj, k, stype, nrow, ncol, nz ; size_t anz ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ /* Wj contains a copy of Rp on input [ */ Wj = Common->Iwork ; /* size MAX (nrow,ncol). (i/l/l) */ Rp = R->p ; Ri = R->i ; Rnz = R->nz ; Rx = R->x ; Rz = R->z ; Ti = T->i ; Tj = T->j ; Tx = T->x ; Tz = T->z ; nz = T->nnz ; nrow = T->nrow ; ncol = T->ncol ; stype = SIGN (T->stype) ; /* ---------------------------------------------------------------------- */ /* construct the row form */ /* ---------------------------------------------------------------------- */ /* if Ti is jumbled, this part dominates the run time */ if (stype > 0) { for (k = 0 ; k < nz ; k++) { i = Ti [k] ; j = Tj [k] ; if (i < j) { /* place triplet (j,i,x) in column i of R */ p = Wj [i]++ ; Ri [p] = j ; } else { /* place triplet (i,j,x) in column j of R */ p = Wj [j]++ ; Ri [p] = i ; } ASSIGN (Rx, Rz, p, Tx, Tz, k) ; } } else if (stype < 0) { for (k = 0 ; k < nz ; k++) { i = Ti [k] ; j = Tj [k] ; if (i > j) { /* place triplet (j,i,x) in column i of R */ p = Wj [i]++ ; Ri [p] = j ; } else { /* place triplet (i,j,x) in column j of R */ p = Wj [j]++ ; Ri [p] = i ; } ASSIGN (Rx, Rz, p, Tx, Tz, k) ; } } else { for (k = 0 ; k < nz ; k++) { /* place triplet (i,j,x) in column i of R */ p = Wj [Ti [k]]++ ; Ri [p] = Tj [k] ; ASSIGN (Rx, Rz, p, Tx, Tz, k) ; } } /* done using Wj (i/l/l) as temporary row pointers ] */ /* ---------------------------------------------------------------------- */ /* sum up duplicates */ /* ---------------------------------------------------------------------- */ /* use Wj (i/l/l) of size ncol to keep track of duplicates in each row [ */ for (j = 0 ; j < ncol ; j++) { Wj [j] = EMPTY ; } anz = 0 ; for (i = 0 ; i < nrow ; i++) { p1 = Rp [i] ; p2 = Rp [i+1] ; pdest = p1 ; /* at this point Wj [j] < p1 holds true for all columns j, because * Ri/Rx is stored in row oriented manner */ for (p = p1 ; p < p2 ; p++) { j = Ri [p] ; pj = Wj [j] ; if (pj >= p1) { /* this column index j is already in row i at position pj; * sum up the duplicate entry */ /* Rx [pj] += Rx [p] ; */ ASSEMBLE (Rx, Rz, pj, Rx, Rz, p) ; } else { /* keep the entry and keep track in Wj [j] for case above */ Wj [j] = pdest ; if (pdest != p) { Ri [pdest] = j ; ASSIGN (Rx, Rz, pdest, Rx, Rz, p) ; } pdest++ ; } } Rnz [i] = pdest - p1 ; anz += (pdest - p1) ; } /* done using Wj to keep track of duplicate entries in each row ] */ /* ---------------------------------------------------------------------- */ /* return number of entries after summing up duplicates */ /* ---------------------------------------------------------------------- */ return (anz) ; } #undef PATTERN #undef REAL #undef COMPLEX #undef ZOMPLEX JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/0000755000175000017500000000000014400711326016311 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/Makefile.am0000664000175000017500000000056414224052371020276 00000000000000noinst_HEADERS = cholmod_blas.h cholmod_core.h cholmod_io64.h \ cholmod_camd.h cholmod_function.h cholmod_matrixops.h cholmod_check.h \ cholmod_gpu.h cholmod_modify.h cholmod_cholesky.h \ cholmod_gpu_kernels.h cholmod_partition.h cholmod_complexity.h \ cholmod.h cholmod_supernodal.h cholmod_config.h cholmod_internal.h \ cholmod_template.h EXTRA_DIST = License.txt JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_blas.h0000664000175000017500000003320414224052371021036 00000000000000/* ========================================================================== */ /* === Include/cholmod_blas.h =============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_blas.h. * Copyright (C) 2005-2006, Univ. of Florida. Author: Timothy A. Davis * CHOLMOD/Include/cholmod_blas.h is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* This does not need to be included in the user's program. */ #ifndef CHOLMOD_BLAS_H #define CHOLMOD_BLAS_H /* ========================================================================== */ /* === Architecture ========================================================= */ /* ========================================================================== */ #if defined (__sun) || defined (MSOL2) || defined (ARCH_SOL2) #define CHOLMOD_SOL2 #define CHOLMOD_ARCHITECTURE "Sun Solaris" #elif defined (__sgi) || defined (MSGI) || defined (ARCH_SGI) #define CHOLMOD_SGI #define CHOLMOD_ARCHITECTURE "SGI Irix" #elif defined (__linux) || defined (MGLNX86) || defined (ARCH_GLNX86) #define CHOLMOD_LINUX #define CHOLMOD_ARCHITECTURE "Linux" #elif defined (__APPLE__) #define CHOLMOD_MAC #define CHOLMOD_ARCHITECTURE "Mac" #elif defined (_AIX) || defined (MIBM_RS) || defined (ARCH_IBM_RS) #define CHOLMOD_AIX #define CHOLMOD_ARCHITECTURE "IBM AIX" /* recent reports from IBM AIX seem to indicate that this is not needed: */ /* #define BLAS_NO_UNDERSCORE */ #elif defined (__alpha) || defined (MALPHA) || defined (ARCH_ALPHA) #define CHOLMOD_ALPHA #define CHOLMOD_ARCHITECTURE "Compaq Alpha" #elif defined (_WIN32) || defined (WIN32) || defined (_WIN64) || defined (WIN64) #if defined (__MINGW32__) || defined (__MINGW32__) #define CHOLMOD_MINGW #elif defined (__CYGWIN32__) || defined (__CYGWIN32__) #define CHOLMOD_CYGWIN #else #define CHOLMOD_WINDOWS #define BLAS_NO_UNDERSCORE #endif #define CHOLMOD_ARCHITECTURE "Microsoft Windows" #elif defined (__hppa) || defined (__hpux) || defined (MHPUX) || defined (ARCH_HPUX) #define CHOLMOD_HP #define CHOLMOD_ARCHITECTURE "HP Unix" #define BLAS_NO_UNDERSCORE #elif defined (__hp700) || defined (MHP700) || defined (ARCH_HP700) #define CHOLMOD_HP #define CHOLMOD_ARCHITECTURE "HP 700 Unix" #define BLAS_NO_UNDERSCORE #else /* If the architecture is unknown, and you call the BLAS, you may need to */ /* define BLAS_BY_VALUE, BLAS_NO_UNDERSCORE, and/or BLAS_CHAR_ARG yourself. */ #define CHOLMOD_ARCHITECTURE "unknown" #endif /* ========================================================================== */ /* === BLAS and LAPACK names ================================================ */ /* ========================================================================== */ /* Prototypes for the various versions of the BLAS. */ /* Determine if the 64-bit Sun Performance BLAS is to be used */ #if defined(CHOLMOD_SOL2) && !defined(NSUNPERF) && defined(BLAS64) #define SUN64 #endif #ifdef SUN64 #define BLAS_DTRSV dtrsv_64_ #define BLAS_DGEMV dgemv_64_ #define BLAS_DTRSM dtrsm_64_ #define BLAS_DGEMM dgemm_64_ #define BLAS_DSYRK dsyrk_64_ #define BLAS_DGER dger_64_ #define BLAS_DSCAL dscal_64_ #define LAPACK_DPOTRF dpotrf_64_ #define BLAS_ZTRSV ztrsv_64_ #define BLAS_ZGEMV zgemv_64_ #define BLAS_ZTRSM ztrsm_64_ #define BLAS_ZGEMM zgemm_64_ #define BLAS_ZHERK zherk_64_ #define BLAS_ZGER zgeru_64_ #define BLAS_ZSCAL zscal_64_ #define LAPACK_ZPOTRF zpotrf_64_ #elif defined (BLAS_NO_UNDERSCORE) #define BLAS_DTRSV dtrsv #define BLAS_DGEMV dgemv #define BLAS_DTRSM dtrsm #define BLAS_DGEMM dgemm #define BLAS_DSYRK dsyrk #define BLAS_DGER dger #define BLAS_DSCAL dscal #define LAPACK_DPOTRF dpotrf #define BLAS_ZTRSV ztrsv #define BLAS_ZGEMV zgemv #define BLAS_ZTRSM ztrsm #define BLAS_ZGEMM zgemm #define BLAS_ZHERK zherk #define BLAS_ZGER zgeru #define BLAS_ZSCAL zscal #define LAPACK_ZPOTRF zpotrf #else #define BLAS_DTRSV dtrsv_ #define BLAS_DGEMV dgemv_ #define BLAS_DTRSM dtrsm_ #define BLAS_DGEMM dgemm_ #define BLAS_DSYRK dsyrk_ #define BLAS_DGER dger_ #define BLAS_DSCAL dscal_ #define LAPACK_DPOTRF dpotrf_ #define BLAS_ZTRSV ztrsv_ #define BLAS_ZGEMV zgemv_ #define BLAS_ZTRSM ztrsm_ #define BLAS_ZGEMM zgemm_ #define BLAS_ZHERK zherk_ #define BLAS_ZGER zgeru_ #define BLAS_ZSCAL zscal_ #define LAPACK_ZPOTRF zpotrf_ #endif /* ========================================================================== */ /* === BLAS and LAPACK integer arguments ==================================== */ /* ========================================================================== */ /* Compile CHOLMOD, UMFPACK, and SPQR with -DBLAS64 if you have a BLAS that * uses 64-bit integers */ #if defined (LONGBLAS) || defined (BLAS64) #define BLAS_INT SuiteSparse_long #else #define BLAS_INT int #endif /* If the BLAS integer is smaller than the basic CHOLMOD integer, then we need * to check for integer overflow when converting from Int to BLAS_INT. If * any integer overflows, the externally-defined BLAS_OK variable is * set to FALSE. BLAS_OK should be set to TRUE before calling any * BLAS_* macro. */ #define CHECK_BLAS_INT (sizeof (BLAS_INT) < sizeof (Int)) #define EQ(K,k) (((BLAS_INT) K) == ((Int) k)) /* ========================================================================== */ /* === BLAS and LAPACK prototypes and macros ================================ */ /* ========================================================================== */ void BLAS_DGEMV (char *trans, BLAS_INT *m, BLAS_INT *n, double *alpha, double *A, BLAS_INT *lda, double *X, BLAS_INT *incx, double *beta, double *Y, BLAS_INT *incy) ; #define BLAS_dgemv(trans,m,n,alpha,A,lda,X,incx,beta,Y,incy) \ { \ BLAS_INT M = m, N = n, LDA = lda, INCX = incx, INCY = incy ; \ if (CHECK_BLAS_INT && !(EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && \ EQ (INCX,incx) && EQ (INCY,incy))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_DGEMV (trans, &M, &N, alpha, A, &LDA, X, &INCX, beta, Y, &INCY) ; \ } \ } void BLAS_ZGEMV (char *trans, BLAS_INT *m, BLAS_INT *n, double *alpha, double *A, BLAS_INT *lda, double *X, BLAS_INT *incx, double *beta, double *Y, BLAS_INT *incy) ; #define BLAS_zgemv(trans,m,n,alpha,A,lda,X,incx,beta,Y,incy) \ { \ BLAS_INT M = m, N = n, LDA = lda, INCX = incx, INCY = incy ; \ if (CHECK_BLAS_INT && !(EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && \ EQ (INCX,incx) && EQ (INCY,incy))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_ZGEMV (trans, &M, &N, alpha, A, &LDA, X, &INCX, beta, Y, &INCY) ; \ } \ } void BLAS_DTRSV (char *uplo, char *trans, char *diag, BLAS_INT *n, double *A, BLAS_INT *lda, double *X, BLAS_INT *incx) ; #define BLAS_dtrsv(uplo,trans,diag,n,A,lda,X,incx) \ { \ BLAS_INT N = n, LDA = lda, INCX = incx ; \ if (CHECK_BLAS_INT && !(EQ (N,n) && EQ (LDA,lda) && EQ (INCX,incx))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_DTRSV (uplo, trans, diag, &N, A, &LDA, X, &INCX) ; \ } \ } void BLAS_ZTRSV (char *uplo, char *trans, char *diag, BLAS_INT *n, double *A, BLAS_INT *lda, double *X, BLAS_INT *incx) ; #define BLAS_ztrsv(uplo,trans,diag,n,A,lda,X,incx) \ { \ BLAS_INT N = n, LDA = lda, INCX = incx ; \ if (CHECK_BLAS_INT && !(EQ (N,n) && EQ (LDA,lda) && EQ (INCX,incx))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_ZTRSV (uplo, trans, diag, &N, A, &LDA, X, &INCX) ; \ } \ } void BLAS_DTRSM (char *side, char *uplo, char *transa, char *diag, BLAS_INT *m, BLAS_INT *n, double *alpha, double *A, BLAS_INT *lda, double *B, BLAS_INT *ldb) ; #define BLAS_dtrsm(side,uplo,transa,diag,m,n,alpha,A,lda,B,ldb) \ { \ BLAS_INT M = m, N = n, LDA = lda, LDB = ldb ; \ if (CHECK_BLAS_INT && !(EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && \ EQ (LDB,ldb))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_DTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\ } \ } void BLAS_ZTRSM (char *side, char *uplo, char *transa, char *diag, BLAS_INT *m, BLAS_INT *n, double *alpha, double *A, BLAS_INT *lda, double *B, BLAS_INT *ldb) ; #define BLAS_ztrsm(side,uplo,transa,diag,m,n,alpha,A,lda,B,ldb) \ { \ BLAS_INT M = m, N = n, LDA = lda, LDB = ldb ; \ if (CHECK_BLAS_INT && !(EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && \ EQ (LDB,ldb))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_ZTRSM (side, uplo, transa, diag, &M, &N, alpha, A, &LDA, B, &LDB);\ } \ } void BLAS_DGEMM (char *transa, char *transb, BLAS_INT *m, BLAS_INT *n, BLAS_INT *k, double *alpha, double *A, BLAS_INT *lda, double *B, BLAS_INT *ldb, double *beta, double *C, BLAS_INT *ldc) ; #define BLAS_dgemm(transa,transb,m,n,k,alpha,A,lda,B,ldb,beta,C,ldc) \ { \ BLAS_INT M = m, N = n, K = k, LDA = lda, LDB = ldb, LDC = ldc ; \ if (CHECK_BLAS_INT && !(EQ (M,m) && EQ (N,n) && EQ (K,k) && \ EQ (LDA,lda) && EQ (LDB,ldb) && EQ (LDC,ldc))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_DGEMM (transa, transb, &M, &N, &K, alpha, A, &LDA, B, &LDB, beta, \ C, &LDC) ; \ } \ } void BLAS_ZGEMM (char *transa, char *transb, BLAS_INT *m, BLAS_INT *n, BLAS_INT *k, double *alpha, double *A, BLAS_INT *lda, double *B, BLAS_INT *ldb, double *beta, double *C, BLAS_INT *ldc) ; #define BLAS_zgemm(transa,transb,m,n,k,alpha,A,lda,B,ldb,beta,C,ldc) \ { \ BLAS_INT M = m, N = n, K = k, LDA = lda, LDB = ldb, LDC = ldc ; \ if (CHECK_BLAS_INT && !(EQ (M,m) && EQ (N,n) && EQ (K,k) && \ EQ (LDA,lda) && EQ (LDB,ldb) && EQ (LDC,ldc))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_ZGEMM (transa, transb, &M, &N, &K, alpha, A, &LDA, B, &LDB, beta, \ C, &LDC) ; \ } \ } void BLAS_DSYRK (char *uplo, char *trans, BLAS_INT *n, BLAS_INT *k, double *alpha, double *A, BLAS_INT *lda, double *beta, double *C, BLAS_INT *ldc) ; #define BLAS_dsyrk(uplo,trans,n,k,alpha,A,lda,beta,C,ldc) \ { \ BLAS_INT N = n, K = k, LDA = lda, LDC = ldc ; \ if (CHECK_BLAS_INT && !(EQ (N,n) && EQ (K,k) && EQ (LDA,lda) && \ EQ (LDC,ldc))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_DSYRK (uplo, trans, &N, &K, alpha, A, &LDA, beta, C, &LDC) ; \ } \ } \ void BLAS_ZHERK (char *uplo, char *trans, BLAS_INT *n, BLAS_INT *k, double *alpha, double *A, BLAS_INT *lda, double *beta, double *C, BLAS_INT *ldc) ; #define BLAS_zherk(uplo,trans,n,k,alpha,A,lda,beta,C,ldc) \ { \ BLAS_INT N = n, K = k, LDA = lda, LDC = ldc ; \ if (CHECK_BLAS_INT && !(EQ (N,n) && EQ (K,k) && EQ (LDA,lda) && \ EQ (LDC,ldc))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_ZHERK (uplo, trans, &N, &K, alpha, A, &LDA, beta, C, &LDC) ; \ } \ } \ void LAPACK_DPOTRF (char *uplo, BLAS_INT *n, double *A, BLAS_INT *lda, BLAS_INT *info) ; #define LAPACK_dpotrf(uplo,n,A,lda,info) \ { \ BLAS_INT N = n, LDA = lda, INFO = 1 ; \ if (CHECK_BLAS_INT && !(EQ (N,n) && EQ (LDA,lda))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ LAPACK_DPOTRF (uplo, &N, A, &LDA, &INFO) ; \ } \ info = INFO ; \ } void LAPACK_ZPOTRF (char *uplo, BLAS_INT *n, double *A, BLAS_INT *lda, BLAS_INT *info) ; #define LAPACK_zpotrf(uplo,n,A,lda,info) \ { \ BLAS_INT N = n, LDA = lda, INFO = 1 ; \ if (CHECK_BLAS_INT && !(EQ (N,n) && EQ (LDA,lda))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ LAPACK_ZPOTRF (uplo, &N, A, &LDA, &INFO) ; \ } \ info = INFO ; \ } /* ========================================================================== */ void BLAS_DSCAL (BLAS_INT *n, double *alpha, double *Y, BLAS_INT *incy) ; #define BLAS_dscal(n,alpha,Y,incy) \ { \ BLAS_INT N = n, INCY = incy ; \ if (CHECK_BLAS_INT && !(EQ (N,n) && EQ (INCY,incy))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_DSCAL (&N, alpha, Y, &INCY) ; \ } \ } void BLAS_ZSCAL (BLAS_INT *n, double *alpha, double *Y, BLAS_INT *incy) ; #define BLAS_zscal(n,alpha,Y,incy) \ { \ BLAS_INT N = n, INCY = incy ; \ if (CHECK_BLAS_INT && !(EQ (N,n) && EQ (INCY,incy))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_ZSCAL (&N, alpha, Y, &INCY) ; \ } \ } void BLAS_DGER (BLAS_INT *m, BLAS_INT *n, double *alpha, double *X, BLAS_INT *incx, double *Y, BLAS_INT *incy, double *A, BLAS_INT *lda) ; #define BLAS_dger(m,n,alpha,X,incx,Y,incy,A,lda) \ { \ BLAS_INT M = m, N = n, LDA = lda, INCX = incx, INCY = incy ; \ if (CHECK_BLAS_INT && !(EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && \ EQ (INCX,incx) && EQ (INCY,incy))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_DGER (&M, &N, alpha, X, &INCX, Y, &INCY, A, &LDA) ; \ } \ } void BLAS_ZGER (BLAS_INT *m, BLAS_INT *n, double *alpha, double *X, BLAS_INT *incx, double *Y, BLAS_INT *incy, double *A, BLAS_INT *lda) ; #define BLAS_zgeru(m,n,alpha,X,incx,Y,incy,A,lda) \ { \ BLAS_INT M = m, N = n, LDA = lda, INCX = incx, INCY = incy ; \ if (CHECK_BLAS_INT && !(EQ (M,m) && EQ (N,n) && EQ (LDA,lda) && \ EQ (INCX,incx) && EQ (INCY,incy))) \ { \ BLAS_OK = FALSE ; \ } \ if (!CHECK_BLAS_INT || BLAS_OK) \ { \ BLAS_ZGER (&M, &N, alpha, X, &INCX, Y, &INCY, A, &LDA) ; \ } \ } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_core.h0000664000175000017500000031122314224052371021045 00000000000000/* ========================================================================== */ /* === Include/cholmod_core.h =============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_core.h. * Copyright (C) 2005-2013, Univ. of Florida. Author: Timothy A. Davis * CHOLMOD/Include/cholmod_core.h is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* CHOLMOD Core module: basic CHOLMOD objects and routines. * Required by all CHOLMOD modules. Requires no other module or package. * * The CHOLMOD modules are: * * Core basic data structures and definitions * Check check/print the 5 CHOLMOD objects, & 3 types of integer vectors * Cholesky sparse Cholesky factorization * Modify sparse Cholesky update/downdate/row-add/row-delete * MatrixOps sparse matrix functions (add, multiply, norm, ...) * Supernodal supernodal sparse Cholesky factorization * Partition graph-partitioning based orderings * * The CHOLMOD objects: * -------------------- * * cholmod_common parameters, statistics, and workspace * cholmod_sparse a sparse matrix in compressed column form * cholmod_factor an LL' or LDL' factorization * cholmod_dense a dense matrix * cholmod_triplet a sparse matrix in "triplet" form * * The Core module described here defines the CHOLMOD data structures, and * basic operations on them. To create and solve a sparse linear system Ax=b, * the user must create A and b, populate them with values, and then pass them * to the routines in the CHOLMOD Cholesky module. There are two primary * methods for creating A: (1) allocate space for a column-oriented sparse * matrix and fill it with pattern and values, or (2) create a triplet form * matrix and convert it to a sparse matrix. The latter option is simpler. * * The matrices b and x are typically dense matrices, but can also be sparse. * You can allocate and free them as dense matrices with the * cholmod_allocate_dense and cholmod_free_dense routines. * * The cholmod_factor object contains the symbolic and numeric LL' or LDL' * factorization of sparse symmetric matrix. The matrix must be positive * definite for an LL' factorization. It need only be symmetric and have well- * conditioned leading submatrices for it to have an LDL' factorization * (CHOLMOD does not pivot for numerical stability). It is typically created * with the cholmod_factorize routine in the Cholesky module, but can also * be initialized to L=D=I in the Core module and then modified by the Modify * module. It must be freed with cholmod_free_factor, defined below. * * The Core routines for each object are described below. Each list is split * into two parts: the primary routines and secondary routines. * * ============================================================================ * === cholmod_common ========================================================= * ============================================================================ * * The Common object contains control parameters, statistics, and * You must call cholmod_start before calling any other CHOLMOD routine, and * must call cholmod_finish as your last call to CHOLMOD, with two exceptions: * you may call cholmod_print_common and cholmod_check_common in the Check * module after calling cholmod_finish. * * cholmod_start first call to CHOLMOD * cholmod_finish last call to CHOLMOD * ----------------------------- * cholmod_defaults restore default parameters * cholmod_maxrank maximum rank for update/downdate * cholmod_allocate_work allocate workspace in Common * cholmod_free_work free workspace in Common * cholmod_clear_flag clear Flag workspace in Common * cholmod_error called when CHOLMOD encounters an error * cholmod_dbound for internal use in CHOLMOD only * cholmod_hypot compute sqrt (x*x + y*y) accurately * cholmod_divcomplex complex division, c = a/b * * ============================================================================ * === cholmod_sparse ========================================================= * ============================================================================ * * A sparse matrix is held in compressed column form. In the basic type * ("packed", which corresponds to a MATLAB sparse matrix), an n-by-n matrix * with nz entries is held in three arrays: p of size n+1, i of size nz, and x * of size nz. Row indices of column j are held in i [p [j] ... p [j+1]-1] and * in the same locations in x. There may be no duplicate entries in a column. * Row indices in each column may be sorted or unsorted (CHOLMOD keeps track). * A->stype determines the storage mode: 0 if both upper/lower parts are stored, * -1 if A is symmetric and just tril(A) is stored, +1 if symmetric and triu(A) * is stored. * * cholmod_allocate_sparse allocate a sparse matrix * cholmod_free_sparse free a sparse matrix * ----------------------------- * cholmod_reallocate_sparse change the size (# entries) of sparse matrix * cholmod_nnz number of nonzeros in a sparse matrix * cholmod_speye sparse identity matrix * cholmod_spzeros sparse zero matrix * cholmod_transpose transpose a sparse matrix * cholmod_ptranspose transpose/permute a sparse matrix * cholmod_transpose_unsym transpose/permute an unsymmetric sparse matrix * cholmod_transpose_sym transpose/permute a symmetric sparse matrix * cholmod_sort sort row indices in each column of sparse matrix * cholmod_band C = tril (triu (A,k1), k2) * cholmod_band_inplace A = tril (triu (A,k1), k2) * cholmod_aat C = A*A' * cholmod_copy_sparse C = A, create an exact copy of a sparse matrix * cholmod_copy C = A, with possible change of stype * cholmod_add C = alpha*A + beta*B * cholmod_sparse_xtype change the xtype of a sparse matrix * * ============================================================================ * === cholmod_factor ========================================================= * ============================================================================ * * The data structure for an LL' or LDL' factorization is too complex to * describe in one sentence. This object can hold the symbolic analysis alone, * or in combination with a "simplicial" (similar to a sparse matrix) or * "supernodal" form of the numerical factorization. Only the routine to free * a factor is primary, since a factor object is created by the factorization * routine (cholmod_factorize). It must be freed with cholmod_free_factor. * * cholmod_free_factor free a factor * ----------------------------- * cholmod_allocate_factor allocate a factor (LL' or LDL') * cholmod_reallocate_factor change the # entries in a factor * cholmod_change_factor change the type of factor (e.g., LDL' to LL') * cholmod_pack_factor pack the columns of a factor * cholmod_reallocate_column resize a single column of a factor * cholmod_factor_to_sparse create a sparse matrix copy of a factor * cholmod_copy_factor create a copy of a factor * cholmod_factor_xtype change the xtype of a factor * * Note that there is no cholmod_sparse_to_factor routine to create a factor * as a copy of a sparse matrix. It could be done, after a fashion, but a * lower triangular sparse matrix would not necessarily have a chordal graph, * which would break the many CHOLMOD routines that rely on this property. * * ============================================================================ * === cholmod_dense ========================================================== * ============================================================================ * * The solve routines and some of the MatrixOps and Modify routines use dense * matrices as inputs. These are held in column-major order. With a leading * dimension of d, the entry in row i and column j is held in x [i+j*d]. * * cholmod_allocate_dense allocate a dense matrix * cholmod_free_dense free a dense matrix * ----------------------------- * cholmod_zeros allocate a dense matrix of all zeros * cholmod_ones allocate a dense matrix of all ones * cholmod_eye allocate a dense identity matrix * cholmod_sparse_to_dense create a dense matrix copy of a sparse matrix * cholmod_dense_to_sparse create a sparse matrix copy of a dense matrix * cholmod_copy_dense create a copy of a dense matrix * cholmod_copy_dense2 copy a dense matrix (pre-allocated) * cholmod_dense_xtype change the xtype of a dense matrix * cholmod_ensure_dense ensure a dense matrix has a given size and type * * ============================================================================ * === cholmod_triplet ======================================================== * ============================================================================ * * A sparse matrix held in triplet form is the simplest one for a user to * create. It consists of a list of nz entries in arbitrary order, held in * three arrays: i, j, and x, each of length nk. The kth entry is in row i[k], * column j[k], with value x[k]. There may be duplicate values; if A(i,j) * appears more than once, its value is the sum of the entries with those row * and column indices. * * cholmod_allocate_triplet allocate a triplet matrix * cholmod_triplet_to_sparse create a sparse matrix copy of a triplet matrix * cholmod_free_triplet free a triplet matrix * ----------------------------- * cholmod_reallocate_triplet change the # of entries in a triplet matrix * cholmod_sparse_to_triplet create a triplet matrix copy of a sparse matrix * cholmod_copy_triplet create a copy of a triplet matrix * cholmod_triplet_xtype change the xtype of a triplet matrix * * ============================================================================ * === memory management ====================================================== * ============================================================================ * * cholmod_malloc malloc wrapper * cholmod_calloc calloc wrapper * cholmod_free free wrapper * cholmod_realloc realloc wrapper * cholmod_realloc_multiple realloc wrapper for multiple objects * * ============================================================================ * === Core CHOLMOD prototypes ================================================ * ============================================================================ * * All CHOLMOD routines (in all modules) use the following protocol for return * values, with one exception: * * int TRUE (1) if successful, or FALSE (0) otherwise. * (exception: cholmod_divcomplex) * SuiteSparse_long a value >= 0 if successful, or -1 otherwise. * double a value >= 0 if successful, or -1 otherwise. * size_t a value > 0 if successful, or 0 otherwise. * void * a non-NULL pointer to newly allocated memory if * successful, or NULL otherwise. * cholmod_sparse * a non-NULL pointer to a newly allocated matrix * if successful, or NULL otherwise. * cholmod_factor * a non-NULL pointer to a newly allocated factor * if successful, or NULL otherwise. * cholmod_triplet * a non-NULL pointer to a newly allocated triplet * matrix if successful, or NULL otherwise. * cholmod_dense * a non-NULL pointer to a newly allocated triplet * matrix if successful, or NULL otherwise. * * The last parameter to all routines is always a pointer to the CHOLMOD * Common object. * * TRUE and FALSE are not defined here, since they may conflict with the user * program. A routine that described here returning TRUE or FALSE returns 1 * or 0, respectively. Any TRUE/FALSE parameter is true if nonzero, false if * zero. */ #ifndef CHOLMOD_CORE_H #define CHOLMOD_CORE_H /* ========================================================================== */ /* === CHOLMOD version ====================================================== */ /* ========================================================================== */ /* All versions of CHOLMOD will include the following definitions. * As an example, to test if the version you are using is 1.3 or later: * * if (CHOLMOD_VERSION >= CHOLMOD_VER_CODE (1,3)) ... * * This also works during compile-time: * * #if CHOLMOD_VERSION >= CHOLMOD_VER_CODE (1,3) * printf ("This is version 1.3 or later\n") ; * #else * printf ("This is version is earlier than 1.3\n") ; * #endif */ #define CHOLMOD_HAS_VERSION_FUNCTION #define CHOLMOD_DATE "Feb 1, 2016" #define CHOLMOD_VER_CODE(main,sub) ((main) * 1000 + (sub)) #define CHOLMOD_MAIN_VERSION 3 #define CHOLMOD_SUB_VERSION 0 #define CHOLMOD_SUBSUB_VERSION 9 #define CHOLMOD_VERSION \ CHOLMOD_VER_CODE(CHOLMOD_MAIN_VERSION,CHOLMOD_SUB_VERSION) /* ========================================================================== */ /* === non-CHOLMOD include files ============================================ */ /* ========================================================================== */ /* This is the only non-CHOLMOD include file imposed on the user program. * It required for size_t definition used here. CHOLMOD itself includes other * ANSI C89 standard #include files, but does not expose them to the user. * * CHOLMOD assumes that your C compiler is ANSI C89 compliant. It does not make * use of ANSI C99 features. */ #include #include /* ========================================================================== */ /* === CUDA BLAS for the GPU ================================================ */ /* ========================================================================== */ /* The number of OMP threads should typically be set to the number of cores */ /* per socket inthe machine being used. This maximizes memory performance. */ #ifndef CHOLMOD_OMP_NUM_THREADS #define CHOLMOD_OMP_NUM_THREADS 4 #endif /* Define buffering parameters for GPU processing */ #ifdef GPU_BLAS #include #endif #define CHOLMOD_DEVICE_SUPERNODE_BUFFERS 6 #define CHOLMOD_HOST_SUPERNODE_BUFFERS 8 #define CHOLMOD_DEVICE_STREAMS 2 /* ========================================================================== */ /* === CHOLMOD objects ====================================================== */ /* ========================================================================== */ /* Each CHOLMOD object has its own type code. */ #define CHOLMOD_COMMON 0 #define CHOLMOD_SPARSE 1 #define CHOLMOD_FACTOR 2 #define CHOLMOD_DENSE 3 #define CHOLMOD_TRIPLET 4 /* ========================================================================== */ /* === CHOLMOD Common ======================================================= */ /* ========================================================================== */ /* itype defines the types of integer used: */ #define CHOLMOD_INT 0 /* all integer arrays are int */ #define CHOLMOD_INTLONG 1 /* most are int, some are SuiteSparse_long */ #define CHOLMOD_LONG 2 /* all integer arrays are SuiteSparse_long */ /* The itype of all parameters for all CHOLMOD routines must match. * FUTURE WORK: CHOLMOD_INTLONG is not yet supported. */ /* dtype defines what the numerical type is (double or float): */ #define CHOLMOD_DOUBLE 0 /* all numerical values are double */ #define CHOLMOD_SINGLE 1 /* all numerical values are float */ /* The dtype of all parameters for all CHOLMOD routines must match. * * Scalar floating-point values are always passed as double arrays of size 2 * (for the real and imaginary parts). They are typecast to float as needed. * FUTURE WORK: the float case is not supported yet. */ /* xtype defines the kind of numerical values used: */ #define CHOLMOD_PATTERN 0 /* pattern only, no numerical values */ #define CHOLMOD_REAL 1 /* a real matrix */ #define CHOLMOD_COMPLEX 2 /* a complex matrix (ANSI C99 compatible) */ #define CHOLMOD_ZOMPLEX 3 /* a complex matrix (MATLAB compatible) */ /* The xtype of all parameters for all CHOLMOD routines must match. * * CHOLMOD_PATTERN: x and z are ignored. * CHOLMOD_DOUBLE: x is non-null of size nzmax, z is ignored. * CHOLMOD_COMPLEX: x is non-null of size 2*nzmax doubles, z is ignored. * CHOLMOD_ZOMPLEX: x and z are non-null of size nzmax * * In the real case, z is ignored. The kth entry in the matrix is x [k]. * There are two methods for the complex case. In the ANSI C99-compatible * CHOLMOD_COMPLEX case, the real and imaginary parts of the kth entry * are in x [2*k] and x [2*k+1], respectively. z is ignored. In the * MATLAB-compatible CHOLMOD_ZOMPLEX case, the real and imaginary * parts of the kth entry are in x [k] and z [k]. * * Scalar floating-point values are always passed as double arrays of size 2 * (real and imaginary parts). The imaginary part of a scalar is ignored if * the routine operates on a real matrix. * * These Modules support complex and zomplex matrices, with a few exceptions: * * Check all routines * Cholesky all routines * Core all except cholmod_aat, add, band, copy * Demo all routines * Partition all routines * Supernodal all routines support any real, complex, or zomplex input. * There will never be a supernodal zomplex L; a complex * supernodal L is created if A is zomplex. * Tcov all routines * Valgrind all routines * * These Modules provide partial support for complex and zomplex matrices: * * MATLAB all routines support real and zomplex only, not complex, * with the exception of ldlupdate, which supports * real matrices only. This is a minor constraint since * MATLAB's matrices are all real or zomplex. * MatrixOps only norm_dense, norm_sparse, and sdmult support complex * and zomplex * * These Modules do not support complex and zomplex matrices at all: * * Modify all routines support real matrices only */ /* Definitions for cholmod_common: */ #define CHOLMOD_MAXMETHODS 9 /* maximum number of different methods that */ /* cholmod_analyze can try. Must be >= 9. */ /* Common->status values. zero means success, negative means a fatal error, * positive is a warning. */ #define CHOLMOD_OK 0 /* success */ #define CHOLMOD_NOT_INSTALLED (-1) /* failure: method not installed */ #define CHOLMOD_OUT_OF_MEMORY (-2) /* failure: out of memory */ #define CHOLMOD_TOO_LARGE (-3) /* failure: integer overflow occured */ #define CHOLMOD_INVALID (-4) /* failure: invalid input */ #define CHOLMOD_GPU_PROBLEM (-5) /* failure: GPU fatal error */ #define CHOLMOD_NOT_POSDEF (1) /* warning: matrix not pos. def. */ #define CHOLMOD_DSMALL (2) /* warning: D for LDL' or diag(L) or */ /* LL' has tiny absolute value */ /* ordering method (also used for L->ordering) */ #define CHOLMOD_NATURAL 0 /* use natural ordering */ #define CHOLMOD_GIVEN 1 /* use given permutation */ #define CHOLMOD_AMD 2 /* use minimum degree (AMD) */ #define CHOLMOD_METIS 3 /* use METIS' nested dissection */ #define CHOLMOD_NESDIS 4 /* use CHOLMOD's version of nested dissection:*/ /* node bisector applied recursively, followed * by constrained minimum degree (CSYMAMD or * CCOLAMD) */ #define CHOLMOD_COLAMD 5 /* use AMD for A, COLAMD for A*A' */ /* POSTORDERED is not a method, but a result of natural ordering followed by a * weighted postorder. It is used for L->ordering, not method [ ].ordering. */ #define CHOLMOD_POSTORDERED 6 /* natural ordering, postordered. */ /* supernodal strategy (for Common->supernodal) */ #define CHOLMOD_SIMPLICIAL 0 /* always do simplicial */ #define CHOLMOD_AUTO 1 /* select simpl/super depending on matrix */ #define CHOLMOD_SUPERNODAL 2 /* always do supernodal */ typedef struct cholmod_common_struct { /* ---------------------------------------------------------------------- */ /* parameters for symbolic/numeric factorization and update/downdate */ /* ---------------------------------------------------------------------- */ double dbound ; /* Smallest absolute value of diagonal entries of D * for LDL' factorization and update/downdate/rowadd/ * rowdel, or the diagonal of L for an LL' factorization. * Entries in the range 0 to dbound are replaced with dbound. * Entries in the range -dbound to 0 are replaced with -dbound. No * changes are made to the diagonal if dbound <= 0. Default: zero */ double grow0 ; /* For a simplicial factorization, L->i and L->x can * grow if necessary. grow0 is the factor by which * it grows. For the initial space, L is of size MAX (1,grow0) times * the required space. If L runs out of space, the new size of L is * MAX(1.2,grow0) times the new required space. If you do not plan on * modifying the LDL' factorization in the Modify module, set grow0 to * zero (or set grow2 to 0, see below). Default: 1.2 */ double grow1 ; size_t grow2 ; /* For a simplicial factorization, each column j of L * is initialized with space equal to * grow1*L->ColCount[j] + grow2. If grow0 < 1, grow1 < 1, or grow2 == 0, * then the space allocated is exactly equal to L->ColCount[j]. If the * column j runs out of space, it increases to grow1*need + grow2 in * size, where need is the total # of nonzeros in that column. If you do * not plan on modifying the factorization in the Modify module, set * grow2 to zero. Default: grow1 = 1.2, grow2 = 5. */ size_t maxrank ; /* rank of maximum update/downdate. Valid values: * 2, 4, or 8. A value < 2 is set to 2, and a * value > 8 is set to 8. It is then rounded up to the next highest * power of 2, if not already a power of 2. Workspace (Xwork, below) of * size nrow-by-maxrank double's is allocated for the update/downdate. * If an update/downdate of rank-k is requested, with k > maxrank, * it is done in steps of maxrank. Default: 8, which is fastest. * Memory usage can be reduced by setting maxrank to 2 or 4. */ double supernodal_switch ; /* supernodal vs simplicial factorization */ int supernodal ; /* If Common->supernodal <= CHOLMOD_SIMPLICIAL * (0) then cholmod_analyze performs a * simplicial analysis. If >= CHOLMOD_SUPERNODAL (2), then a supernodal * analysis is performed. If == CHOLMOD_AUTO (1) and * flop/nnz(L) < Common->supernodal_switch, then a simplicial analysis * is done. A supernodal analysis done otherwise. * Default: CHOLMOD_AUTO. Default supernodal_switch = 40 */ int final_asis ; /* If TRUE, then ignore the other final_* parameters * (except for final_pack). * The factor is left as-is when done. Default: TRUE.*/ int final_super ; /* If TRUE, leave a factor in supernodal form when * supernodal factorization is finished. If FALSE, * then convert to a simplicial factor when done. * Default: TRUE */ int final_ll ; /* If TRUE, leave factor in LL' form when done. * Otherwise, leave in LDL' form. Default: FALSE */ int final_pack ; /* If TRUE, pack the columns when done. If TRUE, and * cholmod_factorize is called with a symbolic L, L is * allocated with exactly the space required, using L->ColCount. If you * plan on modifying the factorization, set Common->final_pack to FALSE, * and each column will be given a little extra slack space for future * growth in fill-in due to updates. Default: TRUE */ int final_monotonic ; /* If TRUE, ensure columns are monotonic when done. * Default: TRUE */ int final_resymbol ;/* if cholmod_factorize performed a supernodal * factorization, final_resymbol is true, and * final_super is FALSE (convert a simplicial numeric factorization), * then numerically zero entries that resulted from relaxed supernodal * amalgamation are removed. This does not remove entries that are zero * due to exact numeric cancellation, since doing so would break the * update/downdate rowadd/rowdel routines. Default: FALSE. */ /* supernodal relaxed amalgamation parameters: */ double zrelax [3] ; size_t nrelax [3] ; /* Let ns be the total number of columns in two adjacent supernodes. * Let z be the fraction of zero entries in the two supernodes if they * are merged (z includes zero entries from prior amalgamations). The * two supernodes are merged if: * (ns <= nrelax [0]) || (no new zero entries added) || * (ns <= nrelax [1] && z < zrelax [0]) || * (ns <= nrelax [2] && z < zrelax [1]) || (z < zrelax [2]) * * Default parameters result in the following rule: * (ns <= 4) || (no new zero entries added) || * (ns <= 16 && z < 0.8) || (ns <= 48 && z < 0.1) || (z < 0.05) */ int prefer_zomplex ; /* X = cholmod_solve (sys, L, B, Common) computes * x=A\b or solves a related system. If L and B are * both real, then X is real. Otherwise, X is returned as * CHOLMOD_COMPLEX if Common->prefer_zomplex is FALSE, or * CHOLMOD_ZOMPLEX if Common->prefer_zomplex is TRUE. This parameter * is needed because there is no supernodal zomplex L. Suppose the * caller wants all complex matrices to be stored in zomplex form * (MATLAB, for example). A supernodal L is returned in complex form * if A is zomplex. B can be real, and thus X = cholmod_solve (L,B) * should return X as zomplex. This cannot be inferred from the input * arguments L and B. Default: FALSE, since all data types are * supported in CHOLMOD_COMPLEX form and since this is the native type * of LAPACK and the BLAS. Note that the MATLAB/cholmod.c mexFunction * sets this parameter to TRUE, since MATLAB matrices are in * CHOLMOD_ZOMPLEX form. */ int prefer_upper ; /* cholmod_analyze and cholmod_factorize work * fastest when a symmetric matrix is stored in * upper triangular form when a fill-reducing ordering is used. In * MATLAB, this corresponds to how x=A\b works. When the matrix is * ordered as-is, they work fastest when a symmetric matrix is in lower * triangular form. In MATLAB, R=chol(A) does the opposite. This * parameter affects only how cholmod_read returns a symmetric matrix. * If TRUE (the default case), a symmetric matrix is always returned in * upper-triangular form (A->stype = 1). */ int quick_return_if_not_posdef ; /* if TRUE, the supernodal numeric * factorization will return quickly if * the matrix is not positive definite. Default: FALSE. */ int prefer_binary ; /* cholmod_read_triplet converts a symmetric * pattern-only matrix into a real matrix. If * prefer_binary is FALSE, the diagonal entries are set to 1 + the degree * of the row/column, and off-diagonal entries are set to -1 (resulting * in a positive definite matrix if the diagonal is zero-free). Most * symmetric patterns are the pattern a positive definite matrix. If * this parameter is TRUE, then the matrix is returned with a 1 in each * entry, instead. Default: FALSE. Added in v1.3. */ /* ---------------------------------------------------------------------- */ /* printing and error handling options */ /* ---------------------------------------------------------------------- */ int print ; /* print level. Default: 3 */ int precise ; /* if TRUE, print 16 digits. Otherwise print 5 */ /* CHOLMOD print_function replaced with SuiteSparse_config.print_func */ int try_catch ; /* if TRUE, then ignore errors; CHOLMOD is in the middle * of a try/catch block. No error message is printed * and the Common->error_handler function is not called. */ void (*error_handler) (int status, const char *file, int line, const char *message) ; /* Common->error_handler is the user's error handling routine. If not * NULL, this routine is called if an error occurs in CHOLMOD. status * can be CHOLMOD_OK (0), negative for a fatal error, and positive for * a warning. file is a string containing the name of the source code * file where the error occured, and line is the line number in that * file. message is a string describing the error in more detail. */ /* ---------------------------------------------------------------------- */ /* ordering options */ /* ---------------------------------------------------------------------- */ /* The cholmod_analyze routine can try many different orderings and select * the best one. It can also try one ordering method multiple times, with * different parameter settings. The default is to use three orderings, * the user's permutation (if provided), AMD which is the fastest ordering * and generally gives good fill-in, and METIS. CHOLMOD's nested dissection * (METIS with a constrained AMD) usually gives a better ordering than METIS * alone (by about 5% to 10%) but it takes more time. * * If you know the method that is best for your matrix, set Common->nmethods * to 1 and set Common->method [0] to the set of parameters for that method. * If you set it to 1 and do not provide a permutation, then only AMD will * be called. * * If METIS is not available, the default # of methods tried is 2 (the user * permutation, if any, and AMD). * * To try other methods, set Common->nmethods to the number of methods you * want to try. The suite of default methods and their parameters is * described in the cholmod_defaults routine, and summarized here: * * Common->method [i]: * i = 0: user-provided ordering (cholmod_analyze_p only) * i = 1: AMD (for both A and A*A') * i = 2: METIS * i = 3: CHOLMOD's nested dissection (NESDIS), default parameters * i = 4: natural * i = 5: NESDIS with nd_small = 20000 * i = 6: NESDIS with nd_small = 4, no constrained minimum degree * i = 7: NESDIS with no dense node removal * i = 8: AMD for A, COLAMD for A*A' * * You can modify the suite of methods you wish to try by modifying * Common.method [...] after calling cholmod_start or cholmod_defaults. * * For example, to use AMD, followed by a weighted postordering: * * Common->nmethods = 1 ; * Common->method [0].ordering = CHOLMOD_AMD ; * Common->postorder = TRUE ; * * To use the natural ordering (with no postordering): * * Common->nmethods = 1 ; * Common->method [0].ordering = CHOLMOD_NATURAL ; * Common->postorder = FALSE ; * * If you are going to factorize hundreds or more matrices with the same * nonzero pattern, you may wish to spend a great deal of time finding a * good permutation. In this case, try setting Common->nmethods to 9. * The time spent in cholmod_analysis will be very high, but you need to * call it only once. * * cholmod_analyze sets Common->current to a value between 0 and nmethods-1. * Each ordering method uses the set of options defined by this parameter. */ int nmethods ; /* The number of ordering methods to try. Default: 0. * nmethods = 0 is a special case. cholmod_analyze * will try the user-provided ordering (if given) and AMD. Let fl and * lnz be the flop count and nonzeros in L from AMD's ordering. Let * anz be the number of nonzeros in the upper or lower triangular part * of the symmetric matrix A. If fl/lnz < 500 or lnz/anz < 5, then this * is a good ordering, and METIS is not attempted. Otherwise, METIS is * tried. The best ordering found is used. If nmethods > 0, the * methods used are given in the method[ ] array, below. The first * three methods in the default suite of orderings is (1) use the given * permutation (if provided), (2) use AMD, and (3) use METIS. Maximum * allowed value is CHOLMOD_MAXMETHODS. */ int current ; /* The current method being tried. Default: 0. Valid * range is 0 to nmethods-1. */ int selected ; /* The best method found. */ /* The suite of ordering methods and parameters: */ struct cholmod_method_struct { /* statistics for this method */ double lnz ; /* nnz(L) excl. zeros from supernodal amalgamation, * for a "pure" L */ double fl ; /* flop count for a "pure", real simplicial LL' * factorization, with no extra work due to * amalgamation. Subtract n to get the LDL' flop count. Multiply * by about 4 if the matrix is complex or zomplex. */ /* ordering method parameters */ double prune_dense ;/* dense row/col control for AMD, SYMAMD, CSYMAMD, * and NESDIS (cholmod_nested_dissection). For a * symmetric n-by-n matrix, rows/columns with more than * MAX (16, prune_dense * sqrt (n)) entries are removed prior to * ordering. They appear at the end of the re-ordered matrix. * * If prune_dense < 0, only completely dense rows/cols are removed. * * This paramater is also the dense column control for COLAMD and * CCOLAMD. For an m-by-n matrix, columns with more than * MAX (16, prune_dense * sqrt (MIN (m,n))) entries are removed prior * to ordering. They appear at the end of the re-ordered matrix. * CHOLMOD factorizes A*A', so it calls COLAMD and CCOLAMD with A', * not A. Thus, this parameter affects the dense *row* control for * CHOLMOD's matrix, and the dense *column* control for COLAMD and * CCOLAMD. * * Removing dense rows and columns improves the run-time of the * ordering methods. It has some impact on ordering quality * (usually minimal, sometimes good, sometimes bad). * * Default: 10. */ double prune_dense2 ;/* dense row control for COLAMD and CCOLAMD. * Rows with more than MAX (16, dense2 * sqrt (n)) * for an m-by-n matrix are removed prior to ordering. CHOLMOD's * matrix is transposed before ordering it with COLAMD or CCOLAMD, * so this controls the dense *columns* of CHOLMOD's matrix, and * the dense *rows* of COLAMD's or CCOLAMD's matrix. * * If prune_dense2 < 0, only completely dense rows/cols are removed. * * Default: -1. Note that this is not the default for COLAMD and * CCOLAMD. -1 is best for Cholesky. 10 is best for LU. */ double nd_oksep ; /* in NESDIS, when a node separator is computed, it * discarded if nsep >= nd_oksep*n, where nsep is * the number of nodes in the separator, and n is the size of the * graph being cut. Valid range is 0 to 1. If 1 or greater, the * separator is discarded if it consists of the entire graph. * Default: 1 */ double other_1 [4] ; /* future expansion */ size_t nd_small ; /* do not partition graphs with fewer nodes than * nd_small, in NESDIS. Default: 200 (same as * METIS) */ size_t other_2 [4] ; /* future expansion */ int aggressive ; /* Aggresive absorption in AMD, COLAMD, SYMAMD, * CCOLAMD, and CSYMAMD. Default: TRUE */ int order_for_lu ; /* CCOLAMD can be optimized to produce an ordering * for LU or Cholesky factorization. CHOLMOD only * performs a Cholesky factorization. However, you may wish to use * CHOLMOD as an interface for CCOLAMD but use it for your own LU * factorization. In this case, order_for_lu should be set to FALSE. * When factorizing in CHOLMOD itself, you should *** NEVER *** set * this parameter FALSE. Default: TRUE. */ int nd_compress ; /* If TRUE, compress the graph and subgraphs before * partitioning them in NESDIS. Default: TRUE */ int nd_camd ; /* If 1, follow the nested dissection ordering * with a constrained minimum degree ordering that * respects the partitioning just found (using CAMD). If 2, use * CSYMAMD instead. If you set nd_small very small, you may not need * this ordering, and can save time by setting it to zero (no * constrained minimum degree ordering). Default: 1. */ int nd_components ; /* The nested dissection ordering finds a node * separator that splits the graph into two parts, * which may be unconnected. If nd_components is TRUE, each of * these connected components is split independently. If FALSE, * each part is split as a whole, even if it consists of more than * one connected component. Default: FALSE */ /* fill-reducing ordering to use */ int ordering ; size_t other_3 [4] ; /* future expansion */ } method [CHOLMOD_MAXMETHODS + 1] ; int postorder ; /* If TRUE, cholmod_analyze follows the ordering with a * weighted postorder of the elimination tree. Improves * supernode amalgamation. Does not affect fundamental nnz(L) and * flop count. Default: TRUE. */ int default_nesdis ; /* Default: FALSE. If FALSE, then the default * ordering strategy (when Common->nmethods == 0) * is to try the given ordering (if present), AMD, and then METIS if AMD * reports high fill-in. If Common->default_nesdis is TRUE then NESDIS * is used instead in the default strategy. */ /* ---------------------------------------------------------------------- */ /* memory management, complex divide, and hypot function pointers moved */ /* ---------------------------------------------------------------------- */ /* Function pointers moved from here (in CHOLMOD 2.2.0) to SuiteSparse_config.[ch]. See CHOLMOD/Include/cholmod_back.h for a set of macros that can be #include'd or copied into your application to define these function pointers on any version of CHOLMOD. */ /* ---------------------------------------------------------------------- */ /* METIS workarounds */ /* ---------------------------------------------------------------------- */ /* These workarounds were put into place for METIS 4.0.1. They are safe to use with METIS 5.1.0, but they might not longer be necessary. */ double metis_memory ; /* This is a parameter for CHOLMOD's interface to * METIS, not a parameter to METIS itself. METIS * uses an amount of memory that is difficult to estimate precisely * beforehand. If it runs out of memory, it terminates your program. * All routines in CHOLMOD except for CHOLMOD's interface to METIS * return an error status and safely return to your program if they run * out of memory. To mitigate this problem, the CHOLMOD interface * can allocate a single block of memory equal in size to an empirical * upper bound of METIS's memory usage times the Common->metis_memory * parameter, and then immediately free it. It then calls METIS. If * this pre-allocation fails, it is possible that METIS will fail as * well, and so CHOLMOD returns with an out-of-memory condition without * calling METIS. * * METIS_NodeND (used in the CHOLMOD_METIS ordering option) with its * default parameter settings typically uses about (4*nz+40n+4096) * times sizeof(int) memory, where nz is equal to the number of entries * in A for the symmetric case or AA' if an unsymmetric matrix is * being ordered (where nz includes both the upper and lower parts * of A or AA'). The observed "upper bound" (with 2 exceptions), * measured in an instrumented copy of METIS 4.0.1 on thousands of * matrices, is (10*nz+50*n+4096) * sizeof(int). Two large matrices * exceeded this bound, one by almost a factor of 2 (Gupta/gupta2). * * If your program is terminated by METIS, try setting metis_memory to * 2.0, or even higher if needed. By default, CHOLMOD assumes that METIS * does not have this problem (so that CHOLMOD will work correctly when * this issue is fixed in METIS). Thus, the default value is zero. * This work-around is not guaranteed anyway. * * If a matrix exceeds this predicted memory usage, AMD is attempted * instead. It, too, may run out of memory, but if it does so it will * not terminate your program. */ double metis_dswitch ; /* METIS_NodeND in METIS 4.0.1 gives a seg */ size_t metis_nswitch ; /* fault with one matrix of order n = 3005 and * nz = 6,036,025. This is a very dense graph. * The workaround is to use AMD instead of METIS for matrices of dimension * greater than Common->metis_nswitch (default 3000) or more and with * density of Common->metis_dswitch (default 0.66) or more. * cholmod_nested_dissection has no problems with the same matrix, even * though it uses METIS_ComputeVertexSeparator on this matrix. If this * seg fault does not affect you, set metis_nswitch to zero or less, * and CHOLMOD will not switch to AMD based just on the density of the * matrix (it will still switch to AMD if the metis_memory parameter * causes the switch). */ /* ---------------------------------------------------------------------- */ /* workspace */ /* ---------------------------------------------------------------------- */ /* CHOLMOD has several routines that take less time than the size of * workspace they require. Allocating and initializing the workspace would * dominate the run time, unless workspace is allocated and initialized * just once. CHOLMOD allocates this space when needed, and holds it here * between calls to CHOLMOD. cholmod_start sets these pointers to NULL * (which is why it must be the first routine called in CHOLMOD). * cholmod_finish frees the workspace (which is why it must be the last * call to CHOLMOD). */ size_t nrow ; /* size of Flag and Head */ SuiteSparse_long mark ; /* mark value for Flag array */ size_t iworksize ; /* size of Iwork. Upper bound: 6*nrow+ncol */ size_t xworksize ; /* size of Xwork, in bytes. * maxrank*nrow*sizeof(double) for update/downdate. * 2*nrow*sizeof(double) otherwise */ /* initialized workspace: contents needed between calls to CHOLMOD */ void *Flag ; /* size nrow, an integer array. Kept cleared between * calls to cholmod rouines (Flag [i] < mark) */ void *Head ; /* size nrow+1, an integer array. Kept cleared between * calls to cholmod routines (Head [i] = EMPTY) */ void *Xwork ; /* a double array. Its size varies. It is nrow for * most routines (cholmod_rowfac, cholmod_add, * cholmod_aat, cholmod_norm, cholmod_ssmult) for the real case, twice * that when the input matrices are complex or zomplex. It is of size * 2*nrow for cholmod_rowadd and cholmod_rowdel. For cholmod_updown, * its size is maxrank*nrow where maxrank is 2, 4, or 8. Kept cleared * between calls to cholmod (set to zero). */ /* uninitialized workspace, contents not needed between calls to CHOLMOD */ void *Iwork ; /* size iworksize, 2*nrow+ncol for most routines, * up to 6*nrow+ncol for cholmod_analyze. */ int itype ; /* If CHOLMOD_LONG, Flag, Head, and Iwork are * SuiteSparse_long. Otherwise all three are int. */ int dtype ; /* double or float */ /* Common->itype and Common->dtype are used to define the types of all * sparse matrices, triplet matrices, dense matrices, and factors * created using this Common struct. The itypes and dtypes of all * parameters to all CHOLMOD routines must match. */ int no_workspace_reallocate ; /* this is an internal flag, used as a * precaution by cholmod_analyze. It is normally false. If true, * cholmod_allocate_work is not allowed to reallocate any workspace; * they must use the existing workspace in Common (Iwork, Flag, Head, * and Xwork). Added for CHOLMOD v1.1 */ /* ---------------------------------------------------------------------- */ /* statistics */ /* ---------------------------------------------------------------------- */ /* fl and lnz are set only in cholmod_analyze and cholmod_rowcolcounts, * in the Cholesky modudle. modfl is set only in the Modify module. */ int status ; /* error code */ double fl ; /* LL' flop count from most recent analysis */ double lnz ; /* fundamental nz in L */ double anz ; /* nonzeros in tril(A) if A is symmetric/lower, * triu(A) if symmetric/upper, or tril(A*A') if * unsymmetric, in last call to cholmod_analyze. */ double modfl ; /* flop count from most recent update/downdate/ * rowadd/rowdel (excluding flops to modify the * solution to Lx=b, if computed) */ size_t malloc_count ; /* # of objects malloc'ed minus the # free'd*/ size_t memory_usage ; /* peak memory usage in bytes */ size_t memory_inuse ; /* current memory usage in bytes */ double nrealloc_col ; /* # of column reallocations */ double nrealloc_factor ;/* # of factor reallocations due to col. reallocs */ double ndbounds_hit ; /* # of times diagonal modified by dbound */ double rowfacfl ; /* # of flops in last call to cholmod_rowfac */ double aatfl ; /* # of flops to compute A(:,f)*A(:,f)' */ int called_nd ; /* TRUE if the last call to * cholmod_analyze called NESDIS or METIS. */ int blas_ok ; /* FALSE if BLAS int overflow; TRUE otherwise */ /* ---------------------------------------------------------------------- */ /* SuiteSparseQR control parameters: */ /* ---------------------------------------------------------------------- */ double SPQR_grain ; /* task size is >= max (total flops / grain) */ double SPQR_small ; /* task size is >= small */ int SPQR_shrink ; /* controls stack realloc method */ int SPQR_nthreads ; /* number of TBB threads, 0 = auto */ /* ---------------------------------------------------------------------- */ /* SuiteSparseQR statistics */ /* ---------------------------------------------------------------------- */ /* was other1 [0:3] */ double SPQR_flopcount ; /* flop count for SPQR */ double SPQR_analyze_time ; /* analysis time in seconds for SPQR */ double SPQR_factorize_time ; /* factorize time in seconds for SPQR */ double SPQR_solve_time ; /* backsolve time in seconds */ /* was SPQR_xstat [0:3] */ double SPQR_flopcount_bound ; /* upper bound on flop count */ double SPQR_tol_used ; /* tolerance used */ double SPQR_norm_E_fro ; /* Frobenius norm of dropped entries */ /* was SPQR_istat [0:9] */ SuiteSparse_long SPQR_istat [10] ; /* ---------------------------------------------------------------------- */ /* GPU configuration and statistics */ /* ---------------------------------------------------------------------- */ /* useGPU: 1 if gpu-acceleration is requested */ /* 0 if gpu-acceleration is prohibited */ /* -1 if gpu-acceleration is undefined in which case the */ /* environment CHOLMOD_USE_GPU will be queried and used. */ /* useGPU=-1 is only used by CHOLMOD and treated as 0 by SPQR */ int useGPU; /* for CHOLMOD: */ size_t maxGpuMemBytes; double maxGpuMemFraction; /* for SPQR: */ size_t gpuMemorySize; /* Amount of memory in bytes on the GPU */ double gpuKernelTime; /* Time taken by GPU kernels */ SuiteSparse_long gpuFlops; /* Number of flops performed by the GPU */ int gpuNumKernelLaunches; /* Number of GPU kernel launches */ /* If not using the GPU, these items are not used, but they should be present so that the CHOLMOD Common has the same size whether the GPU is used or not. This way, all packages will agree on the size of the CHOLMOD Common, regardless of whether or not they are compiled with the GPU libraries or not */ #ifdef GPU_BLAS /* in CUDA, these three types are pointers */ #define CHOLMOD_CUBLAS_HANDLE cublasHandle_t #define CHOLMOD_CUDASTREAM cudaStream_t #define CHOLMOD_CUDAEVENT cudaEvent_t #else /* ... so make them void * pointers if the GPU is not being used */ #define CHOLMOD_CUBLAS_HANDLE void * #define CHOLMOD_CUDASTREAM void * #define CHOLMOD_CUDAEVENT void * #endif CHOLMOD_CUBLAS_HANDLE cublasHandle ; /* a set of streams for general use */ CHOLMOD_CUDASTREAM gpuStream[CHOLMOD_HOST_SUPERNODE_BUFFERS]; CHOLMOD_CUDAEVENT cublasEventPotrf [3] ; CHOLMOD_CUDAEVENT updateCKernelsComplete; CHOLMOD_CUDAEVENT updateCBuffersFree[CHOLMOD_HOST_SUPERNODE_BUFFERS]; void *dev_mempool; /* pointer to single allocation of device memory */ size_t dev_mempool_size; void *host_pinned_mempool; /* pointer to single allocation of pinned mem */ size_t host_pinned_mempool_size; size_t devBuffSize; int ibuffer; double syrkStart ; /* time syrk started */ /* run times of the different parts of CHOLMOD (GPU and CPU) */ double cholmod_cpu_gemm_time ; double cholmod_cpu_syrk_time ; double cholmod_cpu_trsm_time ; double cholmod_cpu_potrf_time ; double cholmod_gpu_gemm_time ; double cholmod_gpu_syrk_time ; double cholmod_gpu_trsm_time ; double cholmod_gpu_potrf_time ; double cholmod_assemble_time ; double cholmod_assemble_time2 ; /* number of times the BLAS are called on the CPU and the GPU */ size_t cholmod_cpu_gemm_calls ; size_t cholmod_cpu_syrk_calls ; size_t cholmod_cpu_trsm_calls ; size_t cholmod_cpu_potrf_calls ; size_t cholmod_gpu_gemm_calls ; size_t cholmod_gpu_syrk_calls ; size_t cholmod_gpu_trsm_calls ; size_t cholmod_gpu_potrf_calls ; } cholmod_common ; /* size_t BLAS statistcs in Common: */ #define CHOLMOD_CPU_GEMM_CALLS cholmod_cpu_gemm_calls #define CHOLMOD_CPU_SYRK_CALLS cholmod_cpu_syrk_calls #define CHOLMOD_CPU_TRSM_CALLS cholmod_cpu_trsm_calls #define CHOLMOD_CPU_POTRF_CALLS cholmod_cpu_potrf_calls #define CHOLMOD_GPU_GEMM_CALLS cholmod_gpu_gemm_calls #define CHOLMOD_GPU_SYRK_CALLS cholmod_gpu_syrk_calls #define CHOLMOD_GPU_TRSM_CALLS cholmod_gpu_trsm_calls #define CHOLMOD_GPU_POTRF_CALLS cholmod_gpu_potrf_calls /* double BLAS statistics in Common: */ #define CHOLMOD_CPU_GEMM_TIME cholmod_cpu_gemm_time #define CHOLMOD_CPU_SYRK_TIME cholmod_cpu_syrk_time #define CHOLMOD_CPU_TRSM_TIME cholmod_cpu_trsm_time #define CHOLMOD_CPU_POTRF_TIME cholmod_cpu_potrf_time #define CHOLMOD_GPU_GEMM_TIME cholmod_gpu_gemm_time #define CHOLMOD_GPU_SYRK_TIME cholmod_gpu_syrk_time #define CHOLMOD_GPU_TRSM_TIME cholmod_gpu_trsm_time #define CHOLMOD_GPU_POTRF_TIME cholmod_gpu_potrf_time #define CHOLMOD_ASSEMBLE_TIME cholmod_assemble_time #define CHOLMOD_ASSEMBLE_TIME2 cholmod_assemble_time2 /* for supernodal analysis */ #define CHOLMOD_ANALYZE_FOR_SPQR 0 #define CHOLMOD_ANALYZE_FOR_CHOLESKY 1 #define CHOLMOD_ANALYZE_FOR_SPQRGPU 2 /* -------------------------------------------------------------------------- */ /* cholmod_start: first call to CHOLMOD */ /* -------------------------------------------------------------------------- */ int cholmod_start ( cholmod_common *Common ) ; int cholmod_l_start (cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_finish: last call to CHOLMOD */ /* -------------------------------------------------------------------------- */ int cholmod_finish ( cholmod_common *Common ) ; int cholmod_l_finish (cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_defaults: restore default parameters */ /* -------------------------------------------------------------------------- */ int cholmod_defaults ( cholmod_common *Common ) ; int cholmod_l_defaults (cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_maxrank: return valid maximum rank for update/downdate */ /* -------------------------------------------------------------------------- */ size_t cholmod_maxrank /* returns validated value of Common->maxrank */ ( /* ---- input ---- */ size_t n, /* A and L will have n rows */ /* --------------- */ cholmod_common *Common ) ; size_t cholmod_l_maxrank (size_t, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_allocate_work: allocate workspace in Common */ /* -------------------------------------------------------------------------- */ int cholmod_allocate_work ( /* ---- input ---- */ size_t nrow, /* size: Common->Flag (nrow), Common->Head (nrow+1) */ size_t iworksize, /* size of Common->Iwork */ size_t xworksize, /* size of Common->Xwork */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_allocate_work (size_t, size_t, size_t, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_free_work: free workspace in Common */ /* -------------------------------------------------------------------------- */ int cholmod_free_work ( cholmod_common *Common ) ; int cholmod_l_free_work (cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_clear_flag: clear Flag workspace in Common */ /* -------------------------------------------------------------------------- */ /* use a macro for speed */ #define CHOLMOD_CLEAR_FLAG(Common) \ { \ Common->mark++ ; \ if (Common->mark <= 0) \ { \ Common->mark = EMPTY ; \ CHOLMOD (clear_flag) (Common) ; \ } \ } SuiteSparse_long cholmod_clear_flag ( cholmod_common *Common ) ; SuiteSparse_long cholmod_l_clear_flag (cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_error: called when CHOLMOD encounters an error */ /* -------------------------------------------------------------------------- */ int cholmod_error ( /* ---- input ---- */ int status, /* error status */ const char *file, /* name of source code file where error occured */ int line, /* line number in source code file where error occured*/ const char *message,/* error message */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_error (int, const char *, int, const char *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_dbound: for internal use in CHOLMOD only */ /* -------------------------------------------------------------------------- */ double cholmod_dbound /* returns modified diagonal entry of D or L */ ( /* ---- input ---- */ double dj, /* diagonal entry of D for LDL' or L for LL' */ /* --------------- */ cholmod_common *Common ) ; double cholmod_l_dbound (double, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_hypot: compute sqrt (x*x + y*y) accurately */ /* -------------------------------------------------------------------------- */ double cholmod_hypot ( /* ---- input ---- */ double x, double y ) ; double cholmod_l_hypot (double, double) ; /* -------------------------------------------------------------------------- */ /* cholmod_divcomplex: complex division, c = a/b */ /* -------------------------------------------------------------------------- */ int cholmod_divcomplex /* return 1 if divide-by-zero, 0 otherise */ ( /* ---- input ---- */ double ar, double ai, /* real and imaginary parts of a */ double br, double bi, /* real and imaginary parts of b */ /* ---- output --- */ double *cr, double *ci /* real and imaginary parts of c */ ) ; int cholmod_l_divcomplex (double, double, double, double, double *, double *) ; /* ========================================================================== */ /* === Core/cholmod_sparse ================================================== */ /* ========================================================================== */ /* A sparse matrix stored in compressed-column form. */ typedef struct cholmod_sparse_struct { size_t nrow ; /* the matrix is nrow-by-ncol */ size_t ncol ; size_t nzmax ; /* maximum number of entries in the matrix */ /* pointers to int or SuiteSparse_long: */ void *p ; /* p [0..ncol], the column pointers */ void *i ; /* i [0..nzmax-1], the row indices */ /* for unpacked matrices only: */ void *nz ; /* nz [0..ncol-1], the # of nonzeros in each col. In * packed form, the nonzero pattern of column j is in * A->i [A->p [j] ... A->p [j+1]-1]. In unpacked form, column j is in * A->i [A->p [j] ... A->p [j]+A->nz[j]-1] instead. In both cases, the * numerical values (if present) are in the corresponding locations in * the array x (or z if A->xtype is CHOLMOD_ZOMPLEX). */ /* pointers to double or float: */ void *x ; /* size nzmax or 2*nzmax, if present */ void *z ; /* size nzmax, if present */ int stype ; /* Describes what parts of the matrix are considered: * * 0: matrix is "unsymmetric": use both upper and lower triangular parts * (the matrix may actually be symmetric in pattern and value, but * both parts are explicitly stored and used). May be square or * rectangular. * >0: matrix is square and symmetric, use upper triangular part. * Entries in the lower triangular part are ignored. * <0: matrix is square and symmetric, use lower triangular part. * Entries in the upper triangular part are ignored. * * Note that stype>0 and stype<0 are different for cholmod_sparse and * cholmod_triplet. See the cholmod_triplet data structure for more * details. */ int itype ; /* CHOLMOD_INT: p, i, and nz are int. * CHOLMOD_INTLONG: p is SuiteSparse_long, * i and nz are int. * CHOLMOD_LONG: p, i, and nz are SuiteSparse_long */ int xtype ; /* pattern, real, complex, or zomplex */ int dtype ; /* x and z are double or float */ int sorted ; /* TRUE if columns are sorted, FALSE otherwise */ int packed ; /* TRUE if packed (nz ignored), FALSE if unpacked * (nz is required) */ } cholmod_sparse ; typedef struct cholmod_descendant_score_t { double score; SuiteSparse_long d; } descendantScore; /* For sorting descendant supernodes with qsort */ int cholmod_score_comp (struct cholmod_descendant_score_t *i, struct cholmod_descendant_score_t *j); int cholmod_l_score_comp (struct cholmod_descendant_score_t *i, struct cholmod_descendant_score_t *j); /* -------------------------------------------------------------------------- */ /* cholmod_allocate_sparse: allocate a sparse matrix */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_allocate_sparse ( /* ---- input ---- */ size_t nrow, /* # of rows of A */ size_t ncol, /* # of columns of A */ size_t nzmax, /* max # of nonzeros of A */ int sorted, /* TRUE if columns of A sorted, FALSE otherwise */ int packed, /* TRUE if A will be packed, FALSE otherwise */ int stype, /* stype of A */ int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_allocate_sparse (size_t, size_t, size_t, int, int, int, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_free_sparse: free a sparse matrix */ /* -------------------------------------------------------------------------- */ int cholmod_free_sparse ( /* ---- in/out --- */ cholmod_sparse **A, /* matrix to deallocate, NULL on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_free_sparse (cholmod_sparse **, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_reallocate_sparse: change the size (# entries) of sparse matrix */ /* -------------------------------------------------------------------------- */ int cholmod_reallocate_sparse ( /* ---- input ---- */ size_t nznew, /* new # of entries in A */ /* ---- in/out --- */ cholmod_sparse *A, /* matrix to reallocate */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_reallocate_sparse ( size_t, cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_nnz: return number of nonzeros in a sparse matrix */ /* -------------------------------------------------------------------------- */ SuiteSparse_long cholmod_nnz ( /* ---- input ---- */ cholmod_sparse *A, /* --------------- */ cholmod_common *Common ) ; SuiteSparse_long cholmod_l_nnz (cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_speye: sparse identity matrix */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_speye ( /* ---- input ---- */ size_t nrow, /* # of rows of A */ size_t ncol, /* # of columns of A */ int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_speye (size_t, size_t, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_spzeros: sparse zero matrix */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_spzeros ( /* ---- input ---- */ size_t nrow, /* # of rows of A */ size_t ncol, /* # of columns of A */ size_t nzmax, /* max # of nonzeros of A */ int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_spzeros (size_t, size_t, size_t, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_transpose: transpose a sparse matrix */ /* -------------------------------------------------------------------------- */ /* Return A' or A.' The "values" parameter is 0, 1, or 2 to denote the pattern * transpose, the array transpose (A.'), and the complex conjugate transpose * (A'). */ cholmod_sparse *cholmod_transpose ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to transpose */ int values, /* 0: pattern, 1: array transpose, 2: conj. transpose */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_transpose (cholmod_sparse *, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_transpose_unsym: transpose an unsymmetric sparse matrix */ /* -------------------------------------------------------------------------- */ /* Compute F = A', A (:,f)', or A (p,f)', where A is unsymmetric and F is * already allocated. See cholmod_transpose for a simpler routine. */ int cholmod_transpose_unsym ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to transpose */ int values, /* 0: pattern, 1: array transpose, 2: conj. transpose */ int *Perm, /* size nrow, if present (can be NULL) */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* ---- output --- */ cholmod_sparse *F, /* F = A', A(:,f)', or A(p,f)' */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_transpose_unsym (cholmod_sparse *, int, SuiteSparse_long *, SuiteSparse_long *, size_t, cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_transpose_sym: transpose a symmetric sparse matrix */ /* -------------------------------------------------------------------------- */ /* Compute F = A' or A (p,p)', where A is symmetric and F is already allocated. * See cholmod_transpose for a simpler routine. */ int cholmod_transpose_sym ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to transpose */ int values, /* 0: pattern, 1: array transpose, 2: conj. transpose */ int *Perm, /* size nrow, if present (can be NULL) */ /* ---- output --- */ cholmod_sparse *F, /* F = A' or A(p,p)' */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_transpose_sym (cholmod_sparse *, int, SuiteSparse_long *, cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_ptranspose: transpose a sparse matrix */ /* -------------------------------------------------------------------------- */ /* Return A' or A(p,p)' if A is symmetric. Return A', A(:,f)', or A(p,f)' if * A is unsymmetric. */ cholmod_sparse *cholmod_ptranspose ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to transpose */ int values, /* 0: pattern, 1: array transpose, 2: conj. transpose */ int *Perm, /* if non-NULL, F = A(p,f) or A(p,p) */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_ptranspose (cholmod_sparse *, int, SuiteSparse_long *, SuiteSparse_long *, size_t, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_sort: sort row indices in each column of sparse matrix */ /* -------------------------------------------------------------------------- */ int cholmod_sort ( /* ---- in/out --- */ cholmod_sparse *A, /* matrix to sort */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_sort (cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_band: C = tril (triu (A,k1), k2) */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_band ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to extract band matrix from */ SuiteSparse_long k1, /* ignore entries below the k1-st diagonal */ SuiteSparse_long k2, /* ignore entries above the k2-nd diagonal */ int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_band (cholmod_sparse *, SuiteSparse_long, SuiteSparse_long, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_band_inplace: A = tril (triu (A,k1), k2) */ /* -------------------------------------------------------------------------- */ int cholmod_band_inplace ( /* ---- input ---- */ SuiteSparse_long k1, /* ignore entries below the k1-st diagonal */ SuiteSparse_long k2, /* ignore entries above the k2-nd diagonal */ int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ /* ---- in/out --- */ cholmod_sparse *A, /* matrix from which entries not in band are removed */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_band_inplace (SuiteSparse_long, SuiteSparse_long, int, cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_aat: C = A*A' or A(:,f)*A(:,f)' */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_aat ( /* ---- input ---- */ cholmod_sparse *A, /* input matrix; C=A*A' is constructed */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag), * -2: pattern only, no diagonal, add 50%+n extra * space to C */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_aat (cholmod_sparse *, SuiteSparse_long *, size_t, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_copy_sparse: C = A, create an exact copy of a sparse matrix */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_copy_sparse ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_copy_sparse (cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_copy: C = A, with possible change of stype */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_copy ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to copy */ int stype, /* requested stype of C */ int mode, /* >0: numerical, 0: pattern, <0: pattern (no diag) */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_copy (cholmod_sparse *, int, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_add: C = alpha*A + beta*B */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_add ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to add */ cholmod_sparse *B, /* matrix to add */ double alpha [2], /* scale factor for A */ double beta [2], /* scale factor for B */ int values, /* if TRUE compute the numerical values of C */ int sorted, /* if TRUE, sort columns of C */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_add (cholmod_sparse *, cholmod_sparse *, double *, double *, int, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_sparse_xtype: change the xtype of a sparse matrix */ /* -------------------------------------------------------------------------- */ int cholmod_sparse_xtype ( /* ---- input ---- */ int to_xtype, /* requested xtype (pattern, real, complex, zomplex) */ /* ---- in/out --- */ cholmod_sparse *A, /* sparse matrix to change */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_sparse_xtype (int, cholmod_sparse *, cholmod_common *) ; /* ========================================================================== */ /* === Core/cholmod_factor ================================================== */ /* ========================================================================== */ /* A symbolic and numeric factorization, either simplicial or supernodal. * In all cases, the row indices in the columns of L are kept sorted. */ typedef struct cholmod_factor_struct { /* ---------------------------------------------------------------------- */ /* for both simplicial and supernodal factorizations */ /* ---------------------------------------------------------------------- */ size_t n ; /* L is n-by-n */ size_t minor ; /* If the factorization failed, L->minor is the column * at which it failed (in the range 0 to n-1). A value * of n means the factorization was successful or * the matrix has not yet been factorized. */ /* ---------------------------------------------------------------------- */ /* symbolic ordering and analysis */ /* ---------------------------------------------------------------------- */ void *Perm ; /* size n, permutation used */ void *ColCount ; /* size n, column counts for simplicial L */ void *IPerm ; /* size n, inverse permutation. Only created by * cholmod_solve2 if Bset is used. */ /* ---------------------------------------------------------------------- */ /* simplicial factorization */ /* ---------------------------------------------------------------------- */ size_t nzmax ; /* size of i and x */ void *p ; /* p [0..ncol], the column pointers */ void *i ; /* i [0..nzmax-1], the row indices */ void *x ; /* x [0..nzmax-1], the numerical values */ void *z ; void *nz ; /* nz [0..ncol-1], the # of nonzeros in each column. * i [p [j] ... p [j]+nz[j]-1] contains the row indices, * and the numerical values are in the same locatins * in x. The value of i [p [k]] is always k. */ void *next ; /* size ncol+2. next [j] is the next column in i/x */ void *prev ; /* size ncol+2. prev [j] is the prior column in i/x. * head of the list is ncol+1, and the tail is ncol. */ /* ---------------------------------------------------------------------- */ /* supernodal factorization */ /* ---------------------------------------------------------------------- */ /* Note that L->x is shared with the simplicial data structure. L->x has * size L->nzmax for a simplicial factor, and size L->xsize for a supernodal * factor. */ size_t nsuper ; /* number of supernodes */ size_t ssize ; /* size of s, integer part of supernodes */ size_t xsize ; /* size of x, real part of supernodes */ size_t maxcsize ; /* size of largest update matrix */ size_t maxesize ; /* max # of rows in supernodes, excl. triangular part */ void *super ; /* size nsuper+1, first col in each supernode */ void *pi ; /* size nsuper+1, pointers to integer patterns */ void *px ; /* size nsuper+1, pointers to real parts */ void *s ; /* size ssize, integer part of supernodes */ /* ---------------------------------------------------------------------- */ /* factorization type */ /* ---------------------------------------------------------------------- */ int ordering ; /* ordering method used */ int is_ll ; /* TRUE if LL', FALSE if LDL' */ int is_super ; /* TRUE if supernodal, FALSE if simplicial */ int is_monotonic ; /* TRUE if columns of L appear in order 0..n-1. * Only applicable to simplicial numeric types. */ /* There are 8 types of factor objects that cholmod_factor can represent * (only 6 are used): * * Numeric types (xtype is not CHOLMOD_PATTERN) * -------------------------------------------- * * simplicial LDL': (is_ll FALSE, is_super FALSE). Stored in compressed * column form, using the simplicial components above (nzmax, p, i, * x, z, nz, next, and prev). The unit diagonal of L is not stored, * and D is stored in its place. There are no supernodes. * * simplicial LL': (is_ll TRUE, is_super FALSE). Uses the same storage * scheme as the simplicial LDL', except that D does not appear. * The first entry of each column of L is the diagonal entry of * that column of L. * * supernodal LDL': (is_ll FALSE, is_super TRUE). Not used. * FUTURE WORK: add support for supernodal LDL' * * supernodal LL': (is_ll TRUE, is_super TRUE). A supernodal factor, * using the supernodal components described above (nsuper, ssize, * xsize, maxcsize, maxesize, super, pi, px, s, x, and z). * * * Symbolic types (xtype is CHOLMOD_PATTERN) * ----------------------------------------- * * simplicial LDL': (is_ll FALSE, is_super FALSE). Nothing is present * except Perm and ColCount. * * simplicial LL': (is_ll TRUE, is_super FALSE). Identical to the * simplicial LDL', except for the is_ll flag. * * supernodal LDL': (is_ll FALSE, is_super TRUE). Not used. * FUTURE WORK: add support for supernodal LDL' * * supernodal LL': (is_ll TRUE, is_super TRUE). A supernodal symbolic * factorization. The simplicial symbolic information is present * (Perm and ColCount), as is all of the supernodal factorization * except for the numerical values (x and z). */ int itype ; /* The integer arrays are Perm, ColCount, p, i, nz, * next, prev, super, pi, px, and s. If itype is * CHOLMOD_INT, all of these are int arrays. * CHOLMOD_INTLONG: p, pi, px are SuiteSparse_long, others int. * CHOLMOD_LONG: all integer arrays are SuiteSparse_long. */ int xtype ; /* pattern, real, complex, or zomplex */ int dtype ; /* x and z double or float */ int useGPU; /* Indicates the symbolic factorization supports * GPU acceleration */ } cholmod_factor ; /* -------------------------------------------------------------------------- */ /* cholmod_allocate_factor: allocate a factor (symbolic LL' or LDL') */ /* -------------------------------------------------------------------------- */ cholmod_factor *cholmod_allocate_factor ( /* ---- input ---- */ size_t n, /* L is n-by-n */ /* --------------- */ cholmod_common *Common ) ; cholmod_factor *cholmod_l_allocate_factor (size_t, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_free_factor: free a factor */ /* -------------------------------------------------------------------------- */ int cholmod_free_factor ( /* ---- in/out --- */ cholmod_factor **L, /* factor to free, NULL on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_free_factor (cholmod_factor **, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_reallocate_factor: change the # entries in a factor */ /* -------------------------------------------------------------------------- */ int cholmod_reallocate_factor ( /* ---- input ---- */ size_t nznew, /* new # of entries in L */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_reallocate_factor (size_t, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_change_factor: change the type of factor (e.g., LDL' to LL') */ /* -------------------------------------------------------------------------- */ int cholmod_change_factor ( /* ---- input ---- */ int to_xtype, /* to CHOLMOD_PATTERN, _REAL, _COMPLEX, _ZOMPLEX */ int to_ll, /* TRUE: convert to LL', FALSE: LDL' */ int to_super, /* TRUE: convert to supernodal, FALSE: simplicial */ int to_packed, /* TRUE: pack simplicial columns, FALSE: do not pack */ int to_monotonic, /* TRUE: put simplicial columns in order, FALSE: not */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_change_factor ( int, int, int, int, int, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_pack_factor: pack the columns of a factor */ /* -------------------------------------------------------------------------- */ /* Pack the columns of a simplicial factor. Unlike cholmod_change_factor, * it can pack the columns of a factor even if they are not stored in their * natural order (non-monotonic). */ int cholmod_pack_factor ( /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_pack_factor (cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_reallocate_column: resize a single column of a factor */ /* -------------------------------------------------------------------------- */ int cholmod_reallocate_column ( /* ---- input ---- */ size_t j, /* the column to reallocate */ size_t need, /* required size of column j */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_reallocate_column (size_t, size_t, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_factor_to_sparse: create a sparse matrix copy of a factor */ /* -------------------------------------------------------------------------- */ /* Only operates on numeric factors, not symbolic ones */ cholmod_sparse *cholmod_factor_to_sparse ( /* ---- in/out --- */ cholmod_factor *L, /* factor to copy, converted to symbolic on output */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_factor_to_sparse (cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_copy_factor: create a copy of a factor */ /* -------------------------------------------------------------------------- */ cholmod_factor *cholmod_copy_factor ( /* ---- input ---- */ cholmod_factor *L, /* factor to copy */ /* --------------- */ cholmod_common *Common ) ; cholmod_factor *cholmod_l_copy_factor (cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_factor_xtype: change the xtype of a factor */ /* -------------------------------------------------------------------------- */ int cholmod_factor_xtype ( /* ---- input ---- */ int to_xtype, /* requested xtype (real, complex, or zomplex) */ /* ---- in/out --- */ cholmod_factor *L, /* factor to change */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_factor_xtype (int, cholmod_factor *, cholmod_common *) ; /* ========================================================================== */ /* === Core/cholmod_dense =================================================== */ /* ========================================================================== */ /* A dense matrix in column-oriented form. It has no itype since it contains * no integers. Entry in row i and column j is located in x [i+j*d]. */ typedef struct cholmod_dense_struct { size_t nrow ; /* the matrix is nrow-by-ncol */ size_t ncol ; size_t nzmax ; /* maximum number of entries in the matrix */ size_t d ; /* leading dimension (d >= nrow must hold) */ void *x ; /* size nzmax or 2*nzmax, if present */ void *z ; /* size nzmax, if present */ int xtype ; /* pattern, real, complex, or zomplex */ int dtype ; /* x and z double or float */ } cholmod_dense ; /* -------------------------------------------------------------------------- */ /* cholmod_allocate_dense: allocate a dense matrix (contents uninitialized) */ /* -------------------------------------------------------------------------- */ cholmod_dense *cholmod_allocate_dense ( /* ---- input ---- */ size_t nrow, /* # of rows of matrix */ size_t ncol, /* # of columns of matrix */ size_t d, /* leading dimension */ int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) ; cholmod_dense *cholmod_l_allocate_dense (size_t, size_t, size_t, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_zeros: allocate a dense matrix and set it to zero */ /* -------------------------------------------------------------------------- */ cholmod_dense *cholmod_zeros ( /* ---- input ---- */ size_t nrow, /* # of rows of matrix */ size_t ncol, /* # of columns of matrix */ int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) ; cholmod_dense *cholmod_l_zeros (size_t, size_t, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_ones: allocate a dense matrix and set it to all ones */ /* -------------------------------------------------------------------------- */ cholmod_dense *cholmod_ones ( /* ---- input ---- */ size_t nrow, /* # of rows of matrix */ size_t ncol, /* # of columns of matrix */ int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) ; cholmod_dense *cholmod_l_ones (size_t, size_t, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_eye: allocate a dense matrix and set it to the identity matrix */ /* -------------------------------------------------------------------------- */ cholmod_dense *cholmod_eye ( /* ---- input ---- */ size_t nrow, /* # of rows of matrix */ size_t ncol, /* # of columns of matrix */ int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) ; cholmod_dense *cholmod_l_eye (size_t, size_t, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_free_dense: free a dense matrix */ /* -------------------------------------------------------------------------- */ int cholmod_free_dense ( /* ---- in/out --- */ cholmod_dense **X, /* dense matrix to deallocate, NULL on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_free_dense (cholmod_dense **, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_ensure_dense: ensure a dense matrix has a given size and type */ /* -------------------------------------------------------------------------- */ cholmod_dense *cholmod_ensure_dense ( /* ---- input/output ---- */ cholmod_dense **XHandle, /* matrix handle to check */ /* ---- input ---- */ size_t nrow, /* # of rows of matrix */ size_t ncol, /* # of columns of matrix */ size_t d, /* leading dimension */ int xtype, /* CHOLMOD_REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) ; cholmod_dense *cholmod_l_ensure_dense (cholmod_dense **, size_t, size_t, size_t, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_sparse_to_dense: create a dense matrix copy of a sparse matrix */ /* -------------------------------------------------------------------------- */ cholmod_dense *cholmod_sparse_to_dense ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) ; cholmod_dense *cholmod_l_sparse_to_dense (cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_dense_to_sparse: create a sparse matrix copy of a dense matrix */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_dense_to_sparse ( /* ---- input ---- */ cholmod_dense *X, /* matrix to copy */ int values, /* TRUE if values to be copied, FALSE otherwise */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_dense_to_sparse (cholmod_dense *, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_copy_dense: create a copy of a dense matrix */ /* -------------------------------------------------------------------------- */ cholmod_dense *cholmod_copy_dense ( /* ---- input ---- */ cholmod_dense *X, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) ; cholmod_dense *cholmod_l_copy_dense (cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_copy_dense2: copy a dense matrix (pre-allocated) */ /* -------------------------------------------------------------------------- */ int cholmod_copy_dense2 ( /* ---- input ---- */ cholmod_dense *X, /* matrix to copy */ /* ---- output --- */ cholmod_dense *Y, /* copy of matrix X */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_copy_dense2 (cholmod_dense *, cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_dense_xtype: change the xtype of a dense matrix */ /* -------------------------------------------------------------------------- */ int cholmod_dense_xtype ( /* ---- input ---- */ int to_xtype, /* requested xtype (real, complex,or zomplex) */ /* ---- in/out --- */ cholmod_dense *X, /* dense matrix to change */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_dense_xtype (int, cholmod_dense *, cholmod_common *) ; /* ========================================================================== */ /* === Core/cholmod_triplet ================================================= */ /* ========================================================================== */ /* A sparse matrix stored in triplet form. */ typedef struct cholmod_triplet_struct { size_t nrow ; /* the matrix is nrow-by-ncol */ size_t ncol ; size_t nzmax ; /* maximum number of entries in the matrix */ size_t nnz ; /* number of nonzeros in the matrix */ void *i ; /* i [0..nzmax-1], the row indices */ void *j ; /* j [0..nzmax-1], the column indices */ void *x ; /* size nzmax or 2*nzmax, if present */ void *z ; /* size nzmax, if present */ int stype ; /* Describes what parts of the matrix are considered: * * 0: matrix is "unsymmetric": use both upper and lower triangular parts * (the matrix may actually be symmetric in pattern and value, but * both parts are explicitly stored and used). May be square or * rectangular. * >0: matrix is square and symmetric. Entries in the lower triangular * part are transposed and added to the upper triangular part when * the matrix is converted to cholmod_sparse form. * <0: matrix is square and symmetric. Entries in the upper triangular * part are transposed and added to the lower triangular part when * the matrix is converted to cholmod_sparse form. * * Note that stype>0 and stype<0 are different for cholmod_sparse and * cholmod_triplet. The reason is simple. You can permute a symmetric * triplet matrix by simply replacing a row and column index with their * new row and column indices, via an inverse permutation. Suppose * P = L->Perm is your permutation, and Pinv is an array of size n. * Suppose a symmetric matrix A is represent by a triplet matrix T, with * entries only in the upper triangular part. Then the following code: * * Ti = T->i ; * Tj = T->j ; * for (k = 0 ; k < n ; k++) Pinv [P [k]] = k ; * for (k = 0 ; k < nz ; k++) Ti [k] = Pinv [Ti [k]] ; * for (k = 0 ; k < nz ; k++) Tj [k] = Pinv [Tj [k]] ; * * creates the triplet form of C=P*A*P'. However, if T initially * contains just the upper triangular entries (T->stype = 1), after * permutation it has entries in both the upper and lower triangular * parts. These entries should be transposed when constructing the * cholmod_sparse form of A, which is what cholmod_triplet_to_sparse * does. Thus: * * C = cholmod_triplet_to_sparse (T, 0, &Common) ; * * will return the matrix C = P*A*P'. * * Since the triplet matrix T is so simple to generate, it's quite easy * to remove entries that you do not want, prior to converting T to the * cholmod_sparse form. So if you include these entries in T, CHOLMOD * assumes that there must be a reason (such as the one above). Thus, * no entry in a triplet matrix is ever ignored. */ int itype ; /* CHOLMOD_LONG: i and j are SuiteSparse_long. Otherwise int */ int xtype ; /* pattern, real, complex, or zomplex */ int dtype ; /* x and z are double or float */ } cholmod_triplet ; /* -------------------------------------------------------------------------- */ /* cholmod_allocate_triplet: allocate a triplet matrix */ /* -------------------------------------------------------------------------- */ cholmod_triplet *cholmod_allocate_triplet ( /* ---- input ---- */ size_t nrow, /* # of rows of T */ size_t ncol, /* # of columns of T */ size_t nzmax, /* max # of nonzeros of T */ int stype, /* stype of T */ int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ /* --------------- */ cholmod_common *Common ) ; cholmod_triplet *cholmod_l_allocate_triplet (size_t, size_t, size_t, int, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_free_triplet: free a triplet matrix */ /* -------------------------------------------------------------------------- */ int cholmod_free_triplet ( /* ---- in/out --- */ cholmod_triplet **T, /* triplet matrix to deallocate, NULL on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_free_triplet (cholmod_triplet **, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_reallocate_triplet: change the # of entries in a triplet matrix */ /* -------------------------------------------------------------------------- */ int cholmod_reallocate_triplet ( /* ---- input ---- */ size_t nznew, /* new # of entries in T */ /* ---- in/out --- */ cholmod_triplet *T, /* triplet matrix to modify */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_reallocate_triplet (size_t, cholmod_triplet *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_sparse_to_triplet: create a triplet matrix copy of a sparse matrix*/ /* -------------------------------------------------------------------------- */ cholmod_triplet *cholmod_sparse_to_triplet ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) ; cholmod_triplet *cholmod_l_sparse_to_triplet (cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_triplet_to_sparse: create a sparse matrix copy of a triplet matrix*/ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_triplet_to_sparse ( /* ---- input ---- */ cholmod_triplet *T, /* matrix to copy */ size_t nzmax, /* allocate at least this much space in output matrix */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_triplet_to_sparse (cholmod_triplet *, size_t, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_copy_triplet: create a copy of a triplet matrix */ /* -------------------------------------------------------------------------- */ cholmod_triplet *cholmod_copy_triplet ( /* ---- input ---- */ cholmod_triplet *T, /* matrix to copy */ /* --------------- */ cholmod_common *Common ) ; cholmod_triplet *cholmod_l_copy_triplet (cholmod_triplet *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_triplet_xtype: change the xtype of a triplet matrix */ /* -------------------------------------------------------------------------- */ int cholmod_triplet_xtype ( /* ---- input ---- */ int to_xtype, /* requested xtype (pattern, real, complex,or zomplex)*/ /* ---- in/out --- */ cholmod_triplet *T, /* triplet matrix to change */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_triplet_xtype (int, cholmod_triplet *, cholmod_common *) ; /* ========================================================================== */ /* === Core/cholmod_memory ================================================== */ /* ========================================================================== */ /* The user may make use of these, just like malloc and free. You can even * malloc an object and safely free it with cholmod_free, and visa versa * (except that the memory usage statistics will be corrupted). These routines * do differ from malloc and free. If cholmod_free is given a NULL pointer, * for example, it does nothing (unlike the ANSI free). cholmod_realloc does * not return NULL if given a non-NULL pointer and a nonzero size, even if it * fails (it returns the original pointer and sets an error code in * Common->status instead). * * CHOLMOD keeps track of the amount of memory it has allocated, and so the * cholmod_free routine also takes the size of the object being freed. This * is only used for statistics. If you, the user of CHOLMOD, pass the wrong * size, the only consequence is that the memory usage statistics will be * corrupted. */ void *cholmod_malloc /* returns pointer to the newly malloc'd block */ ( /* ---- input ---- */ size_t n, /* number of items */ size_t size, /* size of each item */ /* --------------- */ cholmod_common *Common ) ; void *cholmod_l_malloc (size_t, size_t, cholmod_common *) ; void *cholmod_calloc /* returns pointer to the newly calloc'd block */ ( /* ---- input ---- */ size_t n, /* number of items */ size_t size, /* size of each item */ /* --------------- */ cholmod_common *Common ) ; void *cholmod_l_calloc (size_t, size_t, cholmod_common *) ; void *cholmod_free /* always returns NULL */ ( /* ---- input ---- */ size_t n, /* number of items */ size_t size, /* size of each item */ /* ---- in/out --- */ void *p, /* block of memory to free */ /* --------------- */ cholmod_common *Common ) ; void *cholmod_l_free (size_t, size_t, void *, cholmod_common *) ; void *cholmod_realloc /* returns pointer to reallocated block */ ( /* ---- input ---- */ size_t nnew, /* requested # of items in reallocated block */ size_t size, /* size of each item */ /* ---- in/out --- */ void *p, /* block of memory to realloc */ size_t *n, /* current size on input, nnew on output if successful*/ /* --------------- */ cholmod_common *Common ) ; void *cholmod_l_realloc (size_t, size_t, void *, size_t *, cholmod_common *) ; int cholmod_realloc_multiple ( /* ---- input ---- */ size_t nnew, /* requested # of items in reallocated blocks */ int nint, /* number of int/SuiteSparse_long blocks */ int xtype, /* CHOLMOD_PATTERN, _REAL, _COMPLEX, or _ZOMPLEX */ /* ---- in/out --- */ void **Iblock, /* int or SuiteSparse_long block */ void **Jblock, /* int or SuiteSparse_long block */ void **Xblock, /* complex, double, or float block */ void **Zblock, /* zomplex case only: double or float block */ size_t *n, /* current size of the I,J,X,Z blocks on input, * nnew on output if successful */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_realloc_multiple (size_t, int, int, void **, void **, void **, void **, size_t *, cholmod_common *) ; /* ========================================================================== */ /* === version control ====================================================== */ /* ========================================================================== */ int cholmod_version /* returns CHOLMOD_VERSION */ ( /* output, contents not defined on input. Not used if NULL. version [0] = CHOLMOD_MAIN_VERSION version [1] = CHOLMOD_SUB_VERSION version [2] = CHOLMOD_SUBSUB_VERSION */ int version [3] ) ; int cholmod_l_version (int version [3]) ; /* Versions prior to 2.1.1 do not have the above function. The following code fragment will work with any version of CHOLMOD: #ifdef CHOLMOD_HAS_VERSION_FUNCTION v = cholmod_version (NULL) ; #else v = CHOLMOD_VERSION ; #endif */ /* ========================================================================== */ /* === symmetry types ======================================================= */ /* ========================================================================== */ #define CHOLMOD_MM_RECTANGULAR 1 #define CHOLMOD_MM_UNSYMMETRIC 2 #define CHOLMOD_MM_SYMMETRIC 3 #define CHOLMOD_MM_HERMITIAN 4 #define CHOLMOD_MM_SKEW_SYMMETRIC 5 #define CHOLMOD_MM_SYMMETRIC_POSDIAG 6 #define CHOLMOD_MM_HERMITIAN_POSDIAG 7 /* ========================================================================== */ /* === Numerical relop macros =============================================== */ /* ========================================================================== */ /* These macros correctly handle the NaN case. * * CHOLMOD_IS_NAN(x): * True if x is NaN. False otherwise. The commonly-existing isnan(x) * function could be used, but it's not in Kernighan & Ritchie 2nd edition * (ANSI C89). It may appear in , but I'm not certain about * portability. The expression x != x is true if and only if x is NaN, * according to the IEEE 754 floating-point standard. * * CHOLMOD_IS_ZERO(x): * True if x is zero. False if x is nonzero, NaN, or +/- Inf. * This is (x == 0) if the compiler is IEEE 754 compliant. * * CHOLMOD_IS_NONZERO(x): * True if x is nonzero, NaN, or +/- Inf. False if x zero. * This is (x != 0) if the compiler is IEEE 754 compliant. * * CHOLMOD_IS_LT_ZERO(x): * True if x is < zero or -Inf. False if x is >= 0, NaN, or +Inf. * This is (x < 0) if the compiler is IEEE 754 compliant. * * CHOLMOD_IS_GT_ZERO(x): * True if x is > zero or +Inf. False if x is <= 0, NaN, or -Inf. * This is (x > 0) if the compiler is IEEE 754 compliant. * * CHOLMOD_IS_LE_ZERO(x): * True if x is <= zero or -Inf. False if x is > 0, NaN, or +Inf. * This is (x <= 0) if the compiler is IEEE 754 compliant. */ #ifdef CHOLMOD_WINDOWS /* Yes, this is exceedingly ugly. Blame Microsoft, which hopelessly */ /* violates the IEEE 754 floating-point standard in a bizarre way. */ /* If you're using an IEEE 754-compliant compiler, then x != x is true */ /* iff x is NaN. For Microsoft, (x < x) is true iff x is NaN. */ /* So either way, this macro safely detects a NaN. */ #define CHOLMOD_IS_NAN(x) (((x) != (x)) || (((x) < (x)))) #define CHOLMOD_IS_ZERO(x) (((x) == 0.) && !CHOLMOD_IS_NAN(x)) #define CHOLMOD_IS_NONZERO(x) (((x) != 0.) || CHOLMOD_IS_NAN(x)) #define CHOLMOD_IS_LT_ZERO(x) (((x) < 0.) && !CHOLMOD_IS_NAN(x)) #define CHOLMOD_IS_GT_ZERO(x) (((x) > 0.) && !CHOLMOD_IS_NAN(x)) #define CHOLMOD_IS_LE_ZERO(x) (((x) <= 0.) && !CHOLMOD_IS_NAN(x)) #else /* These all work properly, according to the IEEE 754 standard ... except on */ /* a PC with windows. Works fine in Linux on the same PC... */ #define CHOLMOD_IS_NAN(x) ((x) != (x)) #define CHOLMOD_IS_ZERO(x) ((x) == 0.) #define CHOLMOD_IS_NONZERO(x) ((x) != 0.) #define CHOLMOD_IS_LT_ZERO(x) ((x) < 0.) #define CHOLMOD_IS_GT_ZERO(x) ((x) > 0.) #define CHOLMOD_IS_LE_ZERO(x) ((x) <= 0.) #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_io64.h0000664000175000017500000000320214224052371020671 00000000000000/* ========================================================================== */ /* === Include/cholmod_io64 ================================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_io64.h. * Copyright (C) 2005-2006, Univ. of Florida. Author: Timothy A. Davis * CHOLMOD/Include/cholmod_io64.h is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* Definitions required for large file I/O, which must come before any other * #includes. These are not used if -DNLARGEFILE is defined at compile time. * Large file support may not be portable across all platforms and compilers; * if you encounter an error here, compile your code with -DNLARGEFILE. In * particular, you must use -DNLARGEFILE for MATLAB 6.5 or earlier (which does * not have the io64.h include file). */ #ifndef CHOLMOD_IO_H #define CHOLMOD_IO_H /* skip all of this if NLARGEFILE is defined at the compiler command line */ #ifndef NLARGEFILE #if defined(MATLAB_MEX_FILE) || defined(MATHWORKS) /* CHOLMOD is being compiled as a MATLAB mexFunction, or for use in MATLAB */ #include "io64.h" #else /* CHOLMOD is being compiled in a stand-alone library */ #undef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #undef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 #endif #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_camd.h0000664000175000017500000000717714224052371021033 00000000000000/* ========================================================================== */ /* === Include/cholmod_camd.h =============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_camd.h. * Copyright (C) 2005-2013, Univ. of Florida. Author: Timothy A. Davis * CHOLMOD/Include/cholmod_partition.h is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* CHOLMOD Partition module, interface to CAMD, CCOLAMD, and CSYMAMD * * An interface to CCOLAMD and CSYMAMD, constrained minimum degree ordering * methods which order a matrix following constraints determined via nested * dissection. * * These functions do not require METIS. They are installed unless NCAMD * is defined: * cholmod_ccolamd interface to CCOLAMD ordering * cholmod_csymamd interface to CSYMAMD ordering * cholmod_camd interface to CAMD ordering * * Requires the Core and Cholesky modules, and two packages: CAMD, * and CCOLAMD. Used by functions in the Partition Module. */ #ifndef CHOLMOD_CAMD_H #define CHOLMOD_CAMD_H #include "cholmod_core.h" /* -------------------------------------------------------------------------- */ /* cholmod_ccolamd */ /* -------------------------------------------------------------------------- */ /* Order AA' or A(:,f)*A(:,f)' using CCOLAMD. */ int cholmod_ccolamd ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int *Cmember, /* size A->nrow. Cmember [i] = c if row i is in the * constraint set c. c must be >= 0. The # of * constraint sets is max (Cmember) + 1. If Cmember is * NULL, then it is interpretted as Cmember [i] = 0 for * all i */ /* ---- output --- */ int *Perm, /* size A->nrow, output permutation */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_ccolamd (cholmod_sparse *, SuiteSparse_long *, size_t, SuiteSparse_long *, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_csymamd */ /* -------------------------------------------------------------------------- */ /* Order A using CSYMAMD. */ int cholmod_csymamd ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order */ /* ---- output --- */ int *Cmember, /* size nrow. see cholmod_ccolamd above */ int *Perm, /* size A->nrow, output permutation */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_csymamd (cholmod_sparse *, SuiteSparse_long *, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_camd */ /* -------------------------------------------------------------------------- */ /* Order A using CAMD. */ int cholmod_camd ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* ---- output --- */ int *Cmember, /* size nrow. see cholmod_ccolamd above */ int *Perm, /* size A->nrow, output permutation */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_camd (cholmod_sparse *, SuiteSparse_long *, size_t, SuiteSparse_long *, SuiteSparse_long *, cholmod_common *) ; #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_function.h0000664000175000017500000001475714224052371021756 00000000000000/* ========================================================================== */ /* === CHOLMOD/Include/cholmod_function.h ================================ */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_function.h * Copyright (C) 2014, Timothy A. Davis * This specific file (CHOLMOD/Include/cholmod_function.h) has no license * restrictions at all. You may freely include this in your applications, and * modify it at will. * -------------------------------------------------------------------------- */ /* Memory management, printing, and math function pointers were removed from the CHOLMOD Common struct as of version 2.2.0 and later. They now appear in SuiteSparse_config.h instead. This file assists in backward compatibility, so that you can use either old or new versions of CHOLMOD and SuiteSparse in an application that uses the function pointers. You can copy the file into your own application that uses older versions of CHOLMOD, or the current version, so that you have a transparent method for setting these function pointers for any version of CHOLMOD and SuiteSparse. In both old and new versions of CHOLMOD (and SuiteSparse), the intent of these function pointers is that they are not to be called directly. Instead, you should use (for example), the cholmod_malloc function. That function is a wrapper that then uses the cc->malloc_memory or SuiteSparse_config.malloc_func function pointers. In each of the macros below, 'cc' is a pointer to the CHOLMOD Common struct. Usage: to assign, say, 'malloc' as your memory allocator, use this: #include "cholmod_function.h" ... cholmod_common *cc, Common ; cc = &Common ; cholmod_start (cc) ; ... CHOLMOD_FUNCTION_DEFAULTS ; CHOLMOD_FUNCTION_MALLOC (cc) = mymalloc ; instead of this, in older versions of CHOLMOD: cc->malloc_memory = mymalloc ; or in newer versions of CHOLMOD: SuiteSparse_config.malloc_func = mymalloc ; */ #ifndef CHOLMOD_FUNCTION_H #define CHOLMOD_FUNCTION_H #include "cholmod.h" /* -------------------------------------------------------------------------- */ /* location of function pointers, depending on the CHOLMOD version */ /* -------------------------------------------------------------------------- */ #if (CHOLMOD_VERSION < (CHOLMOD_VER_CODE(2,2))) #define CHOLMOD_FUNCTION_MALLOC(cc) cc->malloc_memory #define CHOLMOD_FUNCTION_REALLOC(cc) cc->realloc_memory #define CHOLMOD_FUNCTION_FREE(cc) cc->free_memory #define CHOLMOD_FUNCTION_CALLOC(cc) cc->calloc_memory #define CHOLMOD_FUNCTION_PRINTF(cc) cc->print_function #define CHOLMOD_FUNCTION_DIVCOMPLEX(cc) cc->complex_divide #define CHOLMOD_FUNCTION_HYPOTENUSE(cc) cc->hypotenuse #else #include "SuiteSparse_config.h" #define CHOLMOD_FUNCTION_MALLOC(cc) SuiteSparse_config.malloc_func #define CHOLMOD_FUNCTION_REALLOC(cc) SuiteSparse_config.realloc_func #define CHOLMOD_FUNCTION_FREE(cc) SuiteSparse_config.free_func #define CHOLMOD_FUNCTION_CALLOC(cc) SuiteSparse_config.calloc_func #define CHOLMOD_FUNCTION_PRINTF(cc) SuiteSparse_config.printf_func #define CHOLMOD_FUNCTION_DIVCOMPLEX(cc) SuiteSparse_config.divcomplex_func #define CHOLMOD_FUNCTION_HYPOTENUSE(cc) SuiteSparse_config.hypot_func #endif /* -------------------------------------------------------------------------- */ /* default math functions, depending on the CHOLMOD version */ /* -------------------------------------------------------------------------- */ #if (CHOLMOD_VERSION < (CHOLMOD_VER_CODE(2,2))) #define CHOLMOD_FUNCTION_DEFAULT_DIVCOMPLEX cholmod_l_divcomplex #define CHOLMOD_FUNCTION_DEFAULT_HYPOTENUSE cholmod_l_hypot #else #define CHOLMOD_FUNCTION_DEFAULT_DIVCOMPLEX SuiteSparse_divcomplex #define CHOLMOD_FUNCTION_DEFAULT_HYPOTENUSE SuiteSparse_hypot #endif /* -------------------------------------------------------------------------- */ /* default memory manager functions */ /* -------------------------------------------------------------------------- */ #ifndef NMALLOC #ifdef MATLAB_MEX_FILE /* MATLAB mexFunction */ #define CHOLMOD_FUNCTION_DEFAULT_MALLOC mxMalloc #define CHOLMOD_FUNCTION_DEFAULT_CALLOC mxCalloc #define CHOLMOD_FUNCTION_DEFAULT_REALLOC mxRealloc #define CHOLMOD_FUNCTION_DEFAULT_FREE mxFree #else /* standard ANSI C */ #define CHOLMOD_FUNCTION_DEFAULT_MALLOC malloc #define CHOLMOD_FUNCTION_DEFAULT_CALLOC calloc #define CHOLMOD_FUNCTION_DEFAULT_REALLOC realloc #define CHOLMOD_FUNCTION_DEFAULT_FREE free #endif #else /* no memory manager defined at compile time */ #define CHOLMOD_FUNCTION_DEFAULT_MALLOC NULL #define CHOLMOD_FUNCTION_DEFAULT_CALLOC NULL #define CHOLMOD_FUNCTION_DEFAULT_REALLOC NULL #define CHOLMOD_FUNCTION_DEFAULT_FREE NULL #endif /* -------------------------------------------------------------------------- */ /* default printf function */ /* -------------------------------------------------------------------------- */ #ifdef MATLAB_MEX_FILE #define CHOLMOD_FUNCTION_DEFAULT_PRINTF mexPrintf #else #define CHOLMOD_FUNCTION_DEFAULT_PRINTF printf #endif /* -------------------------------------------------------------------------- */ /* set all the defaults */ /* -------------------------------------------------------------------------- */ /* Use this macro to initialize all the function pointers to their defaults for any version of CHOLMOD. For CHOLMD 2.2.0 and later, it sets function pointers in the SuiteSparse_config struct. For older versions, it sets function pointers in the CHOLMOD Common. This assignment is not thread-safe, and should be done before launching any threads. */ #define CHOLMOD_FUNCTION_DEFAULTS \ { \ CHOLMOD_FUNCTION_MALLOC (cc) = CHOLMOD_FUNCTION_DEFAULT_MALLOC ; \ CHOLMOD_FUNCTION_REALLOC (cc) = CHOLMOD_FUNCTION_DEFAULT_REALLOC ; \ CHOLMOD_FUNCTION_FREE (cc) = CHOLMOD_FUNCTION_DEFAULT_FREE ; \ CHOLMOD_FUNCTION_CALLOC (cc) = CHOLMOD_FUNCTION_DEFAULT_CALLOC ; \ CHOLMOD_FUNCTION_PRINTF (cc) = CHOLMOD_FUNCTION_DEFAULT_PRINTF ; \ CHOLMOD_FUNCTION_DIVCOMPLEX (cc) = CHOLMOD_FUNCTION_DEFAULT_DIVCOMPLEX ; \ CHOLMOD_FUNCTION_HYPOTENUSE (cc) = CHOLMOD_FUNCTION_DEFAULT_HYPOTENUSE ; \ } #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_matrixops.h0000664000175000017500000002076314224052371022151 00000000000000/* ========================================================================== */ /* === Include/cholmod_matrixops.h ========================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_matrixops.h. * Copyright (C) 2005-2006, Timothy A. Davis * CHOLMOD/Include/cholmod_matrixops.h is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* CHOLMOD MatrixOps module. * * Basic operations on sparse and dense matrices. * * cholmod_drop A = entries in A with abs. value >= tol * cholmod_norm_dense s = norm (X), 1-norm, inf-norm, or 2-norm * cholmod_norm_sparse s = norm (A), 1-norm or inf-norm * cholmod_horzcat C = [A,B] * cholmod_scale A = diag(s)*A, A*diag(s), s*A or diag(s)*A*diag(s) * cholmod_sdmult Y = alpha*(A*X) + beta*Y or alpha*(A'*X) + beta*Y * cholmod_ssmult C = A*B * cholmod_submatrix C = A (i,j), where i and j are arbitrary vectors * cholmod_vertcat C = [A ; B] * * A, B, C: sparse matrices (cholmod_sparse) * X, Y: dense matrices (cholmod_dense) * s: scalar or vector * * Requires the Core module. Not required by any other CHOLMOD module. */ #ifndef CHOLMOD_MATRIXOPS_H #define CHOLMOD_MATRIXOPS_H #include "cholmod_core.h" /* -------------------------------------------------------------------------- */ /* cholmod_drop: drop entries with small absolute value */ /* -------------------------------------------------------------------------- */ int cholmod_drop ( /* ---- input ---- */ double tol, /* keep entries with absolute value > tol */ /* ---- in/out --- */ cholmod_sparse *A, /* matrix to drop entries from */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_drop (double, cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_norm_dense: s = norm (X), 1-norm, inf-norm, or 2-norm */ /* -------------------------------------------------------------------------- */ double cholmod_norm_dense ( /* ---- input ---- */ cholmod_dense *X, /* matrix to compute the norm of */ int norm, /* type of norm: 0: inf. norm, 1: 1-norm, 2: 2-norm */ /* --------------- */ cholmod_common *Common ) ; double cholmod_l_norm_dense (cholmod_dense *, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_norm_sparse: s = norm (A), 1-norm or inf-norm */ /* -------------------------------------------------------------------------- */ double cholmod_norm_sparse ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to compute the norm of */ int norm, /* type of norm: 0: inf. norm, 1: 1-norm */ /* --------------- */ cholmod_common *Common ) ; double cholmod_l_norm_sparse (cholmod_sparse *, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_horzcat: C = [A,B] */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_horzcat ( /* ---- input ---- */ cholmod_sparse *A, /* left matrix to concatenate */ cholmod_sparse *B, /* right matrix to concatenate */ int values, /* if TRUE compute the numerical values of C */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_horzcat (cholmod_sparse *, cholmod_sparse *, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_scale: A = diag(s)*A, A*diag(s), s*A or diag(s)*A*diag(s) */ /* -------------------------------------------------------------------------- */ /* scaling modes, selected by the scale input parameter: */ #define CHOLMOD_SCALAR 0 /* A = s*A */ #define CHOLMOD_ROW 1 /* A = diag(s)*A */ #define CHOLMOD_COL 2 /* A = A*diag(s) */ #define CHOLMOD_SYM 3 /* A = diag(s)*A*diag(s) */ int cholmod_scale ( /* ---- input ---- */ cholmod_dense *S, /* scale factors (scalar or vector) */ int scale, /* type of scaling to compute */ /* ---- in/out --- */ cholmod_sparse *A, /* matrix to scale */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_scale (cholmod_dense *, int, cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_sdmult: Y = alpha*(A*X) + beta*Y or alpha*(A'*X) + beta*Y */ /* -------------------------------------------------------------------------- */ /* Sparse matrix times dense matrix */ int cholmod_sdmult ( /* ---- input ---- */ cholmod_sparse *A, /* sparse matrix to multiply */ int transpose, /* use A if 0, or A' otherwise */ double alpha [2], /* scale factor for A */ double beta [2], /* scale factor for Y */ cholmod_dense *X, /* dense matrix to multiply */ /* ---- in/out --- */ cholmod_dense *Y, /* resulting dense matrix */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_sdmult (cholmod_sparse *, int, double *, double *, cholmod_dense *, cholmod_dense *Y, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_ssmult: C = A*B */ /* -------------------------------------------------------------------------- */ /* Sparse matrix times sparse matrix */ cholmod_sparse *cholmod_ssmult ( /* ---- input ---- */ cholmod_sparse *A, /* left matrix to multiply */ cholmod_sparse *B, /* right matrix to multiply */ int stype, /* requested stype of C */ int values, /* TRUE: do numerical values, FALSE: pattern only */ int sorted, /* if TRUE then return C with sorted columns */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_ssmult (cholmod_sparse *, cholmod_sparse *, int, int, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_submatrix: C = A (r,c), where i and j are arbitrary vectors */ /* -------------------------------------------------------------------------- */ /* rsize < 0 denotes ":" in MATLAB notation, or more precisely 0:(A->nrow)-1. * In this case, r can be NULL. An rsize of zero, or r = NULL and rsize >= 0, * denotes "[ ]" in MATLAB notation (the empty set). * Similar rules hold for csize. */ cholmod_sparse *cholmod_submatrix ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to subreference */ int *rset, /* set of row indices, duplicates OK */ SuiteSparse_long rsize, /* size of r; rsize < 0 denotes ":" */ int *cset, /* set of column indices, duplicates OK */ SuiteSparse_long csize, /* size of c; csize < 0 denotes ":" */ int values, /* if TRUE compute the numerical values of C */ int sorted, /* if TRUE then return C with sorted columns */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_submatrix (cholmod_sparse *, SuiteSparse_long *, SuiteSparse_long, SuiteSparse_long *, SuiteSparse_long, int, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_vertcat: C = [A ; B] */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_vertcat ( /* ---- input ---- */ cholmod_sparse *A, /* left matrix to concatenate */ cholmod_sparse *B, /* right matrix to concatenate */ int values, /* if TRUE compute the numerical values of C */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_vertcat (cholmod_sparse *, cholmod_sparse *, int, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_symmetry: determine if a sparse matrix is symmetric */ /* -------------------------------------------------------------------------- */ int cholmod_symmetry ( /* ---- input ---- */ cholmod_sparse *A, int option, /* ---- output ---- */ int *xmatched, int *pmatched, int *nzoffdiag, int *nzdiag, /* --------------- */ cholmod_common *Common ) ; int cholmod_l_symmetry (cholmod_sparse *, int, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, cholmod_common *) ; #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_check.h0000664000175000017500000003535414224052371021202 00000000000000/* ========================================================================== */ /* === Include/cholmod_check.h ============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_check.h. Copyright (C) 2005-2006, Timothy A. Davis * CHOLMOD/Include/cholmod_check.h is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* CHOLMOD Check module. * * Routines that check and print the 5 basic data types in CHOLMOD, and 3 kinds * of integer vectors (subset, perm, and parent), and read in matrices from a * file: * * cholmod_check_common check/print the Common object * cholmod_print_common * * cholmod_check_sparse check/print a sparse matrix in column-oriented form * cholmod_print_sparse * * cholmod_check_dense check/print a dense matrix * cholmod_print_dense * * cholmod_check_factor check/print a Cholesky factorization * cholmod_print_factor * * cholmod_check_triplet check/print a sparse matrix in triplet form * cholmod_print_triplet * * cholmod_check_subset check/print a subset (integer vector in given range) * cholmod_print_subset * * cholmod_check_perm check/print a permutation (an integer vector) * cholmod_print_perm * * cholmod_check_parent check/print an elimination tree (an integer vector) * cholmod_print_parent * * cholmod_read_triplet read a matrix in triplet form (any Matrix Market * "coordinate" format, or a generic triplet format). * * cholmod_read_sparse read a matrix in sparse form (same file format as * cholmod_read_triplet). * * cholmod_read_dense read a dense matrix (any Matrix Market "array" * format, or a generic dense format). * * cholmod_write_sparse write a sparse matrix to a Matrix Market file. * * cholmod_write_dense write a dense matrix to a Matrix Market file. * * cholmod_print_common and cholmod_check_common are the only two routines that * you may call after calling cholmod_finish. * * Requires the Core module. Not required by any CHOLMOD module, except when * debugging is enabled (in which case all modules require the Check module). * * See cholmod_read.c for a description of the file formats supported by the * cholmod_read_* routines. */ #ifndef CHOLMOD_CHECK_H #define CHOLMOD_CHECK_H #include "cholmod_core.h" #include /* -------------------------------------------------------------------------- */ /* cholmod_check_common: check the Common object */ /* -------------------------------------------------------------------------- */ int cholmod_check_common ( cholmod_common *Common ) ; int cholmod_l_check_common (cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_print_common: print the Common object */ /* -------------------------------------------------------------------------- */ int cholmod_print_common ( /* ---- input ---- */ const char *name, /* printed name of Common object */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_print_common (const char *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_gpu_stats: print the GPU / CPU statistics */ /* -------------------------------------------------------------------------- */ int cholmod_gpu_stats (cholmod_common *) ; int cholmod_l_gpu_stats (cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_check_sparse: check a sparse matrix */ /* -------------------------------------------------------------------------- */ int cholmod_check_sparse ( /* ---- input ---- */ cholmod_sparse *A, /* sparse matrix to check */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_check_sparse (cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_print_sparse */ /* -------------------------------------------------------------------------- */ int cholmod_print_sparse ( /* ---- input ---- */ cholmod_sparse *A, /* sparse matrix to print */ const char *name, /* printed name of sparse matrix */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_print_sparse (cholmod_sparse *, const char *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_check_dense: check a dense matrix */ /* -------------------------------------------------------------------------- */ int cholmod_check_dense ( /* ---- input ---- */ cholmod_dense *X, /* dense matrix to check */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_check_dense (cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_print_dense: print a dense matrix */ /* -------------------------------------------------------------------------- */ int cholmod_print_dense ( /* ---- input ---- */ cholmod_dense *X, /* dense matrix to print */ const char *name, /* printed name of dense matrix */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_print_dense (cholmod_dense *, const char *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_check_factor: check a factor */ /* -------------------------------------------------------------------------- */ int cholmod_check_factor ( /* ---- input ---- */ cholmod_factor *L, /* factor to check */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_check_factor (cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_print_factor: print a factor */ /* -------------------------------------------------------------------------- */ int cholmod_print_factor ( /* ---- input ---- */ cholmod_factor *L, /* factor to print */ const char *name, /* printed name of factor */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_print_factor (cholmod_factor *, const char *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_check_triplet: check a sparse matrix in triplet form */ /* -------------------------------------------------------------------------- */ int cholmod_check_triplet ( /* ---- input ---- */ cholmod_triplet *T, /* triplet matrix to check */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_check_triplet (cholmod_triplet *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_print_triplet: print a triplet matrix */ /* -------------------------------------------------------------------------- */ int cholmod_print_triplet ( /* ---- input ---- */ cholmod_triplet *T, /* triplet matrix to print */ const char *name, /* printed name of triplet matrix */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_print_triplet (cholmod_triplet *, const char *, cholmod_common *); /* -------------------------------------------------------------------------- */ /* cholmod_check_subset: check a subset */ /* -------------------------------------------------------------------------- */ int cholmod_check_subset ( /* ---- input ---- */ int *Set, /* Set [0:len-1] is a subset of 0:n-1. Duplicates OK */ SuiteSparse_long len, /* size of Set (an integer array) */ size_t n, /* 0:n-1 is valid range */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_check_subset (SuiteSparse_long *, SuiteSparse_long, size_t, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_print_subset: print a subset */ /* -------------------------------------------------------------------------- */ int cholmod_print_subset ( /* ---- input ---- */ int *Set, /* Set [0:len-1] is a subset of 0:n-1. Duplicates OK */ SuiteSparse_long len, /* size of Set (an integer array) */ size_t n, /* 0:n-1 is valid range */ const char *name, /* printed name of Set */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_print_subset (SuiteSparse_long *, SuiteSparse_long, size_t, const char *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_check_perm: check a permutation */ /* -------------------------------------------------------------------------- */ int cholmod_check_perm ( /* ---- input ---- */ int *Perm, /* Perm [0:len-1] is a permutation of subset of 0:n-1 */ size_t len, /* size of Perm (an integer array) */ size_t n, /* 0:n-1 is valid range */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_check_perm (SuiteSparse_long *, size_t, size_t, cholmod_common *); /* -------------------------------------------------------------------------- */ /* cholmod_print_perm: print a permutation vector */ /* -------------------------------------------------------------------------- */ int cholmod_print_perm ( /* ---- input ---- */ int *Perm, /* Perm [0:len-1] is a permutation of subset of 0:n-1 */ size_t len, /* size of Perm (an integer array) */ size_t n, /* 0:n-1 is valid range */ const char *name, /* printed name of Perm */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_print_perm (SuiteSparse_long *, size_t, size_t, const char *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_check_parent: check an elimination tree */ /* -------------------------------------------------------------------------- */ int cholmod_check_parent ( /* ---- input ---- */ int *Parent, /* Parent [0:n-1] is an elimination tree */ size_t n, /* size of Parent */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_check_parent (SuiteSparse_long *, size_t, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_print_parent */ /* -------------------------------------------------------------------------- */ int cholmod_print_parent ( /* ---- input ---- */ int *Parent, /* Parent [0:n-1] is an elimination tree */ size_t n, /* size of Parent */ const char *name, /* printed name of Parent */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_print_parent (SuiteSparse_long *, size_t, const char *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_read_sparse: read a sparse matrix from a file */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_read_sparse ( /* ---- input ---- */ FILE *f, /* file to read from, must already be open */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_read_sparse (FILE *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_read_triplet: read a triplet matrix from a file */ /* -------------------------------------------------------------------------- */ cholmod_triplet *cholmod_read_triplet ( /* ---- input ---- */ FILE *f, /* file to read from, must already be open */ /* --------------- */ cholmod_common *Common ) ; cholmod_triplet *cholmod_l_read_triplet (FILE *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_read_dense: read a dense matrix from a file */ /* -------------------------------------------------------------------------- */ cholmod_dense *cholmod_read_dense ( /* ---- input ---- */ FILE *f, /* file to read from, must already be open */ /* --------------- */ cholmod_common *Common ) ; cholmod_dense *cholmod_l_read_dense (FILE *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_read_matrix: read a sparse or dense matrix from a file */ /* -------------------------------------------------------------------------- */ void *cholmod_read_matrix ( /* ---- input ---- */ FILE *f, /* file to read from, must already be open */ int prefer, /* If 0, a sparse matrix is always return as a * cholmod_triplet form. It can have any stype * (symmetric-lower, unsymmetric, or * symmetric-upper). * If 1, a sparse matrix is returned as an unsymmetric * cholmod_sparse form (A->stype == 0), with both * upper and lower triangular parts present. * This is what the MATLAB mread mexFunction does, * since MATLAB does not have an stype. * If 2, a sparse matrix is returned with an stype of 0 * or 1 (unsymmetric, or symmetric with upper part * stored). * This argument has no effect for dense matrices. */ /* ---- output---- */ int *mtype, /* CHOLMOD_TRIPLET, CHOLMOD_SPARSE or CHOLMOD_DENSE */ /* --------------- */ cholmod_common *Common ) ; void *cholmod_l_read_matrix (FILE *, int, int *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_write_sparse: write a sparse matrix to a file */ /* -------------------------------------------------------------------------- */ int cholmod_write_sparse ( /* ---- input ---- */ FILE *f, /* file to write to, must already be open */ cholmod_sparse *A, /* matrix to print */ cholmod_sparse *Z, /* optional matrix with pattern of explicit zeros */ const char *comments, /* optional filename of comments to include */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_write_sparse (FILE *, cholmod_sparse *, cholmod_sparse *, const char *c, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_write_dense: write a dense matrix to a file */ /* -------------------------------------------------------------------------- */ int cholmod_write_dense ( /* ---- input ---- */ FILE *f, /* file to write to, must already be open */ cholmod_dense *X, /* matrix to print */ const char *comments, /* optional filename of comments to include */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_write_dense (FILE *, cholmod_dense *, const char *, cholmod_common *) ; #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_gpu.h0000664000175000017500000000503714224052371020713 00000000000000/* ========================================================================== */ /* === Include/cholmod_gpu.h ================================================ */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_gpu.h. * Copyright (C) 2014, Timothy A. Davis * CHOLMOD/Include/cholmod_gpu.h and the CHOLMOD GPU Module are licensed under * Version 2.0 of the GNU General Public License. See gpl.txt for a text of * the license. CHOLMOD is also available under other licenses; contact * authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* CHOLMOD GPU module */ #ifndef CHOLMOD_GPU_H #define CHOLMOD_GPU_H #ifdef GPU_BLAS #include "omp.h" #include #endif /* CHOLMOD_GPU_PRINTF: for printing GPU debug error messages */ /* #define CHOLMOD_GPU_PRINTF(args) printf args */ #define CHOLMOD_GPU_PRINTF(args) /* define supernode requirements for processing on GPU */ #define CHOLMOD_ND_ROW_LIMIT 256 /* required descendant rows */ #define CHOLMOD_ND_COL_LIMIT 32 /* required descendnat cols */ #define CHOLMOD_POTRF_LIMIT 512 /* required cols for POTRF & TRSM on GPU */ /* # of host supernodes to perform before checking for free pinned buffers */ #define CHOLMOD_GPU_SKIP 3 #define CHOLMOD_HANDLE_CUDA_ERROR(e,s) {if (e) {ERROR(CHOLMOD_GPU_PROBLEM,s);}} typedef struct cholmod_gpu_pointers { double *h_Lx [CHOLMOD_HOST_SUPERNODE_BUFFERS] ; double *d_Lx [CHOLMOD_DEVICE_STREAMS] ; double *d_C ; double *d_A [CHOLMOD_DEVICE_STREAMS] ; void *d_Ls ; void *d_Map ; void *d_RelativeMap ; } cholmod_gpu_pointers ; int cholmod_gpu_memorysize /* GPU memory size available, 1 if no GPU */ ( size_t *total_mem, size_t *available_mem, cholmod_common *Common ) ; int cholmod_l_gpu_memorysize /* GPU memory size available, 1 if no GPU */ ( size_t *total_mem, size_t *available_mem, cholmod_common *Common ) ; int cholmod_gpu_probe ( cholmod_common *Common ) ; int cholmod_l_gpu_probe ( cholmod_common *Common ) ; int cholmod_gpu_deallocate ( cholmod_common *Common ) ; int cholmod_l_gpu_deallocate ( cholmod_common *Common ) ; void cholmod_gpu_end ( cholmod_common *Common ) ; void cholmod_l_gpu_end ( cholmod_common *Common ) ; int cholmod_gpu_allocate ( cholmod_common *Common ) ; int cholmod_l_gpu_allocate ( cholmod_common *Common ) ; #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_modify.h0000664000175000017500000003273314224052371021412 00000000000000/* ========================================================================== */ /* === Include/cholmod_modify.h ============================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_modify.h. * Copyright (C) 2005-2006, Timothy A. Davis and William W. Hager * CHOLMOD/Include/cholmod_modify.h is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* CHOLMOD Modify module. * * Sparse Cholesky modification routines: update / downdate / rowadd / rowdel. * Can also modify a corresponding solution to Lx=b when L is modified. This * module is most useful when applied on a Cholesky factorization computed by * the Cholesky module, but it does not actually require the Cholesky module. * The Core module can create an identity Cholesky factorization (LDL' where * L=D=I) that can then by modified by these routines. * * Primary routines: * ----------------- * * cholmod_updown multiple rank update/downdate * cholmod_rowadd add a row to an LDL' factorization * cholmod_rowdel delete a row from an LDL' factorization * * Secondary routines: * ------------------- * * cholmod_updown_solve update/downdate, and modify solution to Lx=b * cholmod_updown_mark update/downdate, and modify solution to partial Lx=b * cholmod_updown_mask update/downdate for LPDASA * cholmod_updown_mask2 update/downdate for LPDASA * cholmod_rowadd_solve add a row, and update solution to Lx=b * cholmod_rowadd_mark add a row, and update solution to partial Lx=b * cholmod_rowdel_solve delete a row, and downdate Lx=b * cholmod_rowdel_mark delete a row, and downdate solution to partial Lx=b * * Requires the Core module. Not required by any other CHOLMOD module. */ #ifndef CHOLMOD_MODIFY_H #define CHOLMOD_MODIFY_H #include "cholmod_core.h" /* -------------------------------------------------------------------------- */ /* cholmod_updown: multiple rank update/downdate */ /* -------------------------------------------------------------------------- */ /* Compute the new LDL' factorization of LDL'+CC' (an update) or LDL'-CC' * (a downdate). The factor object L need not be an LDL' factorization; it * is converted to one if it isn't. */ int cholmod_updown ( /* ---- input ---- */ int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* the incoming sparse update */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_updown (int, cholmod_sparse *, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_updown_solve: update/downdate, and modify solution to Lx=b */ /* -------------------------------------------------------------------------- */ /* Does the same as cholmod_updown, except that it also updates/downdates the * solution to Lx=b+DeltaB. x and b must be n-by-1 dense matrices. b is not * need as input to this routine, but a sparse change to b is (DeltaB). Only * entries in DeltaB corresponding to columns modified in L are accessed; the * rest must be zero. */ int cholmod_updown_solve ( /* ---- input ---- */ int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* the incoming sparse update */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_updown_solve (int, cholmod_sparse *, cholmod_factor *, cholmod_dense *, cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_updown_mark: update/downdate, and modify solution to partial Lx=b */ /* -------------------------------------------------------------------------- */ /* Does the same as cholmod_updown_solve, except only part of L is used in * the update/downdate of the solution to Lx=b. This routine is an "expert" * routine. It is meant for use in LPDASA only. See cholmod_updown.c for * a description of colmark. */ int cholmod_updown_mark ( /* ---- input ---- */ int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* the incoming sparse update */ int *colmark, /* int array of size n. See cholmod_updown.c */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_updown_mark (int, cholmod_sparse *, SuiteSparse_long *, cholmod_factor *, cholmod_dense *, cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_updown_mask: update/downdate, for LPDASA */ /* -------------------------------------------------------------------------- */ /* Does the same as cholmod_updown_mark, except has an additional "mask" * argument. This routine is an "expert" routine. It is meant for use in * LPDASA only. See cholmod_updown.c for a description of mask. */ int cholmod_updown_mask ( /* ---- input ---- */ int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* the incoming sparse update */ int *colmark, /* int array of size n. See cholmod_updown.c */ int *mask, /* size n */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_updown_mask (int, cholmod_sparse *, SuiteSparse_long *, SuiteSparse_long *, cholmod_factor *, cholmod_dense *, cholmod_dense *, cholmod_common *) ; int cholmod_updown_mask2 ( /* ---- input ---- */ int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* the incoming sparse update */ int *colmark, /* int array of size n. See cholmod_updown.c */ int *mask, /* size n */ int maskmark, /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_updown_mask2 (int, cholmod_sparse *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long, cholmod_factor *, cholmod_dense *, cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_rowadd: add a row to an LDL' factorization (a rank-2 update) */ /* -------------------------------------------------------------------------- */ /* cholmod_rowadd adds a row to the LDL' factorization. It computes the kth * row and kth column of L, and then updates the submatrix L (k+1:n,k+1:n) * accordingly. The kth row and column of L must originally be equal to the * kth row and column of the identity matrix. The kth row/column of L is * computed as the factorization of the kth row/column of the matrix to * factorize, which is provided as a single n-by-1 sparse matrix R. */ int cholmod_rowadd ( /* ---- input ---- */ size_t k, /* row/column index to add */ cholmod_sparse *R, /* row/column of matrix to factorize (n-by-1) */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_rowadd (size_t, cholmod_sparse *, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_rowadd_solve: add a row, and update solution to Lx=b */ /* -------------------------------------------------------------------------- */ /* Does the same as cholmod_rowadd, and also updates the solution to Lx=b * See cholmod_updown for a description of how Lx=b is updated. There is on * additional parameter: bk specifies the new kth entry of b. */ int cholmod_rowadd_solve ( /* ---- input ---- */ size_t k, /* row/column index to add */ cholmod_sparse *R, /* row/column of matrix to factorize (n-by-1) */ double bk [2], /* kth entry of the right-hand-side b */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_rowadd_solve (size_t, cholmod_sparse *, double *, cholmod_factor *, cholmod_dense *, cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_rowadd_mark: add a row, and update solution to partial Lx=b */ /* -------------------------------------------------------------------------- */ /* Does the same as cholmod_rowadd_solve, except only part of L is used in * the update/downdate of the solution to Lx=b. This routine is an "expert" * routine. It is meant for use in LPDASA only. */ int cholmod_rowadd_mark ( /* ---- input ---- */ size_t k, /* row/column index to add */ cholmod_sparse *R, /* row/column of matrix to factorize (n-by-1) */ double bk [2], /* kth entry of the right hand side, b */ int *colmark, /* int array of size n. See cholmod_updown.c */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_rowadd_mark (size_t, cholmod_sparse *, double *, SuiteSparse_long *, cholmod_factor *, cholmod_dense *, cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_rowdel: delete a row from an LDL' factorization (a rank-2 update) */ /* -------------------------------------------------------------------------- */ /* Sets the kth row and column of L to be the kth row and column of the identity * matrix, and updates L(k+1:n,k+1:n) accordingly. To reduce the running time, * the caller can optionally provide the nonzero pattern (or an upper bound) of * kth row of L, as the sparse n-by-1 vector R. Provide R as NULL if you want * CHOLMOD to determine this itself, which is easier for the caller, but takes * a little more time. */ int cholmod_rowdel ( /* ---- input ---- */ size_t k, /* row/column index to delete */ cholmod_sparse *R, /* NULL, or the nonzero pattern of kth row of L */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_rowdel (size_t, cholmod_sparse *, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_rowdel_solve: delete a row, and downdate Lx=b */ /* -------------------------------------------------------------------------- */ /* Does the same as cholmod_rowdel, but also downdates the solution to Lx=b. * When row/column k of A is "deleted" from the system A*y=b, this can induce * a change to x, in addition to changes arising when L and b are modified. * If this is the case, the kth entry of y is required as input (yk) */ int cholmod_rowdel_solve ( /* ---- input ---- */ size_t k, /* row/column index to delete */ cholmod_sparse *R, /* NULL, or the nonzero pattern of kth row of L */ double yk [2], /* kth entry in the solution to A*y=b */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_rowdel_solve (size_t, cholmod_sparse *, double *, cholmod_factor *, cholmod_dense *, cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_rowdel_mark: delete a row, and downdate solution to partial Lx=b */ /* -------------------------------------------------------------------------- */ /* Does the same as cholmod_rowdel_solve, except only part of L is used in * the update/downdate of the solution to Lx=b. This routine is an "expert" * routine. It is meant for use in LPDASA only. */ int cholmod_rowdel_mark ( /* ---- input ---- */ size_t k, /* row/column index to delete */ cholmod_sparse *R, /* NULL, or the nonzero pattern of kth row of L */ double yk [2], /* kth entry in the solution to A*y=b */ int *colmark, /* int array of size n. See cholmod_updown.c */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_rowdel_mark (size_t, cholmod_sparse *, double *, SuiteSparse_long *, cholmod_factor *, cholmod_dense *, cholmod_dense *, cholmod_common *) ; #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_cholesky.h0000664000175000017500000005524514224052371021747 00000000000000/* ========================================================================== */ /* === Include/cholmod_cholesky.h =========================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_cholesky.h. Copyright (C) 2005-2013, Timothy A. Davis * CHOLMOD/Include/cholmod_cholesky.h is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* CHOLMOD Cholesky module. * * Sparse Cholesky routines: analysis, factorization, and solve. * * The primary routines are all that a user requires to order, analyze, and * factorize a sparse symmetric positive definite matrix A (or A*A'), and * to solve Ax=b (or A*A'x=b). The primary routines rely on the secondary * routines, the CHOLMOD Core module, and the AMD and COLAMD packages. They * make optional use of the CHOLMOD Supernodal and Partition modules, the * METIS package, and the CCOLAMD package. * * Primary routines: * ----------------- * * cholmod_analyze order and analyze (simplicial or supernodal) * cholmod_factorize simplicial or supernodal Cholesky factorization * cholmod_solve solve a linear system (simplicial or supernodal) * cholmod_solve2 like cholmod_solve, but reuse workspace * cholmod_spsolve solve a linear system (sparse x and b) * * Secondary routines: * ------------------ * * cholmod_analyze_p analyze, with user-provided permutation or f set * cholmod_factorize_p factorize, with user-provided permutation or f * cholmod_analyze_ordering analyze a fill-reducing ordering * cholmod_etree find the elimination tree * cholmod_rowcolcounts compute the row/column counts of L * cholmod_amd order using AMD * cholmod_colamd order using COLAMD * cholmod_rowfac incremental simplicial factorization * cholmod_rowfac_mask rowfac, specific to LPDASA * cholmod_rowfac_mask2 rowfac, specific to LPDASA * cholmod_row_subtree find the nonzero pattern of a row of L * cholmod_resymbol recompute the symbolic pattern of L * cholmod_resymbol_noperm recompute the symbolic pattern of L, no L->Perm * cholmod_postorder postorder a tree * * Requires the Core module, and two packages: AMD and COLAMD. * Optionally uses the Supernodal and Partition modules. * Required by the Partition module. */ #ifndef CHOLMOD_CHOLESKY_H #define CHOLMOD_CHOLESKY_H #include "cholmod_config.h" #include "cholmod_core.h" #ifndef NPARTITION #include "cholmod_partition.h" #endif #ifndef NSUPERNODAL #include "cholmod_supernodal.h" #endif /* -------------------------------------------------------------------------- */ /* cholmod_analyze: order and analyze (simplicial or supernodal) */ /* -------------------------------------------------------------------------- */ /* Orders and analyzes A, AA', PAP', or PAA'P' and returns a symbolic factor * that can later be passed to cholmod_factorize. */ cholmod_factor *cholmod_analyze ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order and analyze */ /* --------------- */ cholmod_common *Common ) ; cholmod_factor *cholmod_l_analyze (cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_analyze_p: analyze, with user-provided permutation or f set */ /* -------------------------------------------------------------------------- */ /* Orders and analyzes A, AA', PAP', PAA'P', FF', or PFF'P and returns a * symbolic factor that can later be passed to cholmod_factorize, where * F = A(:,fset) if fset is not NULL and A->stype is zero. * UserPerm is tried if non-NULL. */ cholmod_factor *cholmod_analyze_p ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order and analyze */ int *UserPerm, /* user-provided permutation, size A->nrow */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* --------------- */ cholmod_common *Common ) ; cholmod_factor *cholmod_l_analyze_p (cholmod_sparse *, SuiteSparse_long *, SuiteSparse_long *, size_t, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_analyze_p2: analyze for sparse Cholesky or sparse QR */ /* -------------------------------------------------------------------------- */ cholmod_factor *cholmod_analyze_p2 ( /* ---- input ---- */ int for_whom, /* FOR_SPQR (0): for SPQR but not GPU-accelerated FOR_CHOLESKY (1): for Cholesky (GPU or not) FOR_SPQRGPU (2): for SPQR with GPU acceleration */ cholmod_sparse *A, /* matrix to order and analyze */ int *UserPerm, /* user-provided permutation, size A->nrow */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* --------------- */ cholmod_common *Common ) ; cholmod_factor *cholmod_l_analyze_p2 (int, cholmod_sparse *, SuiteSparse_long *, SuiteSparse_long *, size_t, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_factorize: simplicial or supernodal Cholesky factorization */ /* -------------------------------------------------------------------------- */ /* Factorizes PAP' (or PAA'P' if A->stype is 0), using a factor obtained * from cholmod_analyze. The analysis can be re-used simply by calling this * routine a second time with another matrix. A must have the same nonzero * pattern as that passed to cholmod_analyze. */ int cholmod_factorize ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ /* ---- in/out --- */ cholmod_factor *L, /* resulting factorization */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_factorize (cholmod_sparse *, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_factorize_p: factorize, with user-provided permutation or fset */ /* -------------------------------------------------------------------------- */ /* Same as cholmod_factorize, but with more options. */ int cholmod_factorize_p ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ double beta [2], /* factorize beta*I+A or beta*I+A'*A */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* ---- in/out --- */ cholmod_factor *L, /* resulting factorization */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_factorize_p (cholmod_sparse *, double *, SuiteSparse_long *, size_t, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_solve: solve a linear system (simplicial or supernodal) */ /* -------------------------------------------------------------------------- */ /* Solves one of many linear systems with a dense right-hand-side, using the * factorization from cholmod_factorize (or as modified by any other CHOLMOD * routine). D is identity for LL' factorizations. */ #define CHOLMOD_A 0 /* solve Ax=b */ #define CHOLMOD_LDLt 1 /* solve LDL'x=b */ #define CHOLMOD_LD 2 /* solve LDx=b */ #define CHOLMOD_DLt 3 /* solve DL'x=b */ #define CHOLMOD_L 4 /* solve Lx=b */ #define CHOLMOD_Lt 5 /* solve L'x=b */ #define CHOLMOD_D 6 /* solve Dx=b */ #define CHOLMOD_P 7 /* permute x=Px */ #define CHOLMOD_Pt 8 /* permute x=P'x */ cholmod_dense *cholmod_solve /* returns the solution X */ ( /* ---- input ---- */ int sys, /* system to solve */ cholmod_factor *L, /* factorization to use */ cholmod_dense *B, /* right-hand-side */ /* --------------- */ cholmod_common *Common ) ; cholmod_dense *cholmod_l_solve (int, cholmod_factor *, cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_solve2: like cholmod_solve, but with reusable workspace */ /* -------------------------------------------------------------------------- */ int cholmod_solve2 /* returns TRUE on success, FALSE on failure */ ( /* ---- input ---- */ int sys, /* system to solve */ cholmod_factor *L, /* factorization to use */ cholmod_dense *B, /* right-hand-side */ cholmod_sparse *Bset, /* ---- output --- */ cholmod_dense **X_Handle, /* solution, allocated if need be */ cholmod_sparse **Xset_Handle, /* ---- workspace */ cholmod_dense **Y_Handle, /* workspace, or NULL */ cholmod_dense **E_Handle, /* workspace, or NULL */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_solve2 (int, cholmod_factor *, cholmod_dense *, cholmod_sparse *, cholmod_dense **, cholmod_sparse **, cholmod_dense **, cholmod_dense **, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_spsolve: solve a linear system with a sparse right-hand-side */ /* -------------------------------------------------------------------------- */ cholmod_sparse *cholmod_spsolve ( /* ---- input ---- */ int sys, /* system to solve */ cholmod_factor *L, /* factorization to use */ cholmod_sparse *B, /* right-hand-side */ /* --------------- */ cholmod_common *Common ) ; cholmod_sparse *cholmod_l_spsolve (int, cholmod_factor *, cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_etree: find the elimination tree of A or A'*A */ /* -------------------------------------------------------------------------- */ int cholmod_etree ( /* ---- input ---- */ cholmod_sparse *A, /* ---- output --- */ int *Parent, /* size ncol. Parent [j] = p if p is the parent of j */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_etree (cholmod_sparse *, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_rowcolcounts: compute the row/column counts of L */ /* -------------------------------------------------------------------------- */ int cholmod_rowcolcounts ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int *Parent, /* size nrow. Parent [i] = p if p is the parent of i */ int *Post, /* size nrow. Post [k] = i if i is the kth node in * the postordered etree. */ /* ---- output --- */ int *RowCount, /* size nrow. RowCount [i] = # entries in the ith row of * L, including the diagonal. */ int *ColCount, /* size nrow. ColCount [i] = # entries in the ith * column of L, including the diagonal. */ int *First, /* size nrow. First [i] = k is the least postordering * of any descendant of i. */ int *Level, /* size nrow. Level [i] is the length of the path from * i to the root, with Level [root] = 0. */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_rowcolcounts (cholmod_sparse *, SuiteSparse_long *, size_t, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_analyze_ordering: analyze a fill-reducing ordering */ /* -------------------------------------------------------------------------- */ int cholmod_analyze_ordering ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ int ordering, /* ordering method used */ int *Perm, /* size n, fill-reducing permutation to analyze */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* ---- output --- */ int *Parent, /* size n, elimination tree */ int *Post, /* size n, postordering of elimination tree */ int *ColCount, /* size n, nnz in each column of L */ /* ---- workspace */ int *First, /* size nworkspace for cholmod_postorder */ int *Level, /* size n workspace for cholmod_postorder */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_analyze_ordering (cholmod_sparse *, int, SuiteSparse_long *, SuiteSparse_long *, size_t, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_amd: order using AMD */ /* -------------------------------------------------------------------------- */ /* Finds a permutation P to reduce fill-in in the factorization of P*A*P' * or P*A*A'P' */ int cholmod_amd ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* ---- output --- */ int *Perm, /* size A->nrow, output permutation */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_amd (cholmod_sparse *, SuiteSparse_long *, size_t, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_colamd: order using COLAMD */ /* -------------------------------------------------------------------------- */ /* Finds a permutation P to reduce fill-in in the factorization of P*A*A'*P'. * Orders F*F' where F = A (:,fset) if fset is not NULL */ int cholmod_colamd ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int postorder, /* if TRUE, follow with a coletree postorder */ /* ---- output --- */ int *Perm, /* size A->nrow, output permutation */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_colamd (cholmod_sparse *, SuiteSparse_long *, size_t, int, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_rowfac: incremental simplicial factorization */ /* -------------------------------------------------------------------------- */ /* Partial or complete simplicial factorization. Rows and columns kstart:kend-1 * of L and D must be initially equal to rows/columns kstart:kend-1 of the * identity matrix. Row k can only be factorized if all descendants of node * k in the elimination tree have been factorized. */ int cholmod_rowfac ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,fset)' */ double beta [2], /* factorize beta*I+A or beta*I+A'*A */ size_t kstart, /* first row to factorize */ size_t kend, /* last row to factorize is kend-1 */ /* ---- in/out --- */ cholmod_factor *L, /* --------------- */ cholmod_common *Common ) ; int cholmod_l_rowfac (cholmod_sparse *, cholmod_sparse *, double *, size_t, size_t, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_rowfac_mask: incremental simplicial factorization */ /* -------------------------------------------------------------------------- */ /* cholmod_rowfac_mask is a version of cholmod_rowfac that is specific to * LPDASA. It is unlikely to be needed by any other application. */ int cholmod_rowfac_mask ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,fset)' */ double beta [2], /* factorize beta*I+A or beta*I+A'*A */ size_t kstart, /* first row to factorize */ size_t kend, /* last row to factorize is kend-1 */ int *mask, /* if mask[i] >= 0, then set row i to zero */ int *RLinkUp, /* link list of rows to compute */ /* ---- in/out --- */ cholmod_factor *L, /* --------------- */ cholmod_common *Common ) ; int cholmod_l_rowfac_mask (cholmod_sparse *, cholmod_sparse *, double *, size_t, size_t, SuiteSparse_long *, SuiteSparse_long *, cholmod_factor *, cholmod_common *) ; int cholmod_rowfac_mask2 ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,fset)' */ double beta [2], /* factorize beta*I+A or beta*I+A'*A */ size_t kstart, /* first row to factorize */ size_t kend, /* last row to factorize is kend-1 */ int *mask, /* if mask[i] >= maskmark, then set row i to zero */ int maskmark, int *RLinkUp, /* link list of rows to compute */ /* ---- in/out --- */ cholmod_factor *L, /* --------------- */ cholmod_common *Common ) ; int cholmod_l_rowfac_mask2 (cholmod_sparse *, cholmod_sparse *, double *, size_t, size_t, SuiteSparse_long *, SuiteSparse_long, SuiteSparse_long *, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_row_subtree: find the nonzero pattern of a row of L */ /* -------------------------------------------------------------------------- */ /* Find the nonzero pattern of x for the system Lx=b where L = (0:k-1,0:k-1) * and b = kth column of A or A*A' (rows 0 to k-1 only) */ int cholmod_row_subtree ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,fset)' */ size_t k, /* row k of L */ int *Parent, /* elimination tree */ /* ---- output --- */ cholmod_sparse *R, /* pattern of L(k,:), n-by-1 with R->nzmax >= n */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_row_subtree (cholmod_sparse *, cholmod_sparse *, size_t, SuiteSparse_long *, cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_lsolve_pattern: find the nonzero pattern of x=L\b */ /* -------------------------------------------------------------------------- */ int cholmod_lsolve_pattern ( /* ---- input ---- */ cholmod_sparse *B, /* sparse right-hand-side (a single sparse column) */ cholmod_factor *L, /* the factor L from which parent(i) is derived */ /* ---- output --- */ cholmod_sparse *X, /* pattern of X=L\B, n-by-1 with X->nzmax >= n */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_lsolve_pattern (cholmod_sparse *, cholmod_factor *, cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_row_lsubtree: find the nonzero pattern of a row of L */ /* -------------------------------------------------------------------------- */ /* Identical to cholmod_row_subtree, except that it finds the elimination tree * from L itself. */ int cholmod_row_lsubtree ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ int *Fi, size_t fnz, /* nonzero pattern of kth row of A', not required * for the symmetric case. Need not be sorted. */ size_t k, /* row k of L */ cholmod_factor *L, /* the factor L from which parent(i) is derived */ /* ---- output --- */ cholmod_sparse *R, /* pattern of L(k,:), n-by-1 with R->nzmax >= n */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_row_lsubtree (cholmod_sparse *, SuiteSparse_long *, size_t, size_t, cholmod_factor *, cholmod_sparse *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_resymbol: recompute the symbolic pattern of L */ /* -------------------------------------------------------------------------- */ /* Remove entries from L that are not in the factorization of P*A*P', P*A*A'*P', * or P*F*F'*P' (depending on A->stype and whether fset is NULL or not). * * cholmod_resymbol is the same as cholmod_resymbol_noperm, except that it * first permutes A according to L->Perm. A can be upper/lower/unsymmetric, * in contrast to cholmod_resymbol_noperm (which can be lower or unsym). */ int cholmod_resymbol ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int pack, /* if TRUE, pack the columns of L */ /* ---- in/out --- */ cholmod_factor *L, /* factorization, entries pruned on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_resymbol (cholmod_sparse *, SuiteSparse_long *, size_t, int, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_resymbol_noperm: recompute the symbolic pattern of L, no L->Perm */ /* -------------------------------------------------------------------------- */ /* Remove entries from L that are not in the factorization of A, A*A', * or F*F' (depending on A->stype and whether fset is NULL or not). */ int cholmod_resymbol_noperm ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int pack, /* if TRUE, pack the columns of L */ /* ---- in/out --- */ cholmod_factor *L, /* factorization, entries pruned on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_resymbol_noperm (cholmod_sparse *, SuiteSparse_long *, size_t, int, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_rcond: compute rough estimate of reciprocal of condition number */ /* -------------------------------------------------------------------------- */ double cholmod_rcond /* return min(diag(L)) / max(diag(L)) */ ( /* ---- input ---- */ cholmod_factor *L, /* --------------- */ cholmod_common *Common ) ; double cholmod_l_rcond (cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_postorder: Compute the postorder of a tree */ /* -------------------------------------------------------------------------- */ SuiteSparse_long cholmod_postorder /* return # of nodes postordered */ ( /* ---- input ---- */ int *Parent, /* size n. Parent [j] = p if p is the parent of j */ size_t n, int *Weight_p, /* size n, optional. Weight [j] is weight of node j */ /* ---- output --- */ int *Post, /* size n. Post [k] = j is kth in postordered tree */ /* --------------- */ cholmod_common *Common ) ; SuiteSparse_long cholmod_l_postorder (SuiteSparse_long *, size_t, SuiteSparse_long *, SuiteSparse_long *, cholmod_common *) ; #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_gpu_kernels.h0000664000175000017500000000354414224052371022437 00000000000000/* ========================================================================== */ /* === Include/cholmod_gpu_kernels.h ======================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_gpu_kernels.h. * Copyright (C) 2014, Timothy A. Davis * CHOLMOD/Include/cholmod_gpu.h and the CHOLMOD GPU Module are licensed under * Version 2.0 of the GNU General Public License. See gpl.txt for a text of * the license. CHOLMOD is also available under other licenses; contact * authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- * CUDA kernel support routines for CHOLMOD * -------------------------------------------------------------------------- */ #ifndef CHOLMODGPUKERNELS_H #define CHOLMODGPUKERNELS_H /* make it easy for C++ programs to include CHOLMOD */ #ifdef __cplusplus extern "C" { #endif #include "SuiteSparse_config.h" int createMapOnDevice ( Int *d_Map, Int *d_Ls, Int psi, Int nsrow ); int createRelativeMapOnDevice ( Int *d_Map, Int *d_Ls, Int *d_RelativeMap, Int pdi1, Int ndrow, cudaStream_t astream ); int addUpateOnDevice ( double *d_A, double *devPtrC, Int *d_RelativeMap, Int ndrow1, Int ndrow2, Int nsrow, cudaStream_t astream ); int addComplexUpateOnDevice ( double *d_A, double *devPtrC, Int *d_RelativeMap, Int ndrow1, Int ndrow2, Int nsrow, cudaStream_t astream ); int sumAOnDevice ( double *a1, double *a2, const double alpha, int nsrow, int nscol ); int sumComplexAOnDevice ( double *a1, double *a2, const double alpha, int nsrow, int nscol ); #ifdef __cplusplus } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_partition.h0000664000175000017500000001573114224052371022133 00000000000000/* ========================================================================== */ /* === Include/cholmod_partition.h ========================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_partition.h. * Copyright (C) 2005-2013, Univ. of Florida. Author: Timothy A. Davis * CHOLMOD/Include/cholmod_partition.h is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* CHOLMOD Partition module. * * Graph partitioning and graph-partition-based orderings. Includes an * interface to CCOLAMD and CSYMAMD, constrained minimum degree ordering * methods which order a matrix following constraints determined via nested * dissection. * * These functions require METIS: * cholmod_nested_dissection CHOLMOD nested dissection ordering * cholmod_metis METIS nested dissection ordering (METIS_NodeND) * cholmod_bisect graph partitioner (currently based on METIS) * cholmod_metis_bisector direct interface to METIS_ComputeVertexSeparator * * Requires the Core and Cholesky modules, and three packages: METIS, CAMD, * and CCOLAMD. Optionally used by the Cholesky module. * * Note that METIS does not have a version that uses SuiteSparse_long integers. * If you try to use cholmod_nested_dissection, cholmod_metis, cholmod_bisect, * or cholmod_metis_bisector on a matrix that is too large, an error code will * be returned. METIS does have an "idxtype", which could be redefined as * SuiteSparse_long, if you wish to edit METIS or use compile-time flags to * redefine idxtype. */ #ifndef CHOLMOD_PARTITION_H #define CHOLMOD_PARTITION_H #include "cholmod_core.h" #include "cholmod_camd.h" /* -------------------------------------------------------------------------- */ /* cholmod_nested_dissection */ /* -------------------------------------------------------------------------- */ /* Order A, AA', or A(:,f)*A(:,f)' using CHOLMOD's nested dissection method * (METIS's node bisector applied recursively to compute the separator tree * and constraint sets, followed by CCOLAMD using the constraints). Usually * finds better orderings than METIS_NodeND, but takes longer. */ SuiteSparse_long cholmod_nested_dissection /* returns # of components */ ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ /* ---- output --- */ int *Perm, /* size A->nrow, output permutation */ int *CParent, /* size A->nrow. On output, CParent [c] is the parent * of component c, or EMPTY if c is a root, and where * c is in the range 0 to # of components minus 1 */ int *Cmember, /* size A->nrow. Cmember [j] = c if node j of A is * in component c */ /* --------------- */ cholmod_common *Common ) ; SuiteSparse_long cholmod_l_nested_dissection (cholmod_sparse *, SuiteSparse_long *, size_t, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_metis */ /* -------------------------------------------------------------------------- */ /* Order A, AA', or A(:,f)*A(:,f)' using METIS_NodeND. */ int cholmod_metis ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to order */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int postorder, /* if TRUE, follow with etree or coletree postorder */ /* ---- output --- */ int *Perm, /* size A->nrow, output permutation */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_metis (cholmod_sparse *, SuiteSparse_long *, size_t, int, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_bisect */ /* -------------------------------------------------------------------------- */ /* Finds a node bisector of A, A*A', A(:,f)*A(:,f)'. */ SuiteSparse_long cholmod_bisect /* returns # of nodes in separator */ ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to bisect */ int *fset, /* subset of 0:(A->ncol)-1 */ size_t fsize, /* size of fset */ int compress, /* if TRUE, compress the graph first */ /* ---- output --- */ int *Partition, /* size A->nrow. Node i is in the left graph if * Partition [i] = 0, the right graph if 1, and in the * separator if 2. */ /* --------------- */ cholmod_common *Common ) ; SuiteSparse_long cholmod_l_bisect (cholmod_sparse *, SuiteSparse_long *, size_t, int, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_metis_bisector */ /* -------------------------------------------------------------------------- */ /* Find a set of nodes that bisects the graph of A or AA' (direct interface * to METIS_ComputeVertexSeperator). */ SuiteSparse_long cholmod_metis_bisector /* returns separator size */ ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to bisect */ int *Anw, /* size A->nrow, node weights, can be NULL, */ /* which means the graph is unweighted. */ int *Aew, /* size nz, edge weights (silently ignored). */ /* This option was available with METIS 4, but not */ /* in METIS 5. This argument is now unused, but */ /* it remains for backward compatibilty, so as not */ /* to change the API for cholmod_metis_bisector. */ /* ---- output --- */ int *Partition, /* size A->nrow */ /* --------------- */ cholmod_common *Common ) ; SuiteSparse_long cholmod_l_metis_bisector (cholmod_sparse *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_collapse_septree */ /* -------------------------------------------------------------------------- */ /* Collapse nodes in a separator tree. */ SuiteSparse_long cholmod_collapse_septree ( /* ---- input ---- */ size_t n, /* # of nodes in the graph */ size_t ncomponents, /* # of nodes in the separator tree (must be <= n) */ double nd_oksep, /* collapse if #sep >= nd_oksep * #nodes in subtree */ size_t nd_small, /* collapse if #nodes in subtree < nd_small */ /* ---- in/out --- */ int *CParent, /* size ncomponents; from cholmod_nested_dissection */ int *Cmember, /* size n; from cholmod_nested_dissection */ /* --------------- */ cholmod_common *Common ) ; SuiteSparse_long cholmod_l_collapse_septree (size_t, size_t, double, size_t, SuiteSparse_long *, SuiteSparse_long *, cholmod_common *) ; #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_complexity.h0000664000175000017500000002231014224052371022306 00000000000000/* ========================================================================== */ /* === Include/cholmod_complexity.h ========================================= */ /* ========================================================================== */ /* Define operations on pattern, real, complex, and zomplex objects. * * The xtype of an object defines it numerical type. A qttern object has no * numerical values (A->x and A->z are NULL). A real object has no imaginary * qrt (A->x is used, A->z is NULL). A complex object has an imaginary qrt * that is stored interleaved with its real qrt (A->x is of size 2*nz, A->z * is NULL). A zomplex object has both real and imaginary qrts, which are * stored seqrately, as in MATLAB (A->x and A->z are both used). * * XTYPE is CHOLMOD_PATTERN, _REAL, _COMPLEX or _ZOMPLEX, and is the xtype of * the template routine under construction. XTYPE2 is equal to XTYPE, except * if XTYPE is CHOLMOD_PATTERN, in which case XTYPE is CHOLMOD_REAL. * XTYPE and XTYPE2 are defined in cholmod_template.h. */ /* -------------------------------------------------------------------------- */ /* pattern */ /* -------------------------------------------------------------------------- */ #define P_TEMPLATE(name) p_ ## name #define P_ASSIGN2(x,z,p,ax,az,q) x [p] = 1 #define P_PRINT(k,x,z,p) PRK(k, ("1")) /* -------------------------------------------------------------------------- */ /* real */ /* -------------------------------------------------------------------------- */ #define R_TEMPLATE(name) r_ ## name #define R_ASSEMBLE(x,z,p,ax,az,q) x [p] += ax [q] #define R_ASSIGN(x,z,p,ax,az,q) x [p] = ax [q] #define R_ASSIGN_CONJ(x,z,p,ax,az,q) x [p] = ax [q] #define R_ASSIGN_REAL(x,p,ax,q) x [p] = ax [q] #define R_XTYPE_OK(type) ((type) == CHOLMOD_REAL) #define R_IS_NONZERO(ax,az,q) IS_NONZERO (ax [q]) #define R_IS_ZERO(ax,az,q) IS_ZERO (ax [q]) #define R_IS_ONE(ax,az,q) (ax [q] == 1) #define R_MULT(x,z,p, ax,az,q, bx,bz,r) x [p] = ax [q] * bx [r] #define R_MULTADD(x,z,p, ax,az,q, bx,bz,r) x [p] += ax [q] * bx [r] #define R_MULTSUB(x,z,p, ax,az,q, bx,bz,r) x [p] -= ax [q] * bx [r] #define R_MULTADDCONJ(x,z,p, ax,az,q, bx,bz,r) x [p] += ax [q] * bx [r] #define R_MULTSUBCONJ(x,z,p, ax,az,q, bx,bz,r) x [p] -= ax [q] * bx [r] #define R_ADD(x,z,p, ax,az,q, bx,bz,r) x [p] = ax [q] + bx [r] #define R_ADD_REAL(x,p, ax,q, bx,r) x [p] = ax [q] + bx [r] #define R_CLEAR(x,z,p) x [p] = 0 #define R_CLEAR_IMAG(x,z,p) #define R_DIV(x,z,p,ax,az,q) x [p] /= ax [q] #define R_LLDOT(x,p, ax,az,q) x [p] -= ax [q] * ax [q] #define R_PRINT(k,x,z,p) PRK(k, ("%24.16e", x [p])) #define R_DIV_REAL(x,z,p, ax,az,q, bx,r) x [p] = ax [q] / bx [r] #define R_MULT_REAL(x,z,p, ax,az,q, bx,r) x [p] = ax [q] * bx [r] #define R_LDLDOT(x,p, ax,az,q, bx,r) x [p] -=(ax[q] * ax[q])/ bx[r] /* -------------------------------------------------------------------------- */ /* complex */ /* -------------------------------------------------------------------------- */ #define C_TEMPLATE(name) c_ ## name #define CT_TEMPLATE(name) ct_ ## name #define C_ASSEMBLE(x,z,p,ax,az,q) \ x [2*(p) ] += ax [2*(q) ] ; \ x [2*(p)+1] += ax [2*(q)+1] #define C_ASSIGN(x,z,p,ax,az,q) \ x [2*(p) ] = ax [2*(q) ] ; \ x [2*(p)+1] = ax [2*(q)+1] #define C_ASSIGN_REAL(x,p,ax,q) x [2*(p)] = ax [2*(q)] #define C_ASSIGN_CONJ(x,z,p,ax,az,q) \ x [2*(p) ] = ax [2*(q) ] ; \ x [2*(p)+1] = -ax [2*(q)+1] #define C_XTYPE_OK(type) ((type) == CHOLMOD_COMPLEX) #define C_IS_NONZERO(ax,az,q) \ (IS_NONZERO (ax [2*(q)]) || IS_NONZERO (ax [2*(q)+1])) #define C_IS_ZERO(ax,az,q) \ (IS_ZERO (ax [2*(q)]) && IS_ZERO (ax [2*(q)+1])) #define C_IS_ONE(ax,az,q) \ ((ax [2*(q)] == 1) && IS_ZERO (ax [2*(q)+1])) #define C_IMAG_IS_NONZERO(ax,az,q) (IS_NONZERO (ax [2*(q)+1])) #define C_MULT(x,z,p, ax,az,q, bx,bz,r) \ x [2*(p) ] = ax [2*(q) ] * bx [2*(r)] - ax [2*(q)+1] * bx [2*(r)+1] ; \ x [2*(p)+1] = ax [2*(q)+1] * bx [2*(r)] + ax [2*(q) ] * bx [2*(r)+1] #define C_MULTADD(x,z,p, ax,az,q, bx,bz,r) \ x [2*(p) ] += ax [2*(q) ] * bx [2*(r)] - ax [2*(q)+1] * bx [2*(r)+1] ; \ x [2*(p)+1] += ax [2*(q)+1] * bx [2*(r)] + ax [2*(q) ] * bx [2*(r)+1] #define C_MULTSUB(x,z,p, ax,az,q, bx,bz,r) \ x [2*(p) ] -= ax [2*(q) ] * bx [2*(r)] - ax [2*(q)+1] * bx [2*(r)+1] ; \ x [2*(p)+1] -= ax [2*(q)+1] * bx [2*(r)] + ax [2*(q) ] * bx [2*(r)+1] /* s += conj(a)*b */ #define C_MULTADDCONJ(x,z,p, ax,az,q, bx,bz,r) \ x [2*(p) ] += ax [2*(q) ] * bx [2*(r)] + ax [2*(q)+1] * bx [2*(r)+1] ; \ x [2*(p)+1] += (-ax [2*(q)+1]) * bx [2*(r)] + ax [2*(q) ] * bx [2*(r)+1] /* s -= conj(a)*b */ #define C_MULTSUBCONJ(x,z,p, ax,az,q, bx,bz,r) \ x [2*(p) ] -= ax [2*(q) ] * bx [2*(r)] + ax [2*(q)+1] * bx [2*(r)+1] ; \ x [2*(p)+1] -= (-ax [2*(q)+1]) * bx [2*(r)] + ax [2*(q) ] * bx [2*(r)+1] #define C_ADD(x,z,p, ax,az,q, bx,bz,r) \ x [2*(p) ] = ax [2*(q) ] + bx [2*(r) ] ; \ x [2*(p)+1] = ax [2*(q)+1] + bx [2*(r)+1] #define C_ADD_REAL(x,p, ax,q, bx,r) \ x [2*(p)] = ax [2*(q)] + bx [2*(r)] #define C_CLEAR(x,z,p) \ x [2*(p) ] = 0 ; \ x [2*(p)+1] = 0 #define C_CLEAR_IMAG(x,z,p) \ x [2*(p)+1] = 0 /* s = s / a */ #define C_DIV(x,z,p,ax,az,q) \ SuiteSparse_config.divcomplex_func ( \ x [2*(p)], x [2*(p)+1], \ ax [2*(q)], ax [2*(q)+1], \ &x [2*(p)], &x [2*(p)+1]) /* s -= conj(a)*a ; note that the result of conj(a)*a is real */ #define C_LLDOT(x,p, ax,az,q) \ x [2*(p)] -= ax [2*(q)] * ax [2*(q)] + ax [2*(q)+1] * ax [2*(q)+1] #define C_PRINT(k,x,z,p) PRK(k, ("(%24.16e,%24.16e)", x [2*(p)], x [2*(p)+1])) #define C_DIV_REAL(x,z,p, ax,az,q, bx,r) \ x [2*(p) ] = ax [2*(q) ] / bx [2*(r)] ; \ x [2*(p)+1] = ax [2*(q)+1] / bx [2*(r)] #define C_MULT_REAL(x,z,p, ax,az,q, bx,r) \ x [2*(p) ] = ax [2*(q) ] * bx [2*(r)] ; \ x [2*(p)+1] = ax [2*(q)+1] * bx [2*(r)] /* s -= conj(a)*a/t */ #define C_LDLDOT(x,p, ax,az,q, bx,r) \ x [2*(p)] -= (ax [2*(q)] * ax [2*(q)] + ax [2*(q)+1] * ax [2*(q)+1]) / bx[r] /* -------------------------------------------------------------------------- */ /* zomplex */ /* -------------------------------------------------------------------------- */ #define Z_TEMPLATE(name) z_ ## name #define ZT_TEMPLATE(name) zt_ ## name #define Z_ASSEMBLE(x,z,p,ax,az,q) \ x [p] += ax [q] ; \ z [p] += az [q] #define Z_ASSIGN(x,z,p,ax,az,q) \ x [p] = ax [q] ; \ z [p] = az [q] #define Z_ASSIGN_REAL(x,p,ax,q) x [p] = ax [q] #define Z_ASSIGN_CONJ(x,z,p,ax,az,q) \ x [p] = ax [q] ; \ z [p] = -az [q] #define Z_XTYPE_OK(type) ((type) == CHOLMOD_ZOMPLEX) #define Z_IS_NONZERO(ax,az,q) \ (IS_NONZERO (ax [q]) || IS_NONZERO (az [q])) #define Z_IS_ZERO(ax,az,q) \ (IS_ZERO (ax [q]) && IS_ZERO (az [q])) #define Z_IS_ONE(ax,az,q) \ ((ax [q] == 1) && IS_ZERO (az [q])) #define Z_IMAG_IS_NONZERO(ax,az,q) (IS_NONZERO (az [q])) #define Z_MULT(x,z,p, ax,az,q, bx,bz,r) \ x [p] = ax [q] * bx [r] - az [q] * bz [r] ; \ z [p] = az [q] * bx [r] + ax [q] * bz [r] #define Z_MULTADD(x,z,p, ax,az,q, bx,bz,r) \ x [p] += ax [q] * bx [r] - az [q] * bz [r] ; \ z [p] += az [q] * bx [r] + ax [q] * bz [r] #define Z_MULTSUB(x,z,p, ax,az,q, bx,bz,r) \ x [p] -= ax [q] * bx [r] - az [q] * bz [r] ; \ z [p] -= az [q] * bx [r] + ax [q] * bz [r] #define Z_MULTADDCONJ(x,z,p, ax,az,q, bx,bz,r) \ x [p] += ax [q] * bx [r] + az [q] * bz [r] ; \ z [p] += (-az [q]) * bx [r] + ax [q] * bz [r] #define Z_MULTSUBCONJ(x,z,p, ax,az,q, bx,bz,r) \ x [p] -= ax [q] * bx [r] + az [q] * bz [r] ; \ z [p] -= (-az [q]) * bx [r] + ax [q] * bz [r] #define Z_ADD(x,z,p, ax,az,q, bx,bz,r) \ x [p] = ax [q] + bx [r] ; \ z [p] = az [q] + bz [r] #define Z_ADD_REAL(x,p, ax,q, bx,r) \ x [p] = ax [q] + bx [r] #define Z_CLEAR(x,z,p) \ x [p] = 0 ; \ z [p] = 0 #define Z_CLEAR_IMAG(x,z,p) \ z [p] = 0 /* s = s / a */ #define Z_DIV(x,z,p,ax,az,q) \ SuiteSparse_config.divcomplex_func \ (x [p], z [p], ax [q], az [q], &x [p], &z [p]) /* s -= conj(a)*a ; note that the result of conj(a)*a is real */ #define Z_LLDOT(x,p, ax,az,q) \ x [p] -= ax [q] * ax [q] + az [q] * az [q] #define Z_PRINT(k,x,z,p) PRK(k, ("(%24.16e,%24.16e)", x [p], z [p])) #define Z_DIV_REAL(x,z,p, ax,az,q, bx,r) \ x [p] = ax [q] / bx [r] ; \ z [p] = az [q] / bx [r] #define Z_MULT_REAL(x,z,p, ax,az,q, bx,r) \ x [p] = ax [q] * bx [r] ; \ z [p] = az [q] * bx [r] /* s -= conj(a)*a/t */ #define Z_LDLDOT(x,p, ax,az,q, bx,r) \ x [p] -= (ax [q] * ax [q] + az [q] * az [q]) / bx[r] /* -------------------------------------------------------------------------- */ /* all classes */ /* -------------------------------------------------------------------------- */ /* Check if A->xtype and the two arrays A->x and A->z are valid. Set status to * invalid, unless status is already "out of memory". A can be a sparse matrix, * dense matrix, factor, or triplet. */ #define RETURN_IF_XTYPE_INVALID(A,xtype1,xtype2,result) \ { \ if ((A)->xtype < (xtype1) || (A)->xtype > (xtype2) || \ ((A)->xtype != CHOLMOD_PATTERN && ((A)->x) == NULL) || \ ((A)->xtype == CHOLMOD_ZOMPLEX && ((A)->z) == NULL)) \ { \ if (Common->status != CHOLMOD_OUT_OF_MEMORY) \ { \ ERROR (CHOLMOD_INVALID, "invalid xtype") ; \ } \ return (result) ; \ } \ } JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod.h0000664000175000017500000000754514224052371020046 00000000000000/* ========================================================================== */ /* === Include/cholmod.h ==================================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod.h. * Copyright (C) 2005-2013, Univ. of Florida. Author: Timothy A. Davis * CHOLMOD/Include/cholmod.h is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * * Portions of CHOLMOD (the Core and Partition Modules) are copyrighted by the * University of Florida. The Modify Module is co-authored by William W. * Hager, Univ. of Florida. * * Acknowledgements: this work was supported in part by the National Science * Foundation (NFS CCR-0203270 and DMS-9803599), and a grant from Sandia * National Laboratories (Dept. of Energy) which supported the development of * CHOLMOD's Partition Module. * -------------------------------------------------------------------------- */ /* CHOLMOD include file, for inclusion user programs. * * The include files listed below include a short description of each user- * callable routine. Each routine in CHOLMOD has a consistent interface. * More details about the CHOLMOD data types is in the cholmod_core.h file. * * Naming convention: * ------------------ * * All routine names, data types, and CHOLMOD library files use the * cholmod_ prefix. All macros and other #define's use the CHOLMOD * prefix. * * Return value: * ------------- * * Most CHOLMOD routines return an int (TRUE (1) if successful, or FALSE * (0) otherwise. A SuiteSparse_long or double return value is >= 0 if * successful, or -1 otherwise. A size_t return value is > 0 if * successful, or 0 otherwise. * * If a routine returns a pointer, it is a pointer to a newly allocated * object or NULL if a failure occured, with one exception. cholmod_free * always returns NULL. * * "Common" parameter: * ------------------ * * The last parameter in all CHOLMOD routines is a pointer to the CHOLMOD * "Common" object. This contains control parameters, statistics, and * workspace used between calls to CHOLMOD. It is always an input/output * parameter. * * Input, Output, and Input/Output parameters: * ------------------------------------------- * * Input parameters are listed first. They are not modified by CHOLMOD. * * Input/output are listed next. They must be defined on input, and * are modified on output. * * Output parameters are listed next. If they are pointers, they must * point to allocated space on input, but their contents are not defined * on input. * * Workspace parameters appear next. They are used in only two routines * in the Supernodal module. * * The cholmod_common *Common parameter always appears as the last * parameter. It is always an input/output parameter. */ #ifndef CHOLMOD_H #define CHOLMOD_H /* make it easy for C++ programs to include CHOLMOD */ #ifdef __cplusplus extern "C" { #endif /* assume large file support. If problems occur, compile with -DNLARGEFILE */ #include "cholmod_io64.h" #include "SuiteSparse_config.h" #include "cholmod_config.h" /* CHOLMOD always includes the Core module. */ #include "cholmod_core.h" #ifndef NCHECK #include "cholmod_check.h" #endif #ifndef NCHOLESKY #include "cholmod_cholesky.h" #endif #ifndef NMATRIXOPS #include "cholmod_matrixops.h" #endif #ifndef NMODIFY #include "cholmod_modify.h" #endif #ifndef NCAMD #include "cholmod_camd.h" #endif #ifndef NPARTITION #include "cholmod_partition.h" #endif #ifndef NSUPERNODAL #include "cholmod_supernodal.h" #endif #ifdef GPU_BLAS #include "cholmod_gpu.h" #endif #ifdef __cplusplus } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_supernodal.h0000664000175000017500000001446214224052371022276 00000000000000/* ========================================================================== */ /* === Include/cholmod_supernodal.h ========================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_supernodal.h. * Copyright (C) 2005-2006, Timothy A. Davis * CHOLMOD/Include/cholmod_supernodal.h is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* CHOLMOD Supernodal module. * * Supernodal analysis, factorization, and solve. The simplest way to use * these routines is via the Cholesky module. It does not provide any * fill-reducing orderings, but does accept the orderings computed by the * Cholesky module. It does not require the Cholesky module itself, however. * * Primary routines: * ----------------- * cholmod_super_symbolic supernodal symbolic analysis * cholmod_super_numeric supernodal numeric factorization * cholmod_super_lsolve supernodal Lx=b solve * cholmod_super_ltsolve supernodal L'x=b solve * * Prototypes for the BLAS and LAPACK routines that CHOLMOD uses are listed * below, including how they are used in CHOLMOD. * * BLAS routines: * -------------- * dtrsv solve Lx=b or L'x=b, L non-unit diagonal, x and b stride-1 * dtrsm solve LX=B or L'X=b, L non-unit diagonal * dgemv y=y-A*x or y=y-A'*x (x and y stride-1) * dgemm C=A*B', C=C-A*B, or C=C-A'*B * dsyrk C=tril(A*A') * * LAPACK routines: * ---------------- * dpotrf LAPACK: A=chol(tril(A)) * * Requires the Core module, and two external packages: LAPACK and the BLAS. * Optionally used by the Cholesky module. */ #ifndef CHOLMOD_SUPERNODAL_H #define CHOLMOD_SUPERNODAL_H #include "cholmod_core.h" /* -------------------------------------------------------------------------- */ /* cholmod_super_symbolic */ /* -------------------------------------------------------------------------- */ /* Analyzes A, AA', or A(:,f)*A(:,f)' in preparation for a supernodal numeric * factorization. The user need not call this directly; cholmod_analyze is * a "simple" wrapper for this routine. */ int cholmod_super_symbolic ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ cholmod_sparse *F, /* F = A' or A(:,f)' */ int *Parent, /* elimination tree */ /* ---- in/out --- */ cholmod_factor *L, /* simplicial symbolic on input, * supernodal symbolic on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_super_symbolic (cholmod_sparse *, cholmod_sparse *, SuiteSparse_long *, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_super_symbolic2 */ /* -------------------------------------------------------------------------- */ /* Analyze for supernodal Cholesky or multifrontal QR */ int cholmod_super_symbolic2 ( /* ---- input ---- */ int for_whom, /* FOR_SPQR (0): for SPQR but not GPU-accelerated FOR_CHOLESKY (1): for Cholesky (GPU or not) FOR_SPQRGPU (2): for SPQR with GPU acceleration */ cholmod_sparse *A, /* matrix to analyze */ cholmod_sparse *F, /* F = A' or A(:,f)' */ int *Parent, /* elimination tree */ /* ---- in/out --- */ cholmod_factor *L, /* simplicial symbolic on input, * supernodal symbolic on output */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_super_symbolic2 (int, cholmod_sparse *, cholmod_sparse *, SuiteSparse_long *, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_super_numeric */ /* -------------------------------------------------------------------------- */ /* Computes the numeric LL' factorization of A, AA', or A(:,f)*A(:,f)' using * a BLAS-based supernodal method. The user need not call this directly; * cholmod_factorize is a "simple" wrapper for this routine. */ int cholmod_super_numeric ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ cholmod_sparse *F, /* F = A' or A(:,f)' */ double beta [2], /* beta*I is added to diagonal of matrix to factorize */ /* ---- in/out --- */ cholmod_factor *L, /* factorization */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_super_numeric (cholmod_sparse *, cholmod_sparse *, double *, cholmod_factor *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_super_lsolve */ /* -------------------------------------------------------------------------- */ /* Solve Lx=b where L is from a supernodal numeric factorization. The user * need not call this routine directly. cholmod_solve is a "simple" wrapper * for this routine. */ int cholmod_super_lsolve ( /* ---- input ---- */ cholmod_factor *L, /* factor to use for the forward solve */ /* ---- output ---- */ cholmod_dense *X, /* b on input, solution to Lx=b on output */ /* ---- workspace */ cholmod_dense *E, /* workspace of size nrhs*(L->maxesize) */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_super_lsolve (cholmod_factor *, cholmod_dense *, cholmod_dense *, cholmod_common *) ; /* -------------------------------------------------------------------------- */ /* cholmod_super_ltsolve */ /* -------------------------------------------------------------------------- */ /* Solve L'x=b where L is from a supernodal numeric factorization. The user * need not call this routine directly. cholmod_solve is a "simple" wrapper * for this routine. */ int cholmod_super_ltsolve ( /* ---- input ---- */ cholmod_factor *L, /* factor to use for the backsolve */ /* ---- output ---- */ cholmod_dense *X, /* b on input, solution to L'x=b on output */ /* ---- workspace */ cholmod_dense *E, /* workspace of size nrhs*(L->maxesize) */ /* --------------- */ cholmod_common *Common ) ; int cholmod_l_super_ltsolve (cholmod_factor *, cholmod_dense *, cholmod_dense *, cholmod_common *) ; #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_config.h0000664000175000017500000000630614224052371021365 00000000000000/* ========================================================================== */ /* === Include/cholmod_config.h ============================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_config.h. * Copyright (C) 2005-2013, Univ. of Florida. Author: Timothy A. Davis * CHOLMOD/Include/cholmod_config.h is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* CHOLMOD configuration file, for inclusion in user programs. * * You do not have to edit any CHOLMOD files to compile and install CHOLMOD. * However, if you do not use all of CHOLMOD's modules, you need to compile * with the appropriate flag, or edit this file to add the appropriate #define. * * If you wish to use CHOLMOD under the GNU LGPL license only, then you must * compile CHOLMOD with -DNMATRIXOPS -DNSUPERNODAL and -DNMODIFY. This can * be done using just -DNGPL. * * Compiler flags for CHOLMOD: * * -DNCHECK do not include the Check module. License: GNU LGPL * -DNCHOLESKY do not include the Cholesky module. License: GNU LGPL * -DNPARTITION do not include the Partition module. License: GNU LGPL * -DNCAMD do not include the interfaces to CAMD, * CCOLAMD, CSYMAND in Partition module. License: GNU LGPL * * -DNGPL do not include any GNU GPL Modules in the CHOLMOD library. * -DNMATRIXOPS do not include the MatrixOps module. License: GNU GPL * -DNMODIFY do not include the Modify module. License: GNU GPL * -DNSUPERNODAL do not include the Supernodal module. License: GNU GPL * * -DNPRINT do not print anything * * -D'LONGBLAS=long' or -DLONGBLAS='long long' defines the integers used by * LAPACK and the BLAS. Use LONGBLAS=long on Solaris to use * the 64-bit Sun Performance BLAS in cholmod_l_* routines. * You may need to use -D'LONGBLAS=long long' on the SGI * (this is not tested). * * -DNSUNPERF for Solaris only. If defined, do not use the Sun * Performance Library. The default is to use SunPerf. * You must compile CHOLMOD with -xlic_lib=sunperf. * * The Core Module (License GNU LGPL) is always included in the CHOLMOD library. */ #ifndef CHOLMOD_CONFIG_H #define CHOLMOD_CONFIG_H /* Use the compiler flag, or uncomment the definition(s), if you want to use * one or more non-default installation options: */ /* #define NCHECK #define NCHOLESKY #define NCAMD #define NPARTITION #define NGPL #define NMATRIXOPS #define NMODIFY #define NSUPERNODAL #define NPRINT #define LONGBLAS long #define LONGBLAS long long #define NSUNPERF */ /* -------------------------------------------------------------------------- */ /* if NGPL is defined, disable all GNU GPL Modules */ /* -------------------------------------------------------------------------- */ #ifdef NGPL #define NMATRIXOPS #define NMODIFY #define NSUPERNODAL #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_internal.h0000664000175000017500000003344114224052371021734 00000000000000/* ========================================================================== */ /* === Include/cholmod_internal.h =========================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Include/cholmod_internal.h. * Copyright (C) 2005-2013, Univ. of Florida. Author: Timothy A. Davis * CHOLMOD/Include/cholmod_internal.h is licensed under Version 2.1 of the GNU * Lesser General Public License. See lesser.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * -------------------------------------------------------------------------- */ /* CHOLMOD internal include file. * * This file contains internal definitions for CHOLMOD, not meant to be included * in user code. They define macros that are not prefixed with CHOLMOD_. This * file can safely #include'd in user code if you want to make use of the * macros defined here, and don't mind the possible name conflicts with your * code, however. * * Required by all CHOLMOD routines. Not required by any user routine that * uses CHOLMOMD. Unless debugging is enabled, this file does not require any * CHOLMOD module (not even the Core module). * * If debugging is enabled, all CHOLMOD modules require the Check module. * Enabling debugging requires that this file be editted. Debugging cannot be * enabled with a compiler flag. This is because CHOLMOD is exceedingly slow * when debugging is enabled. Debugging is meant for development of CHOLMOD * itself, not by users of CHOLMOD. */ #ifndef CHOLMOD_INTERNAL_H #define CHOLMOD_INTERNAL_H /* ========================================================================== */ /* === large file I/O ======================================================= */ /* ========================================================================== */ /* Definitions for large file I/O must come before any other #includes. If * this causes problems (may not be portable to all platforms), then compile * CHOLMOD with -DNLARGEFILE. You must do this for MATLAB 6.5 and earlier, * for example. */ #include "cholmod_io64.h" /* ========================================================================== */ /* === debugging and basic includes ========================================= */ /* ========================================================================== */ /* turn off debugging */ #ifndef NDEBUG #define NDEBUG #endif /* Uncomment this line to enable debugging. CHOLMOD will be very slow. #undef NDEBUG */ #ifdef MATLAB_MEX_FILE #include "mex.h" #endif #if !defined(NPRINT) || !defined(NDEBUG) #include #endif #include #include #include #include #include /* ========================================================================== */ /* === basic definitions ==================================================== */ /* ========================================================================== */ /* Some non-conforming compilers insist on defining TRUE and FALSE. */ #undef TRUE #undef FALSE #define TRUE 1 #define FALSE 0 #define BOOLEAN(x) ((x) ? TRUE : FALSE) /* NULL should already be defined, but ensure it is here. */ #ifndef NULL #define NULL ((void *) 0) #endif /* FLIP is a "negation about -1", and is used to mark an integer i that is * normally non-negative. FLIP (EMPTY) is EMPTY. FLIP of a number > EMPTY * is negative, and FLIP of a number < EMTPY is positive. FLIP (FLIP (i)) = i * for all integers i. UNFLIP (i) is >= EMPTY. */ #define EMPTY (-1) #define FLIP(i) (-(i)-2) #define UNFLIP(i) (((i) < EMPTY) ? FLIP (i) : (i)) /* MAX and MIN are not safe to use for NaN's */ #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MAX3(a,b,c) (((a) > (b)) ? (MAX (a,c)) : (MAX (b,c))) #define MAX4(a,b,c,d) (((a) > (b)) ? (MAX3 (a,c,d)) : (MAX3 (b,c,d))) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define IMPLIES(p,q) (!(p) || (q)) /* find the sign: -1 if x < 0, 1 if x > 0, zero otherwise. * Not safe for NaN's */ #define SIGN(x) (((x) < 0) ? (-1) : (((x) > 0) ? 1 : 0)) /* round up an integer x to a multiple of s */ #define ROUNDUP(x,s) ((s) * (((x) + ((s) - 1)) / (s))) #define ERROR(status,msg) \ CHOLMOD(error) (status, __FILE__, __LINE__, msg, Common) /* Check a pointer and return if null. Set status to invalid, unless the * status is already "out of memory" */ #define RETURN_IF_NULL(A,result) \ { \ if ((A) == NULL) \ { \ if (Common->status != CHOLMOD_OUT_OF_MEMORY) \ { \ ERROR (CHOLMOD_INVALID, "argument missing") ; \ } \ return (result) ; \ } \ } /* Return if Common is NULL or invalid */ #define RETURN_IF_NULL_COMMON(result) \ { \ if (Common == NULL) \ { \ return (result) ; \ } \ if (Common->itype != ITYPE || Common->dtype != DTYPE) \ { \ Common->status = CHOLMOD_INVALID ; \ return (result) ; \ } \ } #define IS_NAN(x) CHOLMOD_IS_NAN(x) #define IS_ZERO(x) CHOLMOD_IS_ZERO(x) #define IS_NONZERO(x) CHOLMOD_IS_NONZERO(x) #define IS_LT_ZERO(x) CHOLMOD_IS_LT_ZERO(x) #define IS_GT_ZERO(x) CHOLMOD_IS_GT_ZERO(x) #define IS_LE_ZERO(x) CHOLMOD_IS_LE_ZERO(x) /* 1e308 is a huge number that doesn't take many characters to print in a * file, in CHOLMOD/Check/cholmod_read and _write. Numbers larger than this * are interpretted as Inf, since sscanf doesn't read in Inf's properly. * This assumes IEEE double precision arithmetic. DBL_MAX would be a little * better, except that it takes too many digits to print in a file. */ #define HUGE_DOUBLE 1e308 /* ========================================================================== */ /* === int/long and double/float definitions ================================ */ /* ========================================================================== */ /* CHOLMOD is designed for 3 types of integer variables: * * (1) all integers are int * (2) most integers are int, some are SuiteSparse_long * (3) all integers are SuiteSparse_long * * and two kinds of floating-point values: * * (1) double * (2) float * * the complex types (ANSI-compatible complex, and MATLAB-compatable zomplex) * are based on the double or float type, and are not selected here. They * are typically selected via template routines. * * This gives 6 different modes in which CHOLMOD can be compiled (only the * first two are currently supported): * * DINT double, int prefix: cholmod_ * DLONG double, SuiteSparse_long prefix: cholmod_l_ * DMIX double, mixed int/SuiteSparse_long prefix: cholmod_m_ * SINT float, int prefix: cholmod_si_ * SLONG float, SuiteSparse_long prefix: cholmod_sl_ * SMIX float, mixed int/log prefix: cholmod_sm_ * * These are selected with compile time flags (-DDLONG, for example). If no * flag is selected, the default is DINT. * * All six versions use the same include files. The user-visible include files * are completely independent of which int/long/double/float version is being * used. The integer / real types in all data structures (sparse, triplet, * dense, common, and triplet) are defined at run-time, not compile-time, so * there is only one "cholmod_sparse" data type. Void pointers are used inside * that data structure to point to arrays of the proper type. Each data * structure has an itype and dtype field which determines the kind of basic * types used. These are defined in Include/cholmod_core.h. * * FUTURE WORK: support all six types (float, and mixed int/long) * * SuiteSparse_long is normally defined as long. However, for WIN64 it is * __int64. It can also be redefined for other platforms, by modifying * SuiteSparse_config.h. */ #include "SuiteSparse_config.h" /* -------------------------------------------------------------------------- */ /* Size_max: the largest value of size_t */ /* -------------------------------------------------------------------------- */ #define Size_max ((size_t) (-1)) /* routines for doing arithmetic on size_t, and checking for overflow */ size_t cholmod_add_size_t (size_t a, size_t b, int *ok) ; size_t cholmod_mult_size_t (size_t a, size_t k, int *ok) ; size_t cholmod_l_add_size_t (size_t a, size_t b, int *ok) ; size_t cholmod_l_mult_size_t (size_t a, size_t k, int *ok) ; /* -------------------------------------------------------------------------- */ /* double (also complex double), SuiteSparse_long */ /* -------------------------------------------------------------------------- */ #ifdef DLONG #define Real double #define Int SuiteSparse_long #define Int_max SuiteSparse_long_max #define CHOLMOD(name) cholmod_l_ ## name #define LONG #define DOUBLE #define ITYPE CHOLMOD_LONG #define DTYPE CHOLMOD_DOUBLE #define ID SuiteSparse_long_id /* -------------------------------------------------------------------------- */ /* double (also complex double), int: this is the default */ /* -------------------------------------------------------------------------- */ #else #ifndef DINT #define DINT #endif #define INT #define DOUBLE #define Real double #define Int int #define Int_max INT_MAX #define CHOLMOD(name) cholmod_ ## name #define ITYPE CHOLMOD_INT #define DTYPE CHOLMOD_DOUBLE #define ID "%d" /* GPU acceleration is not available for the int version of CHOLMOD */ #undef GPU_BLAS #endif /* ========================================================================== */ /* === real/complex arithmetic ============================================== */ /* ========================================================================== */ #include "cholmod_complexity.h" /* ========================================================================== */ /* === Architecture and BLAS ================================================ */ /* ========================================================================== */ #define BLAS_OK Common->blas_ok #include "cholmod_blas.h" /* ========================================================================== */ /* === debugging definitions ================================================ */ /* ========================================================================== */ #ifndef NDEBUG #include #include "cholmod.h" /* The cholmod_dump routines are in the Check module. No CHOLMOD routine * calls the cholmod_check_* or cholmod_print_* routines in the Check module, * since they use Common workspace that may already be in use. Instead, they * use the cholmod_dump_* routines defined there, which allocate their own * workspace if they need it. */ #ifndef EXTERN #define EXTERN extern #endif /* double, int */ EXTERN int cholmod_dump ; EXTERN int cholmod_dump_malloc ; SuiteSparse_long cholmod_dump_sparse (cholmod_sparse *, const char *, cholmod_common *) ; int cholmod_dump_factor (cholmod_factor *, const char *, cholmod_common *) ; int cholmod_dump_triplet (cholmod_triplet *, const char *, cholmod_common *) ; int cholmod_dump_dense (cholmod_dense *, const char *, cholmod_common *) ; int cholmod_dump_subset (int *, size_t, size_t, const char *, cholmod_common *) ; int cholmod_dump_perm (int *, size_t, size_t, const char *, cholmod_common *) ; int cholmod_dump_parent (int *, size_t, const char *, cholmod_common *) ; void cholmod_dump_init (const char *, cholmod_common *) ; int cholmod_dump_mem (const char *, SuiteSparse_long, cholmod_common *) ; void cholmod_dump_real (const char *, Real *, SuiteSparse_long, SuiteSparse_long, int, int, cholmod_common *) ; void cholmod_dump_super (SuiteSparse_long, int *, int *, int *, int *, double *, int, cholmod_common *) ; int cholmod_dump_partition (SuiteSparse_long, int *, int *, int *, int *, SuiteSparse_long, cholmod_common *) ; int cholmod_dump_work(int, int, SuiteSparse_long, cholmod_common *) ; /* double, SuiteSparse_long */ EXTERN int cholmod_l_dump ; EXTERN int cholmod_l_dump_malloc ; SuiteSparse_long cholmod_l_dump_sparse (cholmod_sparse *, const char *, cholmod_common *) ; int cholmod_l_dump_factor (cholmod_factor *, const char *, cholmod_common *) ; int cholmod_l_dump_triplet (cholmod_triplet *, const char *, cholmod_common *); int cholmod_l_dump_dense (cholmod_dense *, const char *, cholmod_common *) ; int cholmod_l_dump_subset (SuiteSparse_long *, size_t, size_t, const char *, cholmod_common *) ; int cholmod_l_dump_perm (SuiteSparse_long *, size_t, size_t, const char *, cholmod_common *) ; int cholmod_l_dump_parent (SuiteSparse_long *, size_t, const char *, cholmod_common *) ; void cholmod_l_dump_init (const char *, cholmod_common *) ; int cholmod_l_dump_mem (const char *, SuiteSparse_long, cholmod_common *) ; void cholmod_l_dump_real (const char *, Real *, SuiteSparse_long, SuiteSparse_long, int, int, cholmod_common *) ; void cholmod_l_dump_super (SuiteSparse_long, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, double *, int, cholmod_common *) ; int cholmod_l_dump_partition (SuiteSparse_long, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long *, SuiteSparse_long, cholmod_common *) ; int cholmod_l_dump_work(int, int, SuiteSparse_long, cholmod_common *) ; #define DEBUG_INIT(s,Common) { CHOLMOD(dump_init)(s, Common) ; } #define ASSERT(expression) (assert (expression)) #define PRK(k,params) \ { \ if (CHOLMOD(dump) >= (k) && SuiteSparse_config.printf_func != NULL) \ { \ (SuiteSparse_config.printf_func) params ; \ } \ } #define PRINT0(params) PRK (0, params) #define PRINT1(params) PRK (1, params) #define PRINT2(params) PRK (2, params) #define PRINT3(params) PRK (3, params) #define PRINTM(params) \ { \ if (CHOLMOD(dump_malloc) > 0) \ { \ printf params ; \ } \ } #define DEBUG(statement) statement #else /* Debugging disabled (the normal case) */ #define PRK(k,params) #define DEBUG_INIT(s,Common) #define PRINT0(params) #define PRINT1(params) #define PRINT2(params) #define PRINT3(params) #define PRINTM(params) #define ASSERT(expression) #define DEBUG(statement) #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/cholmod_template.h0000664000175000017500000002245614224052371021737 00000000000000/* ========================================================================== */ /* === Include/cholmod_template.h =========================================== */ /* ========================================================================== */ /* -------------------------------------------------------------------------- */ /* undefine current xtype macros, and then define macros for current type */ /* -------------------------------------------------------------------------- */ #undef TEMPLATE #undef TEMPLATE2 #undef XTYPE #undef XTYPE2 #undef XTYPE_OK #undef ENTRY_IS_NONZERO #undef ENTRY_IS_ZERO #undef ENTRY_IS_ONE #undef IMAG_IS_NONZERO #undef ASSEMBLE #undef ASSIGN #undef ASSIGN_CONJ #undef ASSIGN2 #undef ASSIGN2_CONJ #undef ASSIGN_REAL #undef MULT #undef MULTADD #undef ADD #undef ADD_REAL #undef MULTSUB #undef MULTADDCONJ #undef MULTSUBCONJ #undef LLDOT #undef CLEAR #undef DIV #undef DIV_REAL #undef MULT_REAL #undef CLEAR_IMAG #undef LDLDOT #undef PREFIX #undef ENTRY_SIZE #undef XPRINT0 #undef XPRINT1 #undef XPRINT2 #undef XPRINT3 /* -------------------------------------------------------------------------- */ /* pattern */ /* -------------------------------------------------------------------------- */ #ifdef PATTERN #define PREFIX p_ #define TEMPLATE(name) P_TEMPLATE(name) #define TEMPLATE2(name) P_TEMPLATE(name) #define XTYPE CHOLMOD_PATTERN #define XTYPE2 CHOLMOD_REAL #define XTYPE_OK(type) (TRUE) #define ENTRY_IS_NONZERO(ax,az,q) (TRUE) #define ENTRY_IS_ZERO(ax,az,q) (FALSE) #define ENTRY_IS_ONE(ax,az,q) (TRUE) #define IMAG_IS_NONZERO(ax,az,q) (FALSE) #define ENTRY_SIZE 0 #define ASSEMBLE(x,z,p,ax,az,q) #define ASSIGN(x,z,p,ax,az,q) #define ASSIGN_CONJ(x,z,p,ax,az,q) #define ASSIGN2(x,z,p,ax,az,q) P_ASSIGN2(x,z,p,ax,az,q) #define ASSIGN2_CONJ(x,z,p,ax,az,q) P_ASSIGN2(x,z,p,ax,az,q) #define ASSIGN_REAL(x,p,ax,q) #define MULT(x,z,p,ax,az,q,bx,bz,pb) #define MULTADD(x,z,p,ax,az,q,bx,bz,pb) #define ADD(x,z,p,ax,az,q,bx,bz,pb) #define ADD_REAL(x,p, ax,q, bx,r) #define MULTSUB(x,z,p,ax,az,q,bx,bz,pb) #define MULTADDCONJ(x,z,p,ax,az,q,bx,bz,pb) #define MULTSUBCONJ(x,z,p,ax,az,q,bx,bz,pb) #define LLDOT(x,p,ax,az,q) #define CLEAR(x,z,p) #define CLEAR_IMAG(x,z,p) #define DIV(x,z,p,ax,az,q) #define DIV_REAL(x,z,p, ax,az,q, bx,r) #define MULT_REAL(x,z,p, ax,az,q, bx,r) #define LDLDOT(x,p, ax,az,q, bx,r) #define XPRINT0(x,z,p) P_PRINT(0,x,z,p) #define XPRINT1(x,z,p) P_PRINT(1,x,z,p) #define XPRINT2(x,z,p) P_PRINT(2,x,z,p) #define XPRINT3(x,z,p) P_PRINT(3,x,z,p) /* -------------------------------------------------------------------------- */ /* real */ /* -------------------------------------------------------------------------- */ #elif defined (REAL) #define PREFIX r_ #define TEMPLATE(name) R_TEMPLATE(name) #define TEMPLATE2(name) R_TEMPLATE(name) #define XTYPE CHOLMOD_REAL #define XTYPE2 CHOLMOD_REAL #define XTYPE_OK(type) R_XTYPE_OK(type) #define ENTRY_IS_NONZERO(ax,az,q) R_IS_NONZERO(ax,az,q) #define ENTRY_IS_ZERO(ax,az,q) R_IS_ZERO(ax,az,q) #define ENTRY_IS_ONE(ax,az,q) R_IS_ONE(ax,az,q) #define IMAG_IS_NONZERO(ax,az,q) (FALSE) #define ENTRY_SIZE 1 #define ASSEMBLE(x,z,p,ax,az,q) R_ASSEMBLE(x,z,p,ax,az,q) #define ASSIGN(x,z,p,ax,az,q) R_ASSIGN(x,z,p,ax,az,q) #define ASSIGN_CONJ(x,z,p,ax,az,q) R_ASSIGN(x,z,p,ax,az,q) #define ASSIGN2(x,z,p,ax,az,q) R_ASSIGN(x,z,p,ax,az,q) #define ASSIGN2_CONJ(x,z,p,ax,az,q) R_ASSIGN(x,z,p,ax,az,q) #define ASSIGN_REAL(x,p,ax,q) R_ASSIGN_REAL(x,p,ax,q) #define MULT(x,z,p,ax,az,q,bx,bz,pb) R_MULT(x,z,p,ax,az,q,bx,bz,pb) #define MULTADD(x,z,p,ax,az,q,bx,bz,pb) R_MULTADD(x,z,p,ax,az,q,bx,bz,pb) #define ADD(x,z,p,ax,az,q,bx,bz,pb) R_ADD(x,z,p,ax,az,q,bx,bz,pb) #define ADD_REAL(x,p, ax,q, bx,r) R_ADD_REAL(x,p, ax,q, bx,r) #define MULTSUB(x,z,p,ax,az,q,bx,bz,pb) R_MULTSUB(x,z,p,ax,az,q,bx,bz,pb) #define MULTADDCONJ(x,z,p,ax,az,q,bx,bz,pb) \ R_MULTADDCONJ(x,z,p,ax,az,q,bx,bz,pb) #define MULTSUBCONJ(x,z,p,ax,az,q,bx,bz,pb) \ R_MULTSUBCONJ(x,z,p,ax,az,q,bx,bz,pb) #define LLDOT(x,p,ax,az,q) R_LLDOT(x,p,ax,az,q) #define CLEAR(x,z,p) R_CLEAR(x,z,p) #define CLEAR_IMAG(x,z,p) R_CLEAR_IMAG(x,z,p) #define DIV(x,z,p,ax,az,q) R_DIV(x,z,p,ax,az,q) #define DIV_REAL(x,z,p, ax,az,q, bx,r) R_DIV_REAL(x,z,p, ax,az,q, bx,r) #define MULT_REAL(x,z,p, ax,az,q, bx,r) R_MULT_REAL(x,z,p, ax,az,q, bx,r) #define LDLDOT(x,p, ax,az,q, bx,r) R_LDLDOT(x,p, ax,az,q, bx,r) #define XPRINT0(x,z,p) R_PRINT(0,x,z,p) #define XPRINT1(x,z,p) R_PRINT(1,x,z,p) #define XPRINT2(x,z,p) R_PRINT(2,x,z,p) #define XPRINT3(x,z,p) R_PRINT(3,x,z,p) /* -------------------------------------------------------------------------- */ /* complex */ /* -------------------------------------------------------------------------- */ #elif defined (COMPLEX) #define PREFIX c_ #ifdef NCONJUGATE #define TEMPLATE(name) CT_TEMPLATE(name) #define TEMPLATE2(name) CT_TEMPLATE(name) #else #define TEMPLATE(name) C_TEMPLATE(name) #define TEMPLATE2(name) C_TEMPLATE(name) #endif #define ASSEMBLE(x,z,p,ax,az,q) C_ASSEMBLE(x,z,p,ax,az,q) #define ASSIGN(x,z,p,ax,az,q) C_ASSIGN(x,z,p,ax,az,q) #define ASSIGN_CONJ(x,z,p,ax,az,q) C_ASSIGN_CONJ(x,z,p,ax,az,q) #define ASSIGN2(x,z,p,ax,az,q) C_ASSIGN(x,z,p,ax,az,q) #define ASSIGN2_CONJ(x,z,p,ax,az,q) C_ASSIGN_CONJ(x,z,p,ax,az,q) #define ASSIGN_REAL(x,p,ax,q) C_ASSIGN_REAL(x,p,ax,q) #define XTYPE CHOLMOD_COMPLEX #define XTYPE2 CHOLMOD_COMPLEX #define XTYPE_OK(type) C_XTYPE_OK(type) #define ENTRY_IS_NONZERO(ax,az,q) C_IS_NONZERO(ax,az,q) #define ENTRY_IS_ZERO(ax,az,q) C_IS_ZERO(ax,az,q) #define ENTRY_IS_ONE(ax,az,q) C_IS_ONE(ax,az,q) #define IMAG_IS_NONZERO(ax,az,q) C_IMAG_IS_NONZERO(ax,az,q) #define ENTRY_SIZE 2 #define MULTADD(x,z,p,ax,az,q,bx,bz,pb) C_MULTADD(x,z,p,ax,az,q,bx,bz,pb) #define MULT(x,z,p,ax,az,q,bx,bz,pb) C_MULT(x,z,p,ax,az,q,bx,bz,pb) #define ADD(x,z,p,ax,az,q,bx,bz,pb) C_ADD(x,z,p,ax,az,q,bx,bz,pb) #define ADD_REAL(x,p, ax,q, bx,r) C_ADD_REAL(x,p, ax,q, bx,r) #define MULTSUB(x,z,p,ax,az,q,bx,bz,pb) C_MULTSUB(x,z,p,ax,az,q,bx,bz,pb) #define MULTADDCONJ(x,z,p,ax,az,q,bx,bz,pb) \ C_MULTADDCONJ(x,z,p,ax,az,q,bx,bz,pb) #define MULTSUBCONJ(x,z,p,ax,az,q,bx,bz,pb) \ C_MULTSUBCONJ(x,z,p,ax,az,q,bx,bz,pb) #define LLDOT(x,p,ax,az,q) C_LLDOT(x,p,ax,az,q) #define CLEAR(x,z,p) C_CLEAR(x,z,p) #define CLEAR_IMAG(x,z,p) C_CLEAR_IMAG(x,z,p) #define DIV(x,z,p,ax,az,q) C_DIV(x,z,p,ax,az,q) #define DIV_REAL(x,z,p, ax,az,q, bx,r) C_DIV_REAL(x,z,p, ax,az,q, bx,r) #define MULT_REAL(x,z,p, ax,az,q, bx,r) C_MULT_REAL(x,z,p, ax,az,q, bx,r) #define LDLDOT(x,p, ax,az,q, bx,r) C_LDLDOT(x,p, ax,az,q, bx,r) #define XPRINT0(x,z,p) C_PRINT(0,x,z,p) #define XPRINT1(x,z,p) C_PRINT(1,x,z,p) #define XPRINT2(x,z,p) C_PRINT(2,x,z,p) #define XPRINT3(x,z,p) C_PRINT(3,x,z,p) /* -------------------------------------------------------------------------- */ /* zomplex */ /* -------------------------------------------------------------------------- */ #elif defined (ZOMPLEX) #define PREFIX z_ #ifdef NCONJUGATE #define TEMPLATE(name) ZT_TEMPLATE(name) #define TEMPLATE2(name) CT_TEMPLATE(name) #else #define TEMPLATE(name) Z_TEMPLATE(name) #define TEMPLATE2(name) C_TEMPLATE(name) #endif #define ASSEMBLE(x,z,p,ax,az,q) Z_ASSEMBLE(x,z,p,ax,az,q) #define ASSIGN(x,z,p,ax,az,q) Z_ASSIGN(x,z,p,ax,az,q) #define ASSIGN_CONJ(x,z,p,ax,az,q) Z_ASSIGN_CONJ(x,z,p,ax,az,q) #define ASSIGN2(x,z,p,ax,az,q) Z_ASSIGN(x,z,p,ax,az,q) #define ASSIGN2_CONJ(x,z,p,ax,az,q) Z_ASSIGN_CONJ(x,z,p,ax,az,q) #define ASSIGN_REAL(x,p,ax,q) Z_ASSIGN_REAL(x,p,ax,q) #define XTYPE CHOLMOD_ZOMPLEX #define XTYPE2 CHOLMOD_ZOMPLEX #define XTYPE_OK(type) Z_XTYPE_OK(type) #define ENTRY_IS_NONZERO(ax,az,q) Z_IS_NONZERO(ax,az,q) #define ENTRY_IS_ZERO(ax,az,q) Z_IS_ZERO(ax,az,q) #define ENTRY_IS_ONE(ax,az,q) Z_IS_ONE(ax,az,q) #define IMAG_IS_NONZERO(ax,az,q) Z_IMAG_IS_NONZERO(ax,az,q) #define ENTRY_SIZE 1 #define MULTADD(x,z,p,ax,az,q,bx,bz,pb) Z_MULTADD(x,z,p,ax,az,q,bx,bz,pb) #define MULT(x,z,p,ax,az,q,bx,bz,pb) Z_MULT(x,z,p,ax,az,q,bx,bz,pb) #define ADD(x,z,p,ax,az,q,bx,bz,pb) Z_ADD(x,z,p,ax,az,q,bx,bz,pb) #define ADD_REAL(x,p, ax,q, bx,r) Z_ADD_REAL(x,p, ax,q, bx,r) #define MULTSUB(x,z,p,ax,az,q,bx,bz,pb) Z_MULTSUB(x,z,p,ax,az,q,bx,bz,pb) #define MULTADDCONJ(x,z,p,ax,az,q,bx,bz,pb) \ Z_MULTADDCONJ(x,z,p,ax,az,q,bx,bz,pb) #define MULTSUBCONJ(x,z,p,ax,az,q,bx,bz,pb) \ Z_MULTSUBCONJ(x,z,p,ax,az,q,bx,bz,pb) #define LLDOT(x,p,ax,az,q) Z_LLDOT(x,p,ax,az,q) #define CLEAR(x,z,p) Z_CLEAR(x,z,p) #define CLEAR_IMAG(x,z,p) Z_CLEAR_IMAG(x,z,p) #define DIV(x,z,p,ax,az,q) Z_DIV(x,z,p,ax,az,q) #define DIV_REAL(x,z,p, ax,az,q, bx,r) Z_DIV_REAL(x,z,p, ax,az,q, bx,r) #define MULT_REAL(x,z,p, ax,az,q, bx,r) Z_MULT_REAL(x,z,p, ax,az,q, bx,r) #define LDLDOT(x,p, ax,az,q, bx,r) Z_LDLDOT(x,p, ax,az,q, bx,r) #define XPRINT0(x,z,p) Z_PRINT(0,x,z,p) #define XPRINT1(x,z,p) Z_PRINT(1,x,z,p) #define XPRINT2(x,z,p) Z_PRINT(2,x,z,p) #define XPRINT3(x,z,p) Z_PRINT(3,x,z,p) #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/Makefile.in0000644000175000017500000003664314400675236020323 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/CHOLMOD/Include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_HEADERS = cholmod_blas.h cholmod_core.h cholmod_io64.h \ cholmod_camd.h cholmod_function.h cholmod_matrixops.h cholmod_check.h \ cholmod_gpu.h cholmod_modify.h cholmod_cholesky.h \ cholmod_gpu_kernels.h cholmod_partition.h cholmod_complexity.h \ cholmod.h cholmod_supernodal.h cholmod_config.h cholmod_internal.h \ cholmod_template.h EXTRA_DIST = License.txt all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Include/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool cscopelist-am ctags ctags-am distclean \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Include/License.txt0000664000175000017500000000041214224052371020355 00000000000000CHOLMOD/Include/* files. Copyright (C) 2005-2006, either Univ. of Florida or T. Davis, depending on the file. Refer to each include file in this directory; each file is licensed separately, according to the Module for which it contains definitions and prototypes. JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/0000755000175000017500000000000014400711326016654 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/Makefile.am0000664000175000017500000000074614224052371020643 00000000000000noinst_LTLIBRARIES = cholmodmatrix.la cholmodmatrix_la_SOURCES = cholmod_drop.c cholmod_scale.c \ cholmod_submatrix.c cholmod_horzcat.c cholmod_sdmult.c \ cholmod_symmetry.c cholmod_norm.c cholmod_ssmult.c cholmod_vertcat.c cholmodmatrix_la_CPPFLAGS = \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include cholmodmatrix_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt gpl.txt t_cholmod_sdmult.c JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/Makefile.in0000644000175000017500000010103414400675236020651 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/CHOLMOD/MatrixOps ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) cholmodmatrix_la_LIBADD = am_cholmodmatrix_la_OBJECTS = cholmodmatrix_la-cholmod_drop.lo \ cholmodmatrix_la-cholmod_scale.lo \ cholmodmatrix_la-cholmod_submatrix.lo \ cholmodmatrix_la-cholmod_horzcat.lo \ cholmodmatrix_la-cholmod_sdmult.lo \ cholmodmatrix_la-cholmod_symmetry.lo \ cholmodmatrix_la-cholmod_norm.lo \ cholmodmatrix_la-cholmod_ssmult.lo \ cholmodmatrix_la-cholmod_vertcat.lo cholmodmatrix_la_OBJECTS = $(am_cholmodmatrix_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = cholmodmatrix_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(cholmodmatrix_la_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/cholmodmatrix_la-cholmod_drop.Plo \ ./$(DEPDIR)/cholmodmatrix_la-cholmod_horzcat.Plo \ ./$(DEPDIR)/cholmodmatrix_la-cholmod_norm.Plo \ ./$(DEPDIR)/cholmodmatrix_la-cholmod_scale.Plo \ ./$(DEPDIR)/cholmodmatrix_la-cholmod_sdmult.Plo \ ./$(DEPDIR)/cholmodmatrix_la-cholmod_ssmult.Plo \ ./$(DEPDIR)/cholmodmatrix_la-cholmod_submatrix.Plo \ ./$(DEPDIR)/cholmodmatrix_la-cholmod_symmetry.Plo \ ./$(DEPDIR)/cholmodmatrix_la-cholmod_vertcat.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(cholmodmatrix_la_SOURCES) DIST_SOURCES = $(cholmodmatrix_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = cholmodmatrix.la cholmodmatrix_la_SOURCES = cholmod_drop.c cholmod_scale.c \ cholmod_submatrix.c cholmod_horzcat.c cholmod_sdmult.c \ cholmod_symmetry.c cholmod_norm.c cholmod_ssmult.c cholmod_vertcat.c cholmodmatrix_la_CPPFLAGS = \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include cholmodmatrix_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt gpl.txt t_cholmod_sdmult.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/MatrixOps/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/MatrixOps/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } cholmodmatrix.la: $(cholmodmatrix_la_OBJECTS) $(cholmodmatrix_la_DEPENDENCIES) $(EXTRA_cholmodmatrix_la_DEPENDENCIES) $(AM_V_CCLD)$(cholmodmatrix_la_LINK) $(cholmodmatrix_la_OBJECTS) $(cholmodmatrix_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmatrix_la-cholmod_drop.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmatrix_la-cholmod_horzcat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmatrix_la-cholmod_norm.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmatrix_la-cholmod_scale.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmatrix_la-cholmod_sdmult.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmatrix_la-cholmod_ssmult.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmatrix_la-cholmod_submatrix.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmatrix_la-cholmod_symmetry.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmatrix_la-cholmod_vertcat.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< cholmodmatrix_la-cholmod_drop.lo: cholmod_drop.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmatrix_la-cholmod_drop.lo -MD -MP -MF $(DEPDIR)/cholmodmatrix_la-cholmod_drop.Tpo -c -o cholmodmatrix_la-cholmod_drop.lo `test -f 'cholmod_drop.c' || echo '$(srcdir)/'`cholmod_drop.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmatrix_la-cholmod_drop.Tpo $(DEPDIR)/cholmodmatrix_la-cholmod_drop.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_drop.c' object='cholmodmatrix_la-cholmod_drop.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmatrix_la-cholmod_drop.lo `test -f 'cholmod_drop.c' || echo '$(srcdir)/'`cholmod_drop.c cholmodmatrix_la-cholmod_scale.lo: cholmod_scale.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmatrix_la-cholmod_scale.lo -MD -MP -MF $(DEPDIR)/cholmodmatrix_la-cholmod_scale.Tpo -c -o cholmodmatrix_la-cholmod_scale.lo `test -f 'cholmod_scale.c' || echo '$(srcdir)/'`cholmod_scale.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmatrix_la-cholmod_scale.Tpo $(DEPDIR)/cholmodmatrix_la-cholmod_scale.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_scale.c' object='cholmodmatrix_la-cholmod_scale.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmatrix_la-cholmod_scale.lo `test -f 'cholmod_scale.c' || echo '$(srcdir)/'`cholmod_scale.c cholmodmatrix_la-cholmod_submatrix.lo: cholmod_submatrix.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmatrix_la-cholmod_submatrix.lo -MD -MP -MF $(DEPDIR)/cholmodmatrix_la-cholmod_submatrix.Tpo -c -o cholmodmatrix_la-cholmod_submatrix.lo `test -f 'cholmod_submatrix.c' || echo '$(srcdir)/'`cholmod_submatrix.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmatrix_la-cholmod_submatrix.Tpo $(DEPDIR)/cholmodmatrix_la-cholmod_submatrix.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_submatrix.c' object='cholmodmatrix_la-cholmod_submatrix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmatrix_la-cholmod_submatrix.lo `test -f 'cholmod_submatrix.c' || echo '$(srcdir)/'`cholmod_submatrix.c cholmodmatrix_la-cholmod_horzcat.lo: cholmod_horzcat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmatrix_la-cholmod_horzcat.lo -MD -MP -MF $(DEPDIR)/cholmodmatrix_la-cholmod_horzcat.Tpo -c -o cholmodmatrix_la-cholmod_horzcat.lo `test -f 'cholmod_horzcat.c' || echo '$(srcdir)/'`cholmod_horzcat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmatrix_la-cholmod_horzcat.Tpo $(DEPDIR)/cholmodmatrix_la-cholmod_horzcat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_horzcat.c' object='cholmodmatrix_la-cholmod_horzcat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmatrix_la-cholmod_horzcat.lo `test -f 'cholmod_horzcat.c' || echo '$(srcdir)/'`cholmod_horzcat.c cholmodmatrix_la-cholmod_sdmult.lo: cholmod_sdmult.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmatrix_la-cholmod_sdmult.lo -MD -MP -MF $(DEPDIR)/cholmodmatrix_la-cholmod_sdmult.Tpo -c -o cholmodmatrix_la-cholmod_sdmult.lo `test -f 'cholmod_sdmult.c' || echo '$(srcdir)/'`cholmod_sdmult.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmatrix_la-cholmod_sdmult.Tpo $(DEPDIR)/cholmodmatrix_la-cholmod_sdmult.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_sdmult.c' object='cholmodmatrix_la-cholmod_sdmult.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmatrix_la-cholmod_sdmult.lo `test -f 'cholmod_sdmult.c' || echo '$(srcdir)/'`cholmod_sdmult.c cholmodmatrix_la-cholmod_symmetry.lo: cholmod_symmetry.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmatrix_la-cholmod_symmetry.lo -MD -MP -MF $(DEPDIR)/cholmodmatrix_la-cholmod_symmetry.Tpo -c -o cholmodmatrix_la-cholmod_symmetry.lo `test -f 'cholmod_symmetry.c' || echo '$(srcdir)/'`cholmod_symmetry.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmatrix_la-cholmod_symmetry.Tpo $(DEPDIR)/cholmodmatrix_la-cholmod_symmetry.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_symmetry.c' object='cholmodmatrix_la-cholmod_symmetry.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmatrix_la-cholmod_symmetry.lo `test -f 'cholmod_symmetry.c' || echo '$(srcdir)/'`cholmod_symmetry.c cholmodmatrix_la-cholmod_norm.lo: cholmod_norm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmatrix_la-cholmod_norm.lo -MD -MP -MF $(DEPDIR)/cholmodmatrix_la-cholmod_norm.Tpo -c -o cholmodmatrix_la-cholmod_norm.lo `test -f 'cholmod_norm.c' || echo '$(srcdir)/'`cholmod_norm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmatrix_la-cholmod_norm.Tpo $(DEPDIR)/cholmodmatrix_la-cholmod_norm.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_norm.c' object='cholmodmatrix_la-cholmod_norm.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmatrix_la-cholmod_norm.lo `test -f 'cholmod_norm.c' || echo '$(srcdir)/'`cholmod_norm.c cholmodmatrix_la-cholmod_ssmult.lo: cholmod_ssmult.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmatrix_la-cholmod_ssmult.lo -MD -MP -MF $(DEPDIR)/cholmodmatrix_la-cholmod_ssmult.Tpo -c -o cholmodmatrix_la-cholmod_ssmult.lo `test -f 'cholmod_ssmult.c' || echo '$(srcdir)/'`cholmod_ssmult.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmatrix_la-cholmod_ssmult.Tpo $(DEPDIR)/cholmodmatrix_la-cholmod_ssmult.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_ssmult.c' object='cholmodmatrix_la-cholmod_ssmult.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmatrix_la-cholmod_ssmult.lo `test -f 'cholmod_ssmult.c' || echo '$(srcdir)/'`cholmod_ssmult.c cholmodmatrix_la-cholmod_vertcat.lo: cholmod_vertcat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmatrix_la-cholmod_vertcat.lo -MD -MP -MF $(DEPDIR)/cholmodmatrix_la-cholmod_vertcat.Tpo -c -o cholmodmatrix_la-cholmod_vertcat.lo `test -f 'cholmod_vertcat.c' || echo '$(srcdir)/'`cholmod_vertcat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmatrix_la-cholmod_vertcat.Tpo $(DEPDIR)/cholmodmatrix_la-cholmod_vertcat.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_vertcat.c' object='cholmodmatrix_la-cholmod_vertcat.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmatrix_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmatrix_la-cholmod_vertcat.lo `test -f 'cholmod_vertcat.c' || echo '$(srcdir)/'`cholmod_vertcat.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_drop.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_horzcat.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_norm.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_scale.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_sdmult.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_ssmult.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_submatrix.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_symmetry.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_vertcat.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_drop.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_horzcat.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_norm.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_scale.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_sdmult.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_ssmult.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_submatrix.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_symmetry.Plo -rm -f ./$(DEPDIR)/cholmodmatrix_la-cholmod_vertcat.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/cholmod_drop.c0000664000175000017500000001210114224052371021410 00000000000000/* ========================================================================== */ /* === MatrixOps/cholmod_drop =============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/MatrixOps Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Drop small entries from A, and entries in the ignored part of A if A * is symmetric. None of the matrix operations drop small numerical entries * from a matrix, except for this one. NaN's and Inf's are kept. * * workspace: none * * Supports pattern and real matrices, complex and zomplex not supported. */ #ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" #include "cholmod_matrixops.h" /* ========================================================================== */ /* === cholmod_drop ========================================================= */ /* ========================================================================== */ int CHOLMOD(drop) ( /* ---- input ---- */ double tol, /* keep entries with absolute value > tol */ /* ---- in/out --- */ cholmod_sparse *A, /* matrix to drop entries from */ /* --------------- */ cholmod_common *Common ) { double aij ; double *Ax ; Int *Ap, *Ai, *Anz ; Int packed, i, j, nrow, ncol, p, pend, nz, values ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_REAL, FALSE) ; Common->status = CHOLMOD_OK ; ASSERT (CHOLMOD(dump_sparse) (A, "A predrop", Common) >= 0) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Ap = A->p ; Ai = A->i ; Ax = A->x ; Anz = A->nz ; packed = A->packed ; ncol = A->ncol ; nrow = A->nrow ; values = (A->xtype != CHOLMOD_PATTERN) ; nz = 0 ; if (values) { /* ------------------------------------------------------------------ */ /* drop small numerical entries from A, and entries in ignored part */ /* ------------------------------------------------------------------ */ if (A->stype > 0) { /* -------------------------------------------------------------- */ /* A is symmetric, with just upper triangular part stored */ /* -------------------------------------------------------------- */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; Ap [j] = nz ; for ( ; p < pend ; p++) { i = Ai [p] ; aij = Ax [p] ; if (i <= j && (fabs (aij) > tol || IS_NAN (aij))) { Ai [nz] = i ; Ax [nz] = aij ; nz++ ; } } } } else if (A->stype < 0) { /* -------------------------------------------------------------- */ /* A is symmetric, with just lower triangular part stored */ /* -------------------------------------------------------------- */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; Ap [j] = nz ; for ( ; p < pend ; p++) { i = Ai [p] ; aij = Ax [p] ; if (i >= j && (fabs (aij) > tol || IS_NAN (aij))) { Ai [nz] = i ; Ax [nz] = aij ; nz++ ; } } } } else { /* -------------------------------------------------------------- */ /* both parts of A present, just drop small entries */ /* -------------------------------------------------------------- */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; Ap [j] = nz ; for ( ; p < pend ; p++) { i = Ai [p] ; aij = Ax [p] ; if (fabs (aij) > tol || IS_NAN (aij)) { Ai [nz] = i ; Ax [nz] = aij ; nz++ ; } } } } Ap [ncol] = nz ; /* reduce A->i and A->x in size */ ASSERT (MAX (1,nz) <= A->nzmax) ; CHOLMOD(reallocate_sparse) (nz, A, Common) ; ASSERT (Common->status >= CHOLMOD_OK) ; } else { /* ------------------------------------------------------------------ */ /* consider only the pattern of A */ /* ------------------------------------------------------------------ */ /* Note that cholmod_band_inplace calls cholmod_reallocate_sparse */ if (A->stype > 0) { CHOLMOD(band_inplace) (0, ncol, 0, A, Common) ; } else if (A->stype < 0) { CHOLMOD(band_inplace) (-nrow, 0, 0, A, Common) ; } } ASSERT (CHOLMOD(dump_sparse) (A, "A dropped", Common) >= 0) ; return (TRUE) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/cholmod_scale.c0000664000175000017500000001442114224052371021542 00000000000000/* ========================================================================== */ /* === MatrixOps/cholmod_scale ============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/MatrixOps Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* scale a matrix: A = diag(s)*A, A*diag(s), s*A, or diag(s)*A*diag(s) * * A can be of any type (packed/unpacked, upper/lower/unsymmetric). * The symmetry of A is ignored; all entries in the matrix are modified. * * If A is m-by-n unsymmetric but scaled symmtrically, the result is * A = diag (s (1:m)) * A * diag (s (1:n)). * * Note: diag(s) should be interpretted as spdiags(s,0,n,n) where n=length(s). * * Row or column scaling of a symmetric matrix still results in a symmetric * matrix, since entries are still ignored by other routines. * For example, when row-scaling a symmetric matrix where just the upper * triangular part is stored (and lower triangular entries ignored) * A = diag(s)*triu(A) is performed, where the result A is also * symmetric-upper. This has the effect of modifying the implicit lower * triangular part. In MATLAB notation: * * U = diag(s)*triu(A) ; * L = tril (U',-1) * A = L + U ; * * The scale parameter determines the kind of scaling to perform: * * CHOLMOD_SCALAR: s[0]*A * CHOLMOD_ROW: diag(s)*A * CHOLMOD_COL: A*diag(s) * CHOLMOD_SYM: diag(s)*A*diag(s) * * The size of S depends on the scale parameter: * * CHOLMOD_SCALAR: size 1 * CHOLMOD_ROW: size nrow-by-1 or 1-by-nrow * CHOLMOD_COL: size ncol-by-1 or 1-by-ncol * CHOLMOD_SYM: size max(nrow,ncol)-by-1, or 1-by-max(nrow,ncol) * * workspace: none * * Only real matrices are supported. */ #ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" #include "cholmod_matrixops.h" /* ========================================================================== */ /* === cholmod_scale ======================================================== */ /* ========================================================================== */ int CHOLMOD(scale) ( /* ---- input ---- */ cholmod_dense *S, /* scale factors (scalar or vector) */ int scale, /* type of scaling to compute */ /* ---- in/out --- */ cholmod_sparse *A, /* matrix to scale */ /* --------------- */ cholmod_common *Common ) { double t ; double *Ax, *s ; Int *Ap, *Anz, *Ai ; Int packed, j, ncol, nrow, p, pend, sncol, snrow, nn, ok ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (S, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_REAL, CHOLMOD_REAL, FALSE) ; RETURN_IF_XTYPE_INVALID (S, CHOLMOD_REAL, CHOLMOD_REAL, FALSE) ; ncol = A->ncol ; nrow = A->nrow ; sncol = S->ncol ; snrow = S->nrow ; if (scale == CHOLMOD_SCALAR) { ok = (snrow == 1 && sncol == 1) ; } else if (scale == CHOLMOD_ROW) { ok = (snrow == nrow && sncol == 1) || (snrow == 1 && sncol == nrow) ; } else if (scale == CHOLMOD_COL) { ok = (snrow == ncol && sncol == 1) || (snrow == 1 && sncol == ncol) ; } else if (scale == CHOLMOD_SYM) { nn = MAX (nrow, ncol) ; ok = (snrow == nn && sncol == 1) || (snrow == 1 && sncol == nn) ; } else { /* scale invalid */ ERROR (CHOLMOD_INVALID, "invalid scaling option") ; return (FALSE) ; } if (!ok) { /* S is wrong size */ ERROR (CHOLMOD_INVALID, "invalid scale factors") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; packed = A->packed ; s = S->x ; /* ---------------------------------------------------------------------- */ /* scale the matrix */ /* ---------------------------------------------------------------------- */ if (scale == CHOLMOD_ROW) { /* ------------------------------------------------------------------ */ /* A = diag(s)*A, row scaling */ /* ------------------------------------------------------------------ */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { Ax [p] *= s [Ai [p]] ; } } } else if (scale == CHOLMOD_COL) { /* ------------------------------------------------------------------ */ /* A = A*diag(s), column scaling */ /* ------------------------------------------------------------------ */ for (j = 0 ; j < ncol ; j++) { t = s [j] ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { Ax [p] *= t ; } } } else if (scale == CHOLMOD_SYM) { /* ------------------------------------------------------------------ */ /* A = diag(s)*A*diag(s), symmetric scaling */ /* ------------------------------------------------------------------ */ for (j = 0 ; j < ncol ; j++) { t = s [j] ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { Ax [p] *= t * s [Ai [p]] ; } } } else if (scale == CHOLMOD_SCALAR) { /* ------------------------------------------------------------------ */ /* A = s[0] * A, scalar scaling */ /* ------------------------------------------------------------------ */ t = s [0] ; for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { Ax [p] *= t ; } } } ASSERT (CHOLMOD(dump_sparse) (A, "A scaled", Common) >= 0) ; return (TRUE) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/cholmod_submatrix.c0000664000175000017500000003167014224052371022476 00000000000000/* ========================================================================== */ /* === MatrixOps/cholmod_submatrix ========================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/MatrixOps Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* C = A (rset,cset), where C becomes length(rset)-by-length(cset) in dimension. * rset and cset can have duplicate entries. A and C must be unsymmetric. C * is packed. If the sorted flag is TRUE on input, or rset is sorted and A is * sorted, then C is sorted; otherwise C is unsorted. * * A NULL rset or cset means "[ ]" in MATLAB notation. * If the length of rset or cset is negative, it denotes ":" in MATLAB notation. * * For permuting a matrix, this routine is an alternative to cholmod_ptranspose * (which permutes and transposes a matrix and can work on symmetric matrices). * * The time taken by this routine is O(A->nrow) if the Common workspace needs * to be initialized, plus O(C->nrow + C->ncol + nnz (A (:,cset))). Thus, if C * is small and the workspace is not initialized, the time can be dominated by * the call to cholmod_allocate_work. However, once the workspace is * allocated, subsequent calls take less time. * * workspace: Iwork (max (A->nrow + length (rset), length (cset))). * allocates temporary copy of C if it is to be returned sorted. * * Future work: A common case occurs where A has sorted columns, and rset is in * the form lo:hi in MATLAB notation. This routine could exploit that case * to run even faster when the matrix is sorted, particularly when lo is small. * * Only pattern and real matrices are supported. Complex and zomplex matrices * are supported only when "values" is FALSE. */ #ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" #include "cholmod_matrixops.h" /* ========================================================================== */ /* === check_subset ========================================================= */ /* ========================================================================== */ /* Check the rset or cset, and return TRUE if valid, FALSE if invalid */ static int check_subset (Int *set, Int len, Int n) { Int k ; if (set == NULL) { return (TRUE) ; } for (k = 0 ; k < len ; k++) { if (set [k] < 0 || set [k] >= n) { return (FALSE) ; } } return (TRUE) ; } /* ========================================================================== */ /* === cholmod_submatrix ==================================================== */ /* ========================================================================== */ cholmod_sparse *CHOLMOD(submatrix) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to subreference */ Int *rset, /* set of row indices, duplicates OK */ SuiteSparse_long rsize, /* size of rset, or -1 for ":" */ Int *cset, /* set of column indices, duplicates OK */ SuiteSparse_long csize, /* size of cset, or -1 for ":" */ int values, /* if TRUE compute the numerical values of C */ int sorted, /* if TRUE then return C with sorted columns */ /* --------------- */ cholmod_common *Common ) { double aij = 0 ; double *Ax, *Cx ; Int *Ap, *Ai, *Anz, *Ci, *Cp, *Head, *Rlen, *Rnext, *Iwork ; cholmod_sparse *C ; Int packed, ancol, anrow, cnrow, cncol, nnz, i, j, csorted, ilast, p, pend, pdest, ci, cj, head, nr, nc ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; values = (values && (A->xtype != CHOLMOD_PATTERN)) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; if (A->stype != 0) { /* A must be unsymmetric */ ERROR (CHOLMOD_INVALID, "symmetric upper or lower case not supported") ; return (NULL) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ ancol = A->ncol ; anrow = A->nrow ; nr = rsize ; nc = csize ; if (rset == NULL) { /* nr = 0 denotes rset = [ ], nr < 0 denotes rset = 0:anrow-1 */ nr = (nr < 0) ? (-1) : 0 ; } if (cset == NULL) { /* nr = 0 denotes cset = [ ], nr < 0 denotes cset = 0:ancol-1 */ nc = (nc < 0) ? (-1) : 0 ; } cnrow = (nr < 0) ? anrow : nr ; /* negative rset means rset = 0:anrow-1 */ cncol = (nc < 0) ? ancol : nc ; /* negative cset means cset = 0:ancol-1 */ if (nr < 0 && nc < 0) { /* ------------------------------------------------------------------ */ /* C = A (:,:), use cholmod_copy instead */ /* ------------------------------------------------------------------ */ /* workspace: Iwork (max (C->nrow,C->ncol)) */ PRINT1 (("submatrix C = A (:,:)\n")) ; C = CHOLMOD(copy) (A, 0, values, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } return (C) ; } PRINT1 (("submatrix nr "ID" nc "ID" Cnrow "ID" Cncol "ID"" " Anrow "ID" Ancol "ID"\n", nr, nc, cnrow, cncol, anrow, ancol)) ; /* s = MAX3 (anrow+MAX(0,nr), cncol, cnrow) ; */ s = CHOLMOD(add_size_t) (anrow, MAX (0,nr), &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (NULL) ; } s = MAX3 (s, ((size_t) cncol), ((size_t) cnrow)) ; CHOLMOD(allocate_work) (anrow, s, 0, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; packed = A->packed ; /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Head = Common->Head ; /* size anrow */ Iwork = Common->Iwork ; Rlen = Iwork ; /* size anrow (i/i/l) */ Rnext = Iwork + anrow ; /* size nr (i/i/l), not used if nr < 0 */ /* ---------------------------------------------------------------------- */ /* construct inverse of rset and compute nnz (C) */ /* ---------------------------------------------------------------------- */ PRINT1 (("nr "ID" nc "ID"\n", nr, nc)) ; PRINT1 (("anrow "ID" ancol "ID"\n", anrow, ancol)) ; PRINT1 (("cnrow "ID" cncol "ID"\n", cnrow, cncol)) ; DEBUG (for (i = 0 ; i < nr ; i++) PRINT2 (("rset ["ID"] = "ID"\n", i, rset [i]))); DEBUG (for (i = 0 ; i < nc ; i++) PRINT2 (("cset ["ID"] = "ID"\n", i, cset [i]))); /* C is sorted if A and rset are sorted, or if C has one row or less */ csorted = A->sorted || (cnrow <= 1) ; if (!check_subset (rset, nr, anrow)) { ERROR (CHOLMOD_INVALID, "invalid rset") ; return (NULL) ; } if (!check_subset (cset, nc, ancol)) { ERROR (CHOLMOD_INVALID, "invalid cset") ; return (NULL) ; } nnz = 0 ; if (nr < 0) { /* C = A (:,cset) where cset = [ ] or cset is not empty */ ASSERT (IMPLIES (cncol > 0, cset != NULL)) ; for (cj = 0 ; cj < cncol ; cj++) { /* construct column cj of C, which is column j of A */ j = cset [cj] ; nnz += (packed) ? (Ap [j+1] - Ap [j]) : MAX (0, Anz [j]) ; } } else { /* C = A (rset,cset), where rset is not empty but cset might be empty */ /* create link lists in reverse order to preserve natural order */ ilast = anrow ; for (ci = nr-1 ; ci >= 0 ; ci--) { /* row i of A becomes row ci of C; add ci to ith link list */ i = rset [ci] ; head = Head [i] ; Rlen [i] = (head == EMPTY) ? 1 : (Rlen [i] + 1) ; Rnext [ci] = head ; Head [i] = ci ; if (i > ilast) { /* row indices in columns of C will not be sorted */ csorted = FALSE ; } ilast = i ; } #ifndef NDEBUG for (i = 0 ; i < anrow ; i++) { Int k = 0 ; Int rlen = (Head [i] != EMPTY) ? Rlen [i] : -1 ; PRINT1 (("Row "ID" Rlen "ID": ", i, rlen)) ; for (ci = Head [i] ; ci != EMPTY ; ci = Rnext [ci]) { k++ ; PRINT2 ((""ID" ", ci)) ; } PRINT1 (("\n")) ; ASSERT (IMPLIES (Head [i] != EMPTY, k == Rlen [i])) ; } #endif /* count nonzeros in C */ for (cj = 0 ; cj < cncol ; cj++) { /* count rows in column cj of C, which is column j of A */ j = (nc < 0) ? cj : (cset [cj]) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { /* row i of A becomes multiple rows (ci) of C */ i = Ai [p] ; ASSERT (i >= 0 && i < anrow) ; if (Head [i] != EMPTY) { nnz += Rlen [i] ; } } } } PRINT1 (("nnz (C) "ID"\n", nnz)) ; /* rset and cset are now valid */ DEBUG (CHOLMOD(dump_subset) (rset, rsize, anrow, "rset", Common)) ; DEBUG (CHOLMOD(dump_subset) (cset, csize, ancol, "cset", Common)) ; /* ---------------------------------------------------------------------- */ /* allocate C */ /* ---------------------------------------------------------------------- */ C = CHOLMOD(allocate_sparse) (cnrow, cncol, nnz, csorted, TRUE, 0, values ? A->xtype : CHOLMOD_PATTERN, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ for (i = 0 ; i < anrow ; i++) { Head [i] = EMPTY ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; return (NULL) ; } Cp = C->p ; Ci = C->i ; Cx = C->x ; /* ---------------------------------------------------------------------- */ /* C = A (rset,cset) */ /* ---------------------------------------------------------------------- */ pdest = 0 ; if (nnz == 0) { /* C has no nonzeros */ for (cj = 0 ; cj <= cncol ; cj++) { Cp [cj] = 0 ; } } else if (nr < 0) { /* C = A (:,cset), where cset is not empty */ for (cj = 0 ; cj < cncol ; cj++) { /* construct column cj of C, which is column j of A */ PRINT1 (("construct cj = j = "ID"\n", cj)) ; j = cset [cj] ; Cp [cj] = pdest ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { Ci [pdest] = Ai [p] ; if (values) { Cx [pdest] = Ax [p] ; } pdest++ ; ASSERT (pdest <= nnz) ; } } } else { /* C = A (rset,cset), where rset is not empty but cset might be empty */ for (cj = 0 ; cj < cncol ; cj++) { /* construct column cj of C, which is column j of A */ PRINT1 (("construct cj = "ID"\n", cj)) ; j = (nc < 0) ? cj : (cset [cj]) ; PRINT1 (("cj = "ID"\n", j)) ; Cp [cj] = pdest ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { /* row (Ai [p]) of A becomes multiple rows (ci) of C */ PRINT2 (("i: "ID" becomes: ", Ai [p])) ; if (values) { aij = Ax [p] ; } for (ci = Head [Ai [p]] ; ci != EMPTY ; ci = Rnext [ci]) { PRINT3 ((""ID" ", ci)) ; Ci [pdest] = ci ; if (values) { Cx [pdest] = aij ; } pdest++ ; ASSERT (pdest <= nnz) ; } PRINT2 (("\n")) ; } } } Cp [cncol] = pdest ; ASSERT (nnz == pdest) ; /* ---------------------------------------------------------------------- */ /* clear workspace */ /* ---------------------------------------------------------------------- */ for (ci = 0 ; ci < nr ; ci++) { Head [rset [ci]] = EMPTY ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* ---------------------------------------------------------------------- */ /* sort C, if requested */ /* ---------------------------------------------------------------------- */ ASSERT (CHOLMOD(dump_sparse) (C , "C before sort", Common) >= 0) ; if (sorted && !csorted) { /* workspace: Iwork (max (C->nrow,C->ncol)) */ if (!CHOLMOD(sort) (C, Common)) { /* out of memory */ CHOLMOD(free_sparse) (&C, Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; return (NULL) ; } } /* ---------------------------------------------------------------------- */ /* return result */ /* ---------------------------------------------------------------------- */ ASSERT (CHOLMOD(dump_sparse) (C , "Final C", Common) >= 0) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; return (C) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/cholmod_horzcat.c0000664000175000017500000001424614224052371022132 00000000000000/* ========================================================================== */ /* === MatrixOps/cholmod_horzcat ============================================ */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/MatrixOps Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Horizontal concatenation, C = [A , B] in MATLAB notation. * * A and B can be up/lo/unsym; C is unsymmetric and packed. * A and B must have the same number of rows. * C is sorted if both A and B are sorted. * * workspace: Iwork (max (A->nrow, A->ncol, B->nrow, B->ncol)). * allocates temporary copies of A and B if they are symmetric. * * A and B must have the same numeric xtype, unless values is FALSE. * A and B cannot be complex or zomplex, unless values is FALSE. */ #ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" #include "cholmod_matrixops.h" /* ========================================================================== */ /* === cholmod_horzcat ====================================================== */ /* ========================================================================== */ cholmod_sparse *CHOLMOD(horzcat) ( /* ---- input ---- */ cholmod_sparse *A, /* left matrix to concatenate */ cholmod_sparse *B, /* right matrix to concatenate */ int values, /* if TRUE compute the numerical values of C */ /* --------------- */ cholmod_common *Common ) { double *Ax, *Bx, *Cx ; Int *Ap, *Ai, *Anz, *Bp, *Bi, *Bnz, *Cp, *Ci ; cholmod_sparse *C, *A2, *B2 ; Int apacked, bpacked, ancol, bncol, ncol, nrow, anz, bnz, nz, j, p, pend, pdest ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; RETURN_IF_NULL (B, NULL) ; values = values && (A->xtype != CHOLMOD_PATTERN) && (B->xtype != CHOLMOD_PATTERN) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; RETURN_IF_XTYPE_INVALID (B, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; if (A->nrow != B->nrow) { /* A and B must have the same number of rows */ ERROR (CHOLMOD_INVALID, "A and B must have same # rows") ; return (NULL) ; } /* A and B must have the same numerical type if values is TRUE (both must * be CHOLMOD_REAL, this is implicitly checked above) */ Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ ancol = A->ncol ; bncol = B->ncol ; nrow = A->nrow ; CHOLMOD(allocate_work) (0, MAX3 (nrow, ancol, bncol), 0, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ /* convert A to unsymmetric, if necessary */ A2 = NULL ; if (A->stype != 0) { /* workspace: Iwork (max (A->nrow,A->ncol)) */ A2 = CHOLMOD(copy) (A, 0, values, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } A = A2 ; } /* convert B to unsymmetric, if necessary */ B2 = NULL ; if (B->stype != 0) { /* workspace: Iwork (max (B->nrow,B->ncol)) */ B2 = CHOLMOD(copy) (B, 0, values, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ CHOLMOD(free_sparse) (&A2, Common) ; return (NULL) ; } B = B2 ; } Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; apacked = A->packed ; Bp = B->p ; Bnz = B->nz ; Bi = B->i ; Bx = B->x ; bpacked = B->packed ; /* ---------------------------------------------------------------------- */ /* allocate C */ /* ---------------------------------------------------------------------- */ anz = CHOLMOD(nnz) (A, Common) ; bnz = CHOLMOD(nnz) (B, Common) ; ncol = ancol + bncol ; nz = anz + bnz ; C = CHOLMOD(allocate_sparse) (nrow, ncol, nz, A->sorted && B->sorted, TRUE, 0, values ? A->xtype : CHOLMOD_PATTERN, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; return (NULL) ; } Cp = C->p ; Ci = C->i ; Cx = C->x ; /* ---------------------------------------------------------------------- */ /* C = [A , B] */ /* ---------------------------------------------------------------------- */ pdest = 0 ; /* copy A as the first A->ncol columns of C */ for (j = 0 ; j < ancol ; j++) { /* A(:,j) is the jth column of C */ p = Ap [j] ; pend = (apacked) ? (Ap [j+1]) : (p + Anz [j]) ; Cp [j] = pdest ; for ( ; p < pend ; p++) { Ci [pdest] = Ai [p] ; if (values) Cx [pdest] = Ax [p] ; pdest++ ; } } /* copy B as the next B->ncol columns of C */ for (j = 0 ; j < bncol ; j++) { /* B(:,j) is the (ancol+j)th column of C */ p = Bp [j] ; pend = (bpacked) ? (Bp [j+1]) : (p + Bnz [j]) ; Cp [ancol + j] = pdest ; for ( ; p < pend ; p++) { Ci [pdest] = Bi [p] ; if (values) Cx [pdest] = Bx [p] ; pdest++ ; } } Cp [ncol] = pdest ; ASSERT (pdest == anz + bnz) ; /* ---------------------------------------------------------------------- */ /* free the unsymmetric copies of A and B, and return C */ /* ---------------------------------------------------------------------- */ CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; return (C) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/cholmod_sdmult.c0000664000175000017500000001242614224052371021766 00000000000000/* ========================================================================== */ /* === MatrixOps/cholmod_sdmult ============================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/MatrixOps Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Sparse matrix times dense matrix: * Y = alpha*(A*X) + beta*Y or Y = alpha*(A'*X) + beta*Y, * where A is sparse and X and Y are dense. * * when using A, X has A->ncol columns and Y has A->nrow rows * when using A', X has A->nrow columns and Y has A->ncol rows * * workspace: none in Common. Temporary workspace of size 4*(X->nrow) is used * if A is stored in symmetric form and X has four columns or more. If the * workspace is not available, a slower method is used instead that requires * no workspace. * * transpose = 0: use A * otherwise, use A' (complex conjugate transpose) * * transpose is ignored if the matrix is symmetric or Hermitian. * (the array transpose A.' is not supported). * * Supports real, complex, and zomplex matrices, but the xtypes of A, X, and Y * must all match. */ #ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" #include "cholmod_matrixops.h" /* ========================================================================== */ /* === TEMPLATE ============================================================= */ /* ========================================================================== */ #define REAL #include "t_cholmod_sdmult.c" #define COMPLEX #include "t_cholmod_sdmult.c" #define ZOMPLEX #include "t_cholmod_sdmult.c" /* ========================================================================== */ /* === cholmod_sdmult ======================================================= */ /* ========================================================================== */ int CHOLMOD(sdmult) ( /* ---- input ---- */ cholmod_sparse *A, /* sparse matrix to multiply */ int transpose, /* use A if 0, otherwise use A' */ double alpha [2], /* scale factor for A */ double beta [2], /* scale factor for Y */ cholmod_dense *X, /* dense matrix to multiply */ /* ---- in/out --- */ cholmod_dense *Y, /* resulting dense matrix */ /* --------------- */ cholmod_common *Common ) { double *w ; size_t nx, ny ; Int e ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (X, FALSE) ; RETURN_IF_NULL (Y, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (Y, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; ny = transpose ? A->ncol : A->nrow ; /* required length of Y */ nx = transpose ? A->nrow : A->ncol ; /* required length of X */ if (X->nrow != nx || X->ncol != Y->ncol || Y->nrow != ny) { /* X and/or Y have the wrong dimension */ ERROR (CHOLMOD_INVALID, "X and/or Y have wrong dimensions") ; return (FALSE) ; } if (A->xtype != X->xtype || A->xtype != Y->xtype) { ERROR (CHOLMOD_INVALID, "A, X, and Y must have same xtype") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace, if required */ /* ---------------------------------------------------------------------- */ w = NULL ; e = (A->xtype == CHOLMOD_REAL ? 1:2) ; if (A->stype && X->ncol >= 4) { w = CHOLMOD(malloc) (nx, 4*e*sizeof (double), Common) ; } if (Common->status < CHOLMOD_OK) { return (FALSE) ; /* out of memory */ } /* ---------------------------------------------------------------------- */ /* Y = alpha*op(A)*X + beta*Y via template routine */ /* ---------------------------------------------------------------------- */ ASSERT (CHOLMOD(dump_sparse) (A, "A", Common) >= 0) ; DEBUG (CHOLMOD(dump_dense) (X, "X", Common)) ; DEBUG (if (IS_NONZERO (beta [0]) || (IS_NONZERO (beta [1]) && A->xtype != CHOLMOD_REAL)) CHOLMOD(dump_dense) (Y, "Y", Common)) ; switch (A->xtype) { case CHOLMOD_REAL: r_cholmod_sdmult (A, transpose, alpha, beta, X, Y, w) ; break ; case CHOLMOD_COMPLEX: c_cholmod_sdmult (A, transpose, alpha, beta, X, Y, w) ; break ; case CHOLMOD_ZOMPLEX: z_cholmod_sdmult (A, transpose, alpha, beta, X, Y, w) ; break ; } /* ---------------------------------------------------------------------- */ /* free workspace */ /* ---------------------------------------------------------------------- */ CHOLMOD(free) (4*nx, e*sizeof (double), w, Common) ; DEBUG (CHOLMOD(dump_dense) (Y, "Y", Common)) ; return (TRUE) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/cholmod_symmetry.c0000664000175000017500000004022614224052371022346 00000000000000/* ========================================================================== */ /* === MatrixOps/cholmod_symmetry =========================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/MatrixOps Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Determines if a sparse matrix is rectangular, unsymmetric, symmetric, * skew-symmetric, or Hermitian. It does so by looking at its numerical values * of both upper and lower triangular parts of a CHOLMOD "unsymmetric" * matrix, where A->stype == 0. The transpose of A is NOT constructed. * * If not unsymmetric, it also determines if the matrix has a diagonal whose * entries are all real and positive (and thus a candidate for sparse Cholesky * if A->stype is changed to a nonzero value). * * Note that a Matrix Market "general" matrix is either rectangular or * unsymmetric. * * The row indices in the column of each matrix MUST be sorted for this function * to work properly (A->sorted must be TRUE). This routine returns EMPTY if * A->stype is not zero, or if A->sorted is FALSE. The exception to this rule * is if A is rectangular. * * If option == 0, then this routine returns immediately when it finds a * non-positive diagonal entry (or one with nonzero imaginary part). If the * matrix is not a candidate for sparse Cholesky, it returns the value * CHOLMOD_MM_UNSYMMETRIC, even if the matrix might in fact be symmetric or * Hermitian. * * This routine is useful inside the MATLAB backslash, which must look at an * arbitrary matrix (A->stype == 0) and determine if it is a candidate for * sparse Cholesky. In that case, option should be 0. * * This routine is also useful when writing a MATLAB matrix to a file in * Rutherford/Boeing or Matrix Market format. Those formats require a * determination as to the symmetry of the matrix, and thus this routine should * not return upon encountering the first non-positive diagonal. In this case, * option should be 1. * * If option is 2, this function can be used to compute the numerical and * pattern symmetry, where 0 is a completely unsymmetric matrix, and 1 is a * perfectly symmetric matrix. This option is used when computing the following * statistics for the matrices in the UF Sparse Matrix Collection. * * numerical symmetry: number of matched offdiagonal nonzeros over * the total number of offdiagonal entries. A real entry A(i,j), i ~= j, * is matched if A (j,i) == A (i,j), but this is only counted if both * A(j,i) and A(i,j) are nonzero. This does not depend on Z. * (If A is complex, then the above test is modified; A (i,j) is matched * if conj (A (j,i)) == A (i,j)). * * Then numeric symmetry = xmatched / nzoffdiag, or 1 if nzoffdiag = 0. * * pattern symmetry: number of matched offdiagonal entries over the * total number of offdiagonal entries. An entry A(i,j), i ~= j, is * matched if A (j,i) is also an entry. * * Then pattern symmetry = pmatched / nzoffdiag, or 1 if nzoffdiag = 0. * * The symmetry of a matrix with no offdiagonal entries is equal to 1. * * A workspace of size ncol integers is allocated; EMPTY is returned if this * allocation fails. * * Summary of return values: * * EMPTY (-1) out of memory, stype not zero, A not sorted * CHOLMOD_MM_RECTANGULAR 1 A is rectangular * CHOLMOD_MM_UNSYMMETRIC 2 A is unsymmetric * CHOLMOD_MM_SYMMETRIC 3 A is symmetric, but with non-pos. diagonal * CHOLMOD_MM_HERMITIAN 4 A is Hermitian, but with non-pos. diagonal * CHOLMOD_MM_SKEW_SYMMETRIC 5 A is skew symmetric * CHOLMOD_MM_SYMMETRIC_POSDIAG 6 A is symmetric with positive diagonal * CHOLMOD_MM_HERMITIAN_POSDIAG 7 A is Hermitian with positive diagonal * * See also the spsym mexFunction, which is a MATLAB interface for this code. * * If the matrix is a candidate for sparse Cholesky, it will return a result * CHOLMOD_MM_SYMMETRIC_POSDIAG if real, or CHOLMOD_MM_HERMITIAN_POSDIAG if * complex. Otherwise, it will return a value less than this. This is true * regardless of the value of the option parameter. */ #ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" #include "cholmod_matrixops.h" /* ========================================================================== */ /* === get_value ============================================================ */ /* ========================================================================== */ /* Get the pth value in the matrix. */ static void get_value ( double *Ax, /* real values, or real/imag. for CHOLMOD_COMPLEX type */ double *Az, /* imaginary values for CHOLMOD_ZOMPLEX type */ Int p, /* get the pth entry */ Int xtype, /* A->xtype: pattern, real, complex, or zomplex */ double *x, /* the real part */ double *z /* the imaginary part */ ) { switch (xtype) { case CHOLMOD_PATTERN: *x = 1 ; *z = 0 ; break ; case CHOLMOD_REAL: *x = Ax [p] ; *z = 0 ; break ; case CHOLMOD_COMPLEX: *x = Ax [2*p] ; *z = Ax [2*p+1] ; break ; case CHOLMOD_ZOMPLEX: *x = Ax [p] ; *z = Az [p] ; break ; } } /* ========================================================================== */ /* === cholmod_symmetry ===================================================== */ /* ========================================================================== */ /* Determine the symmetry of a matrix, and check its diagonal. * * option 0: Do not count # of matched pairs. Quick return if the * the matrix has a zero, negative, or imaginary diagonal entry. * * option 1: Do not count # of matched pairs. Do not return quickly if * the matrix has a zero, negative, or imaginary diagonal entry. * The result 1 to 7 is accurately computed: * * EMPTY (-1) out of memory, stype not zero, A not sorted * CHOLMOD_MM_RECTANGULAR 1 A is rectangular * CHOLMOD_MM_UNSYMMETRIC 2 A is unsymmetric * CHOLMOD_MM_SYMMETRIC 3 A is symmetric, with non-pos. diagonal * CHOLMOD_MM_HERMITIAN 4 A is Hermitian, with non-pos. diagonal * CHOLMOD_MM_SKEW_SYMMETRIC 5 A is skew symmetric * CHOLMOD_MM_SYMMETRIC_POSDIAG 6 is symmetric with positive diagonal * CHOLMOD_MM_HERMITIAN_POSDIAG 7 A is Hermitian with positive diagonal * * The routine returns as soon as the above is determined (that is, it * can return as soon as it determines the matrix is unsymmetric). * * option 2: All of the above, but also compute the number of matched off- * diagonal entries (of two types). xmatched is the number of * nonzero entries for which A(i,j) = conj(A(j,i)). pmatched is * the number of entries (i,j) for which A(i,j) and A(j,i) are both in * the pattern of A (the value doesn't matter). nzoffdiag is the total * number of off-diagonal entries in the pattern. nzdiag is the number of * diagonal entries in the pattern. * * With option 0 or 1, or if the matrix is rectangular, xmatched, pmatched, * nzoffdiag, and nzdiag are not computed. * * Note that a matched pair, A(i,j) and A(j,i) for i != j, is counted twice * (once per entry). */ int CHOLMOD(symmetry) ( /* ---- input ---- */ cholmod_sparse *A, int option, /* option 0, 1, or 2 (see above) */ /* ---- output --- */ /* outputs ignored if any are NULL */ Int *p_xmatched, /* # of matched numerical entries */ Int *p_pmatched, /* # of matched entries in pattern */ Int *p_nzoffdiag, /* # of off diagonal entries */ Int *p_nzdiag, /* # of diagonal entries */ /* --------------- */ cholmod_common *Common ) { double aij_real = 0, aij_imag = 0, aji_real = 0, aji_imag = 0 ; double *Ax, *Az ; Int *Ap, *Ai, *Anz, *munch ; Int packed, nrow, ncol, xtype, is_symmetric, is_skew, is_hermitian, posdiag, j, p, pend, i, piend, result, xmatched, pmatched, nzdiag, i2, found ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (A, EMPTY) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, EMPTY) ; Common->status = CHOLMOD_OK ; ASSERT (CHOLMOD(dump_sparse) (A, "cholmod_symmetry", Common) >= 0) ; if (p_xmatched == NULL || p_pmatched == NULL || p_nzoffdiag == NULL || p_nzdiag == NULL) { /* option 2 is not performed if any output parameter is NULL */ option = MAX (option, 1) ; } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Ap = A->p ; Ai = A->i ; Ax = A->x ; Az = A->z ; Anz = A->nz ; packed = A->packed ; ncol = A->ncol ; nrow = A->nrow ; xtype = A->xtype ; /* ---------------------------------------------------------------------- */ /* check if rectangular, unsorted, or stype is not zero */ /* ---------------------------------------------------------------------- */ if (nrow != ncol) { /* matrix is rectangular */ return (CHOLMOD_MM_RECTANGULAR) ; } if (!(A->sorted) || A->stype != 0) { /* this function cannot determine the type or symmetry */ return (EMPTY) ; } /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* this function requires uninitialized Int workspace of size ncol */ CHOLMOD(allocate_work) (0, ncol, 0, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (EMPTY) ; } munch = Common->Iwork ; /* the munch array is size ncol */ /* ---------------------------------------------------------------------- */ /* determine symmetry of a square matrix */ /* ---------------------------------------------------------------------- */ /* a complex or zomplex matrix is Hermitian until proven otherwise */ is_hermitian = (xtype >= CHOLMOD_COMPLEX) ; /* any matrix is symmetric until proven otherwise */ is_symmetric = TRUE ; /* a non-pattern matrix is skew-symmetric until proven otherwise */ is_skew = (xtype != CHOLMOD_PATTERN) ; /* a matrix has positive diagonal entries until proven otherwise */ posdiag = TRUE ; /* munch pointers start at the top of each column */ for (j = 0 ; j < ncol ; j++) { munch [j] = Ap [j] ; } xmatched = 0 ; pmatched = 0 ; nzdiag = 0 ; for (j = 0 ; j < ncol ; j++) /* examine each column of A */ { /* ------------------------------------------------------------------ */ /* look at the entire munch column j */ /* ------------------------------------------------------------------ */ /* start at the munch point of column j, and go to end of the column */ p = munch [j] ; pend = (packed) ? (Ap [j+1]) : (Ap [j] + Anz [j]) ; for ( ; p < pend ; p++) { /* get the row index of A(i,j) */ i = Ai [p] ; if (i < j) { /* ---------------------------------------------------------- */ /* A(i,j) in triu(A), but matching A(j,i) not in tril(A) */ /* ---------------------------------------------------------- */ /* entry A(i,j) is unmatched; it appears in the upper triangular * part, but not the lower triangular part. The matrix is * unsymmetric. */ is_hermitian = FALSE ; is_symmetric = FALSE ; is_skew = FALSE ; } else if (i == j) { /* ---------------------------------------------------------- */ /* the diagonal A(j,j) is present; check its value */ /* ---------------------------------------------------------- */ get_value (Ax, Az, p, xtype, &aij_real, &aij_imag) ; if (aij_real != 0. || aij_imag != 0.) { /* diagonal is nonzero; matrix is not skew-symmetric */ nzdiag++ ; is_skew = FALSE ; } if (aij_real <= 0. || aij_imag != 0.) { /* diagonal negative or imaginary; not chol candidate */ posdiag = FALSE ; } if (aij_imag != 0.) { /* imaginary part is present; not Hermitian */ is_hermitian = FALSE ; } } else /* i > j */ { /* ---------------------------------------------------------- */ /* consider column i, up to and including row j */ /* ---------------------------------------------------------- */ /* munch the entry at top of column i up to and incl row j */ piend = (packed) ? (Ap [i+1]) : (Ap [i] + Anz [i]) ; found = FALSE ; for ( ; munch [i] < piend ; munch [i]++) { i2 = Ai [munch [i]] ; if (i2 < j) { /* -------------------------------------------------- */ /* A(i2,i) in triu(A) but A(i,i2) not in tril(A) */ /* -------------------------------------------------- */ /* The matrix is unsymmetric. */ is_hermitian = FALSE ; is_symmetric = FALSE ; is_skew = FALSE ; } else if (i2 == j) { /* -------------------------------------------------- */ /* both A(i,j) and A(j,i) exist in the matrix */ /* -------------------------------------------------- */ /* this is one more matching entry in the pattern */ pmatched += 2 ; found = TRUE ; /* get the value of A(i,j) */ get_value (Ax, Az, p, xtype, &aij_real, &aij_imag) ; /* get the value of A(j,i) */ get_value (Ax, Az, munch [i], xtype, &aji_real, &aji_imag) ; /* compare A(i,j) with A(j,i) */ if (aij_real != aji_real || aij_imag != aji_imag) { /* the matrix cannot be symmetric */ is_symmetric = FALSE ; } if (aij_real != -aji_real || aij_imag != aji_imag) { /* the matrix cannot be skew-symmetric */ is_skew = FALSE ; } if (aij_real != aji_real || aij_imag != -aji_imag) { /* the matrix cannot be Hermitian */ is_hermitian = FALSE ; } else { /* A(i,j) and A(j,i) are numerically matched */ xmatched += 2 ; } } else /* i2 > j */ { /* -------------------------------------------------- */ /* entry A(i2,i) is not munched; consider it later */ /* -------------------------------------------------- */ break ; } } if (!found) { /* A(i,j) in tril(A) but A(j,i) not in triu(A). * The matrix is unsymmetric. */ is_hermitian = FALSE ; is_symmetric = FALSE ; is_skew = FALSE ; } } if (option < 2 && !(is_symmetric || is_skew || is_hermitian)) { /* matrix is unsymmetric; terminate the test */ return (CHOLMOD_MM_UNSYMMETRIC) ; } } /* ------------------------------------------------------------------ */ /* quick return if not Cholesky candidate */ /* ------------------------------------------------------------------ */ if (option < 1 && (!posdiag || nzdiag <= j)) { /* Diagonal entry not present, or present but negative or with * nonzero imaginary part. Quick return for option 0. */ return (CHOLMOD_MM_UNSYMMETRIC) ; } } /* ---------------------------------------------------------------------- */ /* return the results */ /* ---------------------------------------------------------------------- */ if (nzdiag < ncol) { /* not all diagonal entries are present */ posdiag = FALSE ; } if (option >= 2) { *p_xmatched = xmatched ; *p_pmatched = pmatched ; *p_nzoffdiag = CHOLMOD(nnz) (A, Common) - nzdiag ; *p_nzdiag = nzdiag ; } result = CHOLMOD_MM_UNSYMMETRIC ; if (is_hermitian) { /* complex Hermitian matrix, with either pos. or non-pos. diagonal */ result = posdiag ? CHOLMOD_MM_HERMITIAN_POSDIAG : CHOLMOD_MM_HERMITIAN ; } else if (is_symmetric) { /* real or complex symmetric matrix, with pos. or non-pos. diagonal */ result = posdiag ? CHOLMOD_MM_SYMMETRIC_POSDIAG : CHOLMOD_MM_SYMMETRIC ; } else if (is_skew) { /* real or complex skew-symmetric matrix */ result = CHOLMOD_MM_SKEW_SYMMETRIC ; } return (result) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/cholmod_norm.c0000664000175000017500000002644714224052371021441 00000000000000/* ========================================================================== */ /* === MatrixOps/cholmod_norm =============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/MatrixOps Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* r = norm (A), compute the infinity-norm, 1-norm, or 2-norm of a sparse or * dense matrix. Can compute the 2-norm only for a dense column vector. * Returns -1 if an error occurs. * * Pattern, real, complex, and zomplex sparse matrices are supported. */ #ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" #include "cholmod_matrixops.h" /* ========================================================================== */ /* === abs_value ============================================================ */ /* ========================================================================== */ /* Compute the absolute value of a real, complex, or zomplex value */ static double abs_value ( int xtype, double *Ax, double *Az, Int p, cholmod_common *Common ) { double s = 0 ; switch (xtype) { case CHOLMOD_PATTERN: s = 1 ; break ; case CHOLMOD_REAL: s = fabs (Ax [p]) ; break ; case CHOLMOD_COMPLEX: s = SuiteSparse_config.hypot_func (Ax [2*p], Ax [2*p+1]) ; break ; case CHOLMOD_ZOMPLEX: s = SuiteSparse_config.hypot_func (Ax [p], Az [p]) ; break ; } return (s) ; } /* ========================================================================== */ /* === cholmod_norm_dense =================================================== */ /* ========================================================================== */ double CHOLMOD(norm_dense) ( /* ---- input ---- */ cholmod_dense *X, /* matrix to compute the norm of */ int norm, /* type of norm: 0: inf. norm, 1: 1-norm, 2: 2-norm */ /* --------------- */ cholmod_common *Common ) { double xnorm, s, x, z ; double *Xx, *Xz, *W ; Int nrow, ncol, d, i, j, use_workspace, xtype ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (X, EMPTY) ; RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, EMPTY) ; Common->status = CHOLMOD_OK ; ncol = X->ncol ; if (norm < 0 || norm > 2 || (norm == 2 && ncol > 1)) { ERROR (CHOLMOD_INVALID, "invalid norm") ; return (EMPTY) ; } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ nrow = X->nrow ; d = X->d ; Xx = X->x ; Xz = X->z ; xtype = X->xtype ; /* ---------------------------------------------------------------------- */ /* allocate workspace, if needed */ /* ---------------------------------------------------------------------- */ W = NULL ; use_workspace = (norm == 0 && ncol > 4) ; if (use_workspace) { CHOLMOD(allocate_work) (0, 0, nrow, Common) ; W = Common->Xwork ; if (Common->status < CHOLMOD_OK) { /* oops, no workspace */ use_workspace = FALSE ; } } /* ---------------------------------------------------------------------- */ /* compute the norm */ /* ---------------------------------------------------------------------- */ xnorm = 0 ; if (use_workspace) { /* ------------------------------------------------------------------ */ /* infinity-norm = max row sum, using stride-1 access of X */ /* ------------------------------------------------------------------ */ DEBUG (for (i = 0 ; i < nrow ; i++) ASSERT (W [i] == 0)) ; /* this is faster than stride-d, but requires O(nrow) workspace */ for (j = 0 ; j < ncol ; j++) { for (i = 0 ; i < nrow ; i++) { W [i] += abs_value (xtype, Xx, Xz, i+j*d, Common) ; } } for (i = 0 ; i < nrow ; i++) { s = W [i] ; if ((IS_NAN (s) || s > xnorm) && !IS_NAN (xnorm)) { xnorm = s ; } W [i] = 0 ; } } else if (norm == 0) { /* ------------------------------------------------------------------ */ /* infinity-norm = max row sum, using stride-d access of X */ /* ------------------------------------------------------------------ */ for (i = 0 ; i < nrow ; i++) { s = 0 ; for (j = 0 ; j < ncol ; j++) { s += abs_value (xtype, Xx, Xz, i+j*d, Common) ; } if ((IS_NAN (s) || s > xnorm) && !IS_NAN (xnorm)) { xnorm = s ; } } } else if (norm == 1) { /* ------------------------------------------------------------------ */ /* 1-norm = max column sum */ /* ------------------------------------------------------------------ */ for (j = 0 ; j < ncol ; j++) { s = 0 ; for (i = 0 ; i < nrow ; i++) { s += abs_value (xtype, Xx, Xz, i+j*d, Common) ; } if ((IS_NAN (s) || s > xnorm) && !IS_NAN (xnorm)) { xnorm = s ; } } } else { /* ------------------------------------------------------------------ */ /* 2-norm = sqrt (sum (X.^2)) */ /* ------------------------------------------------------------------ */ switch (xtype) { case CHOLMOD_REAL: for (i = 0 ; i < nrow ; i++) { x = Xx [i] ; xnorm += x*x ; } break ; case CHOLMOD_COMPLEX: for (i = 0 ; i < nrow ; i++) { x = Xx [2*i ] ; z = Xx [2*i+1] ; xnorm += x*x + z*z ; } break ; case CHOLMOD_ZOMPLEX: for (i = 0 ; i < nrow ; i++) { x = Xx [i] ; z = Xz [i] ; xnorm += x*x + z*z ; } break ; } xnorm = sqrt (xnorm) ; } /* ---------------------------------------------------------------------- */ /* return result */ /* ---------------------------------------------------------------------- */ return (xnorm) ; } /* ========================================================================== */ /* === cholmod_norm_sparse ================================================== */ /* ========================================================================== */ double CHOLMOD(norm_sparse) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to compute the norm of */ int norm, /* type of norm: 0: inf. norm, 1: 1-norm */ /* --------------- */ cholmod_common *Common ) { double anorm, s ; double *Ax, *Az, *W ; Int *Ap, *Ai, *Anz ; Int i, j, p, pend, nrow, ncol, packed, xtype ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (EMPTY) ; RETURN_IF_NULL (A, EMPTY) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, EMPTY) ; Common->status = CHOLMOD_OK ; ncol = A->ncol ; nrow = A->nrow ; if (norm < 0 || norm > 1) { ERROR (CHOLMOD_INVALID, "invalid norm") ; return (EMPTY) ; } if (A->stype && nrow != ncol) { ERROR (CHOLMOD_INVALID, "matrix invalid") ; return (EMPTY) ; } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Ap = A->p ; Ai = A->i ; Ax = A->x ; Az = A->z ; Anz = A->nz ; packed = A->packed ; xtype = A->xtype ; /* ---------------------------------------------------------------------- */ /* allocate workspace, if needed */ /* ---------------------------------------------------------------------- */ W = NULL ; if (A->stype || norm == 0) { CHOLMOD(allocate_work) (0, 0, nrow, Common) ; W = Common->Xwork ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (EMPTY) ; } DEBUG (for (i = 0 ; i < nrow ; i++) ASSERT (W [i] == 0)) ; } /* ---------------------------------------------------------------------- */ /* compute the norm */ /* ---------------------------------------------------------------------- */ anorm = 0 ; if (A->stype > 0) { /* ------------------------------------------------------------------ */ /* A is symmetric with upper triangular part stored */ /* ------------------------------------------------------------------ */ /* infinity-norm = 1-norm = max row/col sum */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; s = abs_value (xtype, Ax, Az, p, Common) ; if (i == j) { W [i] += s ; } else if (i < j) { W [i] += s ; W [j] += s ; } } } } else if (A->stype < 0) { /* ------------------------------------------------------------------ */ /* A is symmetric with lower triangular part stored */ /* ------------------------------------------------------------------ */ /* infinity-norm = 1-norm = max row/col sum */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; s = abs_value (xtype, Ax, Az, p, Common) ; if (i == j) { W [i] += s ; } else if (i > j) { W [i] += s ; W [j] += s ; } } } } else if (norm == 0) { /* ------------------------------------------------------------------ */ /* A is unsymmetric, compute the infinity-norm */ /* ------------------------------------------------------------------ */ /* infinity-norm = max row sum */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { W [Ai [p]] += abs_value (xtype, Ax, Az, p, Common) ; } } } else { /* ------------------------------------------------------------------ */ /* A is unsymmetric, compute the 1-norm */ /* ------------------------------------------------------------------ */ /* 1-norm = max column sum */ for (j = 0 ; j < ncol ; j++) { p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; if (xtype == CHOLMOD_PATTERN) { s = pend - p ; } else { s = 0 ; for ( ; p < pend ; p++) { s += abs_value (xtype, Ax, Az, p, Common) ; } } if ((IS_NAN (s) || s > anorm) && !IS_NAN (anorm)) { anorm = s ; } } } /* ---------------------------------------------------------------------- */ /* compute the max row sum */ /* ---------------------------------------------------------------------- */ if (A->stype || norm == 0) { for (i = 0 ; i < nrow ; i++) { s = W [i] ; if ((IS_NAN (s) || s > anorm) && !IS_NAN (anorm)) { anorm = s ; } W [i] = 0 ; } } /* ---------------------------------------------------------------------- */ /* return result */ /* ---------------------------------------------------------------------- */ return (anorm) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/cholmod_ssmult.c0000664000175000017500000003402414224052371022003 00000000000000/* ========================================================================== */ /* === MatrixOps/cholmod_ssmult ============================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/MatrixOps Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* C = A*B. Multiply two sparse matrices. * * A and B can be packed or unpacked, sorted or unsorted, and of any stype. * If A or B are symmetric, an internal unsymmetric copy is made first, however. * C is computed as if A and B are unsymmetric, and then if the stype input * parameter requests a symmetric form (upper or lower) the matrix is converted * into that form. * * C is returned as packed, and either unsorted or sorted, depending on the * "sorted" input parameter. If C is returned sorted, then either C = (B'*A')' * or C = (A*B)'' is computed, depending on the number of nonzeros in A, B, and * C. * * workspace: * if C unsorted: Flag (A->nrow), W (A->nrow) if values * if C sorted: Flag (B->ncol), W (B->ncol) if values * Iwork (max (A->ncol, A->nrow, B->nrow, B->ncol)) * allocates temporary copies for A, B, and C, if required. * * Only pattern and real matrices are supported. Complex and zomplex matrices * are supported only when the numerical values are not computed ("values" * is FALSE). */ #ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" #include "cholmod_matrixops.h" /* ========================================================================== */ /* === cholmod_ssmult ======================================================= */ /* ========================================================================== */ cholmod_sparse *CHOLMOD(ssmult) ( /* ---- input ---- */ cholmod_sparse *A, /* left matrix to multiply */ cholmod_sparse *B, /* right matrix to multiply */ int stype, /* requested stype of C */ int values, /* TRUE: do numerical values, FALSE: pattern only */ int sorted, /* if TRUE then return C with sorted columns */ /* --------------- */ cholmod_common *Common ) { double bjt ; double *Ax, *Bx, *Cx, *W ; Int *Ap, *Anz, *Ai, *Bp, *Bnz, *Bi, *Cp, *Ci, *Flag ; cholmod_sparse *C, *A2, *B2, *A3, *B3, *C2 ; Int apacked, bpacked, j, i, pa, paend, pb, pbend, ncol, mark, cnz, t, p, nrow, anz, bnz, do_swap_and_transpose, n1, n2 ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; RETURN_IF_NULL (B, NULL) ; values = values && (A->xtype != CHOLMOD_PATTERN) && (B->xtype != CHOLMOD_PATTERN) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; RETURN_IF_XTYPE_INVALID (B, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; if (A->ncol != B->nrow) { /* inner dimensions must agree */ ERROR (CHOLMOD_INVALID, "A and B inner dimensions must match") ; return (NULL) ; } /* A and B must have the same numerical type if values is TRUE (both must * be CHOLMOD_REAL, this is implicitly checked above) */ Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ if (A->nrow <= 1) { /* C will be implicitly sorted, so no need to sort it here */ sorted = FALSE ; } if (sorted) { n1 = MAX (A->nrow, B->ncol) ; } else { n1 = A->nrow ; } n2 = MAX4 (A->ncol, A->nrow, B->nrow, B->ncol) ; CHOLMOD(allocate_work) (n1, n2, values ? n1 : 0, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1 : 0, Common)) ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ /* convert A to unsymmetric, if necessary */ A2 = NULL ; B2 = NULL ; if (A->stype) { /* workspace: Iwork (max (A->nrow,A->ncol)) */ A2 = CHOLMOD(copy) (A, 0, values, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1:0, Common)) ; return (NULL) ; } A = A2 ; } /* convert B to unsymmetric, if necessary */ if (B->stype) { /* workspace: Iwork (max (B->nrow,B->ncol)) */ B2 = CHOLMOD(copy) (B, 0, values, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ CHOLMOD(free_sparse) (&A2, Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1:0, Common)) ; return (NULL) ; } B = B2 ; } ASSERT (CHOLMOD(dump_sparse) (A, "A", Common) >= 0) ; ASSERT (CHOLMOD(dump_sparse) (B, "B", Common) >= 0) ; /* get the A matrix */ Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; apacked = A->packed ; /* get the B matrix */ Bp = B->p ; Bnz = B->nz ; Bi = B->i ; Bx = B->x ; bpacked = B->packed ; /* get the size of C */ nrow = A->nrow ; ncol = B->ncol ; /* get workspace */ W = Common->Xwork ; /* size nrow, unused if values is FALSE */ Flag = Common->Flag ; /* size nrow, Flag [0..nrow-1] < mark on input*/ /* ---------------------------------------------------------------------- */ /* count the number of entries in the result C */ /* ---------------------------------------------------------------------- */ cnz = 0 ; for (j = 0 ; j < ncol ; j++) { /* clear the Flag array */ /* mark = CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; /* for each nonzero B(t,j) in column j, do: */ pb = Bp [j] ; pbend = (bpacked) ? (Bp [j+1]) : (pb + Bnz [j]) ; for ( ; pb < pbend ; pb++) { /* B(t,j) is nonzero */ t = Bi [pb] ; /* add the nonzero pattern of A(:,t) to the pattern of C(:,j) */ pa = Ap [t] ; paend = (apacked) ? (Ap [t+1]) : (pa + Anz [t]) ; for ( ; pa < paend ; pa++) { i = Ai [pa] ; if (Flag [i] != mark) { Flag [i] = mark ; cnz++ ; } } } if (cnz < 0) { break ; /* integer overflow case */ } } /* mark = CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; /* ---------------------------------------------------------------------- */ /* check for integer overflow */ /* ---------------------------------------------------------------------- */ if (cnz < 0) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1:0, Common)) ; return (NULL) ; } /* ---------------------------------------------------------------------- */ /* Determine how to return C sorted (if requested) */ /* ---------------------------------------------------------------------- */ do_swap_and_transpose = FALSE ; if (sorted) { /* Determine the best way to return C with sorted columns. Computing * C = (B'*A')' takes cnz + anz + bnz time (ignoring O(n) terms). * Sorting C when done, C = (A*B)'', takes 2*cnz time. Pick the one * with the least amount of work. */ anz = CHOLMOD(nnz) (A, Common) ; bnz = CHOLMOD(nnz) (B, Common) ; do_swap_and_transpose = (anz + bnz < cnz) ; if (do_swap_and_transpose) { /* -------------------------------------------------------------- */ /* C = (B'*A')' */ /* -------------------------------------------------------------- */ /* workspace: Iwork (A->nrow) */ A3 = CHOLMOD(ptranspose) (A, values, NULL, NULL, 0, Common) ; CHOLMOD(free_sparse) (&A2, Common) ; A2 = A3 ; if (Common->status < CHOLMOD_OK) { /* out of memory */ CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1:0, Common)); return (NULL) ; } /* workspace: Iwork (B->nrow) */ B3 = CHOLMOD(ptranspose) (B, values, NULL, NULL, 0, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; B2 = B3 ; if (Common->status < CHOLMOD_OK) { /* out of memory */ CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1:0, Common)); return (NULL) ; } A = B2 ; B = A2 ; /* get the new A matrix */ Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; apacked = A->packed ; /* get the new B matrix */ Bp = B->p ; Bnz = B->nz ; Bi = B->i ; Bx = B->x ; bpacked = B->packed ; /* get the size of C' */ nrow = A->nrow ; ncol = B->ncol ; } } /* ---------------------------------------------------------------------- */ /* allocate C */ /* ---------------------------------------------------------------------- */ C = CHOLMOD(allocate_sparse) (nrow, ncol, cnz, FALSE, TRUE, 0, values ? A->xtype : CHOLMOD_PATTERN, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1:0, Common)) ; return (NULL) ; } Cp = C->p ; Ci = C->i ; Cx = C->x ; /* ---------------------------------------------------------------------- */ /* C = A*B */ /* ---------------------------------------------------------------------- */ cnz = 0 ; if (values) { /* pattern and values */ for (j = 0 ; j < ncol ; j++) { /* clear the Flag array */ /* mark = CHOLMOD(clear_flag (Common)) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; /* start column j of C */ Cp [j] = cnz ; /* for each nonzero B(t,j) in column j, do: */ pb = Bp [j] ; pbend = (bpacked) ? (Bp [j+1]) : (pb + Bnz [j]) ; for ( ; pb < pbend ; pb++) { /* B(t,j) is nonzero */ t = Bi [pb] ; bjt = Bx [pb] ; /* add the nonzero pattern of A(:,t) to the pattern of C(:,j) * and scatter the values into W */ pa = Ap [t] ; paend = (apacked) ? (Ap [t+1]) : (pa + Anz [t]) ; for ( ; pa < paend ; pa++) { i = Ai [pa] ; if (Flag [i] != mark) { Flag [i] = mark ; Ci [cnz++] = i ; } W [i] += Ax [pa] * bjt ; } } /* gather the values into C(:,j) */ for (p = Cp [j] ; p < cnz ; p++) { i = Ci [p] ; Cx [p] = W [i] ; W [i] = 0 ; } } } else { /* pattern only */ for (j = 0 ; j < ncol ; j++) { /* clear the Flag array */ /* mark = CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; /* start column j of C */ Cp [j] = cnz ; /* for each nonzero B(t,j) in column j, do: */ pb = Bp [j] ; pbend = (bpacked) ? (Bp [j+1]) : (pb + Bnz [j]) ; for ( ; pb < pbend ; pb++) { /* B(t,j) is nonzero */ t = Bi [pb] ; /* add the nonzero pattern of A(:,t) to the pattern of C(:,j) */ pa = Ap [t] ; paend = (apacked) ? (Ap [t+1]) : (pa + Anz [t]) ; for ( ; pa < paend ; pa++) { i = Ai [pa] ; if (Flag [i] != mark) { Flag [i] = mark ; Ci [cnz++] = i ; } } } } } Cp [ncol] = cnz ; ASSERT (MAX (1,cnz) == C->nzmax) ; /* ---------------------------------------------------------------------- */ /* clear workspace and free temporary matrices */ /* ---------------------------------------------------------------------- */ CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; /* CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1:0, Common)) ; /* ---------------------------------------------------------------------- */ /* convert C to a symmetric upper/lower matrix if requested */ /* ---------------------------------------------------------------------- */ /* convert C in place, which cannot fail since no memory is allocated */ if (stype > 0) { /* C = triu (C), in place */ (void) CHOLMOD(band_inplace) (0, ncol, values, C, Common) ; C->stype = 1 ; } else if (stype < 0) { /* C = tril (C), in place */ (void) CHOLMOD(band_inplace) (-nrow, 0, values, C, Common) ; C->stype = -1 ; } ASSERT (Common->status >= CHOLMOD_OK) ; /* ---------------------------------------------------------------------- */ /* sort C, if requested */ /* ---------------------------------------------------------------------- */ if (sorted) { if (do_swap_and_transpose) { /* workspace: Iwork (C->ncol), which is A->nrow since C=(B'*A') */ C2 = CHOLMOD(ptranspose) (C, values, NULL, NULL, 0, Common) ; CHOLMOD(free_sparse) (&C, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1:0, Common)); return (NULL) ; } C = C2 ; } else { /* workspace: Iwork (max (C->nrow,C->ncol)) */ if (!CHOLMOD(sort) (C, Common)) { /* out of memory */ CHOLMOD(free_sparse) (&C, Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1:0, Common)); return (NULL) ; } } } /* ---------------------------------------------------------------------- */ /* return result */ /* ---------------------------------------------------------------------- */ DEBUG (CHOLMOD(dump_sparse) (C, "ssmult", Common) >= 0) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, values ? n1:0, Common)) ; return (C) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/cholmod_vertcat.c0000664000175000017500000001404714224052371022127 00000000000000/* ========================================================================== */ /* === MatrixOps/cholmod_vertcat ============================================ */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/MatrixOps Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Vertical concatenation, C = [A ; B] in MATLAB notation. * * A and B can be up/lo/unsym; C is unsymmetric and packed. * A and B must have the same number of columns. * C is sorted if both A and B are sorted. * * workspace: Iwork (max (A->nrow, A->ncol, B->nrow, B->ncol)). * allocates temporary copies of A and B if they are symmetric. * * Only pattern and real matrices are supported. Complex and zomplex matrices * are supported only if "values" is FALSE. */ #ifndef NGPL #ifndef NMATRIXOPS #include "cholmod_internal.h" #include "cholmod_matrixops.h" /* ========================================================================== */ /* === cholmod_vertcat ====================================================== */ /* ========================================================================== */ cholmod_sparse *CHOLMOD(vertcat) ( /* ---- input ---- */ cholmod_sparse *A, /* left matrix to concatenate */ cholmod_sparse *B, /* right matrix to concatenate */ int values, /* if TRUE compute the numerical values of C */ /* --------------- */ cholmod_common *Common ) { double *Ax, *Bx, *Cx ; Int *Ap, *Ai, *Anz, *Bp, *Bi, *Bnz, *Cp, *Ci ; cholmod_sparse *C, *A2, *B2 ; Int apacked, bpacked, anrow, bnrow, ncol, nrow, anz, bnz, nz, j, p, pend, pdest ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (NULL) ; RETURN_IF_NULL (A, NULL) ; RETURN_IF_NULL (B, NULL) ; values = values && (A->xtype != CHOLMOD_PATTERN) && (B->xtype != CHOLMOD_PATTERN) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; RETURN_IF_XTYPE_INVALID (B, CHOLMOD_PATTERN, values ? CHOLMOD_REAL : CHOLMOD_ZOMPLEX, NULL) ; if (A->ncol != B->ncol) { /* A and B must have the same number of columns */ ERROR (CHOLMOD_INVALID, "A and B must have same # of columns") ; return (NULL) ; } /* A and B must have the same numerical type if values is TRUE (both must * be CHOLMOD_REAL, this is implicitly checked above) */ Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ anrow = A->nrow ; bnrow = B->nrow ; ncol = A->ncol ; CHOLMOD(allocate_work) (0, MAX3 (anrow, bnrow, ncol), 0, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ /* convert A to unsymmetric, if necessary */ A2 = NULL ; if (A->stype != 0) { /* workspace: Iwork (max (A->nrow,A->ncol)) */ A2 = CHOLMOD(copy) (A, 0, values, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (NULL) ; } A = A2 ; } /* convert B to unsymmetric, if necessary */ B2 = NULL ; if (B->stype != 0) { /* workspace: Iwork (max (B->nrow,B->ncol)) */ B2 = CHOLMOD(copy) (B, 0, values, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ CHOLMOD(free_sparse) (&A2, Common) ; return (NULL) ; } B = B2 ; } Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; apacked = A->packed ; Bp = B->p ; Bnz = B->nz ; Bi = B->i ; Bx = B->x ; bpacked = B->packed ; /* ---------------------------------------------------------------------- */ /* allocate C */ /* ---------------------------------------------------------------------- */ anz = CHOLMOD(nnz) (A, Common) ; bnz = CHOLMOD(nnz) (B, Common) ; nrow = anrow + bnrow ; nz = anz + bnz ; C = CHOLMOD(allocate_sparse) (nrow, ncol, nz, A->sorted && B->sorted, TRUE, 0, values ? A->xtype : CHOLMOD_PATTERN, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; return (NULL) ; } Cp = C->p ; Ci = C->i ; Cx = C->x ; /* ---------------------------------------------------------------------- */ /* C = [A ; B] */ /* ---------------------------------------------------------------------- */ pdest = 0 ; for (j = 0 ; j < ncol ; j++) { /* attach A(:,j) as the first part of C(:,j) */ p = Ap [j] ; pend = (apacked) ? (Ap [j+1]) : (p + Anz [j]) ; Cp [j] = pdest ; for ( ; p < pend ; p++) { Ci [pdest] = Ai [p] ; if (values) { Cx [pdest] = Ax [p] ; } pdest++ ; } /* attach B(:,j) as the second part of C(:,j) */ p = Bp [j] ; pend = (bpacked) ? (Bp [j+1]) : (p + Bnz [j]) ; for ( ; p < pend ; p++) { Ci [pdest] = Bi [p] + anrow ; if (values) { Cx [pdest] = Bx [p] ; } pdest++ ; } } Cp [ncol] = pdest ; ASSERT (pdest == nz) ; /* ---------------------------------------------------------------------- */ /* free the unsymmetric copies of A and B, and return C */ /* ---------------------------------------------------------------------- */ CHOLMOD(free_sparse) (&A2, Common) ; CHOLMOD(free_sparse) (&B2, Common) ; return (C) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/License.txt0000664000175000017500000000203014224052371020716 00000000000000CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis CHOLMOD is also available under other licenses; contact authors for details. http://www.suitesparse.com Note that this license is for the CHOLMOD/MatrixOps module only. All CHOLMOD modules are licensed separately. -------------------------------------------------------------------------------- This Module 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 of the License, or (at your option) any later version. This Module 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 Module; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/gpl.txt0000664000175000017500000004313314224052371020127 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 of the License, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/MatrixOps/t_cholmod_sdmult.c0000664000175000017500000004456314224052371022320 00000000000000/* ========================================================================== */ /* === MatrixOps/t_cholmod_sdmult =========================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/MatrixOps Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/MatrixOps Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Template routine for cholmod_sdmult */ #include "cholmod_template.h" #undef ADVANCE #ifdef REAL #define ADVANCE(x,z,d) x += d #elif defined (COMPLEX) #define ADVANCE(x,z,d) x += 2*d #else #define ADVANCE(x,z,d) x += d ; z += d #endif /* ========================================================================== */ /* === t_cholmod_sdmult ===================================================== */ /* ========================================================================== */ static void TEMPLATE (cholmod_sdmult) ( /* ---- input ---- */ cholmod_sparse *A, /* sparse matrix to multiply */ int transpose, /* use A if 0, or A' otherwise */ double alpha [2], /* scale factor for A */ double beta [2], /* scale factor for Y */ cholmod_dense *X, /* dense matrix to multiply */ /* ---- in/out --- */ cholmod_dense *Y, /* resulting dense matrix */ /* -- workspace -- */ double *W /* size 4*nx if needed, twice that for c/zomplex case */ ) { double yx [8], xx [8], ax [2] ; #ifdef ZOMPLEX double yz [4], xz [4], az [1] ; double betaz [1], alphaz [1] ; #endif double *Ax, *Az, *Xx, *Xz, *Yx, *Yz, *w, *Wz ; Int *Ap, *Ai, *Anz ; size_t nx, ny, dx, dy ; Int packed, nrow, ncol, j, k, p, pend, kcol, i ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ #ifdef ZOMPLEX betaz [0] = beta [1] ; alphaz [0] = alpha [1] ; #endif ny = transpose ? A->ncol : A->nrow ; /* required length of Y */ nx = transpose ? A->nrow : A->ncol ; /* required length of X */ nrow = A->nrow ; ncol = A->ncol ; Ap = A->p ; Anz = A->nz ; Ai = A->i ; Ax = A->x ; Az = A->z ; packed = A->packed ; Xx = X->x ; Xz = X->z ; Yx = Y->x ; Yz = Y->z ; kcol = X->ncol ; dy = Y->d ; dx = X->d ; w = W ; Wz = W + 4*nx ; /* ---------------------------------------------------------------------- */ /* Y = beta * Y */ /* ---------------------------------------------------------------------- */ if (ENTRY_IS_ZERO (beta, betaz, 0)) { for (k = 0 ; k < kcol ; k++) { for (i = 0 ; i < ((Int) ny) ; i++) { /* y [i] = 0. ; */ CLEAR (Yx, Yz, i) ; } /* y += dy ; */ ADVANCE (Yx,Yz,dy) ; } } else if (!ENTRY_IS_ONE (beta, betaz, 0)) { for (k = 0 ; k < kcol ; k++) { for (i = 0 ; i < ((Int) ny) ; i++) { /* y [i] *= beta [0] ; */ MULT (Yx,Yz,i, Yx,Yz,i, beta,betaz, 0) ; } /* y += dy ; */ ADVANCE (Yx,Yz,dy) ; } } if (ENTRY_IS_ZERO (alpha, alphaz, 0)) { /* nothing else to do */ return ; } /* ---------------------------------------------------------------------- */ /* Y += alpha * op(A) * X, where op(A)=A or A' */ /* ---------------------------------------------------------------------- */ Yx = Y->x ; Yz = Y->z ; k = 0 ; if (A->stype == 0) { if (transpose) { /* -------------------------------------------------------------- */ /* Y += alpha * A' * x, unsymmetric case */ /* -------------------------------------------------------------- */ if (kcol % 4 == 1) { for (j = 0 ; j < ncol ; j++) { /* yj = 0. ; */ CLEAR (yx, yz, 0) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { /* yj += conj(Ax [p]) * x [Ai [p]] ; */ i = Ai [p] ; ASSIGN_CONJ (ax,az,0, Ax,Az,p) ; MULTADD (yx,yz,0, ax,az,0, Xx,Xz,i) ; } /* y [j] += alpha [0] * yj ; */ MULTADD (Yx,Yz,j, alpha,alphaz,0, yx,yz,0) ; } /* y += dy ; */ /* x += dx ; */ ADVANCE (Yx,Yz,dy) ; ADVANCE (Xx,Xz,dx) ; k++ ; } else if (kcol % 4 == 2) { for (j = 0 ; j < ncol ; j++) { /* yj0 = 0. ; */ /* yj1 = 0. ; */ CLEAR (yx,yz,0) ; CLEAR (yx,yz,1) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; /* aij = conj (Ax [p]) ; */ ASSIGN_CONJ (ax,az,0, Ax,Az,p) ; /* yj0 += aij * x [i ] ; */ /* yj1 += aij * x [i+dx] ; */ MULTADD (yx,yz,0, ax,az,0, Xx,Xz,i) ; MULTADD (yx,yz,1, ax,az,0, Xx,Xz,i+dx) ; } /* y [j ] += alpha [0] * yj0 ; */ /* y [j+dy] += alpha [0] * yj1 ; */ MULTADD (Yx,Yz,j, alpha,alphaz,0, yx,yz,0) ; MULTADD (Yx,Yz,j+dy, alpha,alphaz,0, yx,yz,1) ; } /* y += 2*dy ; */ /* x += 2*dx ; */ ADVANCE (Yx,Yz,2*dy) ; ADVANCE (Xx,Xz,2*dx) ; k += 2 ; } else if (kcol % 4 == 3) { for (j = 0 ; j < ncol ; j++) { /* yj0 = 0. ; */ /* yj1 = 0. ; */ /* yj2 = 0. ; */ CLEAR (yx,yz,0) ; CLEAR (yx,yz,1) ; CLEAR (yx,yz,2) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; /* aij = conj (Ax [p]) ; */ ASSIGN_CONJ (ax,az,0, Ax,Az,p) ; /* yj0 += aij * x [i ] ; */ /* yj1 += aij * x [i+ dx] ; */ /* yj2 += aij * x [i+2*dx] ; */ MULTADD (yx,yz,0, ax,az,0, Xx,Xz,i) ; MULTADD (yx,yz,1, ax,az,0, Xx,Xz,i+dx) ; MULTADD (yx,yz,2, ax,az,0, Xx,Xz,i+2*dx) ; } /* y [j ] += alpha [0] * yj0 ; */ /* y [j+ dy] += alpha [0] * yj1 ; */ /* y [j+2*dy] += alpha [0] * yj2 ; */ MULTADD (Yx,Yz,j, alpha,alphaz,0, yx,yz,0) ; MULTADD (Yx,Yz,j+dy, alpha,alphaz,0, yx,yz,1) ; MULTADD (Yx,Yz,j+2*dy, alpha,alphaz,0, yx,yz,2) ; } /* y += 3*dy ; */ /* x += 3*dx ; */ ADVANCE (Yx,Yz,3*dy) ; ADVANCE (Xx,Xz,3*dx) ; k += 3 ; } for ( ; k < kcol ; k += 4) { for (j = 0 ; j < ncol ; j++) { /* yj0 = 0. ; */ /* yj1 = 0. ; */ /* yj2 = 0. ; */ /* yj3 = 0. ; */ CLEAR (yx,yz,0) ; CLEAR (yx,yz,1) ; CLEAR (yx,yz,2) ; CLEAR (yx,yz,3) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; /* aij = conj(Ax [p]) ; */ ASSIGN_CONJ (ax,az,0, Ax,Az,p) ; /* yj0 += aij * x [i ] ; */ /* yj1 += aij * x [i+ dx] ; */ /* yj2 += aij * x [i+2*dx] ; */ /* yj3 += aij * x [i+3*dx] ; */ MULTADD (yx,yz,0, ax,az,0, Xx,Xz,i) ; MULTADD (yx,yz,1, ax,az,0, Xx,Xz,i+dx) ; MULTADD (yx,yz,2, ax,az,0, Xx,Xz,i+2*dx) ; MULTADD (yx,yz,3, ax,az,0, Xx,Xz,i+3*dx) ; } /* y [j ] += alpha [0] * yj0 ; */ /* y [j+ dy] += alpha [0] * yj1 ; */ /* y [j+2*dy] += alpha [0] * yj2 ; */ /* y [j+3*dy] += alpha [0] * yj3 ; */ MULTADD (Yx,Yz,j, alpha,alphaz,0, yx,yz,0) ; MULTADD (Yx,Yz,j+dy, alpha,alphaz,0, yx,yz,1) ; MULTADD (Yx,Yz,j+2*dy, alpha,alphaz,0, yx,yz,2) ; MULTADD (Yx,Yz,j+3*dy, alpha,alphaz,0, yx,yz,3) ; } /* y += 4*dy ; */ /* x += 4*dx ; */ ADVANCE (Yx,Yz,4*dy) ; ADVANCE (Xx,Xz,4*dx) ; } } else { /* -------------------------------------------------------------- */ /* Y += alpha * A * x, unsymmetric case */ /* -------------------------------------------------------------- */ if (kcol % 4 == 1) { for (j = 0 ; j < ncol ; j++) { /* xj = alpha [0] * x [j] ; */ MULT (xx,xz,0, alpha,alphaz,0, Xx,Xz,j) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { /* y [Ai [p]] += Ax [p] * xj ; */ i = Ai [p] ; MULTADD (Yx,Yz,i, Ax,Az,p, xx,xz,0) ; } } /* y += dy ; */ /* x += dx ; */ ADVANCE (Yx,Yz,dy) ; ADVANCE (Xx,Xz,dx) ; k++ ; } else if (kcol % 4 == 2) { for (j = 0 ; j < ncol ; j++) { /* xj0 = alpha [0] * x [j ] ; */ /* xj1 = alpha [0] * x [j+dx] ; */ MULT (xx,xz,0, alpha,alphaz,0, Xx,Xz,j) ; MULT (xx,xz,1, alpha,alphaz,0, Xx,Xz,j+dx) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; /* aij = Ax [p] ; */ ASSIGN (ax,az,0, Ax,Az,p) ; /* y [i ] += aij * xj0 ; */ /* y [i+dy] += aij * xj1 ; */ MULTADD (Yx,Yz,i, ax,az,0, xx,xz,0) ; MULTADD (Yx,Yz,i+dy, ax,az,0, xx,xz,1) ; } } /* y += 2*dy ; */ /* x += 2*dx ; */ ADVANCE (Yx,Yz,2*dy) ; ADVANCE (Xx,Xz,2*dx) ; k += 2 ; } else if (kcol % 4 == 3) { for (j = 0 ; j < ncol ; j++) { /* xj0 = alpha [0] * x [j ] ; */ /* xj1 = alpha [0] * x [j+ dx] ; */ /* xj2 = alpha [0] * x [j+2*dx] ; */ MULT (xx,xz,0, alpha,alphaz,0, Xx,Xz,j) ; MULT (xx,xz,1, alpha,alphaz,0, Xx,Xz,j+dx) ; MULT (xx,xz,2, alpha,alphaz,0, Xx,Xz,j+2*dx) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; /* aij = Ax [p] ; */ ASSIGN (ax,az,0, Ax,Az,p) ; /* y [i ] += aij * xj0 ; */ /* y [i+ dy] += aij * xj1 ; */ /* y [i+2*dy] += aij * xj2 ; */ MULTADD (Yx,Yz,i, ax,az,0, xx,xz,0) ; MULTADD (Yx,Yz,i+dy, ax,az,0, xx,xz,1) ; MULTADD (Yx,Yz,i+2*dy, ax,az,0, xx,xz,2) ; } } /* y += 3*dy ; */ /* x += 3*dx ; */ ADVANCE (Yx,Yz,3*dy) ; ADVANCE (Xx,Xz,3*dx) ; k += 3 ; } for ( ; k < kcol ; k += 4) { for (j = 0 ; j < ncol ; j++) { /* xj0 = alpha [0] * x [j ] ; */ /* xj1 = alpha [0] * x [j+ dx] ; */ /* xj2 = alpha [0] * x [j+2*dx] ; */ /* xj3 = alpha [0] * x [j+3*dx] ; */ MULT (xx,xz,0, alpha,alphaz,0, Xx,Xz,j) ; MULT (xx,xz,1, alpha,alphaz,0, Xx,Xz,j+dx) ; MULT (xx,xz,2, alpha,alphaz,0, Xx,Xz,j+2*dx) ; MULT (xx,xz,3, alpha,alphaz,0, Xx,Xz,j+3*dx) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; /* aij = Ax [p] ; */ ASSIGN (ax,az,0, Ax,Az,p) ; /* y [i ] += aij * xj0 ; */ /* y [i+ dy] += aij * xj1 ; */ /* y [i+2*dy] += aij * xj2 ; */ /* y [i+3*dy] += aij * xj3 ; */ MULTADD (Yx,Yz,i, ax,az,0, xx,xz,0) ; MULTADD (Yx,Yz,i+dy, ax,az,0, xx,xz,1) ; MULTADD (Yx,Yz,i+2*dy, ax,az,0, xx,xz,2) ; MULTADD (Yx,Yz,i+3*dy, ax,az,0, xx,xz,3) ; } } /* y += 4*dy ; */ /* x += 4*dx ; */ ADVANCE (Yx,Yz,4*dy) ; ADVANCE (Xx,Xz,4*dx) ; } } } else { /* ------------------------------------------------------------------ */ /* Y += alpha * (A or A') * x, symmetric case (upper/lower) */ /* ------------------------------------------------------------------ */ /* Only the upper/lower triangular part and the diagonal of A is used. * Since both x and y are written to in the innermost loop, this * code can experience cache bank conflicts if x is used directly. * Thus, a copy is made of x, four columns at a time, if x has * four or more columns. */ if (kcol % 4 == 1) { for (j = 0 ; j < ncol ; j++) { /* yj = 0. ; */ CLEAR (yx,yz,0) ; /* xj = alpha [0] * x [j] ; */ MULT (xx,xz,0, alpha,alphaz,0, Xx,Xz,j) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i == j) { /* y [i] += Ax [p] * xj ; */ MULTADD (Yx,Yz,i, Ax,Az,p, xx,xz,0) ; } else if ((A->stype > 0 && i < j) || (A->stype < 0 && i > j)) { /* aij = Ax [p] ; */ ASSIGN (ax,az,0, Ax,Az,p) ; /* y [i] += aij * xj ; */ /* yj += aij * x [i] ; */ MULTADD (Yx,Yz,i, ax,az,0, xx,xz,0) ; MULTADDCONJ (yx,yz,0, ax,az,0, Xx,Xz,i) ; } } /* y [j] += alpha [0] * yj ; */ MULTADD (Yx,Yz,j, alpha,alphaz,0, yx,yz,0) ; } /* y += dy ; */ /* x += dx ; */ ADVANCE (Yx,Yz,dy) ; ADVANCE (Xx,Xz,dx) ; k++ ; } else if (kcol % 4 == 2) { for (j = 0 ; j < ncol ; j++) { /* yj0 = 0. ; */ /* yj1 = 0. ; */ CLEAR (yx,yz,0) ; CLEAR (yx,yz,1) ; /* xj0 = alpha [0] * x [j ] ; */ /* xj1 = alpha [0] * x [j+dx] ; */ MULT (xx,xz,0, alpha,alphaz,0, Xx,Xz,j) ; MULT (xx,xz,1, alpha,alphaz,0, Xx,Xz,j+dx) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i == j) { /* aij = Ax [p] ; */ ASSIGN (ax,az,0, Ax,Az,p) ; /* y [i ] += aij * xj0 ; */ /* y [i+dy] += aij * xj1 ; */ MULTADD (Yx,Yz,i, ax,az,0, xx,xz,0) ; MULTADD (Yx,Yz,i+dy, ax,az,0, xx,xz,1) ; } else if ((A->stype > 0 && i < j) || (A->stype < 0 && i > j)) { /* aij = Ax [p] ; */ ASSIGN (ax,az,0, Ax,Az,p) ; /* y [i ] += aij * xj0 ; */ /* y [i+dy] += aij * xj1 ; */ /* yj0 += aij * x [i ] ; */ /* yj1 += aij * x [i+dx] ; */ MULTADD (Yx,Yz,i, ax,az,0, xx,xz,0) ; MULTADD (Yx,Yz,i+dy, ax,az,0, xx,xz,1) ; MULTADDCONJ (yx,yz,0, ax,az,0, Xx,Xz,i) ; MULTADDCONJ (yx,yz,1, ax,az,0, Xx,Xz,i+dx) ; } } /* y [j ] += alpha [0] * yj0 ; */ /* y [j+dy] += alpha [0] * yj1 ; */ MULTADD (Yx,Yz,j, alpha,alphaz,0, yx,yz,0) ; MULTADD (Yx,Yz,j+dy, alpha,alphaz,0, yx,yz,1) ; } /* y += 2*dy ; */ /* x += 2*dx ; */ ADVANCE (Yx,Yz,2*dy) ; ADVANCE (Xx,Xz,2*dx) ; k += 2 ; } else if (kcol % 4 == 3) { for (j = 0 ; j < ncol ; j++) { /* yj0 = 0. ; */ /* yj1 = 0. ; */ /* yj2 = 0. ; */ CLEAR (yx,yz,0) ; CLEAR (yx,yz,1) ; CLEAR (yx,yz,2) ; /* xj0 = alpha [0] * x [j ] ; */ /* xj1 = alpha [0] * x [j+ dx] ; */ /* xj2 = alpha [0] * x [j+2*dx] ; */ MULT (xx,xz,0, alpha,alphaz,0, Xx,Xz,j) ; MULT (xx,xz,1, alpha,alphaz,0, Xx,Xz,j+dx) ; MULT (xx,xz,2, alpha,alphaz,0, Xx,Xz,j+2*dx) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i == j) { /* aij = Ax [p] ; */ ASSIGN (ax,az,0, Ax,Az,p) ; /* y [i ] += aij * xj0 ; */ /* y [i+ dy] += aij * xj1 ; */ /* y [i+2*dy] += aij * xj2 ; */ MULTADD (Yx,Yz,i, ax,az,0, xx,xz,0) ; MULTADD (Yx,Yz,i+dy, ax,az,0, xx,xz,1) ; MULTADD (Yx,Yz,i+2*dy, ax,az,0, xx,xz,2) ; } else if ((A->stype > 0 && i < j) || (A->stype < 0 && i > j)) { /* aij = Ax [p] ; */ ASSIGN (ax,az,0, Ax,Az,p) ; /* y [i ] += aij * xj0 ; */ /* y [i+ dy] += aij * xj1 ; */ /* y [i+2*dy] += aij * xj2 ; */ /* yj0 += aij * x [i ] ; */ /* yj1 += aij * x [i+ dx] ; */ /* yj2 += aij * x [i+2*dx] ; */ MULTADD (Yx,Yz,i, ax,az,0, xx,xz,0) ; MULTADD (Yx,Yz,i+dy, ax,az,0, xx,xz,1) ; MULTADD (Yx,Yz,i+2*dy, ax,az,0, xx,xz,2) ; MULTADDCONJ (yx,yz,0, ax,az,0, Xx,Xz,i) ; MULTADDCONJ (yx,yz,1, ax,az,0, Xx,Xz,i+dx) ; MULTADDCONJ (yx,yz,2, ax,az,0, Xx,Xz,i+2*dx) ; } } /* y [j ] += alpha [0] * yj0 ; */ /* y [j+ dy] += alpha [0] * yj1 ; */ /* y [j+2*dy] += alpha [0] * yj2 ; */ MULTADD (Yx,Yz,j, alpha,alphaz,0, yx,yz,0) ; MULTADD (Yx,Yz,j+dy, alpha,alphaz,0, yx,yz,1) ; MULTADD (Yx,Yz,j+2*dy, alpha,alphaz,0, yx,yz,2) ; } /* y += 3*dy ; */ /* x += 3*dx ; */ ADVANCE (Yx,Yz,3*dy) ; ADVANCE (Xx,Xz,3*dx) ; k += 3 ; } /* copy four columns of X into W, and put in row form */ for ( ; k < kcol ; k += 4) { for (j = 0 ; j < ncol ; j++) { /* w [4*j ] = x [j ] ; */ /* w [4*j+1] = x [j+ dx] ; */ /* w [4*j+2] = x [j+2*dx] ; */ /* w [4*j+3] = x [j+3*dx] ; */ ASSIGN (w,Wz,4*j , Xx,Xz,j ) ; ASSIGN (w,Wz,4*j+1, Xx,Xz,j+dx ) ; ASSIGN (w,Wz,4*j+2, Xx,Xz,j+2*dx) ; ASSIGN (w,Wz,4*j+3, Xx,Xz,j+3*dx) ; } for (j = 0 ; j < ncol ; j++) { /* yj0 = 0. ; */ /* yj1 = 0. ; */ /* yj2 = 0. ; */ /* yj3 = 0. ; */ CLEAR (yx,yz,0) ; CLEAR (yx,yz,1) ; CLEAR (yx,yz,2) ; CLEAR (yx,yz,3) ; /* xj0 = alpha [0] * w [4*j ] ; */ /* xj1 = alpha [0] * w [4*j+1] ; */ /* xj2 = alpha [0] * w [4*j+2] ; */ /* xj3 = alpha [0] * w [4*j+3] ; */ MULT (xx,xz,0, alpha,alphaz,0, w,Wz,4*j) ; MULT (xx,xz,1, alpha,alphaz,0, w,Wz,4*j+1) ; MULT (xx,xz,2, alpha,alphaz,0, w,Wz,4*j+2) ; MULT (xx,xz,3, alpha,alphaz,0, w,Wz,4*j+3) ; p = Ap [j] ; pend = (packed) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i == j) { /* aij = Ax [p] ; */ ASSIGN (ax,az,0, Ax,Az,p) ; /* y [i ] += aij * xj0 ; */ /* y [i+ dy] += aij * xj1 ; */ /* y [i+2*dy] += aij * xj2 ; */ /* y [i+3*dy] += aij * xj3 ; */ MULTADD (Yx,Yz,i , ax,az,0, xx,xz,0) ; MULTADD (Yx,Yz,i+dy , ax,az,0, xx,xz,1) ; MULTADD (Yx,Yz,i+2*dy, ax,az,0, xx,xz,2) ; MULTADD (Yx,Yz,i+3*dy, ax,az,0, xx,xz,3) ; } else if ((A->stype > 0 && i < j) || (A->stype < 0 && i > j)) { /* aij = Ax [p] ; */ ASSIGN (ax,az,0, Ax,Az,p) ; /* y [i ] += aij * xj0 ; */ /* y [i+ dy] += aij * xj1 ; */ /* y [i+2*dy] += aij * xj2 ; */ /* y [i+3*dy] += aij * xj3 ; */ /* yj0 += aij * w [4*i ] ; */ /* yj1 += aij * w [4*i+1] ; */ /* yj2 += aij * w [4*i+2] ; */ /* yj3 += aij * w [4*i+3] ; */ MULTADD (Yx,Yz,i, ax,az,0, xx,xz,0) ; MULTADD (Yx,Yz,i+dy, ax,az,0, xx,xz,1) ; MULTADD (Yx,Yz,i+2*dy, ax,az,0, xx,xz,2) ; MULTADD (Yx,Yz,i+3*dy, ax,az,0, xx,xz,3) ; MULTADDCONJ (yx,yz,0, ax,az,0, w,Wz,4*i) ; MULTADDCONJ (yx,yz,1, ax,az,0, w,Wz,4*i+1) ; MULTADDCONJ (yx,yz,2, ax,az,0, w,Wz,4*i+2) ; MULTADDCONJ (yx,yz,3, ax,az,0, w,Wz,4*i+3) ; } } /* y [j ] += alpha [0] * yj0 ; */ /* y [j+ dy] += alpha [0] * yj1 ; */ /* y [j+2*dy] += alpha [0] * yj2 ; */ /* y [j+3*dy] += alpha [0] * yj3 ; */ MULTADD (Yx,Yz,j , alpha,alphaz,0, yx,yz,0) ; MULTADD (Yx,Yz,j+dy , alpha,alphaz,0, yx,yz,1) ; MULTADD (Yx,Yz,j+2*dy, alpha,alphaz,0, yx,yz,2) ; MULTADD (Yx,Yz,j+3*dy, alpha,alphaz,0, yx,yz,3) ; } /* y += 4*dy ; */ /* x += 4*dx ; */ ADVANCE (Yx,Yz,4*dy) ; ADVANCE (Xx,Xz,4*dx) ; } } } #undef PATTERN #undef REAL #undef COMPLEX #undef ZOMPLEX JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Modify/0000755000175000017500000000000014400711326016155 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Modify/Makefile.am0000664000175000017500000000062214224052371020135 00000000000000noinst_LTLIBRARIES = cholmodmodify.la cholmodmodify_la_SOURCES = cholmod_rowadd.c cholmod_updown.c \ cholmod_rowdel.c cholmodmodify_la_CPPFLAGS = \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include cholmodmodify_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt gpl.txt t_cholmod_updown_numkr.c t_cholmod_updown.c JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Modify/Makefile.in0000644000175000017500000005710714400675236020165 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/CHOLMOD/Modify ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) cholmodmodify_la_LIBADD = am_cholmodmodify_la_OBJECTS = cholmodmodify_la-cholmod_rowadd.lo \ cholmodmodify_la-cholmod_updown.lo \ cholmodmodify_la-cholmod_rowdel.lo cholmodmodify_la_OBJECTS = $(am_cholmodmodify_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = cholmodmodify_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(cholmodmodify_la_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/cholmodmodify_la-cholmod_rowadd.Plo \ ./$(DEPDIR)/cholmodmodify_la-cholmod_rowdel.Plo \ ./$(DEPDIR)/cholmodmodify_la-cholmod_updown.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(cholmodmodify_la_SOURCES) DIST_SOURCES = $(cholmodmodify_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = cholmodmodify.la cholmodmodify_la_SOURCES = cholmod_rowadd.c cholmod_updown.c \ cholmod_rowdel.c cholmodmodify_la_CPPFLAGS = \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include cholmodmodify_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt gpl.txt t_cholmod_updown_numkr.c t_cholmod_updown.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Modify/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Modify/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } cholmodmodify.la: $(cholmodmodify_la_OBJECTS) $(cholmodmodify_la_DEPENDENCIES) $(EXTRA_cholmodmodify_la_DEPENDENCIES) $(AM_V_CCLD)$(cholmodmodify_la_LINK) $(cholmodmodify_la_OBJECTS) $(cholmodmodify_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmodify_la-cholmod_rowadd.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmodify_la-cholmod_rowdel.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodmodify_la-cholmod_updown.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< cholmodmodify_la-cholmod_rowadd.lo: cholmod_rowadd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmodify_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmodify_la-cholmod_rowadd.lo -MD -MP -MF $(DEPDIR)/cholmodmodify_la-cholmod_rowadd.Tpo -c -o cholmodmodify_la-cholmod_rowadd.lo `test -f 'cholmod_rowadd.c' || echo '$(srcdir)/'`cholmod_rowadd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmodify_la-cholmod_rowadd.Tpo $(DEPDIR)/cholmodmodify_la-cholmod_rowadd.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_rowadd.c' object='cholmodmodify_la-cholmod_rowadd.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmodify_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmodify_la-cholmod_rowadd.lo `test -f 'cholmod_rowadd.c' || echo '$(srcdir)/'`cholmod_rowadd.c cholmodmodify_la-cholmod_updown.lo: cholmod_updown.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmodify_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmodify_la-cholmod_updown.lo -MD -MP -MF $(DEPDIR)/cholmodmodify_la-cholmod_updown.Tpo -c -o cholmodmodify_la-cholmod_updown.lo `test -f 'cholmod_updown.c' || echo '$(srcdir)/'`cholmod_updown.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmodify_la-cholmod_updown.Tpo $(DEPDIR)/cholmodmodify_la-cholmod_updown.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_updown.c' object='cholmodmodify_la-cholmod_updown.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmodify_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmodify_la-cholmod_updown.lo `test -f 'cholmod_updown.c' || echo '$(srcdir)/'`cholmod_updown.c cholmodmodify_la-cholmod_rowdel.lo: cholmod_rowdel.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmodify_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodmodify_la-cholmod_rowdel.lo -MD -MP -MF $(DEPDIR)/cholmodmodify_la-cholmod_rowdel.Tpo -c -o cholmodmodify_la-cholmod_rowdel.lo `test -f 'cholmod_rowdel.c' || echo '$(srcdir)/'`cholmod_rowdel.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodmodify_la-cholmod_rowdel.Tpo $(DEPDIR)/cholmodmodify_la-cholmod_rowdel.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_rowdel.c' object='cholmodmodify_la-cholmod_rowdel.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodmodify_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodmodify_la-cholmod_rowdel.lo `test -f 'cholmod_rowdel.c' || echo '$(srcdir)/'`cholmod_rowdel.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/cholmodmodify_la-cholmod_rowadd.Plo -rm -f ./$(DEPDIR)/cholmodmodify_la-cholmod_rowdel.Plo -rm -f ./$(DEPDIR)/cholmodmodify_la-cholmod_updown.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/cholmodmodify_la-cholmod_rowadd.Plo -rm -f ./$(DEPDIR)/cholmodmodify_la-cholmod_rowdel.Plo -rm -f ./$(DEPDIR)/cholmodmodify_la-cholmod_updown.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Modify/cholmod_rowadd.c0000664000175000017500000004645414224052371021247 00000000000000/* ========================================================================== */ /* === Modify/cholmod_rowadd ================================================ */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Modify Module. * Copyright (C) 2005-2006, Timothy A. Davis and William W. Hager. * The CHOLMOD/Modify Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Adds a row and column to an LDL' factorization, and optionally updates the * solution to Lx=b. * * workspace: Flag (nrow), Head (nrow+1), W (2*nrow), Iwork (2*nrow) * * Only real matrices are supported. A symbolic L is converted into a * numeric identity matrix before the row is added. */ #ifndef NGPL #ifndef NMODIFY #include "cholmod_internal.h" #include "cholmod_modify.h" /* ========================================================================== */ /* === cholmod_rowadd ======================================================= */ /* ========================================================================== */ /* cholmod_rowadd adds a row to the LDL' factorization. It computes the kth * row and kth column of L, and then updates the submatrix L (k+1:n,k+1:n) * accordingly. The kth row and column of L should originally be equal to the * kth row and column of the identity matrix (they are treated as such, if they * are not). The kth row/column of L is computed as the factorization of the * kth row/column of the matrix to factorize, which is provided as a single * n-by-1 sparse matrix R. The sparse vector R need not be sorted. */ int CHOLMOD(rowadd) ( /* ---- input ---- */ size_t k, /* row/column index to add */ cholmod_sparse *R, /* row/column of matrix to factorize (n-by-1) */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) { double bk [2] ; bk [0] = 0. ; bk [1] = 0. ; return (CHOLMOD(rowadd_mark) (k, R, bk, NULL, L, NULL, NULL, Common)) ; } /* ========================================================================== */ /* === cholmod_rowadd_solve ================================================= */ /* ========================================================================== */ /* Does the same as cholmod_rowadd, and also updates the solution to Lx=b * See cholmod_updown for a description of how Lx=b is updated. There is on * additional parameter: bk specifies the new kth entry of b. */ int CHOLMOD(rowadd_solve) ( /* ---- input ---- */ size_t k, /* row/column index to add */ cholmod_sparse *R, /* row/column of matrix to factorize (n-by-1) */ double bk [2], /* kth entry of the right-hand-side b */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) { return (CHOLMOD(rowadd_mark) (k, R, bk, NULL, L, X, DeltaB, Common)) ; } /* ========================================================================== */ /* === icomp ================================================================ */ /* ========================================================================== */ /* for sorting by qsort */ static int icomp (Int *i, Int *j) { if (*i < *j) { return (-1) ; } else { return (1) ; } } /* ========================================================================== */ /* === cholmod_rowadd_mark ================================================== */ /* ========================================================================== */ /* Does the same as cholmod_rowadd_solve, except only part of L is used in * the update/downdate of the solution to Lx=b. This routine is an "expert" * routine. It is meant for use in LPDASA only. */ int CHOLMOD(rowadd_mark) ( /* ---- input ---- */ size_t kadd, /* row/column index to add */ cholmod_sparse *R, /* row/column of matrix to factorize (n-by-1) */ double bk [2], /* kth entry of the right hand side, b */ Int *colmark, /* Int array of size 1. See cholmod_updown.c */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) { double dk, yj, l_kj, lx, l_ij, sqrt_dk, dj, xk, rnz, fl ; double *Lx, *W, *Cx, *Rx, *Xx, *Nx ; Int *Li, *Lp, *Lnz, *Flag, *Stack, *Ci, *Rj, *Rp, *Lnext, *Iwork, *Rnz ; cholmod_sparse *C, Cmatrix ; Int i, j, p, pend, top, len, kk, li, lnz, mark, k, n, parent, Cp [2], do_solve, do_update ; size_t s ; int ok = TRUE ; DEBUG (Int lastrow) ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_NULL (R, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_PATTERN, CHOLMOD_REAL, FALSE) ; RETURN_IF_XTYPE_INVALID (R, CHOLMOD_REAL, CHOLMOD_REAL, FALSE) ; n = L->n ; k = kadd ; if (kadd >= L->n || k < 0) { ERROR (CHOLMOD_INVALID, "k invalid") ; return (FALSE) ; } if (R->ncol != 1 || R->nrow != L->n) { ERROR (CHOLMOD_INVALID, "R invalid") ; return (FALSE) ; } Rj = R->i ; Rx = R->x ; Rp = R->p ; Rnz = R->nz ; rnz = (R->packed) ? (Rp [1]) : (Rnz [0]) ; do_solve = (X != NULL) && (DeltaB != NULL) ; if (do_solve) { RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_REAL, FALSE) ; RETURN_IF_XTYPE_INVALID (DeltaB, CHOLMOD_REAL, CHOLMOD_REAL, FALSE) ; Xx = X->x ; Nx = DeltaB->x ; if (X->nrow != L->n || X->ncol != 1 || DeltaB->nrow != L->n || DeltaB->ncol != 1 || Xx == NULL || Nx == NULL) { ERROR (CHOLMOD_INVALID, "X and/or DeltaB invalid") ; return (FALSE) ; } } else { Xx = NULL ; Nx = NULL ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* s = 2*n */ s = CHOLMOD(mult_size_t) (n, 2, &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (n, s, s, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, s, Common)) ; /* ---------------------------------------------------------------------- */ /* convert to simplicial numeric LDL' factor, if not already */ /* ---------------------------------------------------------------------- */ if (L->xtype == CHOLMOD_PATTERN || L->is_super || L->is_ll) { /* can only update/downdate a simplicial LDL' factorization */ CHOLMOD(change_factor) (CHOLMOD_REAL, FALSE, FALSE, FALSE, FALSE, L, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory, L is returned unchanged */ return (FALSE) ; } } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ /* inputs, not modified on output: */ Lp = L->p ; /* size n+1. input, not modified on output */ /* outputs, contents defined on input for incremental case only: */ Lnz = L->nz ; /* size n */ Li = L->i ; /* size L->nzmax. Can change in size. */ Lx = L->x ; /* size L->nzmax. Can change in size. */ Lnext = L->next ; /* size n+2 */ ASSERT (L->nz != NULL) ; PRINT1 (("rowadd:\n")) ; fl = 0 ; #if 0 #ifndef NDEBUG /* column k of L should be zero, except for the diagonal. This test is * overly cautious. */ for (p = Lp [k] + 1 ; p < Lp [k] + Lnz [k] ; p++) ASSERT (Lx [p] == 0) ; #endif #endif /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Flag = Common->Flag ; /* size n */ W = Common->Xwork ; /* size n */ Cx = W + n ; /* size n (use 2nd column of Xwork for C) */ Iwork = Common->Iwork ; Stack = Iwork ; /* size n (i/i/l), also in cholmod_updown */ Ci = Iwork + n ; /* size n (i/i/l) */ /* NOTE: cholmod_updown uses Iwork [0..n-1] (i/i/l) as Stack as well */ mark = Common->mark ; /* copy Rj/Rx into W/Ci */ for (p = 0 ; p < rnz ; p++) { i = Rj [p] ; ASSERT (i >= 0 && i < n) ; W [i] = Rx [p] ; Ci [p] = i ; } /* At this point, W [Ci [0..rnz-1]] holds the sparse vector to add */ /* The nonzero pattern of column W is held in Ci (it may be unsorted). */ /* ---------------------------------------------------------------------- */ /* symbolic factorization to get pattern of kth row of L */ /* ---------------------------------------------------------------------- */ DEBUG (for (p = 0 ; p < rnz ; p++) PRINT1 (("C ("ID",%g)\n", Ci [p], W [Ci [p]]))) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* flag the diagonal */ Flag [k] = mark ; /* find the union of all the paths */ top = n ; lnz = 0 ; /* # of nonzeros in column k of L, excluding diagonal */ for (p = 0 ; p < rnz ; p++) { i = Ci [p] ; if (i < k) { /* walk from i = entry in Ci to root (and stop if i marked)*/ PRINT2 (("\nwalk from i = "ID" towards k = "ID"\n", i, k)) ; len = 0 ; /* walk up tree, but stop if we go below the diagonal */ while (i < k && i != EMPTY && Flag [i] < mark) { PRINT2 ((" Add "ID" to path\n", i)) ; ASSERT (i >= 0 && i < k) ; Stack [len++] = i ; /* place i on the stack */ Flag [i] = mark ; /* mark i as visited */ /* parent is the first entry in the column after the diagonal */ ASSERT (Lnz [i] > 0) ; parent = (Lnz [i] > 1) ? (Li [Lp [i] + 1]) : EMPTY ; PRINT2 ((" parent: "ID"\n", parent)) ; i = parent ; /* go up the tree */ } ASSERT (len <= top) ; /* move the path down to the bottom of the stack */ /* this shifts Stack [0..len-1] down to [ ... oldtop-1] */ while (len > 0) { Stack [--top] = Stack [--len] ; } } else if (i > k) { /* prune the diagonal and upper triangular entries from Ci */ Ci [lnz++] = i ; Flag [i] = mark ; } } #ifndef NDEBUG PRINT1 (("length of S after prune: "ID"\n", lnz)) ; for (p = 0 ; p < lnz ; p++) { PRINT1 (("After prune Ci ["ID"] = "ID"\n", p, Ci [p])) ; ASSERT (Ci [p] > k) ; } #endif /* ---------------------------------------------------------------------- */ /* ensure each column of L has enough space to grow */ /* ---------------------------------------------------------------------- */ for (kk = top ; kk < n ; kk++) { /* could skip this if we knew column j already included row k */ j = Stack [kk] ; if (Lp [j] + Lnz [j] >= Lp [Lnext [j]]) { PRINT1 (("Col "ID" realloc, old Lnz "ID"\n", j, Lnz [j])) ; if (!CHOLMOD(reallocate_column) (j, Lnz [j] + 1, L, Common)) { /* out of memory, L is now simplicial symbolic */ /* CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; for (i = 0 ; i < n ; i++) { W [i] = 0 ; } return (FALSE) ; } /* L->i and L->x may have moved */ Li = L->i ; Lx = L->x ; } ASSERT (Lp [j] + Lnz [j] < Lp [Lnext [j]] || (Lp [Lnext [j]] - Lp [j] == n-j)) ; } /* ---------------------------------------------------------------------- */ /* compute kth row of L and store in column form */ /* ---------------------------------------------------------------------- */ /* solve L (1:k-1, 1:k-1) * y (1:k-1) = b (1:k-1) */ /* where b (1:k) is in W and Ci */ /* L (k, 1:k-1) = y (1:k-1) ./ D (1:k-1) */ /* D (k) = B (k,k) - L (k, 1:k-1) * y (1:k-1) */ PRINT2 (("\nForward solve: "ID" to "ID"\n", top, n)) ; ASSERT (Lnz [k] >= 1 && Li [Lp [k]] == k) ; DEBUG (for (i = top ; i < n ; i++) PRINT2 ((" Path: "ID"\n", Stack [i]))) ; dk = W [k] ; W [k] = 0.0 ; /* if do_solve: compute x (k) = b (k) - L (k, 1:k-1) * x (1:k-1) */ xk = bk [0] ; PRINT2 (("B [k] = %g\n", xk)) ; for (kk = top ; kk < n ; kk++) { j = Stack [kk] ; i = j ; PRINT2 (("Forward solve col j = "ID":\n", j)) ; ASSERT (j >= 0 && j < k) ; /* forward solve using L (j+1:k-1,j) */ yj = W [j] ; W [j] = 0.0 ; p = Lp [j] ; pend = p + Lnz [j] ; ASSERT (Lnz [j] > 0) ; dj = Lx [p++] ; for ( ; p < pend ; p++) { i = Li [p] ; PRINT2 ((" row "ID"\n", i)) ; ASSERT (i > j) ; ASSERT (i < n) ; /* stop at row k */ if (i >= k) { break ; } W [i] -= Lx [p] * yj ; } /* each iteration of the above for loop did 2 flops, and 3 flops * are done below. so: fl += 2 * (Lp [j] - p - 1) + 3 becomes: */ fl += 2 * (Lp [j] - p) + 1 ; /* scale L (k,1:k-1) and compute dot product for D (k,k) */ l_kj = yj / dj ; dk -= l_kj * yj ; /* compute dot product for X(k) */ if (do_solve) { xk -= l_kj * Xx [j] ; } /* store l_kj in the jth column of L */ /* and shift the rest of the column down */ li = k ; lx = l_kj ; if (i == k) { /* no need to modify the nonzero pattern of L, since it already * contains row index k. */ ASSERT (Li [p] == k) ; Lx [p] = l_kj ; for (p++ ; p < pend ; p++) { i = Li [p] ; l_ij = Lx [p] ; ASSERT (i > k && i < n) ; PRINT2 ((" apply to row "ID" of column k of L\n", i)) ; /* add to the pattern of the kth column of L */ if (Flag [i] < mark) { PRINT2 ((" add Ci["ID"] = "ID"\n", lnz, i)) ; ASSERT (i > k) ; Ci [lnz++] = i ; Flag [i] = mark ; } /* apply the update to the kth column of L */ /* yj is equal to l_kj * d_j */ W [i] -= l_ij * yj ; } } else { PRINT2 (("Shift col j = "ID", apply saxpy to col k of L\n", j)) ; for ( ; p < pend ; p++) { /* swap (Li [p],Lx [p]) with (li,lx) */ i = Li [p] ; l_ij = Lx [p] ; Li [p] = li ; Lx [p] = lx ; li = i ; lx = l_ij ; ASSERT (i > k && i < n) ; PRINT2 ((" apply to row "ID" of column k of L\n", i)) ; /* add to the pattern of the kth column of L */ if (Flag [i] < mark) { PRINT2 ((" add Ci["ID"] = "ID"\n", lnz, i)) ; ASSERT (i > k) ; Ci [lnz++] = i ; Flag [i] = mark ; } /* apply the update to the kth column of L */ /* yj is equal to l_kj * d_j */ W [i] -= l_ij * yj ; } /* store the last value in the jth column of L */ Li [p] = li ; Lx [p] = lx ; Lnz [j]++ ; } } /* ---------------------------------------------------------------------- */ /* merge C with the pattern of the existing column of L */ /* ---------------------------------------------------------------------- */ /* This column should be zero, but it may contain explicit zero entries. * These entries should be kept, not dropped. */ p = Lp [k] ; pend = p + Lnz [k] ; for (p++ ; p < pend ; p++) { i = Li [p] ; /* add to the pattern of the kth column of L */ if (Flag [i] < mark) { PRINT2 ((" add Ci["ID"] = "ID" from existing col k\n", lnz, i)) ; ASSERT (i > k) ; Ci [lnz++] = i ; Flag [i] = mark ; } } /* ---------------------------------------------------------------------- */ if (do_solve) { Xx [k] = xk ; PRINT2 (("Xx [k] = %g\n", Xx [k])) ; } /* ---------------------------------------------------------------------- */ /* ensure abs (dk) >= dbound, if dbound is given */ /* ---------------------------------------------------------------------- */ dk = (IS_GT_ZERO (Common->dbound)) ? (CHOLMOD(dbound) (dk, Common)) : dk ; PRINT2 (("D [k = "ID"] = %g\n", k, dk)) ; /* ---------------------------------------------------------------------- */ /* store the kth column of L */ /* ---------------------------------------------------------------------- */ /* ensure the new column of L has enough space */ if (Lp [k] + lnz + 1 > Lp [Lnext [k]]) { PRINT1 (("New Col "ID" realloc, old Lnz "ID"\n", k, Lnz [k])) ; if (!CHOLMOD(reallocate_column) (k, lnz + 1, L, Common)) { /* out of memory, L is now simplicial symbolic */ CHOLMOD(clear_flag) (Common) ; for (i = 0 ; i < n ; i++) { W [i] = 0 ; } return (FALSE) ; } /* L->i and L->x may have moved */ Li = L->i ; Lx = L->x ; } ASSERT (Lp [k] + lnz + 1 <= Lp [Lnext [k]]) ; #ifndef NDEBUG PRINT2 (("\nPrior to sort: lnz "ID" (excluding diagonal)\n", lnz)) ; for (kk = 0 ; kk < lnz ; kk++) { i = Ci [kk] ; PRINT2 (("L ["ID"] kept: "ID" %e\n", kk, i, W [i] / dk)) ; } #endif /* sort Ci */ qsort (Ci, lnz, sizeof (Int), (int (*) (const void *, const void *)) icomp); /* store the kth column of L */ DEBUG (lastrow = k) ; p = Lp [k] ; Lx [p++] = dk ; Lnz [k] = lnz + 1 ; fl += lnz ; for (kk = 0 ; kk < lnz ; kk++, p++) { i = Ci [kk] ; PRINT2 (("L ["ID"] after sort: "ID", %e\n", kk, i, W [i] / dk)) ; ASSERT (i > lastrow) ; Li [p] = i ; Lx [p] = W [i] / dk ; W [i] = 0.0 ; DEBUG (lastrow = i) ; } /* compute DeltaB for updown (in DeltaB) */ if (do_solve) { p = Lp [k] ; pend = p + Lnz [k] ; for (p++ ; p < pend ; p++) { ASSERT (Li [p] > k) ; Nx [Li [p]] -= Lx [p] * xk ; } } /* clear the flag for the update */ mark = CHOLMOD(clear_flag) (Common) ; /* workspaces are now cleared */ ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 2*n, Common)) ; /* ---------------------------------------------------------------------- */ /* update/downdate */ /* ---------------------------------------------------------------------- */ /* update or downdate L (k+1:n, k+1:n) with the vector * C = L (:,k) * sqrt (abs (D [k])). * Do a numeric update if D[k] < 0, numeric downdate otherwise. */ ok = TRUE ; Common->modfl = 0 ; PRINT1 (("rowadd update lnz = "ID"\n", lnz)) ; if (lnz > 0) { do_update = IS_LT_ZERO (dk) ; if (do_update) { dk = -dk ; } sqrt_dk = sqrt (dk) ; p = Lp [k] + 1 ; for (kk = 0 ; kk < lnz ; kk++, p++) { Cx [kk] = Lx [p] * sqrt_dk ; } fl += lnz + 1 ; /* create a n-by-1 sparse matrix to hold the single column */ C = &Cmatrix ; C->nrow = n ; C->ncol = 1 ; C->nzmax = lnz ; C->sorted = TRUE ; C->packed = TRUE ; C->p = Cp ; C->i = Ci ; C->x = Cx ; C->nz = NULL ; C->itype = L->itype ; C->xtype = L->xtype ; C->dtype = L->dtype ; C->z = NULL ; C->stype = 0 ; Cp [0] = 0 ; Cp [1] = lnz ; /* numeric downdate if dk > 0, and optional Lx=b change */ /* workspace: Flag (nrow), Head (nrow+1), W (nrow), Iwork (2*nrow) */ ok = CHOLMOD(updown_mark) (do_update ? (1) : (0), C, colmark, L, X, DeltaB, Common) ; /* clear workspace */ for (kk = 0 ; kk < lnz ; kk++) { Cx [kk] = 0 ; } } Common->modfl += fl ; DEBUG (CHOLMOD(dump_factor) (L, "LDL factorization, L:", Common)) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 2*n, Common)) ; return (ok) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Modify/cholmod_updown.c0000664000175000017500000014530414224052371021275 00000000000000/* ========================================================================== */ /* === Modify/cholmod_updown ================================================ */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Modify Module. * Copyright (C) 2005-2006, Timothy A. Davis and William W. Hager. * The CHOLMOD/Modify Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Updates/downdates the LDL' factorization (symbolic, then numeric), by * computing a new factorization of * * Lnew * Dnew * Lnew' = Lold * Dold * Lold' +/- C*C' * * C must be sorted. It can be either packed or unpacked. As in all CHOLMOD * routines, the columns of L are sorted on input, and also on output. * * If the factor is not an unpacked LDL' or dynamic LDL', it is converted * to an LDL' dynamic factor. An unpacked LDL' factor may be updated, but if * any one column runs out of space, the factor is converted to an LDL' * dynamic one. If the initial conversion fails, the factor is returned * unchanged. * * If memory runs out during the update, the factor is returned as a simplicial * symbolic factor. That is, everything is freed except for the fill-reducing * ordering and its corresponding column counts (typically computed by * cholmod_analyze). * * Note that the fill-reducing permutation L->Perm is NOT used. The row * indices of C refer to the rows of L, not A. If your original system is * LDL' = PAP' (where P = L->Perm), and you want to compute the LDL' * factorization of A+CC', then you must permute C first. That is: * * PAP' = LDL' * P(A+CC')P' = PAP'+PCC'P' = LDL' + (PC)(PC)' = LDL' + Cnew*Cnew' * where Cnew = P*C. * * You can use the cholmod_submatrix routine in the MatrixOps module * to permute C, with: * * Cnew = cholmod_submatrix (C, L->Perm, L->n, NULL, -1, TRUE, TRUE, Common) ; * * Note that the sorted input parameter to cholmod_submatrix must be TRUE, * because cholmod_updown requires C with sorted columns. * * The system Lx=b can also be updated/downdated. The old system was Lold*x=b. * The new system is Lnew*xnew = b + deltab. The old solution x is overwritten * with xnew. Note that as in the update/downdate of L itself, the fill- * reducing permutation L->Perm is not used. x and b are in the permuted * ordering, not your original ordering. x and b are n-by-1; this routine * does not handle multiple right-hand-sides. * * workspace: Flag (nrow), Head (nrow+1), W (maxrank*nrow), Iwork (nrow), * where maxrank is 2, 4, or 8. * * Only real matrices are supported. A symbolic L is converted into a * numeric identity matrix. */ #ifndef NGPL #ifndef NMODIFY #include "cholmod_internal.h" #include "cholmod_modify.h" /* ========================================================================== */ /* === cholmod_updown ======================================================= */ /* ========================================================================== */ /* Compute the new LDL' factorization of LDL'+CC' (an update) or LDL'-CC' * (a downdate). The factor object L need not be an LDL' factorization; it * is converted to one if it isn't. */ int CHOLMOD(updown) ( /* ---- input ---- */ int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* the incoming sparse update */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) { return (CHOLMOD(updown_mask2) (update, C, NULL, NULL, 0, L, NULL, NULL, Common)) ; } /* ========================================================================== */ /* === cholmod_updown_solve ================================================= */ /* ========================================================================== */ /* Does the same as cholmod_updown, except that it also updates/downdates the * solution to Lx=b+DeltaB. x and b must be n-by-1 dense matrices. b is not * need as input to this routine, but a sparse change to b is (DeltaB). Only * entries in DeltaB corresponding to columns modified in L are accessed; the * rest are ignored. */ int CHOLMOD(updown_solve) ( /* ---- input ---- */ int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* the incoming sparse update */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) { return (CHOLMOD(updown_mask2) (update, C, NULL, NULL, 0, L, X, DeltaB, Common)) ; } /* ========================================================================== */ /* === Power2 =============================================================== */ /* ========================================================================== */ /* Power2 [i] is smallest power of 2 that is >= i (for i in range 0 to 8) */ static Int Power2 [ ] = { /* 0 1 2 3 4 5 6 7 8 */ 0, 1, 2, 4, 4, 8, 8, 8, 8 } ; /* ========================================================================== */ /* === debug routines ======================================================= */ /* ========================================================================== */ #ifndef NDEBUG static void dump_set (Int s, Int **Set_ps1, Int **Set_ps2, Int j, Int n, cholmod_common *Common) { Int *p, len, i, ilast ; if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return ; } len = Set_ps2 [s] - Set_ps1 [s] ; PRINT2 (("Set s: "ID" len: "ID":", s, len)) ; ASSERT (len > 0) ; ilast = j ; for (p = Set_ps1 [s] ; p < Set_ps2 [s] ; p++) { i = *p ; PRINT3 ((" "ID"", i)) ; ASSERT (i > ilast && i < n) ; ilast = i ; } PRINT3 (("\n")) ; } static void dump_col ( char *w, Int j, Int p1, Int p2, Int *Li, double *Lx, Int n, cholmod_common *Common ) { Int p, row, lastrow ; if (CHOLMOD(dump) < -1) { /* no checks if debug level is -2 or less */ return ; } PRINT3 (("\n\nDUMP COL==== j = "ID" %s: p1="ID" p2="ID" \n", j, w, p1,p2)); lastrow = -1 ; for (p = p1 ; p < p2 ; p++) { PRINT3 ((" "ID": ", p)) ; row = Li [p] ; PRINT3 ((""ID" ", Li [p])) ; PRINT3 (("%g ", Lx [p])) ; PRINT3 (("\n")) ; ASSERT (row > lastrow && row < n) ; lastrow = row ; } ASSERT (p1 < p2) ; ASSERT (Li [p1] == j) ; PRINT3 (("\n")) ; } #endif /* ========================================================================== */ /* === a path =============================================================== */ /* ========================================================================== */ /* A path is a set of nodes of the etree which are all affected by the same * columns of C. */ typedef struct Path_struct { Int start ; /* column at which to start, or EMPTY if initial */ Int end ; /* column at which to end, or EMPTY if initial */ Int ccol ; /* column of C to which path refers */ Int parent ; /* parent path */ Int c ; /* child of j along this path */ Int next ; /* next path in link list */ Int rank ; /* number of rank-1 paths merged onto this path */ Int order ; /* dfs order of this path */ Int wfirst ; /* first column of W to affect this path */ Int pending ; /* column at which the path is pending */ Int botrow ; /* for partial update/downdate of solution to Lx=b */ } Path_type ; /* ========================================================================== */ /* === dfs ================================================================== */ /* ========================================================================== */ /* Compute the DFS order of the set of paths. This can be recursive because * there are at most 23 paths to sort: one for each column of C (8 at most), * and one for each node in a balanced binary tree with 8 leaves (15). * Stack overflow is thus not a problem. */ static void dfs ( Path_type *Path, /* the set of Paths */ Int k, /* the rank of the update/downdate */ Int path, /* which path to work on */ Int *path_order, /* the current path order */ Int *w_order, /* the current order of the columns of W */ Int depth, Int npaths /* total number of paths */ ) { Int c ; /* child path */ ASSERT (path >= 0 && path < npaths) ; if (path < k) { /* this is a leaf node, corresponding to column W (:,path) */ /* and column C (:, Path [path].ccol) */ ASSERT (Path [path].ccol >= 0) ; Path [path].wfirst = *w_order ; Path [path].order = *w_order ; (*w_order)++ ; } else { /* this is a non-leaf path, within the tree */ ASSERT (Path [path].c != EMPTY) ; ASSERT (Path [path].ccol == EMPTY) ; /* order each child path */ for (c = Path [path].c ; c != EMPTY ; c = Path [c].next) { dfs (Path, k, c, path_order, w_order, depth+1, npaths) ; if (Path [path].wfirst == EMPTY) { Path [path].wfirst = Path [c].wfirst ; } } /* order this path next */ Path [path].order = (*path_order)++ ; } } /* ========================================================================== */ /* === numeric update/downdate routines ===================================== */ /* ========================================================================== */ #define WDIM 1 #include "t_cholmod_updown.c" #define WDIM 2 #include "t_cholmod_updown.c" #define WDIM 4 #include "t_cholmod_updown.c" #define WDIM 8 #include "t_cholmod_updown.c" /* ========================================================================== */ /* === cholmod_updown_mark ================================================== */ /* ========================================================================== */ /* Update/downdate LDL' +/- C*C', and update/downdate selected portions of the * solution to Lx=b. * * The original system is L*x = b. The new system is Lnew*xnew = b + deltab. * deltab(i) can be nonzero only if column i of L is modified by the update/ * downdate. If column i is not modified, the deltab(i) is not accessed. * * The solution to Lx=b is not modified if either X or DeltaB are NULL. * * Rowmark and colmark: * -------------------- * * rowmark and colmark affect which portions of L take part in the update/ * downdate of the solution to Lx=b. They do not affect how L itself is * updated/downdated. They are both ignored if X or DeltaB are NULL. * * If not NULL, rowmark is an integer array of size n where L is n-by-n. * rowmark [j] defines the part of column j of L that takes part in the update/ * downdate of the forward solve, Lx=b. Specifically, if i = rowmark [j], * then L(j:i-1,j) is used, and L(i:end,j) is ignored. * * If not NULL, colmark is an integer array of size C->ncol. colmark [ccol] * for a column C(:,ccol) redefines those parts of L that take part in the * update/downdate of Lx=b. Each column of C affects a set of columns of L. * If column ccol of C affects column j of L, then the new rowmark [j] of * column j of L is defined as colmark [ccol]. In a multiple-rank update/ * downdate, if two or more columns of C affect column j, its new rowmark [j] * is the colmark of the least-numbered column of C. colmark is ignored if * it is NULL, in which case rowmark is not modified. If colmark [ccol] is * EMPTY (-1), then rowmark is not modified for that particular column of C. * colmark is ignored if it is NULL, or rowmark, X, or DeltaB are NULL. * * The algorithm for modifying the solution to Lx=b when rowmark and colmark * are NULL is as follows: * * for each column j of L that is modified: * deltab (j:end) += L (j:end,j) * x(j) * modify L * for each column j of L that is modified: * x (j) = deltab (j) * deltab (j) = 0 * deltab (j+1:end) -= L (j+1:end,j) * x(j) * * If rowmark is non-NULL but colmark is NULL: * * for each column j of L that is modified: * deltab (j:rowmark(j)-1) += L (j:rowmark(j)-1,j) * x(j) * modify L * for each column j of L that is modified: * x (j) = deltab (j) * deltab (j) = 0 * deltab (j+1:rowmark(j)-1) -= L (j+1:rowmark(j)-1,j) * x(j) * * If both rowmark and colmark are non-NULL: * * for each column j of L that is modified: * deltab (j:rowmark(j)-1) += L (j:rowmark(j)-1,j) * x(j) * modify L * for each column j of L that is modified: * modify rowmark (j) according to colmark * for each column j of L that is modified: * x (j) = deltab (j) * deltab (j) = 0 * deltab (j+1:rowmark(j)-1) -= L (j+1:rowmark(j)-1,j) * x(j) * * Note that if the rank of C exceeds k = Common->maxrank (which is 2, 4, or 8), * then the update/downdate is done as a series of rank-k updates. In this * case, the above algorithm is repeated for each block of k columns of C. * * Unless it leads to no changes in rowmark, colmark should be used only if * C->ncol <= Common->maxrank, because the update/downdate is done with maxrank * columns at a time. Otherwise, the results are undefined. * * This routine is an "expert" routine. It is meant for use in LPDASA only. */ int CHOLMOD(updown_mark) ( /* ---- input ---- */ int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* the incoming sparse update */ Int *colmark, /* Int array of size n. */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) { return (CHOLMOD(updown_mask2) (update, C, colmark, NULL, 0, L, X, DeltaB, Common)) ; } /* ========================================================================== */ /* === cholmod_updown_mask ================================================== */ /* ========================================================================== */ int CHOLMOD(updown_mask) ( /* ---- input ---- */ int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* the incoming sparse update */ Int *colmark, /* Int array of size n. See cholmod_updown.c */ Int *mask, /* size n */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) { Int maskmark = 0 ; return (CHOLMOD(updown_mask2) (update, C, colmark, mask, maskmark, L, X, DeltaB, Common)) ; } /* ========================================================================== */ /* === cholmod_updown_mask2 ================================================= */ /* ========================================================================== */ int CHOLMOD(updown_mask2) ( /* ---- input ---- */ int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* the incoming sparse update */ Int *colmark, /* Int array of size n. See cholmod_updown.c */ Int *mask, /* size n */ Int maskmark, /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) { double xj, fl ; double *Lx, *W, *Xx, *Nx ; Int *Li, *Lp, *Lnz, *Cp, *Ci, *Cnz, *Head, *Flag, *Stack, *Lnext, *Iwork, *Set_ps1 [32], *Set_ps2 [32], *ps1, *ps2 ; size_t maxrank ; Path_type OrderedPath [32], Path [32] ; Int n, wdim, k1, k2, npaths, i, j, row, packed, ccol, p, cncol, do_solve, mark, jj, j2, kk, nextj, p1, p2, c, use_colmark, newlnz, k, newpath, path_order, w_order, scattered, path, newparent, pp1, pp2, smax, maxrow, row1, nsets, s, p3, newlnz1, Set [32], top, len, lnz, m, botrow ; size_t w ; int ok = TRUE ; DEBUG (Int oldparent) ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (C, FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_PATTERN, CHOLMOD_REAL, FALSE) ; RETURN_IF_XTYPE_INVALID (C, CHOLMOD_REAL, CHOLMOD_REAL, FALSE) ; n = L->n ; cncol = C->ncol ; if (!(C->sorted)) { ERROR (CHOLMOD_INVALID, "C must have sorted columns") ; return (FALSE) ; } if (n != (Int) (C->nrow)) { ERROR (CHOLMOD_INVALID, "C and L dimensions do not match") ; return (FALSE) ; } do_solve = (X != NULL) && (DeltaB != NULL) ; if (do_solve) { RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_REAL, FALSE) ; RETURN_IF_XTYPE_INVALID (DeltaB, CHOLMOD_REAL, CHOLMOD_REAL, FALSE) ; Xx = X->x ; Nx = DeltaB->x ; if (X->nrow != L->n || X->ncol != 1 || DeltaB->nrow != L->n || DeltaB->ncol != 1 || Xx == NULL || Nx == NULL) { ERROR (CHOLMOD_INVALID, "X and/or DeltaB invalid") ; return (FALSE) ; } } else { Xx = NULL ; Nx = NULL ; } Common->status = CHOLMOD_OK ; Common->modfl = 0 ; fl = 0 ; use_colmark = (colmark != NULL) ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* Note: cholmod_rowadd and cholmod_rowdel use the second n doubles in * Common->Xwork for Cx, and then perform a rank-1 update here, which uses * the first n doubles in Common->Xwork. Both the rowadd and rowdel * routines allocate enough workspace so that Common->Xwork isn't destroyed * below. Also, both cholmod_rowadd and cholmod_rowdel use the second n * ints in Common->Iwork for Ci. */ /* make sure maxrank is in the proper range */ maxrank = CHOLMOD(maxrank) (n, Common) ; k = MIN (cncol, (Int) maxrank) ; /* maximum k is wdim */ wdim = Power2 [k] ; /* number of columns needed in W */ ASSERT (wdim <= (Int) maxrank) ; PRINT1 (("updown wdim final "ID" k "ID"\n", wdim, k)) ; /* w = wdim * n */ w = CHOLMOD(mult_size_t) (n, wdim, &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (n, n, w, Common) ; if (Common->status < CHOLMOD_OK || maxrank == 0) { /* out of memory, L is returned unchanged */ return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* convert to simplicial numeric LDL' factor, if not already */ /* ---------------------------------------------------------------------- */ if (L->xtype == CHOLMOD_PATTERN || L->is_super || L->is_ll) { /* can only update/downdate a simplicial LDL' factorization */ CHOLMOD(change_factor) (CHOLMOD_REAL, FALSE, FALSE, FALSE, FALSE, L, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory, L is returned unchanged */ return (FALSE) ; } } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ /* mark = CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; PRINT1 (("updown, rank %g update %d\n", (double) C->ncol, update)) ; DEBUG (CHOLMOD(dump_factor) (L, "input L for updown", Common)) ; ASSERT (CHOLMOD(dump_sparse) (C, "input C for updown", Common) >= 0) ; Ci = C->i ; Cp = C->p ; Cnz = C->nz ; packed = C->packed ; ASSERT (IMPLIES (!packed, Cnz != NULL)) ; /* ---------------------------------------------------------------------- */ /* quick return */ /* ---------------------------------------------------------------------- */ if (cncol <= 0 || n == 0) { /* nothing to do */ return (TRUE) ; } /* ---------------------------------------------------------------------- */ /* get L */ /* ---------------------------------------------------------------------- */ Li = L->i ; Lx = L->x ; Lp = L->p ; Lnz = L->nz ; Lnext = L->next ; ASSERT (Lnz != NULL) ; /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ Flag = Common->Flag ; /* size n, Flag [i] <= mark must hold */ Head = Common->Head ; /* size n, Head [i] == EMPTY must hold */ W = Common->Xwork ; /* size n-by-wdim, zero on input and output*/ /* note that Iwork [n .. 2*n-1] (i/i/l) may be in use in rowadd/rowdel: */ Iwork = Common->Iwork ; Stack = Iwork ; /* size n, uninitialized (i/i/l) */ /* ---------------------------------------------------------------------- */ /* entire rank-cncol update, done as a sequence of rank-k updates */ /* ---------------------------------------------------------------------- */ ps1 = NULL ; ps2 = NULL ; for (k1 = 0 ; k1 < cncol ; k1 += k) { /* ------------------------------------------------------------------ */ /* get the next k columns of C for the update/downdate */ /* ------------------------------------------------------------------ */ /* the last update/downdate might be less than rank-k */ if (k > cncol - k1) { k = cncol - k1 ; wdim = Power2 [k] ; } k2 = k1 + k - 1 ; /* workspaces are in the following state, on input and output */ ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, wdim, Common)) ; /* ------------------------------------------------------------------ */ /* create a zero-length path for each column of W */ /* ------------------------------------------------------------------ */ nextj = n ; path = 0 ; for (ccol = k1 ; ccol <= k2 ; ccol++) { PRINT1 (("Column ["ID"]: "ID"\n", path, ccol)) ; ASSERT (ccol >= 0 && ccol <= cncol) ; pp1 = Cp [ccol] ; pp2 = (packed) ? (Cp [ccol+1]) : (pp1 + Cnz [ccol]) ; /* get the row index j of the first entry in C (:,ccol) */ if (pp2 > pp1) { /* Column ccol of C has at least one entry. */ j = Ci [pp1] ; } else { /* Column ccol of C is empty. Pretend it has one entry in * the last column with numerical value of zero. */ j = n-1 ; } ASSERT (j >= 0 && j < n) ; /* find first column to work on */ nextj = MIN (nextj, j) ; Path [path].ccol = ccol ; /* which column of C this path is for */ Path [path].start = EMPTY ; /* paths for C have zero length */ Path [path].end = EMPTY ; Path [path].parent = EMPTY ; /* no parent yet */ Path [path].rank = 1 ; /* one column of W */ Path [path].c = EMPTY ; /* no child of this path (case A) */ Path [path].next = Head [j] ; /* this path is pending at col j */ Path [path].pending = j ; /* this path is pending at col j */ Head [j] = path ; /* this path is pending at col j */ PRINT1(("Path "ID" starts: start "ID" end "ID" parent "ID" c "ID"" "j "ID" ccol "ID"\n", path, Path [path].start, Path [path].end, Path [path].parent, Path [path].c, j, ccol)) ; /* initialize botrow for this path */ Path [path].botrow = (use_colmark) ? colmark [ccol] : n ; path++ ; } /* we start with paths 0 to k-1. Next one (now unused) is npaths */ npaths = k ; j = nextj ; ASSERT (j < n) ; scattered = FALSE ; /* ------------------------------------------------------------------ */ /* symbolic update of columns of L */ /* ------------------------------------------------------------------ */ while (j < n) { ASSERT (j >= 0 && j < n && Lnz [j] > 0) ; /* the old column, Li [p1..p2-1]. D (j,j) is stored in Lx [p1] */ p1 = Lp [j] ; newlnz = Lnz [j] ; p2 = p1 + newlnz ; #ifndef NDEBUG PRINT1 (("\n=========Column j="ID" p1 "ID" p2 "ID" lnz "ID" \n", j, p1, p2, newlnz)) ; dump_col ("Old", j, p1, p2, Li, Lx, n, Common) ; oldparent = (Lnz [j] > 1) ? (Li [p1 + 1]) : EMPTY ; ASSERT (CHOLMOD(dump_work) (TRUE, FALSE, 0, Common)) ; ASSERT (!scattered) ; PRINT1 (("Col "ID": Checking paths, npaths: "ID"\n", j, npaths)) ; for (kk = 0 ; kk < npaths ; kk++) { Int kk2, found, j3 = Path [kk].pending ; PRINT2 (("Path "ID" pending at "ID".\n", kk, j3)) ; if (j3 != EMPTY) { /* Path kk must be somewhere in link list for column j3 */ ASSERT (Head [j3] != EMPTY) ; PRINT3 ((" List at "ID": ", j3)) ; found = FALSE ; for (kk2 = Head [j3] ; kk2 != EMPTY ; kk2 = Path [kk2].next) { PRINT3 ((""ID" ", kk2)) ; ASSERT (Path [kk2].pending == j3) ; found = found || (kk2 == kk) ; } PRINT3 (("\n")) ; ASSERT (found) ; } } PRINT1 (("\nCol "ID": Paths at this column, head "ID"\n", j, Head [j])); ASSERT (Head [j] != EMPTY) ; for (kk = Head [j] ; kk != EMPTY ; kk = Path [kk].next) { PRINT1 (("path "ID": (c="ID" j="ID") npaths "ID"\n", kk, Path[kk].c, j, npaths)) ; ASSERT (kk >= 0 && kk < npaths) ; ASSERT (Path [kk].pending == j) ; } #endif /* -------------------------------------------------------------- */ /* determine the path we're on */ /* -------------------------------------------------------------- */ /* get the first old path at column j */ path = Head [j] ; /* -------------------------------------------------------------- */ /* update/downdate of forward solve, Lx=b */ /* -------------------------------------------------------------- */ if (do_solve) { xj = Xx [j] ; if (IS_NONZERO (xj)) { xj = Xx [j] ; /* This is first time column j has been seen for entire */ /* rank-k update/downdate. */ /* DeltaB += Lold (j:botrow-1,j) * X (j) */ Nx [j] += xj ; /* diagonal of L */ /* find the botrow for this column */ botrow = (use_colmark) ? Path [path].botrow : n ; for (p = p1 + 1 ; p < p2 ; p++) { i = Li [p] ; if (i >= botrow) { break ; } Nx [i] += Lx [p] * xj ; } /* clear X[j] to flag col j of Lold as having been seen. If * X (j) was initially zero, then the above code is never * executed for column j. This is safe, since if xj=0 the * code above does not do anything anyway. */ Xx [j] = 0.0 ; } } /* -------------------------------------------------------------- */ /* start a new path at this column if two or more paths merge */ /* -------------------------------------------------------------- */ newpath = /* start a new path if paths have merged */ (Path [path].next != EMPTY) /* or if j is the first node on a path (case A). */ || (Path [path].c == EMPTY) ; if (newpath) { /* get the botrow of the first path at column j */ botrow = (use_colmark) ? Path [path].botrow : n ; path = npaths++ ; ASSERT (npaths <= 3*k) ; Path [path].ccol = EMPTY ; /* no single col of C for this path*/ Path [path].start = j ; /* path starts at this column j */ Path [path].end = EMPTY ; /* don't know yet where it ends */ Path [path].parent = EMPTY ;/* don't know parent path yet */ Path [path].rank = 0 ; /* rank is sum of child path ranks */ PRINT1 (("Path "ID" starts: start "ID" end "ID" parent "ID"\n", path, Path [path].start, Path [path].end, Path [path].parent)) ; /* set the botrow of the new path */ Path [path].botrow = (use_colmark) ? botrow : n ; } /* -------------------------------------------------------------- */ /* for each path kk pending at column j */ /* -------------------------------------------------------------- */ /* make a list of the sets that need to be merged into column j */ nsets = 0 ; for (kk = Head [j] ; kk != EMPTY ; kk = Path [kk].next) { /* ---------------------------------------------------------- */ /* path kk is at (c,j) */ /* ---------------------------------------------------------- */ c = Path [kk].c ; ASSERT (c < j) ; PRINT1 (("TUPLE on path "ID" (c="ID" j="ID")\n", kk, c, j)) ; ASSERT (Path [kk].pending == j) ; if (newpath) { /* finalize path kk and find rank of this path */ Path [kk].end = c ; /* end of old path is previous node c */ Path [kk].parent = path ; /* parent is this path */ Path [path].rank += Path [kk].rank ; /* sum up ranks */ Path [kk].pending = EMPTY ; PRINT1 (("Path "ID" done:start "ID" end "ID" parent "ID"\n", kk, Path [kk].start, Path [kk].end, Path [kk].parent)) ; } if (c == EMPTY) { /* ------------------------------------------------------ */ /* CASE A: first node in path */ /* ------------------------------------------------------ */ /* update: add pattern of incoming column */ /* Column ccol of C is in Ci [pp1 ... pp2-1] */ ccol = Path [kk].ccol ; pp1 = Cp [ccol] ; pp2 = (packed) ? (Cp [ccol+1]) : (pp1 + Cnz [ccol]) ; PRINT1 (("Case A, ccol = "ID" len "ID"\n", ccol, pp2-pp1)) ; ASSERT (IMPLIES (pp2 > pp1, Ci [pp1] == j)) ; if (!scattered) { /* scatter the original pattern of column j of L */ for (p = p1 ; p < p2 ; p++) { Flag [Li [p]] = mark ; } scattered = TRUE ; } /* scatter column ccol of C (skip first entry, j) */ newlnz1 = newlnz ; for (p = pp1 + 1 ; p < pp2 ; p++) { row = Ci [p] ; if (Flag [row] < mark) { /* this is a new entry in Lj' */ Flag [row] = mark ; newlnz++ ; } } if (newlnz1 != newlnz) { /* column ccol of C adds something to column j of L */ Set [nsets++] = FLIP (ccol) ; } } else if (Head [c] == 1) { /* ------------------------------------------------------ */ /* CASE B: c is old, but changed, child of j */ /* CASE C: new child of j */ /* ------------------------------------------------------ */ /* Head [c] is 1 if col c of L has new entries, * EMPTY otherwise */ Flag [c] = 0 ; Head [c] = EMPTY ; /* update: add Lc' */ /* column c of L is in Li [pp1 .. pp2-1] */ pp1 = Lp [c] ; pp2 = pp1 + Lnz [c] ; PRINT1 (("Case B/C: c = "ID"\n", c)) ; DEBUG (dump_col ("Child", c, pp1, pp2, Li, Lx, n, Common)) ; ASSERT (j == Li [pp1 + 1]) ; /* j is new parent of c */ if (!scattered) { /* scatter the original pattern of column j of L */ for (p = p1 ; p < p2 ; p++) { Flag [Li [p]] = mark ; } scattered = TRUE ; } /* scatter column c of L (skip first two entries, c and j)*/ newlnz1 = newlnz ; for (p = pp1 + 2 ; p < pp2 ; p++) { row = Li [p] ; if (Flag [row] < mark) { /* this is a new entry in Lj' */ Flag [row] = mark ; newlnz++ ; } } PRINT2 (("\n")) ; if (newlnz1 != newlnz) { /* column c of L adds something to column j of L */ Set [nsets++] = c ; } } } /* -------------------------------------------------------------- */ /* update the pattern of column j of L */ /* -------------------------------------------------------------- */ /* Column j of L will be in Li/Lx [p1 .. p3-1] */ p3 = p1 + newlnz ; ASSERT (IMPLIES (nsets == 0, newlnz == Lnz [j])) ; PRINT1 (("p1 "ID" p2 "ID" p3 "ID" nsets "ID"\n", p1, p2, p3,nsets)); /* -------------------------------------------------------------- */ /* ensure we have enough space for the longer column */ /* -------------------------------------------------------------- */ if (nsets > 0 && p3 > Lp [Lnext [j]]) { PRINT1 (("Col realloc: j "ID" newlnz "ID"\n", j, newlnz)) ; if (!CHOLMOD(reallocate_column) (j, newlnz, L, Common)) { /* out of memory, L is now simplicial symbolic */ CHOLMOD(clear_flag) (Common) ; for (j = 0 ; j <= n ; j++) { Head [j] = EMPTY ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, wdim, Common)) ; return (FALSE) ; } /* L->i and L->x may have moved. Column j has moved too */ Li = L->i ; Lx = L->x ; p1 = Lp [j] ; p2 = p1 + Lnz [j] ; p3 = p1 + newlnz ; } /* -------------------------------------------------------------- */ /* create set pointers */ /* -------------------------------------------------------------- */ for (s = 0 ; s < nsets ; s++) { /* Pattern of Set s is *(Set_ps1 [s] ... Set_ps2 [s]-1) */ c = Set [s] ; if (c < EMPTY) { /* column ccol of C, skip first entry (j) */ ccol = FLIP (c) ; pp1 = Cp [ccol] ; pp2 = (packed) ? (Cp [ccol+1]) : (pp1 + Cnz [ccol]) ; ASSERT (pp2 - pp1 > 1) ; Set_ps1 [s] = &(Ci [pp1 + 1]) ; Set_ps2 [s] = &(Ci [pp2]) ; PRINT1 (("set "ID" is ccol "ID"\n", s, ccol)) ; } else { /* column c of L, skip first two entries (c and j) */ pp1 = Lp [c] ; pp2 = pp1 + Lnz [c] ; ASSERT (Lnz [c] > 2) ; Set_ps1 [s] = &(Li [pp1 + 2]) ; Set_ps2 [s] = &(Li [pp2]) ; PRINT1 (("set "ID" is L "ID"\n", s, c)) ; } DEBUG (dump_set (s, Set_ps1, Set_ps2, j, n, Common)) ; } /* -------------------------------------------------------------- */ /* multiset merge */ /* -------------------------------------------------------------- */ /* Merge the sets into a single sorted set, Lj'. Before the merge * starts, column j is located in Li/Lx [p1 ... p2-1] and the * space Li/Lx [p2 ... p3-1] is empty. p1 is Lp [j], p2 is * Lp [j] + Lnz [j] (the old length of the column), and p3 is * Lp [j] + newlnz (the new and longer length of the column). * * The sets 0 to nsets-1 are defined by the Set_ps1 and Set_ps2 * pointers. Set s is located in *(Set_ps1 [s] ... Set_ps2 [s]-1). * It may be a column of C, or a column of L. All row indices i in * the sets are in the range i > j and i < n. All sets are sorted. * * The merge into column j of L is done in place. * * During the merge, p2 and p3 are updated. Li/Lx [p1..p2-1] * reflects the indices of the old column j of L that are yet to * be merged into the new column. Entries in their proper place in * the new column j of L are located in Li/Lx [p3 ... p1+newlnz-1]. * The merge finishes when p2 == p3. * * During the merge, set s consumed as it is merged into column j of * L. Its unconsumed contents are *(Set_ps1 [s] ... Set_ps2 [s]-1). * When a set is completely consumed, it is removed from the set of * sets, and nsets is decremented. * * The multiset merge and 2-set merge finishes when p2 == p3. */ PRINT1 (("Multiset merge p3 "ID" p2 "ID" nsets "ID"\n", p3, p2, nsets)) ; while (p3 > p2 && nsets > 1) { #ifndef NDEBUG PRINT2 (("\nMultiset merge. nsets = "ID"\n", nsets)) ; PRINT2 (("Source col p1 = "ID", p2 = "ID", p3= "ID"\n", p1, p2, p3)) ; for (p = p1 + 1 ; p < p2 ; p++) { PRINT2 ((" p: "ID" source row "ID" %g\n", p, Li[p], Lx[p])) ; ASSERT (Li [p] > j && Li [p] < n) ; } PRINT2 (("---\n")) ; for (p = p3 ; p < p1 + newlnz ; p++) { PRINT2 ((" p: "ID" target row "ID" %g\n", p, Li[p], Lx[p])) ; ASSERT (Li [p] > j && Li [p] < n) ; } for (s = 0 ; s < nsets ; s++) { dump_set (s, Set_ps1, Set_ps2, j, n, Common) ; } #endif /* get the entry at the tail end of source column Lj */ row1 = Li [p2 - 1] ; ASSERT (row1 >= j && p2 >= p1) ; /* find the largest row in all the sets */ maxrow = row1 ; smax = EMPTY ; for (s = nsets-1 ; s >= 0 ; s--) { ASSERT (Set_ps1 [s] < Set_ps2 [s]) ; row = *(Set_ps2 [s] - 1) ; if (row == maxrow) { /* skip past this entry in set s (it is a duplicate) */ Set_ps2 [s]-- ; if (Set_ps1 [s] == Set_ps2 [s]) { /* nothing more in this set */ nsets-- ; Set_ps1 [s] = Set_ps1 [nsets] ; Set_ps2 [s] = Set_ps2 [nsets] ; if (smax == nsets) { /* Set smax redefined; it is now this set */ smax = s ; } } } else if (row > maxrow) { maxrow = row ; smax = s ; } } ASSERT (maxrow > j) ; /* move the row onto the stack of the target column */ if (maxrow == row1) { /* next entry is in Lj, move to the bottom of Lj' */ ASSERT (smax == EMPTY) ; p2-- ; p3-- ; Li [p3] = maxrow ; Lx [p3] = Lx [p2] ; } else { /* new entry in Lj' */ ASSERT (smax >= 0 && smax < nsets) ; Set_ps2 [smax]-- ; p3-- ; Li [p3] = maxrow ; Lx [p3] = 0.0 ; if (Set_ps1 [smax] == Set_ps2 [smax]) { /* nothing more in this set */ nsets-- ; Set_ps1 [smax] = Set_ps1 [nsets] ; Set_ps2 [smax] = Set_ps2 [nsets] ; PRINT1 (("Set "ID" now empty\n", smax)) ; } } } /* -------------------------------------------------------------- */ /* 2-set merge: */ /* -------------------------------------------------------------- */ /* This the same as the multi-set merge, except there is only one * set s = 0 left. The source column j and the set 0 are being * merged into the target column j. */ if (nsets > 0) { ps1 = Set_ps1 [0] ; ps2 = Set_ps2 [0] ; } while (p3 > p2) { #ifndef NDEBUG PRINT2 (("\n2-set merge.\n")) ; ASSERT (nsets == 1) ; PRINT2 (("Source col p1 = "ID", p2 = "ID", p3= "ID"\n", p1, p2, p3)) ; for (p = p1 + 1 ; p < p2 ; p++) { PRINT2 ((" p: "ID" source row "ID" %g\n", p, Li[p], Lx[p])) ; ASSERT (Li [p] > j && Li [p] < n) ; } PRINT2 (("---\n")) ; for (p = p3 ; p < p1 + newlnz ; p++) { PRINT2 ((" p: "ID" target row "ID" %g\n", p, Li[p], Lx[p])) ; ASSERT (Li [p] > j && Li [p] < n) ; } dump_set (0, Set_ps1, Set_ps2, j, n, Common) ; #endif if (p2 == p1 + 1) { /* the top of Lj is empty; copy the set and quit */ while (p3 > p2) { /* new entry in Lj' */ row = *(--ps2) ; p3-- ; Li [p3] = row ; Lx [p3] = 0.0 ; } } else { /* get the entry at the tail end of Lj */ row1 = Li [p2 - 1] ; ASSERT (row1 > j && row1 < n) ; /* get the entry at the tail end of the incoming set */ ASSERT (ps1 < ps2) ; row = *(ps2-1) ; ASSERT (row > j && row1 < n) ; /* move the larger of the two entries to the target set */ if (row1 >= row) { /* next entry is in Lj, move to the bottom */ if (row1 == row) { /* skip past this entry in the set */ ps2-- ; } p2-- ; p3-- ; Li [p3] = row1 ; Lx [p3] = Lx [p2] ; } else { /* new entry in Lj' */ ps2-- ; p3-- ; Li [p3] = row ; Lx [p3] = 0.0 ; } } } /* -------------------------------------------------------------- */ /* The new column j of L is now in Li/Lx [p1 ... p2-1] */ /* -------------------------------------------------------------- */ p2 = p1 + newlnz ; DEBUG (dump_col ("After merge: ", j, p1, p2, Li, Lx, n, Common)) ; fl += Path [path].rank * (6 + 4 * (double) newlnz) ; /* -------------------------------------------------------------- */ /* clear Flag; original pattern of column j L no longer marked */ /* -------------------------------------------------------------- */ mark = CHOLMOD(clear_flag) (Common) ; scattered = FALSE ; /* -------------------------------------------------------------- */ /* find the new parent */ /* -------------------------------------------------------------- */ newparent = (newlnz > 1) ? (Li [p1 + 1]) : EMPTY ; PRINT1 (("\nNew parent, Lnz: "ID": "ID" "ID"\n", j, newparent,newlnz)); ASSERT (oldparent == EMPTY || newparent <= oldparent) ; /* -------------------------------------------------------------- */ /* go to the next node in the path */ /* -------------------------------------------------------------- */ /* path moves to (j,nextj) unless j is a root */ nextj = (newparent == EMPTY) ? n : newparent ; /* place path at head of list for nextj, or terminate the path */ PRINT1 (("\n j = "ID" nextj = "ID"\n\n", j, nextj)) ; Path [path].c = j ; if (nextj < n) { /* put path on link list of pending paths at column nextj */ Path [path].next = Head [nextj] ; Path [path].pending = nextj ; Head [nextj] = path ; PRINT1 (("Path "ID" continues to ("ID","ID"). Rank "ID"\n", path, Path [path].c, nextj, Path [path].rank)) ; } else { /* path has ended here, at a root */ Path [path].next = EMPTY ; Path [path].pending = EMPTY ; Path [path].end = j ; PRINT1 (("Path "ID" ends at root ("ID"). Rank "ID"\n", path, Path [path].end, Path [path].rank)) ; } /* The link list Head [j] can now be emptied. Set Head [j] to 1 * if column j has changed (it is no longer used as a link list). */ PRINT1 (("column "ID", oldlnz = "ID"\n", j, Lnz [j])) ; Head [j] = (Lnz [j] != newlnz) ? 1 : EMPTY ; Lnz [j] = newlnz ; PRINT1 (("column "ID", newlnz = "ID"\n", j, newlnz)) ; DEBUG (dump_col ("New", j, p1, p2, Li, Lx, n, Common)) ; /* move to the next column */ if (k == Path [path].rank) { /* only one path left */ j = nextj ; } else { /* The current path is moving from column j to column nextj * (nextj is n if the path has ended). However, there may be * other paths pending in columns j+1 to nextj-1. There are * two methods for looking for the next column with a pending * update. The first one looks at all columns j+1 to nextj-1 * for a non-empty link list. This can be costly if j and * nextj differ by a large amount (it can be O(n), but this * entire routine may take Omega(1) time). The second method * looks at all paths and finds the smallest column at which any * path is pending. It takes O(# of paths), which is bounded * by 23: one for each column of C (up to 8), and then 15 for a * balanced binary tree with 8 leaves. However, if j and * nextj differ by a tiny amount (nextj is often j+1 near * the end of the matrix), looking at columns j+1 to nextj * would be faster. Both methods give the same answer. */ if (nextj - j < npaths) { /* there are fewer columns to search than paths */ PRINT1 (("check j="ID" to nextj="ID"\n", j, nextj)) ; for (j2 = j + 1 ; j2 < nextj ; j2++) { PRINT1 (("check j="ID" "ID"\n", j2, Head [j2])) ; if (Head [j2] != EMPTY) { PRINT1 (("found, j="ID"\n", j2)) ; ASSERT (Path [Head [j2]].pending == j2) ; break ; } } } else { /* there are fewer paths than columns to search */ j2 = nextj ; for (kk = 0 ; kk < npaths ; kk++) { jj = Path [kk].pending ; PRINT2 (("Path "ID" pending at "ID"\n", kk, jj)) ; if (jj != EMPTY) j2 = MIN (j2, jj) ; } } j = j2 ; } } /* ensure workspaces are back to the values required on input */ ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, TRUE, Common)) ; /* ------------------------------------------------------------------ */ /* depth-first-search of tree to order the paths */ /* ------------------------------------------------------------------ */ /* create lists of child paths */ PRINT1 (("\n\nDFS search:\n\n")) ; for (path = 0 ; path < npaths ; path++) { Path [path].c = EMPTY ; /* first child of path */ Path [path].next = EMPTY ; /* next sibling of path */ Path [path].order = EMPTY ; /* path is not ordered yet */ Path [path].wfirst = EMPTY ; /* 1st column of W not found yet */ #ifndef NDEBUG j = Path [path].start ; PRINT1 (("Path "ID" : start "ID" end "ID" parent "ID" ccol "ID"\n", path, j, Path [path].end, Path [path].parent, Path [path].ccol)) ; for ( ; ; ) { PRINT1 ((" column "ID"\n", j)) ; ASSERT (j == EMPTY || (j >= 0 && j < n)) ; if (j == Path [path].end) { break ; } ASSERT (j >= 0 && j < n) ; j = (Lnz [j] > 1) ? (Li [Lp [j] + 1]) : EMPTY ; } #endif } for (path = 0 ; path < npaths ; path++) { p = Path [path].parent ; /* add path to child list of parent */ if (p != EMPTY) { ASSERT (p < npaths) ; Path [path].next = Path [p].c ; Path [p].c = path ; } } path_order = k ; w_order = 0 ; for (path = npaths-1 ; path >= 0 ; path--) { if (Path [path].order == EMPTY) { /* this path is the root of a subtree of Tbar */ PRINT1 (("Root path "ID"\n", path)) ; ASSERT (path >= k) ; dfs (Path, k, path, &path_order, &w_order, 0, npaths) ; } } ASSERT (path_order == npaths) ; ASSERT (w_order == k) ; /* reorder the paths */ for (path = 0 ; path < npaths ; path++) { /* old order is path, new order is Path [path].order */ OrderedPath [Path [path].order] = Path [path] ; } #ifndef NDEBUG for (path = 0 ; path < npaths ; path++) { PRINT1 (("Ordered Path "ID": start "ID" end "ID" wfirst "ID" rank " ""ID" ccol "ID"\n", path, OrderedPath [path].start, OrderedPath [path].end, OrderedPath [path].wfirst, OrderedPath [path].rank, OrderedPath [path].ccol)) ; if (path < k) { ASSERT (OrderedPath [path].ccol >= 0) ; } else { ASSERT (OrderedPath [path].ccol == EMPTY) ; } } #endif /* ------------------------------------------------------------------ */ /* numeric update/downdate for all paths */ /* ------------------------------------------------------------------ */ ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, wdim, Common)) ; switch (wdim) { case 1: updown_1_r (update, C, k, L, W, OrderedPath, npaths, mask, maskmark, Common) ; break ; case 2: updown_2_r (update, C, k, L, W, OrderedPath, npaths, mask, maskmark, Common) ; break ; case 4: updown_4_r (update, C, k, L, W, OrderedPath, npaths, mask, maskmark, Common) ; break ; case 8: updown_8_r (update, C, k, L, W, OrderedPath, npaths, mask, maskmark, Common) ; break ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, wdim, Common)) ; } /* ---------------------------------------------------------------------- */ /* update/downdate the forward solve */ /* ---------------------------------------------------------------------- */ if (do_solve) { /* We now have DeltaB += Lold (:,j) * X (j) for all columns j in union * of all paths seen during the entire rank-cncol update/downdate. For * each j in path, do DeltaB -= Lnew (:,j)*DeltaB(j) * in topological order. */ #ifndef NDEBUG PRINT1 (("\ndo_solve, DeltaB + Lold(:,Path)*X(Path):\n")) ; for (i = 0 ; i < n ; i++) { PRINT1 (("do_solve: "ID" %30.20e\n", i, Nx [i])) ; } #endif /* Note that the downdate, if it deleted entries, would need to compute * the Stack prior to doing any downdates. */ /* find the union of all the paths in the new L */ top = n ; /* "top" is stack pointer, not a row or column index */ for (ccol = 0 ; ccol < cncol ; ccol++) { /* -------------------------------------------------------------- */ /* j = first row index of C (:,ccol) */ /* -------------------------------------------------------------- */ pp1 = Cp [ccol] ; pp2 = (packed) ? (Cp [ccol+1]) : (pp1 + Cnz [ccol]) ; if (pp2 > pp1) { /* Column ccol of C has at least one entry. */ j = Ci [pp1] ; } else { /* Column ccol of C is empty */ j = n-1 ; } PRINT1 (("\ndo_solve: ccol= "ID"\n", ccol)) ; ASSERT (j >= 0 && j < n) ; len = 0 ; /* -------------------------------------------------------------- */ /* find the new rowmark */ /* -------------------------------------------------------------- */ /* Each column of C can redefine the region of L that takes part in * the update/downdate of the triangular solve Lx=b. If * i = colmark [ccol] for column C(:,ccol), then i = rowmark [j] is * redefined for all columns along the path modified by C(:,ccol). * If more than one column modifies any given column j of L, then * the rowmark of j is determined by the colmark of the least- * numbered column that affects column j. That is, if both * C(:,ccol1) and C(:,ccol2) affect column j of L, then * rowmark [j] = colmark [MIN (ccol1, ccol2)]. * * rowmark [j] is not modified if rowmark or colmark are NULL, * or if colmark [ccol] is EMPTY. */ botrow = (use_colmark) ? (colmark [ccol]) : EMPTY ; /* -------------------------------------------------------------- */ /* traverse from j towards root, stopping if node already visited */ /* -------------------------------------------------------------- */ while (j != EMPTY && Flag [j] < mark) { PRINT1 (("do_solve: subpath j= "ID"\n", j)) ; ASSERT (j >= 0 && j < n) ; Stack [len++] = j ; /* place j on the stack */ Flag [j] = mark ; /* flag j as visited */ /* if using colmark, mark column j with botrow */ ASSERT (Li [Lp [j]] == j) ; /* diagonal is always present */ if (use_colmark) { Li [Lp [j]] = botrow ; /* use the space for botrow */ } /* go up the tree, to the parent of j */ j = (Lnz [j] > 1) ? (Li [Lp [j] + 1]) : EMPTY ; } /* -------------------------------------------------------------- */ /* move the path down to the bottom of the stack */ /* -------------------------------------------------------------- */ ASSERT (len <= top) ; while (len > 0) { Stack [--top] = Stack [--len] ; } } #ifndef NDEBUG /* Union of paths now in Stack [top..n-1] in topological order */ PRINT1 (("\nTopological order:\n")) ; for (i = top ; i < n ; i++) { PRINT1 (("column "ID" in full path\n", Stack [i])) ; } #endif /* Do the forward solve for the full path part of L */ for (m = top ; m < n ; m++) { j = Stack [m] ; ASSERT (j >= 0 && j < n) ; PRINT1 (("do_solve: path j= "ID"\n", j)) ; p1 = Lp [j] ; lnz = Lnz [j] ; p2 = p1 + lnz ; xj = Nx [j] ; /* copy new solution onto old one, for all cols in full path */ Xx [j] = xj ; Nx [j] = 0. ; /* DeltaB -= Lnew (j+1:botrow-1,j) * deltab(j) */ if (use_colmark) { botrow = Li [p1] ; /* get botrow */ Li [p1] = j ; /* restore diagonal entry */ for (p = p1 + 1 ; p < p2 ; p++) { i = Li [p] ; if (i >= botrow) break ; Nx [i] -= Lx [p] * xj ; } } else { for (p = p1 + 1 ; p < p2 ; p++) { Nx [Li [p]] -= Lx [p] * xj ; } } } /* clear the Flag */ mark = CHOLMOD(clear_flag) (Common) ; } /* ---------------------------------------------------------------------- */ /* successful update/downdate */ /* ---------------------------------------------------------------------- */ Common->modfl = fl ; DEBUG (for (j = 0 ; j < n ; j++) ASSERT (IMPLIES (do_solve, Nx[j] == 0.))) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, TRUE, Common)) ; DEBUG (CHOLMOD(dump_factor) (L, "output L for updown", Common)) ; return (TRUE) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Modify/cholmod_rowdel.c0000664000175000017500000003175414224052371021260 00000000000000/* ========================================================================== */ /* === Modify/cholmod_rowdel ================================================ */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Modify Module. * Copyright (C) 2005-2006, Timothy A. Davis and William W. Hager. * The CHOLMOD/Modify Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Deletes a row and column from an LDL' factorization. The row and column k * is set to the kth row and column of the identity matrix. Optionally * downdates the solution to Lx=b. * * workspace: Flag (nrow), Head (nrow+1), W (nrow*2), Iwork (2*nrow) * * Only real matrices are supported (exception: since only the pattern of R * is used, it can have any valid xtype). */ #ifndef NGPL #ifndef NMODIFY #include "cholmod_internal.h" #include "cholmod_modify.h" /* ========================================================================== */ /* === cholmod_rowdel ======================================================= */ /* ========================================================================== */ /* Sets the kth row and column of L to be the kth row and column of the identity * matrix, and updates L(k+1:n,k+1:n) accordingly. To reduce the running time, * the caller can optionally provide the nonzero pattern (or an upper bound) of * kth row of L, as the sparse n-by-1 vector R. Provide R as NULL if you want * CHOLMOD to determine this itself, which is easier for the caller, but takes * a little more time. */ int CHOLMOD(rowdel) ( /* ---- input ---- */ size_t k, /* row/column index to delete */ cholmod_sparse *R, /* NULL, or the nonzero pattern of kth row of L */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ /* --------------- */ cholmod_common *Common ) { double yk [2] ; yk [0] = 0. ; yk [1] = 0. ; return (CHOLMOD(rowdel_mark) (k, R, yk, NULL, L, NULL, NULL, Common)) ; } /* ========================================================================== */ /* === cholmod_rowdel_solve ================================================= */ /* ========================================================================== */ /* Does the same as cholmod_rowdel, but also downdates the solution to Lx=b. * When row/column k of A is "deleted" from the system A*y=b, this can induce * a change to x, in addition to changes arising when L and b are modified. * If this is the case, the kth entry of y is required as input (yk) */ int CHOLMOD(rowdel_solve) ( /* ---- input ---- */ size_t k, /* row/column index to delete */ cholmod_sparse *R, /* NULL, or the nonzero pattern of kth row of L */ double yk [2], /* kth entry in the solution to A*y=b */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) { return (CHOLMOD(rowdel_mark) (k, R, yk, NULL, L, X, DeltaB, Common)) ; } /* ========================================================================== */ /* === cholmod_rowdel_mark ================================================== */ /* ========================================================================== */ /* Does the same as cholmod_rowdel_solve, except only part of L is used in * the update/downdate of the solution to Lx=b. This routine is an "expert" * routine. It is meant for use in LPDASA only. * * if R == NULL then columns 0:k-1 of L are searched for row k. Otherwise, it * searches columns in the set defined by the pattern of the first column of R. * This is meant to be the pattern of row k of L (a superset of that pattern is * OK too). R must be a permutation of a subset of 0:k-1. */ int CHOLMOD(rowdel_mark) ( /* ---- input ---- */ size_t kdel, /* row/column index to delete */ cholmod_sparse *R, /* NULL, or the nonzero pattern of kth row of L */ double yk [2], /* kth entry in the solution to A*y=b */ Int *colmark, /* Int array of size 1. See cholmod_updown.c */ /* ---- in/out --- */ cholmod_factor *L, /* factor to modify */ cholmod_dense *X, /* solution to Lx=b (size n-by-1) */ cholmod_dense *DeltaB, /* change in b, zero on output */ /* --------------- */ cholmod_common *Common ) { double dk, sqrt_dk, xk, dj, fl ; double *Lx, *Cx, *W, *Xx, *Nx ; Int *Li, *Lp, *Lnz, *Ci, *Rj, *Rp, *Iwork ; cholmod_sparse *C, Cmatrix ; Int j, p, pend, kk, lnz, n, Cp [2], do_solve, do_update, left, k, right, middle, i, klast, given_row, rnz ; size_t s ; int ok = TRUE ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_PATTERN, CHOLMOD_REAL, FALSE) ; n = L->n ; k = kdel ; if (kdel >= L->n || k < 0) { ERROR (CHOLMOD_INVALID, "k invalid") ; return (FALSE) ; } if (R == NULL) { Rj = NULL ; rnz = EMPTY ; } else { RETURN_IF_XTYPE_INVALID (R, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; if (R->ncol != 1 || R->nrow != L->n) { ERROR (CHOLMOD_INVALID, "R invalid") ; return (FALSE) ; } Rj = R->i ; Rp = R->p ; rnz = Rp [1] ; } do_solve = (X != NULL) && (DeltaB != NULL) ; if (do_solve) { RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_REAL, FALSE) ; RETURN_IF_XTYPE_INVALID (DeltaB, CHOLMOD_REAL, CHOLMOD_REAL, FALSE) ; Xx = X->x ; Nx = DeltaB->x ; if (X->nrow != L->n || X->ncol != 1 || DeltaB->nrow != L->n || DeltaB->ncol != 1 || Xx == NULL || Nx == NULL) { ERROR (CHOLMOD_INVALID, "X and/or DeltaB invalid") ; return (FALSE) ; } } else { Xx = NULL ; Nx = NULL ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ /* s = 2*n */ s = CHOLMOD(mult_size_t) (n, 2, &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (n, s, s, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 2*n, Common)) ; /* ---------------------------------------------------------------------- */ /* convert to simplicial numeric LDL' factor, if not already */ /* ---------------------------------------------------------------------- */ if (L->xtype == CHOLMOD_PATTERN || L->is_super || L->is_ll) { /* can only update/downdate a simplicial LDL' factorization */ CHOLMOD(change_factor) (CHOLMOD_REAL, FALSE, FALSE, FALSE, FALSE, L, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory, L is returned unchanged */ return (FALSE) ; } } /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ /* inputs, not modified on output: */ Lp = L->p ; /* size n+1 */ /* outputs, contents defined on input for incremental case only: */ Lnz = L->nz ; /* size n */ Li = L->i ; /* size L->nzmax. Can change in size. */ Lx = L->x ; /* size L->nzmax. Can change in size. */ ASSERT (L->nz != NULL) ; /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ W = Common->Xwork ; /* size n, used only in cholmod_updown */ Cx = W + n ; /* use 2nd column of Xwork for C (size n) */ Iwork = Common->Iwork ; Ci = Iwork + n ; /* size n (i/i/l) */ /* NOTE: cholmod_updown uses Iwork [0..n-1] (i/i/l) as Stack */ /* ---------------------------------------------------------------------- */ /* prune row k from all columns of L */ /* ---------------------------------------------------------------------- */ given_row = (rnz >= 0) ; klast = given_row ? rnz : k ; PRINT2 (("given_row "ID"\n", given_row)) ; for (kk = 0 ; kk < klast ; kk++) { /* either search j = 0:k-1 or j = Rj [0:rnz-1] */ j = given_row ? (Rj [kk]) : (kk) ; if (j < 0 || j >= k) { ERROR (CHOLMOD_INVALID, "R invalid") ; return (FALSE) ; } PRINT2 (("Prune col j = "ID":\n", j)) ; lnz = Lnz [j] ; dj = Lx [Lp [j]] ; ASSERT (Lnz [j] > 0 && Li [Lp [j]] == j) ; if (lnz > 1) { left = Lp [j] ; pend = left + lnz ; right = pend - 1 ; i = Li [right] ; if (i < k) { /* row k is not in column j */ continue ; } else if (i == k) { /* k is the last row index in this column (quick delete) */ if (do_solve) { Xx [j] -= yk [0] * dj * Lx [right] ; } Lx [right] = 0 ; } else { /* binary search for row k in column j */ PRINT2 (("\nBinary search: lnz "ID" k = "ID"\n", lnz, k)) ; while (left < right) { middle = (left + right) / 2 ; PRINT2 (("left "ID" right "ID" middle "ID": ["ID" "ID"" ""ID"]\n", left, right, middle, Li [left], Li [middle], Li [right])) ; if (k > Li [middle]) { left = middle + 1 ; } else { right = middle ; } } ASSERT (left >= Lp [j] && left < pend) ; #ifndef NDEBUG /* brute force, linear-time search */ { Int p3 = Lp [j] ; i = EMPTY ; PRINT2 (("Brute force:\n")) ; for ( ; p3 < pend ; p3++) { i = Li [p3] ; PRINT2 (("p "ID" ["ID"]\n", p3, i)) ; if (i >= k) { break ; } } if (i == k) { ASSERT (k == Li [p3]) ; ASSERT (p3 == left) ; } } #endif if (k == Li [left]) { if (do_solve) { Xx [j] -= yk [0] * dj * Lx [left] ; } /* found row k in column j. Prune it from the column.*/ Lx [left] = 0 ; } } } } #ifndef NDEBUG /* ensure that row k has been deleted from the matrix L */ for (j = 0 ; j < k ; j++) { Int lasti ; lasti = EMPTY ; p = Lp [j] ; pend = p + Lnz [j] ; /* look for row k in column j */ PRINT1 (("Pruned column "ID"\n", j)) ; for ( ; p < pend ; p++) { i = Li [p] ; PRINT2 ((" "ID"", i)) ; PRINT2 ((" %g\n", Lx [p])) ; ASSERT (IMPLIES (i == k, Lx [p] == 0)) ; ASSERT (i > lasti) ; lasti = i ; } PRINT1 (("\n")) ; } #endif /* ---------------------------------------------------------------------- */ /* set diagonal and clear column k of L */ /* ---------------------------------------------------------------------- */ lnz = Lnz [k] - 1 ; ASSERT (Lnz [k] > 0) ; /* ---------------------------------------------------------------------- */ /* update/downdate */ /* ---------------------------------------------------------------------- */ /* update or downdate L (k+1:n, k+1:n) with the vector * C = L (:,k) * sqrt (abs (D [k])) * Do a numeric update if D[k] > 0, numeric downdate otherwise. */ PRINT1 (("rowdel downdate lnz = "ID"\n", lnz)) ; /* store the new unit diagonal */ p = Lp [k] ; pend = p + lnz + 1 ; dk = Lx [p] ; Lx [p++] = 1 ; PRINT2 (("D [k = "ID"] = %g\n", k, dk)) ; ok = TRUE ; fl = 0 ; if (lnz > 0) { /* compute DeltaB for updown (in DeltaB) */ if (do_solve) { xk = Xx [k] - yk [0] * dk ; for ( ; p < pend ; p++) { Nx [Li [p]] += Lx [p] * xk ; } } do_update = IS_GT_ZERO (dk) ; if (!do_update) { dk = -dk ; } sqrt_dk = sqrt (dk) ; p = Lp [k] + 1 ; for (kk = 0 ; kk < lnz ; kk++, p++) { Ci [kk] = Li [p] ; Cx [kk] = Lx [p] * sqrt_dk ; Lx [p] = 0 ; /* clear column k */ } fl = lnz + 1 ; /* create a n-by-1 sparse matrix to hold the single column */ C = &Cmatrix ; C->nrow = n ; C->ncol = 1 ; C->nzmax = lnz ; C->sorted = TRUE ; C->packed = TRUE ; C->p = Cp ; C->i = Ci ; C->x = Cx ; C->nz = NULL ; C->itype = L->itype ; C->xtype = L->xtype ; C->dtype = L->dtype ; C->z = NULL ; C->stype = 0 ; Cp [0] = 0 ; Cp [1] = lnz ; /* numeric update if dk > 0, and with Lx=b change */ /* workspace: Flag (nrow), Head (nrow+1), W (nrow), Iwork (2*nrow) */ ok = CHOLMOD(updown_mark) (do_update ? (1) : (0), C, colmark, L, X, DeltaB, Common) ; /* clear workspace */ for (kk = 0 ; kk < lnz ; kk++) { Cx [kk] = 0 ; } } Common->modfl += fl ; if (do_solve) { /* kth equation becomes identity, so X(k) is now Y(k) */ Xx [k] = yk [0] ; } DEBUG (CHOLMOD(dump_factor) (L, "LDL factorization, L:", Common)) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 2*n, Common)) ; return (ok) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Modify/License.txt0000664000175000017500000000204614224052371020226 00000000000000CHOLMOD/Modify Module. Copyright (C) 2005-2006, Timothy A. Davis and William W. Hager CHOLMOD is also available under other licenses; contact authors for details. http://www.suitesparse.com Note that this license is for the CHOLMOD/Modify module only. All CHOLMOD modules are licensed separately. -------------------------------------------------------------------------------- This Module 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 of the License, or (at your option) any later version. This Module 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 Module; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Modify/gpl.txt0000664000175000017500000004313314224052371017430 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 of the License, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Modify/t_cholmod_updown_numkr.c0000664000175000017500000005165214224052371023036 00000000000000/* ========================================================================== */ /* === Modify/t_cholmod_updown_numkr ======================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Modify Module. Copyright (C) 2005-2006, * Timothy A. Davis and William W. Hager. * The CHOLMOD/Modify Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Supernodal numerical update/downdate of rank K = RANK, along a single path. * This routine operates on a simplicial factor, but operates on adjacent * columns of L that would fit within a single supernode. "Adjacent" means * along a single path in the elimination tree; they may or may not be * adjacent in the matrix L. * * external defines: NUMERIC, WDIM, RANK. * * WDIM is 1, 2, 4, or 8. RANK can be 1 to WDIM. * * A simple method is included (#define SIMPLE). The code works, but is slow. * It is meant only to illustrate what this routine is doing. * * A rank-K update proceeds along a single path, using single-column, dual- * column, or quad-column updates of L. If a column j and the next column * in the path (its parent) do not have the same nonzero pattern, a single- * column update is used. If they do, but the 3rd and 4th column from j do * not have the same pattern, a dual-column update is used, in which the two * columns are treated as if they were a single supernode of two columns. If * there are 4 columns in the path that all have the same nonzero pattern, then * a quad-column update is used. All three kinds of updates can be used along * a single path, in a single call to this function. * * Single-column update: * * When updating a single column of L, each iteration of the for loop, * below, processes four rows of W (all columns involved) and one column * of L. Suppose we have a rank-5 update, and columns 2 through 6 of W * are involved. In this case, W in this routine is a pointer to column * 2 of the matrix W in the caller. W (in the caller, shown as 'W') is * held in row-major order, and is 8-by-n (a dense matrix storage format), * but shown below in column form to match the column of L. Suppose there * are 13 nonzero entries in column 27 of L, with row indices 27 (the * diagonal, D), 28, 30, 31, 42, 43, 44, 50, 51, 67, 81, 83, and 84. This * pattern is held in Li [Lp [27] ... Lp [27 + Lnz [27] - 1], where * Lnz [27] = 13. The modification of the current column j of L is done * in the following order. A dot (.) means the entry of W is not accessed. * * W0 points to row 27 of W, and G is a 1-by-8 temporary vector. * * G[0] G[4] * G x x x x x . . . * * W0 * | * v * 27 . . x x x x x . W0 points to W (27,2) * * * row 'W' W column j = 27 * | | | of L * v v v | * first iteration of for loop: v * * 28 . . 1 5 9 13 17 . x * 30 . . 2 6 10 14 18 . x * 31 . . 3 7 11 15 19 . x * 42 . . 4 8 12 16 20 . x * * second iteration of for loop: * * 43 . . 1 5 9 13 17 . x * 44 . . 2 6 10 14 18 . x * 50 . . 3 7 11 15 19 . x * 51 . . 4 8 12 16 20 . x * * third iteration of for loop: * * 67 . . 1 5 9 13 17 . x * 81 . . 2 6 10 14 18 . x * 83 . . 3 7 11 15 19 . x * 84 . . 4 8 12 16 20 . x * * If the number of offdiagonal nonzeros in column j of L is not divisible * by 4, then the switch-statement does the work for the first nz % 4 rows. * * Dual-column update: * * In this case, two columns of L that are adjacent in the path are being * updated, by 1 to 8 columns of W. Suppose columns j=27 and j=28 are * adjacent columns in the path (they need not be j and j+1). Two rows * of G and W are used as coefficients during the update: (G0, G1) and * (W0, W1). * * G0 x x x x x . . . * G1 x x x x x . . . * * 27 . . x x x x x . W0 points to W (27,2) * 28 . . x x x x x . W1 points to W (28,2) * * * row 'W' W0,W1 column j = 27 * | | | of L * v v v | * | |-- column j = 28 of L * v v * update L (j1,j): * * 28 . . 1 2 3 4 5 . x - ("-" is not stored in L) * * cleanup iteration since length is odd: * * 30 . . 1 2 3 4 5 . x x * * then each iteration does two rows of both columns of L: * * 31 . . 1 3 5 7 9 . x x * 42 . . 2 4 6 8 10 . x x * * 43 . . 1 3 5 7 9 . x x * 44 . . 2 4 6 8 10 . x x * * 50 . . 1 3 5 7 9 . x x * 51 . . 2 4 6 8 10 . x x * * 67 . . 1 3 5 7 9 . x x * 81 . . 2 4 6 8 10 . x x * * 83 . . 1 3 5 7 9 . x x * 84 . . 2 4 6 8 10 . x x * * If the number of offdiagonal nonzeros in column j of L is not even, * then the cleanup iteration does the work for the first row. * * Quad-column update: * * In this case, four columns of L that are adjacent in the path are being * updated, by 1 to 8 columns of W. Suppose columns j=27, 28, 30, and 31 * are adjacent columns in the path (they need not be j, j+1, ...). Four * rows of G and W are used as coefficients during the update: (G0 through * G3) and (W0 through W3). j=27, j1=28, j2=30, and j3=31. * * G0 x x x x x . . . * G1 x x x x x . . . * G3 x x x x x . . . * G4 x x x x x . . . * * 27 . . x x x x x . W0 points to W (27,2) * 28 . . x x x x x . W1 points to W (28,2) * 30 . . x x x x x . W2 points to W (30,2) * 31 . . x x x x x . W3 points to W (31,2) * * * row 'W' W0,W1,.. column j = 27 * | | | of L * v v v | * | |-- column j = 28 of L * | | |-- column j = 30 of L * | | | |-- column j = 31 of L * v v v v * update L (j1,j): * 28 . . 1 2 3 4 5 . x - - - * * update L (j2,j): * 30 . . 1 2 3 4 5 . # x - - (# denotes modified) * * update L (j2,j1) * 30 . . 1 2 3 4 5 . x # - - * * update L (j3,j) * 31 . . 1 2 3 4 5 . # x x - * * update L (j3,j1) * 31 . . 1 2 3 4 5 . x # x - * * update L (j3,j2) * 31 . . 1 2 3 4 5 . x x # - * * cleanup iteration since length is odd: * 42 . . 1 2 3 4 5 . x x x x * * * ----- CHOLMOD v1.1.1 did the following -------------------------------------- * then each iteration does two rows of all four colummns of L: * * 43 . . 1 3 5 7 9 . x x x x * 44 . . 2 4 6 8 10 . x x x x * * 50 . . 1 3 5 7 9 . x x x x * 51 . . 2 4 6 8 10 . x x x x * * 67 . . 1 3 5 7 9 . x x x x * 81 . . 2 4 6 8 10 . x x x x * * 83 . . 1 3 5 7 9 . x x x x * 84 . . 2 4 6 8 10 . x x x x * * ----- CHOLMOD v1.2.0 does the following ------------------------------------- * then each iteration does one rows of all four colummns of L: * * 43 . . 1 2 3 4 5 . x x x x * 44 . . 1 2 3 4 5 . x x x x * 50 . . 1 3 5 4 5 . x x x x * 51 . . 1 2 3 4 5 . x x x x * 67 . . 1 3 5 4 5 . x x x x * 81 . . 1 2 3 4 5 . x x x x * 83 . . 1 3 5 4 5 . x x x x * 84 . . 1 2 3 4 5 . x x x x * * This file is included in t_cholmod_updown.c, only. * It is not compiled separately. It contains no user-callable routines. * * workspace: Xwork (WDIM*nrow) */ /* ========================================================================== */ /* === loop unrolling macros ================================================ */ /* ========================================================================== */ #undef RANK1 #undef RANK2 #undef RANK3 #undef RANK4 #undef RANK5 #undef RANK6 #undef RANK7 #undef RANK8 #define RANK1(statement) statement #if RANK < 2 #define RANK2(statement) #else #define RANK2(statement) statement #endif #if RANK < 3 #define RANK3(statement) #else #define RANK3(statement) statement #endif #if RANK < 4 #define RANK4(statement) #else #define RANK4(statement) statement #endif #if RANK < 5 #define RANK5(statement) #else #define RANK5(statement) statement #endif #if RANK < 6 #define RANK6(statement) #else #define RANK6(statement) statement #endif #if RANK < 7 #define RANK7(statement) #else #define RANK7(statement) statement #endif #if RANK < 8 #define RANK8(statement) #else #define RANK8(statement) statement #endif #define FOR_ALL_K \ RANK1 (DO (0)) \ RANK2 (DO (1)) \ RANK3 (DO (2)) \ RANK4 (DO (3)) \ RANK5 (DO (4)) \ RANK6 (DO (5)) \ RANK7 (DO (6)) \ RANK8 (DO (7)) /* ========================================================================== */ /* === alpha/gamma ========================================================== */ /* ========================================================================== */ #undef ALPHA_GAMMA #define ALPHA_GAMMA(Dj,Alpha,Gamma,W) \ { \ double dj = Dj ; \ if (update) \ { \ for (k = 0 ; k < RANK ; k++) \ { \ double w = W [k] ; \ double alpha = Alpha [k] ; \ double a = alpha + (w * w) / dj ; \ dj *= a ; \ Alpha [k] = a ; \ Gamma [k] = (- w / dj) ; \ dj /= alpha ; \ } \ } \ else \ { \ for (k = 0 ; k < RANK ; k++) \ { \ double w = W [k] ; \ double alpha = Alpha [k] ; \ double a = alpha - (w * w) / dj ; \ dj *= a ; \ Alpha [k] = a ; \ Gamma [k] = w / dj ; \ dj /= alpha ; \ } \ } \ Dj = ((use_dbound) ? (CHOLMOD(dbound) (dj, Common)) : (dj)) ; \ } /* ========================================================================== */ /* === numeric update/downdate along one path =============================== */ /* ========================================================================== */ static void NUMERIC (WDIM, RANK) ( int update, /* TRUE for update, FALSE for downdate */ Int j, /* first column in the path */ Int e, /* last column in the path */ double Alpha [ ], /* alpha, for each column of W */ double W [ ], /* W is an n-by-WDIM array, stored in row-major order */ cholmod_factor *L, /* with unit diagonal (diagonal not stored) */ cholmod_common *Common ) { #ifdef SIMPLE #define w(row,col) W [WDIM*(row) + (col)] /* ---------------------------------------------------------------------- */ /* concise but slow version for illustration only */ /* ---------------------------------------------------------------------- */ double Gamma [WDIM] ; double *Lx ; Int *Li, *Lp, *Lnz ; Int p, k ; Int use_dbound = IS_GT_ZERO (Common->dbound) ; Li = L->i ; Lx = L->x ; Lp = L->p ; Lnz = L->nz ; /* walk up the etree from node j to its ancestor e */ for ( ; j <= e ; j = (Lnz [j] > 1) ? (Li [Lp [j] + 1]) : Int_max) { /* update the diagonal entry D (j,j) with each column of W */ ALPHA_GAMMA (Lx [Lp [j]], Alpha, Gamma, (&(w (j,0)))) ; /* update column j of L */ for (p = Lp [j] + 1 ; p < Lp [j] + Lnz [j] ; p++) { /* update row Li [p] of column j of L with each column of W */ Int i = Li [p] ; for (k = 0 ; k < RANK ; k++) { w (i,k) -= w (j,k) * Lx [p] ; Lx [p] -= Gamma [k] * w (i,k) ; } } /* clear workspace W */ for (k = 0 ; k < RANK ; k++) { w (j,k) = 0 ; } } #else /* ---------------------------------------------------------------------- */ /* dynamic supernodal version: supernodes detected dynamically */ /* ---------------------------------------------------------------------- */ double G0 [RANK], G1 [RANK], G2 [RANK], G3 [RANK] ; double Z0 [RANK], Z1 [RANK], Z2 [RANK], Z3 [RANK] ; double *W0, *W1, *W2, *W3, *Lx ; Int *Li, *Lp, *Lnz ; Int j1, j2, j3, p0, p1, p2, p3, parent, lnz, pend, k ; Int use_dbound = IS_GT_ZERO (Common->dbound) ; Li = L->i ; Lx = L->x ; Lp = L->p ; Lnz = L->nz ; /* walk up the etree from node j to its ancestor e */ for ( ; j <= e ; j = parent) { p0 = Lp [j] ; /* col j is Li,Lx [p0 ... p0+lnz-1] */ lnz = Lnz [j] ; W0 = W + WDIM * j ; /* pointer to row j of W */ pend = p0 + lnz ; /* for k = 0 to RANK-1 do: */ #define DO(k) Z0 [k] = W0 [k] ; FOR_ALL_K #undef DO /* for k = 0 to RANK-1 do: */ #define DO(k) W0 [k] = 0 ; FOR_ALL_K #undef DO /* update D (j,j) */ ALPHA_GAMMA (Lx [p0], Alpha, G0, Z0) ; p0++ ; /* determine how many columns of L to update at the same time */ parent = (lnz > 1) ? (Li [p0]) : Int_max ; if (parent <= e && lnz == Lnz [parent] + 1) { /* -------------------------------------------------------------- */ /* node j and its parent j1 can be updated at the same time */ /* -------------------------------------------------------------- */ j1 = parent ; j2 = (lnz > 2) ? (Li [p0+1]) : Int_max ; j3 = (lnz > 3) ? (Li [p0+2]) : Int_max ; W1 = W + WDIM * j1 ; /* pointer to row j1 of W */ p1 = Lp [j1] ; /* for k = 0 to RANK-1 do: */ #define DO(k) Z1 [k] = W1 [k] ; FOR_ALL_K #undef DO /* for k = 0 to RANK-1 do: */ #define DO(k) W1 [k] = 0 ; FOR_ALL_K #undef DO /* update L (j1,j) */ { double lx = Lx [p0] ; /* for k = 0 to RANK-1 do: */ #define DO(k) \ Z1 [k] -= Z0 [k] * lx ; \ lx -= G0 [k] * Z1 [k] ; FOR_ALL_K #undef DO Lx [p0++] = lx ; } /* update D (j1,j1) */ ALPHA_GAMMA (Lx [p1], Alpha, G1, Z1) ; p1++ ; /* -------------------------------------------------------------- */ /* update 2 or 4 columns of L */ /* -------------------------------------------------------------- */ if ((j2 <= e) && /* j2 in the current path */ (j3 <= e) && /* j3 in the current path */ (lnz == Lnz [j2] + 2) && /* column j2 matches */ (lnz == Lnz [j3] + 3)) /* column j3 matches */ { /* ---------------------------------------------------------- */ /* update 4 columns of L */ /* ---------------------------------------------------------- */ /* p0 and p1 currently point to row j2 in cols j and j1 of L */ parent = (lnz > 4) ? (Li [p0+2]) : Int_max ; W2 = W + WDIM * j2 ; /* pointer to row j2 of W */ W3 = W + WDIM * j3 ; /* pointer to row j3 of W */ p2 = Lp [j2] ; p3 = Lp [j3] ; /* for k = 0 to RANK-1 do: */ #define DO(k) Z2 [k] = W2 [k] ; FOR_ALL_K #undef DO /* for k = 0 to RANK-1 do: */ #define DO(k) Z3 [k] = W3 [k] ; FOR_ALL_K #undef DO /* for k = 0 to RANK-1 do: */ #define DO(k) W2 [k] = 0 ; FOR_ALL_K #undef DO /* for k = 0 to RANK-1 do: */ #define DO(k) W3 [k] = 0 ; FOR_ALL_K #undef DO /* update L (j2,j) and update L (j2,j1) */ { double lx [2] ; lx [0] = Lx [p0] ; lx [1] = Lx [p1] ; /* for k = 0 to RANK-1 do: */ #define DO(k) \ Z2 [k] -= Z0 [k] * lx [0] ; lx [0] -= G0 [k] * Z2 [k] ; \ Z2 [k] -= Z1 [k] * lx [1] ; lx [1] -= G1 [k] * Z2 [k] ; FOR_ALL_K #undef DO Lx [p0++] = lx [0] ; Lx [p1++] = lx [1] ; } /* update D (j2,j2) */ ALPHA_GAMMA (Lx [p2], Alpha, G2, Z2) ; p2++ ; /* update L (j3,j), L (j3,j1), and L (j3,j2) */ { double lx [3] ; lx [0] = Lx [p0] ; lx [1] = Lx [p1] ; lx [2] = Lx [p2] ; /* for k = 0 to RANK-1 do: */ #define DO(k) \ Z3 [k] -= Z0 [k] * lx [0] ; lx [0] -= G0 [k] * Z3 [k] ; \ Z3 [k] -= Z1 [k] * lx [1] ; lx [1] -= G1 [k] * Z3 [k] ; \ Z3 [k] -= Z2 [k] * lx [2] ; lx [2] -= G2 [k] * Z3 [k] ; FOR_ALL_K #undef DO Lx [p0++] = lx [0] ; Lx [p1++] = lx [1] ; Lx [p2++] = lx [2] ; } /* update D (j3,j3) */ ALPHA_GAMMA (Lx [p3], Alpha, G3, Z3) ; p3++ ; /* each iteration updates L (i, [j j1 j2 j3]) */ for ( ; p0 < pend ; p0++, p1++, p2++, p3++) { double lx [4], *w0 ; lx [0] = Lx [p0] ; lx [1] = Lx [p1] ; lx [2] = Lx [p2] ; lx [3] = Lx [p3] ; w0 = W + WDIM * Li [p0] ; /* for k = 0 to RANK-1 do: */ #define DO(k) \ w0 [k] -= Z0 [k] * lx [0] ; lx [0] -= G0 [k] * w0 [k] ; \ w0 [k] -= Z1 [k] * lx [1] ; lx [1] -= G1 [k] * w0 [k] ; \ w0 [k] -= Z2 [k] * lx [2] ; lx [2] -= G2 [k] * w0 [k] ; \ w0 [k] -= Z3 [k] * lx [3] ; lx [3] -= G3 [k] * w0 [k] ; FOR_ALL_K #undef DO Lx [p0] = lx [0] ; Lx [p1] = lx [1] ; Lx [p2] = lx [2] ; Lx [p3] = lx [3] ; } } else { /* ---------------------------------------------------------- */ /* update 2 columns of L */ /* ---------------------------------------------------------- */ parent = j2 ; /* cleanup iteration if length is odd */ if ((lnz - 2) % 2) { double lx [2] , *w0 ; lx [0] = Lx [p0] ; lx [1] = Lx [p1] ; w0 = W + WDIM * Li [p0] ; /* for k = 0 to RANK-1 do: */ #define DO(k) \ w0 [k] -= Z0 [k] * lx [0] ; lx [0] -= G0 [k] * w0 [k] ; \ w0 [k] -= Z1 [k] * lx [1] ; lx [1] -= G1 [k] * w0 [k] ; FOR_ALL_K #undef DO Lx [p0++] = lx [0] ; Lx [p1++] = lx [1] ; } for ( ; p0 < pend ; p0 += 2, p1 += 2) { double lx [2][2], w [2], *w0, *w1 ; lx [0][0] = Lx [p0 ] ; lx [1][0] = Lx [p0+1] ; lx [0][1] = Lx [p1 ] ; lx [1][1] = Lx [p1+1] ; w0 = W + WDIM * Li [p0 ] ; w1 = W + WDIM * Li [p0+1] ; /* for k = 0 to RANK-1 do: */ #define DO(k) \ w [0] = w0 [k] - Z0 [k] * lx [0][0] ; \ w [1] = w1 [k] - Z0 [k] * lx [1][0] ; \ lx [0][0] -= G0 [k] * w [0] ; \ lx [1][0] -= G0 [k] * w [1] ; \ w0 [k] = w [0] -= Z1 [k] * lx [0][1] ; \ w1 [k] = w [1] -= Z1 [k] * lx [1][1] ; \ lx [0][1] -= G1 [k] * w [0] ; \ lx [1][1] -= G1 [k] * w [1] ; FOR_ALL_K #undef DO Lx [p0 ] = lx [0][0] ; Lx [p0+1] = lx [1][0] ; Lx [p1 ] = lx [0][1] ; Lx [p1+1] = lx [1][1] ; } } } else { /* -------------------------------------------------------------- */ /* update one column of L */ /* -------------------------------------------------------------- */ /* cleanup iteration if length is not a multiple of 4 */ switch ((lnz - 1) % 4) { case 1: { double lx , *w0 ; lx = Lx [p0] ; w0 = W + WDIM * Li [p0] ; /* for k = 0 to RANK-1 do: */ #define DO(k) \ w0 [k] -= Z0 [k] * lx ; lx -= G0 [k] * w0 [k] ; FOR_ALL_K #undef DO Lx [p0++] = lx ; } break ; case 2: { double lx [2], *w0, *w1 ; lx [0] = Lx [p0 ] ; lx [1] = Lx [p0+1] ; w0 = W + WDIM * Li [p0 ] ; w1 = W + WDIM * Li [p0+1] ; /* for k = 0 to RANK-1 do: */ #define DO(k) \ w0 [k] -= Z0 [k] * lx [0] ; \ w1 [k] -= Z0 [k] * lx [1] ; \ lx [0] -= G0 [k] * w0 [k] ; \ lx [1] -= G0 [k] * w1 [k] ; FOR_ALL_K #undef DO Lx [p0++] = lx [0] ; Lx [p0++] = lx [1] ; } break ; case 3: { double lx [3], *w0, *w1, *w2 ; lx [0] = Lx [p0 ] ; lx [1] = Lx [p0+1] ; lx [2] = Lx [p0+2] ; w0 = W + WDIM * Li [p0 ] ; w1 = W + WDIM * Li [p0+1] ; w2 = W + WDIM * Li [p0+2] ; /* for k = 0 to RANK-1 do: */ #define DO(k) \ w0 [k] -= Z0 [k] * lx [0] ; \ w1 [k] -= Z0 [k] * lx [1] ; \ w2 [k] -= Z0 [k] * lx [2] ; \ lx [0] -= G0 [k] * w0 [k] ; \ lx [1] -= G0 [k] * w1 [k] ; \ lx [2] -= G0 [k] * w2 [k] ; FOR_ALL_K #undef DO Lx [p0++] = lx [0] ; Lx [p0++] = lx [1] ; Lx [p0++] = lx [2] ; } } for ( ; p0 < pend ; p0 += 4) { double lx [4], *w0, *w1, *w2, *w3 ; lx [0] = Lx [p0 ] ; lx [1] = Lx [p0+1] ; lx [2] = Lx [p0+2] ; lx [3] = Lx [p0+3] ; w0 = W + WDIM * Li [p0 ] ; w1 = W + WDIM * Li [p0+1] ; w2 = W + WDIM * Li [p0+2] ; w3 = W + WDIM * Li [p0+3] ; /* for k = 0 to RANK-1 do: */ #define DO(k) \ w0 [k] -= Z0 [k] * lx [0] ; \ w1 [k] -= Z0 [k] * lx [1] ; \ w2 [k] -= Z0 [k] * lx [2] ; \ w3 [k] -= Z0 [k] * lx [3] ; \ lx [0] -= G0 [k] * w0 [k] ; \ lx [1] -= G0 [k] * w1 [k] ; \ lx [2] -= G0 [k] * w2 [k] ; \ lx [3] -= G0 [k] * w3 [k] ; FOR_ALL_K #undef DO Lx [p0 ] = lx [0] ; Lx [p0+1] = lx [1] ; Lx [p0+2] = lx [2] ; Lx [p0+3] = lx [3] ; } } } #endif } /* prepare this file for another inclusion in t_cholmod_updown.c: */ #undef RANK JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Modify/t_cholmod_updown.c0000664000175000017500000001507614224052371021622 00000000000000/* ========================================================================== */ /* === Modify/t_cholmod_updown ============================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Modify Module. Copyright (C) 2005-2006, * Timothy A. Davis and William W. Hager. * The CHOLMOD/Modify Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Updates/downdates the LDL' factorization, by computing a new factorization of * * Lnew * Dnew * Lnew' = Lold * Dold * Lold' +/- C*C' * * This file is not compiled separately. It is included into * cholmod_updown.c. There are no user-callable routines in this file. * * The next include statements, below, create the numerical update/downdate * kernels from t_cholmod_updown_numkr.c. There are 4 compiled versions of this * file, one for each value of WDIM in the set 1, 2, 4, and 8. Each calls * multiple versions of t_cholmod_updown_numkr; the number of versions of each * is equal to WDIM. Each t_cholmod_updown_numkr version is included as a * static function within its t_cholmod_updown.c caller routine. Thus: * * t*_updown.c creates these versions of t_cholmod_updown_numkr.c: * --------- --------------------------------------------------- * * updown_1_r updown_1_1 * * updown_2_r updown_2_1 updown_2_2 * * updown_4_r updown_4_1 updown_4_2 updown_4_3 updown_4_4 * * updown_8_r updown_8_1 updown_8_2 updown_8_3 updown_8_4 * updown_8_5 updown_8_6 updown_8_7 updown_8_8 * * workspace: Xwork (nrow*wdim) */ /* ========================================================================== */ /* === routines for numeric update/downdate along one path ================== */ /* ========================================================================== */ #undef FORM_NAME #undef NUMERIC #define FORM_NAME(k,rank) updown_ ## k ## _ ## rank #define NUMERIC(k,rank) FORM_NAME(k,rank) #define RANK 1 #include "t_cholmod_updown_numkr.c" #if WDIM >= 2 #define RANK 2 #include "t_cholmod_updown_numkr.c" #endif #if WDIM >= 4 #define RANK 3 #include "t_cholmod_updown_numkr.c" #define RANK 4 #include "t_cholmod_updown_numkr.c" #endif #if WDIM == 8 #define RANK 5 #include "t_cholmod_updown_numkr.c" #define RANK 6 #include "t_cholmod_updown_numkr.c" #define RANK 7 #include "t_cholmod_updown_numkr.c" #define RANK 8 #include "t_cholmod_updown_numkr.c" #endif /* ========================================================================== */ /* === numeric update/downdate for all paths ================================ */ /* ========================================================================== */ static void NUMERIC (WDIM, r) ( int update, /* TRUE for update, FALSE for downdate */ cholmod_sparse *C, /* in packed or unpacked, and sorted form */ /* no empty columns */ Int rank, /* rank of the update/downdate */ cholmod_factor *L, /* with unit diagonal (diagonal not stored) */ /* temporary workspaces: */ double W [ ], /* n-by-WDIM dense matrix, initially zero */ Path_type Path [ ], Int npaths, Int mask [ ], /* size n */ Int maskmark, cholmod_common *Common ) { double Alpha [8] ; double *Cx, *Wpath, *W1, *a ; Int i, j, p, ccol, pend, wfirst, e, path, packed ; Int *Ci, *Cp, *Cnz ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ Ci = C->i ; Cx = C->x ; Cp = C->p ; Cnz = C->nz ; packed = C->packed ; ASSERT (IMPLIES (!packed, Cnz != NULL)) ; ASSERT (L->n == C->nrow) ; DEBUG (CHOLMOD(dump_real) ("num_d: in W:", W, WDIM, L->n, FALSE, 1,Common)); /* ---------------------------------------------------------------------- */ /* scatter C into W */ /* ---------------------------------------------------------------------- */ for (path = 0 ; path < rank ; path++) { /* W (:, path) = C (:, Path [path].col) */ ccol = Path [path].ccol ; Wpath = W + path ; PRINT1 (("Ordered Columns [path = "ID"] = "ID"\n", path, ccol)) ; p = Cp [ccol] ; pend = (packed) ? (Cp [ccol+1]) : (p + Cnz [ccol]) ; /* column C can be empty */ for ( ; p < pend ; p++) { i = Ci [p] ; ASSERT (i >= 0 && i < (Int) (C->nrow)) ; if (mask == NULL || mask [i] < maskmark) { Wpath [WDIM * i] = Cx [p] ; } PRINT1 ((" row "ID" : %g mask "ID"\n", i, Cx [p], (mask) ? mask [i] : 0)) ; } Alpha [path] = 1.0 ; } DEBUG (CHOLMOD(dump_real) ("num_d: W:", W, WDIM, L->n, FALSE, 1,Common)) ; /* ---------------------------------------------------------------------- */ /* numeric update/downdate of the paths */ /* ---------------------------------------------------------------------- */ /* for each disjoint subpath in Tbar in DFS order do */ for (path = rank ; path < npaths ; path++) { /* determine which columns of W to use */ wfirst = Path [path].wfirst ; e = Path [path].end ; j = Path [path].start ; ASSERT (e >= 0 && e < (Int) (L->n)) ; ASSERT (j >= 0 && j < (Int) (L->n)) ; W1 = W + wfirst ; /* pointer to row 0, column wfirst of W */ a = Alpha + wfirst ; /* pointer to Alpha [wfirst] */ PRINT1 (("Numerical update/downdate of path "ID"\n", path)) ; PRINT1 (("start "ID" end "ID" wfirst "ID" rank "ID" ccol "ID"\n", j, e, wfirst, Path [path].rank, Path [path].ccol)) ; #if WDIM == 1 NUMERIC (WDIM,1) (update, j, e, a, W1, L, Common) ; #else switch (Path [path].rank) { case 1: NUMERIC (WDIM,1) (update, j, e, a, W1, L, Common) ; break ; #if WDIM >= 2 case 2: NUMERIC (WDIM,2) (update, j, e, a, W1, L, Common) ; break ; #endif #if WDIM >= 4 case 3: NUMERIC (WDIM,3) (update, j, e, a, W1, L, Common) ; break ; case 4: NUMERIC (WDIM,4) (update, j, e, a, W1, L, Common) ; break ; #endif #if WDIM == 8 case 5: NUMERIC (WDIM,5) (update, j, e, a, W1, L, Common) ; break ; case 6: NUMERIC (WDIM,6) (update, j, e, a, W1, L, Common) ; break ; case 7: NUMERIC (WDIM,7) (update, j, e, a, W1, L, Common) ; break ; case 8: NUMERIC (WDIM,8) (update, j, e, a, W1, L, Common) ; break ; #endif } #endif } } /* prepare for the next inclusion of this file in cholmod_updown.c */ #undef WDIM JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Supernodal/0000755000175000017500000000000014400711327017043 500000000000000JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Supernodal/Makefile.am0000664000175000017500000000067714224052371021034 00000000000000noinst_LTLIBRARIES = cholmodsupernodal.la cholmodsupernodal_la_SOURCES = cholmod_super_numeric.c \ cholmod_super_symbolic.c cholmod_super_solve.c cholmodsupernodal_la_CPPFLAGS = \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include cholmodsupernodal_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt gpl.txt t_cholmod_super_solve.c \ t_cholmod_super_numeric.c JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Supernodal/Makefile.in0000644000175000017500000006036514400675236021052 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/SSparse/CHOLMOD/Supernodal ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) cholmodsupernodal_la_LIBADD = am_cholmodsupernodal_la_OBJECTS = \ cholmodsupernodal_la-cholmod_super_numeric.lo \ cholmodsupernodal_la-cholmod_super_symbolic.lo \ cholmodsupernodal_la-cholmod_super_solve.lo cholmodsupernodal_la_OBJECTS = $(am_cholmodsupernodal_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = cholmodsupernodal_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(cholmodsupernodal_la_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = \ ./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_numeric.Plo \ ./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_solve.Plo \ ./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_symbolic.Plo am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(cholmodsupernodal_la_SOURCES) DIST_SOURCES = $(cholmodsupernodal_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = cholmodsupernodal.la cholmodsupernodal_la_SOURCES = cholmod_super_numeric.c \ cholmod_super_symbolic.c cholmod_super_solve.c cholmodsupernodal_la_CPPFLAGS = \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include cholmodsupernodal_la_LDFLAGS = -no-undefined -module -avoid-version EXTRA_DIST = License.txt gpl.txt t_cholmod_super_solve.c \ t_cholmod_super_numeric.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Supernodal/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/SSparse/CHOLMOD/Supernodal/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } cholmodsupernodal.la: $(cholmodsupernodal_la_OBJECTS) $(cholmodsupernodal_la_DEPENDENCIES) $(EXTRA_cholmodsupernodal_la_DEPENDENCIES) $(AM_V_CCLD)$(cholmodsupernodal_la_LINK) $(cholmodsupernodal_la_OBJECTS) $(cholmodsupernodal_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_numeric.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_solve.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_symbolic.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< cholmodsupernodal_la-cholmod_super_numeric.lo: cholmod_super_numeric.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodsupernodal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodsupernodal_la-cholmod_super_numeric.lo -MD -MP -MF $(DEPDIR)/cholmodsupernodal_la-cholmod_super_numeric.Tpo -c -o cholmodsupernodal_la-cholmod_super_numeric.lo `test -f 'cholmod_super_numeric.c' || echo '$(srcdir)/'`cholmod_super_numeric.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodsupernodal_la-cholmod_super_numeric.Tpo $(DEPDIR)/cholmodsupernodal_la-cholmod_super_numeric.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_super_numeric.c' object='cholmodsupernodal_la-cholmod_super_numeric.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodsupernodal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodsupernodal_la-cholmod_super_numeric.lo `test -f 'cholmod_super_numeric.c' || echo '$(srcdir)/'`cholmod_super_numeric.c cholmodsupernodal_la-cholmod_super_symbolic.lo: cholmod_super_symbolic.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodsupernodal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodsupernodal_la-cholmod_super_symbolic.lo -MD -MP -MF $(DEPDIR)/cholmodsupernodal_la-cholmod_super_symbolic.Tpo -c -o cholmodsupernodal_la-cholmod_super_symbolic.lo `test -f 'cholmod_super_symbolic.c' || echo '$(srcdir)/'`cholmod_super_symbolic.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodsupernodal_la-cholmod_super_symbolic.Tpo $(DEPDIR)/cholmodsupernodal_la-cholmod_super_symbolic.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_super_symbolic.c' object='cholmodsupernodal_la-cholmod_super_symbolic.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodsupernodal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodsupernodal_la-cholmod_super_symbolic.lo `test -f 'cholmod_super_symbolic.c' || echo '$(srcdir)/'`cholmod_super_symbolic.c cholmodsupernodal_la-cholmod_super_solve.lo: cholmod_super_solve.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodsupernodal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cholmodsupernodal_la-cholmod_super_solve.lo -MD -MP -MF $(DEPDIR)/cholmodsupernodal_la-cholmod_super_solve.Tpo -c -o cholmodsupernodal_la-cholmod_super_solve.lo `test -f 'cholmod_super_solve.c' || echo '$(srcdir)/'`cholmod_super_solve.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/cholmodsupernodal_la-cholmod_super_solve.Tpo $(DEPDIR)/cholmodsupernodal_la-cholmod_super_solve.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cholmod_super_solve.c' object='cholmodsupernodal_la-cholmod_super_solve.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cholmodsupernodal_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cholmodsupernodal_la-cholmod_super_solve.lo `test -f 'cholmod_super_solve.c' || echo '$(srcdir)/'`cholmod_super_solve.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_numeric.Plo -rm -f ./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_solve.Plo -rm -f ./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_symbolic.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_numeric.Plo -rm -f ./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_solve.Plo -rm -f ./$(DEPDIR)/cholmodsupernodal_la-cholmod_super_symbolic.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libtool clean-noinstLTLIBRARIES \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Supernodal/cholmod_super_numeric.c0000664000175000017500000002563214224052371023527 00000000000000/* ========================================================================== */ /* === Supernodal/cholmod_super_numeric ===================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Supernodal Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Supernodal Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Computes the Cholesky factorization of A+beta*I or A*F+beta*I. Only the * the lower triangular part of A+beta*I or A*F+beta*I is accessed. The * matrices A and F must already be permuted according to the fill-reduction * permutation L->Perm. cholmod_factorize is an "easy" wrapper for this code * which applies that permutation. beta is real. * * Symmetric case: A is a symmetric (lower) matrix. F is not accessed. * With a fill-reducing permutation, A(p,p) should be passed instead, where is * p is L->Perm. * * Unsymmetric case: A is unsymmetric, and F must be present. Normally, F=A'. * With a fill-reducing permutation, A(p,f) and A(p,f)' should be passed as A * and F, respectively, where f is a list of the subset of the columns of A. * * The input factorization L must be supernodal (L->is_super is TRUE). It can * either be symbolic or numeric. In the first case, L has been analyzed by * cholmod_analyze or cholmod_super_symbolic, but the matrix has not yet been * numerically factorized. The numerical values are allocated here and the * factorization is computed. In the second case, a prior matrix has been * analyzed and numerically factorized, and a new matrix is being factorized. * The numerical values of L are replaced with the new numerical factorization. * * L->is_ll is ignored, and set to TRUE. This routine always computes an LL' * factorization. Supernodal LDL' factorization is not (yet) supported. * FUTURE WORK: perform a supernodal LDL' factorization if L->is_ll is FALSE. * * Uses BLAS routines dsyrk, dgemm, dtrsm, and the LAPACK routine dpotrf. * The supernodal solver uses BLAS routines dtrsv, dgemv, dtrsm, and dgemm. * * If the matrix is not positive definite the routine returns TRUE, but sets * Common->status to CHOLMOD_NOT_POSDEF and L->minor is set to the column at * which the failure occurred. The supernode containing the non-positive * diagonal entry is set to zero (this includes columns to the left of L->minor * in the same supernode), as are all subsequent supernodes. * * workspace: Flag (nrow), Head (nrow+1), Iwork (2*nrow + 5*nsuper). * Allocates temporary space of size L->maxcsize * sizeof(double) * (twice that for the complex/zomplex case). * * If L is supernodal symbolic on input, it is converted to a supernodal numeric * factor on output, with an xtype of real if A is real, or complex if A is * complex or zomplex. If L is supernodal numeric on input, its xtype must * match A (except that L can be complex and A zomplex). The xtype of A and F * must match. */ #ifndef NGPL #ifndef NSUPERNODAL #include "cholmod_internal.h" #include "cholmod_supernodal.h" #ifdef GPU_BLAS #include "cholmod_gpu.h" #endif /* ========================================================================== */ /* === TEMPLATE codes for GPU and regular numeric factorization ============= */ /* ========================================================================== */ #ifdef DLONG #ifdef GPU_BLAS #define REAL #include "../GPU/t_cholmod_gpu.c" #define COMPLEX #include "../GPU/t_cholmod_gpu.c" #define ZOMPLEX /* no #include of "../GPU/t_cholmod_gpu.c". Zomplex case relies on complex */ #endif #endif #define REAL #include "t_cholmod_super_numeric.c" #define COMPLEX #include "t_cholmod_super_numeric.c" #define ZOMPLEX #include "t_cholmod_super_numeric.c" /* ========================================================================== */ /* === cholmod_super_numeric ================================================ */ /* ========================================================================== */ /* Returns TRUE if successful, or if the matrix is not positive definite. * Returns FALSE if out of memory, inputs are invalid, or other fatal error * occurs. */ int CHOLMOD(super_numeric) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ cholmod_sparse *F, /* F = A' or A(:,f)' */ double beta [2], /* beta*I is added to diagonal of matrix to factorize */ /* ---- in/out --- */ cholmod_factor *L, /* factorization */ /* --------------- */ cholmod_common *Common ) { cholmod_dense *C ; Int *Super, *Map, *SuperMap ; size_t maxcsize ; Int nsuper, n, i, k, s, stype, nrow ; int ok = TRUE, symbolic ; size_t t, w ; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_PATTERN, CHOLMOD_COMPLEX, FALSE) ; stype = A->stype ; if (stype < 0) { if (A->nrow != A->ncol || A->nrow != L->n) { ERROR (CHOLMOD_INVALID, "invalid dimensions") ; return (FALSE) ; } } else if (stype == 0) { if (A->nrow != L->n) { ERROR (CHOLMOD_INVALID, "invalid dimensions") ; return (FALSE) ; } RETURN_IF_NULL (F, FALSE) ; RETURN_IF_XTYPE_INVALID (F, CHOLMOD_REAL, CHOLMOD_ZOMPLEX, FALSE) ; if (A->nrow != F->ncol || A->ncol != F->nrow || F->stype != 0) { ERROR (CHOLMOD_INVALID, "F invalid") ; return (FALSE) ; } if (A->xtype != F->xtype) { ERROR (CHOLMOD_INVALID, "A and F must have same xtype") ; return (FALSE) ; } } else { /* symmetric upper case not suppored */ ERROR (CHOLMOD_INVALID, "symmetric upper case not supported") ; return (FALSE) ; } if (!(L->is_super)) { ERROR (CHOLMOD_INVALID, "L not supernodal") ; return (FALSE) ; } if (L->xtype != CHOLMOD_PATTERN) { if (! ((A->xtype == CHOLMOD_REAL && L->xtype == CHOLMOD_REAL) || (A->xtype == CHOLMOD_COMPLEX && L->xtype == CHOLMOD_COMPLEX) || (A->xtype == CHOLMOD_ZOMPLEX && L->xtype == CHOLMOD_COMPLEX))) { ERROR (CHOLMOD_INVALID, "complex type mismatch") ; return (FALSE) ; } } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace in Common */ /* ---------------------------------------------------------------------- */ nsuper = L->nsuper ; maxcsize = L->maxcsize ; nrow = A->nrow ; n = nrow ; PRINT1 (("nsuper "ID" maxcsize %g\n", nsuper, (double) maxcsize)) ; ASSERT (nsuper >= 0 && maxcsize > 0) ; /* w = 2*n + 5*nsuper */ w = CHOLMOD(mult_size_t) (n, 2, &ok) ; t = CHOLMOD(mult_size_t) (nsuper, 5, &ok) ; w = CHOLMOD(add_size_t) (w, t, &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (n, w, 0, Common) ; if (Common->status < CHOLMOD_OK) { return (FALSE) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* ---------------------------------------------------------------------- */ /* get the current factor L and allocate numerical part, if needed */ /* ---------------------------------------------------------------------- */ Super = L->super ; symbolic = (L->xtype == CHOLMOD_PATTERN) ; if (symbolic) { /* convert to supernodal numeric by allocating L->x */ CHOLMOD(change_factor) ( (A->xtype == CHOLMOD_REAL) ? CHOLMOD_REAL : CHOLMOD_COMPLEX, TRUE, TRUE, TRUE, TRUE, L, Common) ; if (Common->status < CHOLMOD_OK) { /* the factor L remains in symbolic supernodal form */ return (FALSE) ; } } ASSERT (L->dtype == DTYPE) ; ASSERT (L->xtype == CHOLMOD_REAL || L->xtype == CHOLMOD_COMPLEX) ; /* supernodal LDL' is not supported */ L->is_ll = TRUE ; /* ---------------------------------------------------------------------- */ /* get more workspace */ /* ---------------------------------------------------------------------- */ C = CHOLMOD(allocate_dense) (maxcsize, 1, maxcsize, L->xtype, Common) ; if (Common->status < CHOLMOD_OK) { int status = Common->status ; if (symbolic) { /* Change L back to symbolic, since the numeric values are not * initialized. This cannot fail. */ CHOLMOD(change_factor) (CHOLMOD_PATTERN, TRUE, TRUE, TRUE, TRUE, L, Common) ; } /* the factor L is now back to the form it had on input */ Common->status = status ; return (FALSE) ; } /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ SuperMap = Common->Iwork ; /* size n (i/i/l) */ Map = Common->Flag ; /* size n, use Flag as workspace for Map array */ for (i = 0 ; i < n ; i++) { Map [i] = EMPTY ; } /* ---------------------------------------------------------------------- */ /* find the mapping of nodes to relaxed supernodes */ /* ---------------------------------------------------------------------- */ /* SuperMap [k] = s if column k is contained in supernode s */ for (s = 0 ; s < nsuper ; s++) { PRINT1 (("Super ["ID"] "ID" ncols "ID"\n", s, Super[s], Super[s+1]-Super[s])); for (k = Super [s] ; k < Super [s+1] ; k++) { SuperMap [k] = s ; PRINT2 (("relaxed SuperMap ["ID"] = "ID"\n", k, SuperMap [k])) ; } } /* ---------------------------------------------------------------------- */ /* supernodal numerical factorization, using template routine */ /* ---------------------------------------------------------------------- */ switch (A->xtype) { case CHOLMOD_REAL: ok = r_cholmod_super_numeric (A, F, beta, L, C, Common) ; break ; case CHOLMOD_COMPLEX: ok = c_cholmod_super_numeric (A, F, beta, L, C, Common) ; break ; case CHOLMOD_ZOMPLEX: /* This operates on complex L, not zomplex */ ok = z_cholmod_super_numeric (A, F, beta, L, C, Common) ; break ; } /* ---------------------------------------------------------------------- */ /* clear Common workspace, free temp workspace C, and return */ /* ---------------------------------------------------------------------- */ /* Flag array was used as workspace, clear it */ Common->mark = EMPTY ; /* CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; CHOLMOD(free_dense) (&C, Common) ; return (ok) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Supernodal/cholmod_super_symbolic.c0000664000175000017500000010252214224052371023700 00000000000000/* ========================================================================== */ /* === Supernodal/cholmod_super_symbolic ==================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Supernodal Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Supernodal Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Supernodal symbolic analysis of the LL' factorization of A, A*A', * A(:,f)*A(:,f)'. * * This routine must be preceded by a simplicial symbolic analysis * (cholmod_rowcolcounts). See cholmod_analyze.c for an example of how to use * this routine. * * The user need not call this directly; cholmod_analyze is a "simple" wrapper * for this routine. * * Symmetric case: * * A is stored in column form, with entries stored in the upper triangular * part. Entries in the lower triangular part are ignored. * * Unsymmetric case: * * A is stored in column form. If F is equal to the transpose of A, then * A*A' is analyzed. F can include a subset of the columns of A * (F=A(:,f)'), in which case F*F' is analyzed. * * Requires Parent and L->ColCount to be defined on input; these are the * simplicial Parent and ColCount arrays as computed by cholmod_rowcolcounts. * Does not use L->Perm; the input matrices A and F must already be properly * permuted. Allocates and computes the supernodal pattern of L (L->super, * L->pi, L->px, and L->s). Does not allocate the real part (L->x). * * Supports any xtype (pattern, real, complex, or zomplex). */ #ifndef NGPL #ifndef NSUPERNODAL #include "cholmod_internal.h" #include "cholmod_supernodal.h" #ifdef GPU_BLAS #include "cholmod_gpu.h" #endif /* ========================================================================== */ /* === subtree ============================================================== */ /* ========================================================================== */ /* In the symmetric case, traverse the kth row subtree from the nonzeros in * A (0:k1-1,k) and add the new entries found to the pattern of the kth row * of L. The current supernode s contains the diagonal block k1:k2-1, so it * can be skipped. * * In the unsymmetric case, the nonzero pattern of A*F is computed one column * at a time (thus, the total time spent in this function is bounded below by * the time taken to multiply A*F, which can be high if A is tall and thin). * The kth column is A*F(:,k), or the set union of all columns A(:,j) for which * F(j,k) is nonzero. This routine is called once for each entry j. Only the * upper triangular part is needed, so only A (0:k1-1,j) is accessed, where * k1:k2-1 are the columns of the current supernode s (k is in the range k1 to * k2-1). * * If A is sorted, then the total time taken by this function is proportional * to the number of nonzeros in the strictly block upper triangular part of A, * plus the number of entries in the strictly block lower triangular part of * the supernodal part of L. This excludes entries in the diagonal blocks * corresponding to the columns in each supernode. That is, if k1:k2-1 are * in a single supernode, then only A (0:k1-1,k1:k2-1) are accessed. * * For the unsymmetric case, only the strictly block upper triangular part * of A*F is constructed. * * Only adds column indices corresponding to the leading columns of each * relaxed supernode. */ static void subtree ( /* inputs, not modified: */ Int j, /* j = k for symmetric case */ Int k, Int Ap [ ], Int Ai [ ], Int Anz [ ], Int SuperMap [ ], Int Sparent [ ], Int mark, Int sorted, /* true if the columns of A are sorted */ Int k1, /* only consider A (0:k1-1,k) */ /* input/output: */ Int Flag [ ], Int Ls [ ], Int Lpi2 [ ] ) { Int p, pend, i, si ; p = Ap [j] ; pend = (Anz == NULL) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i < k1) { /* (i,k) is an entry in the upper triangular part of A or A*F'. * symmetric case: A(i,k) is nonzero (j=k). * unsymmetric case: A(i,j) and F(j,k) are both nonzero. * * Column i is in supernode si = SuperMap [i]. Follow path from si * to root of supernodal etree, stopping at the first flagged * supernode. The root of the row subtree is supernode SuperMap[k], * which is flagged already. This traversal will stop there, or it * might stop earlier if supernodes have been flagged by previous * calls to this routine for the same k. */ for (si = SuperMap [i] ; Flag [si] < mark ; si = Sparent [si]) { ASSERT (si <= SuperMap [k]) ; Ls [Lpi2 [si]++] = k ; Flag [si] = mark ; } } else if (sorted) { break ; } } } /* clear workspace used by cholmod_super_symbolic */ #define FREE_WORKSPACE \ { \ /* CHOLMOD(clear_flag) (Common) ; */ \ CHOLMOD_CLEAR_FLAG (Common) ; \ for (k = 0 ; k <= nfsuper ; k++) \ { \ Head [k] = EMPTY ; \ } \ ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; \ } \ /* ========================================================================== */ /* === cholmod_super_symbolic2 ============================================== */ /* ========================================================================== */ /* Analyze for supernodal Cholesky or multifrontal QR. */ int CHOLMOD(super_symbolic2) ( /* ---- input ---- */ int for_whom, /* FOR_SPQR (0): for SPQR but not GPU-accelerated FOR_CHOLESKY (1): for Cholesky (GPU or not) FOR_SPQRGPU (2): for SPQR with GPU acceleration */ cholmod_sparse *A, /* matrix to analyze */ cholmod_sparse *F, /* F = A' or A(:,f)' */ Int *Parent, /* elimination tree */ /* ---- in/out --- */ cholmod_factor *L, /* simplicial symbolic on input, * supernodal symbolic on output */ /* --------------- */ cholmod_common *Common ) { double zrelax0, zrelax1, zrelax2, xxsize ; Int *Wi, *Wj, *Super, *Snz, *Ap, *Ai, *Flag, *Head, *Ls, *Lpi, *Lpx, *Fnz, *Sparent, *Anz, *SuperMap, *Merged, *Nscol, *Zeros, *Fp, *Fj, *ColCount, *Lpi2, *Lsuper, *Iwork ; Int nsuper, d, n, j, k, s, mark, parent, p, pend, k1, k2, packed, nscol, nsrow, ndrow1, ndrow2, stype, ssize, xsize, sparent, plast, slast, csize, maxcsize, ss, nscol0, nscol1, ns, nfsuper, newzeros, totzeros, merge, snext, esize, maxesize, nrelax0, nrelax1, nrelax2, Asorted ; size_t w ; int ok = TRUE, find_xsize ; const char* env_use_gpu; const char* env_max_bytes; size_t max_bytes; const char* env_max_fraction; double max_fraction; /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (A, FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_NULL (Parent, FALSE) ; RETURN_IF_XTYPE_INVALID (A, CHOLMOD_PATTERN, CHOLMOD_ZOMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_PATTERN, CHOLMOD_PATTERN, FALSE) ; stype = A->stype ; if (stype < 0) { /* invalid symmetry; symmetric lower form not supported */ ERROR (CHOLMOD_INVALID, "symmetric lower not supported") ; return (FALSE) ; } if (stype == 0) { /* F must be present in the unsymmetric case */ RETURN_IF_NULL (F, FALSE) ; } if (L->is_super) { /* L must be a simplicial symbolic factor */ ERROR (CHOLMOD_INVALID, "L must be symbolic on input") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; /* ---------------------------------------------------------------------- */ /* allocate workspace */ /* ---------------------------------------------------------------------- */ n = A->nrow ; /* w = 5*n */ w = CHOLMOD(mult_size_t) (n, 5, &ok) ; if (!ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; return (FALSE) ; } CHOLMOD(allocate_work) (n, w, 0, Common) ; if (Common->status < CHOLMOD_OK) { /* out of memory */ return (FALSE) ; } ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ; /* ---------------------------------------------------------------------- */ /* allocate GPU workspace */ /* ---------------------------------------------------------------------- */ L->useGPU = 0 ; /* only used for Cholesky factorization, not QR */ #ifdef GPU_BLAS /* GPU module is installed */ if ( for_whom == CHOLMOD_ANALYZE_FOR_CHOLESKY ) { /* only allocate GPU workspace for supernodal Cholesky, and only when the GPU is requested and available. */ max_bytes = 0; max_fraction = 0; #ifdef DLONG if ( Common->useGPU == EMPTY ) { /* useGPU not explicity requested by the user, but not explicitly * prohibited either. Query OS environment variables for request.*/ env_use_gpu = getenv("CHOLMOD_USE_GPU"); if ( env_use_gpu ) { /* CHOLMOD_USE_GPU environment variable is set to something */ if ( atoi ( env_use_gpu ) == 0 ) { Common->useGPU = 0; /* don't use the gpu */ } else { Common->useGPU = 1; /* use the gpu */ env_max_bytes = getenv("CHOLMOD_GPU_MEM_BYTES"); env_max_fraction = getenv("CHOLMOD_GPU_MEM_FRACTION"); if ( env_max_bytes ) { max_bytes = atol(env_max_bytes); Common->maxGpuMemBytes = max_bytes; } if ( env_max_fraction ) { max_fraction = atof (env_max_fraction); if ( max_fraction < 0 ) max_fraction = 0; if ( max_fraction > 1 ) max_fraction = 1; Common->maxGpuMemFraction = max_fraction; } } } else { /* CHOLMOD_USE_GPU environment variable not set, so no GPU * acceleration will be used */ Common->useGPU = 0; } /* fprintf (stderr, "useGPU queried: %d\n", Common->useGPU) ; */ } /* Ensure that a GPU is present */ if ( Common->useGPU == 1 ) { /* fprintf (stderr, "\nprobe GPU:\n") ; */ Common->useGPU = CHOLMOD(gpu_probe) (Common); /* fprintf (stderr, "\nprobe GPU: result %d\n", Common->useGPU) ; */ } if ( Common->useGPU == 1 ) { /* Cholesky + GPU, so allocate space */ /* fprintf (stderr, "allocate GPU:\n") ; */ CHOLMOD(gpu_allocate) ( Common ); /* fprintf (stderr, "allocate GPU done\n") ; */ } #else /* GPU acceleration is only supported for long int version */ Common->useGPU = 0; #endif /* Cache the fact that the symbolic factorization supports * GPU acceleration */ L->useGPU = Common->useGPU; } #else /* GPU module is not installed */ Common->useGPU = 0 ; #endif /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ /* A is now either A or triu(A(p,p)) for the symmetric case. It is either * A or A(p,f) for the unsymmetric case (both in column form). It can be * either packed or unpacked, and either sorted or unsorted. Entries in * the lower triangular part may be present if A is symmetric, but these * are ignored. */ Ap = A->p ; Ai = A->i ; Anz = A->nz ; if (stype != 0) { /* F not accessed */ Fp = NULL ; Fj = NULL ; Fnz = NULL ; packed = TRUE ; } else { /* F = A(:,f) or A(p,f) in packed row form, either sorted or unsorted */ Fp = F->p ; Fj = F->i ; Fnz = F->nz ; packed = F->packed ; } ColCount = L->ColCount ; nrelax0 = Common->nrelax [0] ; nrelax1 = Common->nrelax [1] ; nrelax2 = Common->nrelax [2] ; zrelax0 = Common->zrelax [0] ; zrelax1 = Common->zrelax [1] ; zrelax2 = Common->zrelax [2] ; zrelax0 = IS_NAN (zrelax0) ? 0 : zrelax0 ; zrelax1 = IS_NAN (zrelax1) ? 0 : zrelax1 ; zrelax2 = IS_NAN (zrelax2) ? 0 : zrelax2 ; ASSERT (CHOLMOD(dump_parent) (Parent, n, "Parent", Common)) ; /* ---------------------------------------------------------------------- */ /* get workspace */ /* ---------------------------------------------------------------------- */ /* Sparent, Snz, and Merged could be allocated later, of size nfsuper */ Iwork = Common->Iwork ; Wi = Iwork ; /* size n (i/l/l). Lpi2 is i/l/l */ Wj = Iwork + n ; /* size n (i/l/l). Zeros is i/l/l */ Sparent = Iwork + 2*((size_t) n) ; /* size nfsuper <= n [ */ Snz = Iwork + 3*((size_t) n) ; /* size nfsuper <= n [ */ Merged = Iwork + 4*((size_t) n) ; /* size nfsuper <= n [ */ Flag = Common->Flag ; /* size n */ Head = Common->Head ; /* size n+1 */ /* ---------------------------------------------------------------------- */ /* find the fundamental supernodes */ /* ---------------------------------------------------------------------- */ /* count the number of children of each node, using Wi [ */ for (j = 0 ; j < n ; j++) { Wi [j] = 0 ; } for (j = 0 ; j < n ; j++) { parent = Parent [j] ; if (parent != EMPTY) { Wi [parent]++ ; } } Super = Head ; /* use Head [0..nfsuper] as workspace for Super list ( */ /* column 0 always starts a new supernode */ nfsuper = (n == 0) ? 0 : 1 ; /* number of fundamental supernodes */ Super [0] = 0 ; for (j = 1 ; j < n ; j++) { /* check if j starts new supernode, or in the same supernode as j-1 */ if (Parent [j-1] != j /* parent of j-1 is not j */ || (ColCount [j-1] != ColCount [j] + 1) /* j-1 not subset of j*/ || Wi [j] > 1 /* j has more than one child */ #ifdef GPU_BLAS /* Ensure that the supernode will fit in the GPU buffers */ /* Data size of 16 bytes must be assumed for case of PATTERN */ || (for_whom == CHOLMOD_ANALYZE_FOR_CHOLESKY && L->useGPU && (j-Super[nfsuper-1]+1) * ColCount[Super[nfsuper-1]] * sizeof(double) * 2 >= Common->devBuffSize) #endif ) { /* j is the leading node of a supernode */ Super [nfsuper++] = j ; } } Super [nfsuper] = n ; /* contents of Wi no longer needed for child count ] */ Nscol = Wi ; /* use Wi as size-nfsuper workspace for Nscol [ */ /* ---------------------------------------------------------------------- */ /* find the mapping of fundamental nodes to supernodes */ /* ---------------------------------------------------------------------- */ SuperMap = Wj ; /* use Wj as workspace for SuperMap [ */ /* SuperMap [k] = s if column k is contained in supernode s */ for (s = 0 ; s < nfsuper ; s++) { for (k = Super [s] ; k < Super [s+1] ; k++) { SuperMap [k] = s ; } } /* ---------------------------------------------------------------------- */ /* construct the fundamental supernodal etree */ /* ---------------------------------------------------------------------- */ for (s = 0 ; s < nfsuper ; s++) { j = Super [s+1] - 1 ; /* last node in supernode s */ parent = Parent [j] ; /* parent of last node */ Sparent [s] = (parent == EMPTY) ? EMPTY : SuperMap [parent] ; PRINT1 (("Sparent ["ID"] = "ID"\n", s, Sparent [s])) ; } /* contents of Wj no longer needed as workspace for SuperMap ] * SuperMap will be recomputed below, for the relaxed supernodes. */ Zeros = Wj ; /* use Wj for Zeros, workspace of size nfsuper [ */ /* ---------------------------------------------------------------------- */ /* relaxed amalgamation */ /* ---------------------------------------------------------------------- */ for (s = 0 ; s < nfsuper ; s++) { Merged [s] = EMPTY ; /* s not merged into another */ Nscol [s] = Super [s+1] - Super [s] ; /* # of columns in s */ Zeros [s] = 0 ; /* # of zero entries in s */ ASSERT (s <= Super [s]) ; Snz [s] = ColCount [Super [s]] ; /* # of entries in leading col of s */ PRINT2 (("lnz ["ID"] "ID"\n", s, Snz [s])) ; } for (s = nfsuper-2 ; s >= 0 ; s--) { double lnz1 ; /* should supernodes s and s+1 merge into a new node s? */ PRINT1 (("\n========= Check relax of s "ID" and s+1 "ID"\n", s, s+1)) ; ss = Sparent [s] ; if (ss == EMPTY) { PRINT1 (("s "ID" is a root, no merge with s+1 = "ID"\n", s, s+1)) ; continue ; } /* find the current parent of s (perform path compression as needed) */ for (ss = Sparent [s] ; Merged [ss] != EMPTY ; ss = Merged [ss]) ; sparent = ss ; PRINT2 (("Current sparent of s "ID" is "ID"\n", s, sparent)) ; /* ss is the current parent of s */ for (ss = Sparent [s] ; Merged [ss] != EMPTY ; ss = snext) { snext = Merged [ss] ; PRINT2 (("ss "ID" is dead, merged into snext "ID"\n", ss, snext)) ; Merged [ss] = sparent ; } /* if s+1 is not the current parent of s, do not merge */ if (sparent != s+1) { continue ; } nscol0 = Nscol [s] ; /* # of columns in s */ nscol1 = Nscol [s+1] ; /* # of columns in s+1 */ ns = nscol0 + nscol1 ; PRINT2 (("ns "ID" nscol0 "ID" nscol1 "ID"\n", ns, nscol0, nscol1)) ; totzeros = Zeros [s+1] ; /* current # of zeros in s+1 */ lnz1 = (double) (Snz [s+1]) ; /* # entries in leading column of s+1 */ /* determine if supernodes s and s+1 should merge */ if (ns <= nrelax0) { PRINT2 (("ns is tiny ("ID"), so go ahead and merge\n", ns)) ; merge = TRUE ; } else { /* use double to avoid integer overflow */ double lnz0 = Snz [s] ; /* # entries in leading column of s */ double xnewzeros = nscol0 * (lnz1 + nscol0 - lnz0) ; /* use Int for the final update of Zeros [s] below */ newzeros = nscol0 * (Snz [s+1] + nscol0 - Snz [s]) ; ASSERT (newzeros == xnewzeros) ; PRINT2 (("lnz0 %g lnz1 %g xnewzeros %g\n", lnz0, lnz1, xnewzeros)) ; if (xnewzeros == 0) { /* no new zeros, so go ahead and merge */ PRINT2 (("no new fillin, so go ahead and merge\n")) ; merge = TRUE ; } else { /* # of zeros if merged */ double xtotzeros = ((double) totzeros) + xnewzeros ; /* xtotsize: total size of merged supernode, if merged: */ double xns = (double) ns ; double xtotsize = (xns * (xns+1) / 2) + xns * (lnz1 - nscol1) ; double z = xtotzeros / xtotsize ; Int totsize ; totsize = (ns * (ns+1) / 2) + ns * (Snz [s+1] - nscol1) ; PRINT2 (("oldzeros "ID" newzeros "ID" xtotsize %g z %g\n", Zeros [s+1], newzeros, xtotsize, z)) ; /* use Int for the final update of Zeros [s] below */ totzeros += newzeros ; /* do not merge if supernode would become too big * (Int overflow). Continue computing; not (yet) an error. */ /* fl.pt. compare, but no NaN's can occur here */ merge = ((ns <= nrelax1 && z < zrelax0) || (ns <= nrelax2 && z < zrelax1) || (z < zrelax2)) && (xtotsize < Int_max / sizeof (double)) ; } } #ifdef GPU_BLAS if ( for_whom == CHOLMOD_ANALYZE_FOR_CHOLESKY && L->useGPU ) { /* Ensure that the aggregated supernode fits in the device supernode buffers */ double xns = (double) ns; if ( ((xns * xns) + xns * (lnz1 - nscol1))*sizeof(double)*2 >= Common->devBuffSize ) { merge = FALSE; } } #endif if (merge) { PRINT1 (("Merge node s ("ID") and s+1 ("ID")\n", s, s+1)) ; Zeros [s] = totzeros ; Merged [s+1] = s ; Snz [s] = nscol0 + Snz [s+1] ; Nscol [s] += Nscol [s+1] ; } } /* contents of Wj no longer needed for Zeros ] */ /* contents of Wi no longer needed for Nscol ] */ /* contents of Sparent no longer needed (recomputed below) */ /* ---------------------------------------------------------------------- */ /* construct the relaxed supernode list */ /* ---------------------------------------------------------------------- */ nsuper = 0 ; for (s = 0 ; s < nfsuper ; s++) { if (Merged [s] == EMPTY) { PRINT1 (("live supernode: "ID" snz "ID"\n", s, Snz [s])) ; Super [nsuper] = Super [s] ; Snz [nsuper] = Snz [s] ; nsuper++ ; } } Super [nsuper] = n ; PRINT1 (("Fundamental supernodes: "ID" relaxed "ID"\n", nfsuper, nsuper)) ; /* Merged no longer needed ] */ /* ---------------------------------------------------------------------- */ /* find the mapping of relaxed nodes to supernodes */ /* ---------------------------------------------------------------------- */ /* use Wj as workspace for SuperMap { */ /* SuperMap [k] = s if column k is contained in supernode s */ for (s = 0 ; s < nsuper ; s++) { for (k = Super [s] ; k < Super [s+1] ; k++) { SuperMap [k] = s ; } } /* ---------------------------------------------------------------------- */ /* construct the relaxed supernodal etree */ /* ---------------------------------------------------------------------- */ for (s = 0 ; s < nsuper ; s++) { j = Super [s+1] - 1 ; /* last node in supernode s */ parent = Parent [j] ; /* parent of last node */ Sparent [s] = (parent == EMPTY) ? EMPTY : SuperMap [parent] ; PRINT1 (("new Sparent ["ID"] = "ID"\n", s, Sparent [s])) ; } /* ---------------------------------------------------------------------- */ /* determine the size of L->s and L->x */ /* ---------------------------------------------------------------------- */ ssize = 0 ; xsize = 0 ; xxsize = 0 ; find_xsize = for_whom == CHOLMOD_ANALYZE_FOR_CHOLESKY || for_whom == CHOLMOD_ANALYZE_FOR_SPQRGPU ; for (s = 0 ; s < nsuper ; s++) { nscol = Super [s+1] - Super [s] ; nsrow = Snz [s] ; ASSERT (nscol > 0) ; ssize += nsrow ; if (find_xsize) { xsize += nscol * nsrow ; /* also compute xsize in double to guard against Int overflow */ xxsize += ((double) nscol) * ((double) nsrow) ; } if (ssize < 0 ||(find_xsize && xxsize > Int_max)) { /* Int overflow, clear workspace and return. QR factorization will not use xxsize, so that error is ignored. For Cholesky factorization, however, memory of space xxsize will be allocated, so this is a failure. Both QR and Cholesky fail if ssize overflows. */ ERROR (CHOLMOD_TOO_LARGE, "problem too large") ; FREE_WORKSPACE ; return (FALSE) ; } ASSERT (ssize > 0) ; ASSERT (IMPLIES (find_xsize, xsize > 0)) ; } xsize = MAX (1, xsize) ; ssize = MAX (1, ssize) ; PRINT1 (("ix sizes: "ID" "ID" nsuper "ID"\n", ssize, xsize, nsuper)) ; /* ---------------------------------------------------------------------- */ /* allocate L (all except real part L->x) */ /* ---------------------------------------------------------------------- */ L->ssize = ssize ; L->xsize = xsize ; L->nsuper = nsuper ; CHOLMOD(change_factor) (CHOLMOD_PATTERN, TRUE, TRUE, TRUE, TRUE, L, Common); if (Common->status < CHOLMOD_OK) { /* out of memory; L is still a valid simplicial symbolic factor */ FREE_WORKSPACE ; return (FALSE) ; } DEBUG (CHOLMOD(dump_factor) (L, "L to symbolic super", Common)) ; ASSERT (L->is_ll && L->xtype == CHOLMOD_PATTERN && L->is_super) ; Lpi = L->pi ; Lpx = L->px ; Ls = L->s ; Ls [0] = 0 ; /* flag for cholmod_check_factor; supernodes are defined */ Lsuper = L->super ; /* copy the list of relaxed supernodes into the final list in L */ for (s = 0 ; s <= nsuper ; s++) { Lsuper [s] = Super [s] ; } /* Head no longer needed as workspace for fundamental Super list ) */ Super = Lsuper ; /* Super is now the list of relaxed supernodes */ /* ---------------------------------------------------------------------- */ /* construct column pointers of relaxed supernodal pattern (L->pi) */ /* ---------------------------------------------------------------------- */ p = 0 ; for (s = 0 ; s < nsuper ; s++) { Lpi [s] = p ; p += Snz [s] ; PRINT1 (("Snz ["ID"] = "ID", Super ["ID"] = "ID"\n", s, Snz [s], s, Super[s])) ; } Lpi [nsuper] = p ; ASSERT ((Int) (L->ssize) == MAX (1,p)) ; /* ---------------------------------------------------------------------- */ /* construct pointers for supernodal values (L->px) */ /* ---------------------------------------------------------------------- */ if (for_whom == CHOLMOD_ANALYZE_FOR_CHOLESKY || for_whom == CHOLMOD_ANALYZE_FOR_SPQRGPU) { Lpx [0] = 0 ; p = 0 ; for (s = 0 ; s < nsuper ; s++) { nscol = Super [s+1] - Super [s] ; /* number of columns in s */ nsrow = Snz [s] ; /* # of rows, incl triangular part*/ Lpx [s] = p ; /* pointer to numerical part of s */ p += nscol * nsrow ; } Lpx [s] = p ; ASSERT ((Int) (L->xsize) == MAX (1,p)) ; } else { /* L->px is not needed for non-GPU accelerated QR factorization (it may * lead to Int overflow, anyway, if xsize caused Int overflow above). * Use a magic number to tell cholmod_check_factor to ignore Lpx. */ Lpx [0] = 123456 ; } /* Snz no longer needed ] */ /* ---------------------------------------------------------------------- */ /* symbolic analysis to construct the relaxed supernodal pattern (L->s) */ /* ---------------------------------------------------------------------- */ Lpi2 = Wi ; /* copy Lpi into Lpi2, using Wi as workspace for Lpi2 [ */ for (s = 0 ; s < nsuper ; s++) { Lpi2 [s] = Lpi [s] ; } Asorted = A->sorted ; for (s = 0 ; s < nsuper ; s++) { /* sth supernode is in columns k1 to k2-1. * compute nonzero pattern of L (k1:k2-1,:). */ /* place rows k1 to k2-1 in leading column of supernode s */ k1 = Super [s] ; k2 = Super [s+1] ; PRINT1 (("=========>>> Supernode "ID" k1 "ID" k2-1 "ID"\n", s, k1, k2-1)) ; for (k = k1 ; k < k2 ; k++) { Ls [Lpi2 [s]++] = k ; } /* compute nonzero pattern each row k1 to k2-1 */ for (k = k1 ; k < k2 ; k++) { /* compute row k of L. In the symmetric case, the pattern of L(k,:) * is the set of nodes reachable in the supernodal etree from any * row i in the nonzero pattern of A(0:k,k). In the unsymmetric * case, the pattern of the kth column of A*A' is the set union * of all columns A(0:k,j) for each nonzero F(j,k). */ /* clear the Flag array and mark the current supernode */ /* mark = CHOLMOD(clear_flag) (Common) ; */ CHOLMOD_CLEAR_FLAG (Common) ; mark = Common->mark ; Flag [s] = mark ; ASSERT (s == SuperMap [k]) ; /* traverse the row subtree for each nonzero in A or AA' */ if (stype != 0) { subtree (k, k, Ap, Ai, Anz, SuperMap, Sparent, mark, Asorted, k1, Flag, Ls, Lpi2) ; } else { /* for each j nonzero in F (:,k) do */ p = Fp [k] ; pend = (packed) ? (Fp [k+1]) : (p + Fnz [k]) ; for ( ; p < pend ; p++) { subtree (Fj [p], k, Ap, Ai, Anz, SuperMap, Sparent, mark, Asorted, k1, Flag, Ls, Lpi2) ; } } } } #ifndef NDEBUG for (s = 0 ; s < nsuper ; s++) { PRINT1 (("Lpi2[s] "ID" Lpi[s+1] "ID"\n", Lpi2 [s], Lpi [s+1])) ; ASSERT (Lpi2 [s] == Lpi [s+1]) ; CHOLMOD(dump_super) (s, Super, Lpi, Ls, NULL, NULL, 0, Common) ; } #endif /* contents of Wi no longer needed for Lpi2 ] */ /* Sparent no longer needed ] */ /* ---------------------------------------------------------------------- */ /* determine the largest update matrix (L->maxcsize) */ /* ---------------------------------------------------------------------- */ /* maxcsize could be determined before L->s is allocated and defined, which * would mean that all memory requirements for both the symbolic and numeric * factorizations could be computed using O(nnz(A)+O(n)) space. However, it * would require a lot of extra work. The analysis phase, above, would need * to be duplicated, but with Ls not kept; instead, the algorithm would keep * track of the current s and slast for each supernode d, and update them * when a new row index appears in supernode d. An alternative would be to * do this computation only if the allocation of L->s failed, in which case * the following code would be skipped. * * The csize for a supernode is the size of its largest contribution to * a subsequent ancestor supernode. For example, suppose the rows of #'s * in the figure below correspond to the columns of a subsequent supernode, * and the dots are the entries in that ancestore. * * c * c c * c c c * x x x * x x x * # # # . * # # # . . * * * * . . * * * * . . * * * * . . * . . * * Then for this update, the csize is 3-by-2, or 6, because there are 3 * rows of *'s which is the number of rows in the update, and there are * 2 rows of #'s, which is the number columns in the update. The csize * of a supernode is the largest such contribution for any ancestor * supernode. maxcsize, for the whole matrix, has a rough upper bound of * the maximum size of any supernode. This bound is loose, because the * the contribution must be less than the size of the ancestor supernodal * that it's updating. maxcsize of a completely dense matrix, with one * supernode, is zero. * * maxesize is the column dimension for the workspace E needed for the * solve. E is of size nrhs-by-maxesize, where the nrhs is the number of * columns in the right-hand-side. The maxesize is the largest esize of * any supernode. The esize of a supernode is the number of row indices * it contains, excluding the column indices of the supernode itself. * For the following example, esize is 4: * * c * c c * c c c * x x x * x x x * x x x * x x x * * maxesize can be no bigger than n. */ maxcsize = 1 ; maxesize = 1 ; /* Do not need to guard csize against Int overflow since xsize is OK. */ if (for_whom == CHOLMOD_ANALYZE_FOR_CHOLESKY || for_whom == CHOLMOD_ANALYZE_FOR_SPQRGPU) { /* this is not needed for non-GPU accelerated QR factorization */ for (d = 0 ; d < nsuper ; d++) { nscol = Super [d+1] - Super [d] ; p = Lpi [d] + nscol ; plast = p ; pend = Lpi [d+1] ; esize = pend - p ; maxesize = MAX (maxesize, esize) ; slast = (p == pend) ? (EMPTY) : (SuperMap [Ls [p]]) ; for ( ; p <= pend ; p++) { s = (p == pend) ? (EMPTY) : (SuperMap [Ls [p]]) ; if (s != slast) { /* row i is the start of a new supernode */ ndrow1 = p - plast ; ndrow2 = pend - plast ; csize = ndrow2 * ndrow1 ; PRINT1 (("Supernode "ID" ancestor "ID" C: "ID"-by-"ID " csize "ID"\n", d, slast, ndrow1, ndrow2, csize)) ; maxcsize = MAX (maxcsize, csize) ; plast = p ; slast = s ; } } } PRINT1 (("max csize "ID"\n", maxcsize)) ; } /* Wj no longer needed for SuperMap } */ L->maxcsize = maxcsize ; L->maxesize = maxesize ; L->is_super = TRUE ; ASSERT (L->xtype == CHOLMOD_PATTERN && L->is_ll) ; /* ---------------------------------------------------------------------- */ /* supernodal symbolic factorization is complete */ /* ---------------------------------------------------------------------- */ FREE_WORKSPACE ; return (TRUE) ; } /* ========================================================================== */ /* === cholmod_super_symbolic =============================================== */ /* ========================================================================== */ /* Analyzes A, AA', or A(:,f)*A(:,f)' in preparation for a supernodal numeric * factorization. The user need not call this directly; cholmod_analyze is * a "simple" wrapper for this routine. * * This function does all the analysis for a supernodal Cholesky factorization. * * workspace: Flag (nrow), Head (nrow), Iwork (2*nrow), * and temporary space of size 3*nfsuper*sizeof(Int), where nfsuper <= n * is the number of fundamental supernodes. */ int CHOLMOD(super_symbolic) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to analyze */ cholmod_sparse *F, /* F = A' or A(:,f)' */ Int *Parent, /* elimination tree */ /* ---- in/out --- */ cholmod_factor *L, /* simplicial symbolic on input, * supernodal symbolic on output */ /* --------------- */ cholmod_common *Common ) { return (CHOLMOD(super_symbolic2) (TRUE, A, F, Parent, L, Common)) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Supernodal/cholmod_super_solve.c0000664000175000017500000001572614224052371023220 00000000000000/* ========================================================================== */ /* === Supernodal/cholmod_super_solve ======================================= */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Supernodal Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Supernodal Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Solve Lx=b or L'x=b for a supernodal factorization. These routines do not * apply the permutation L->Perm. See cholmod_solve for a more general * interface that performs that operation. */ #ifndef NGPL #ifndef NSUPERNODAL #include "cholmod_internal.h" #include "cholmod_supernodal.h" /* ========================================================================== */ /* === TEMPLATE ============================================================= */ /* ========================================================================== */ #define REAL #include "t_cholmod_super_solve.c" #define COMPLEX #include "t_cholmod_super_solve.c" /* ========================================================================== */ /* === cholmod_super_lsolve ================================================= */ /* ========================================================================== */ /* Solve Lx=b where x and b are of size n-by-nrhs. b is overwritten by the * solution x. On input, b is stored in col-major order with leading dimension * of d, and on output x is stored in the same manner. * * The contents of the workspace E are undefined on both input and output. * * workspace: none */ int CHOLMOD(super_lsolve) /* TRUE if OK, FALSE if BLAS overflow occured */ ( /* ---- input ---- */ cholmod_factor *L, /* factor to use for the forward solve */ /* ---- output ---- */ cholmod_dense *X, /* b on input, solution to Lx=b on output */ /* ---- workspace ---- */ cholmod_dense *E, /* workspace of size nrhs*(L->maxesize) */ /* --------------- */ cholmod_common *Common ) { /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_NULL (X, FALSE) ; RETURN_IF_NULL (E, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_COMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_COMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (E, CHOLMOD_REAL, CHOLMOD_COMPLEX, FALSE) ; if (L->xtype != X->xtype) { ERROR (CHOLMOD_INVALID, "L and X must have the same xtype") ; return (FALSE) ; } if (L->xtype != E->xtype) { ERROR (CHOLMOD_INVALID, "L and E must have the same xtype") ; return (FALSE) ; } if (X->d < X->nrow || L->n != X->nrow) { ERROR (CHOLMOD_INVALID, "X and L dimensions must match") ; return (FALSE) ; } if (E->nzmax < X->ncol * (L->maxesize)) { ERROR (CHOLMOD_INVALID, "workspace E not large enough") ; return (FALSE) ; } if (!(L->is_ll) || !(L->is_super)) { ERROR (CHOLMOD_INVALID, "L not supernodal") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; ASSERT (IMPLIES (L->n == 0, L->nsuper == 0)) ; if (L->n == 0 || X->ncol == 0) { /* nothing to do */ return (TRUE) ; } /* ---------------------------------------------------------------------- */ /* solve Lx=b using template routine */ /* ---------------------------------------------------------------------- */ switch (L->xtype) { case CHOLMOD_REAL: r_cholmod_super_lsolve (L, X, E, Common) ; break ; case CHOLMOD_COMPLEX: c_cholmod_super_lsolve (L, X, E, Common) ; break ; } if (CHECK_BLAS_INT && !Common->blas_ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large for the BLAS") ; } return (Common->blas_ok) ; } /* ========================================================================== */ /* === cholmod_super_ltsolve ================================================ */ /* ========================================================================== */ /* Solve L'x=b where x and b are of size n-by-nrhs. b is overwritten by the * solution x. On input, b is stored in col-major order with leading dimension * of d, and on output x is stored in the same manner. * * The contents of the workspace E are undefined on both input and output. * * workspace: none */ int CHOLMOD(super_ltsolve) /* TRUE if OK, FALSE if BLAS overflow occured */ ( /* ---- input ---- */ cholmod_factor *L, /* factor to use for the backsolve */ /* ---- output ---- */ cholmod_dense *X, /* b on input, solution to L'x=b on output */ /* ---- workspace ---- */ cholmod_dense *E, /* workspace of size nrhs*(L->maxesize) */ /* --------------- */ cholmod_common *Common ) { /* ---------------------------------------------------------------------- */ /* check inputs */ /* ---------------------------------------------------------------------- */ RETURN_IF_NULL_COMMON (FALSE) ; RETURN_IF_NULL (L, FALSE) ; RETURN_IF_NULL (X, FALSE) ; RETURN_IF_NULL (E, FALSE) ; RETURN_IF_XTYPE_INVALID (L, CHOLMOD_REAL, CHOLMOD_COMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (X, CHOLMOD_REAL, CHOLMOD_COMPLEX, FALSE) ; RETURN_IF_XTYPE_INVALID (E, CHOLMOD_REAL, CHOLMOD_COMPLEX, FALSE) ; if (L->xtype != X->xtype) { ERROR (CHOLMOD_INVALID, "L and X must have the same xtype") ; return (FALSE) ; } if (L->xtype != E->xtype) { ERROR (CHOLMOD_INVALID, "L and E must have the same xtype") ; return (FALSE) ; } if (X->d < X->nrow || L->n != X->nrow) { ERROR (CHOLMOD_INVALID, "X and L dimensions must match") ; return (FALSE) ; } if (E->nzmax < X->ncol * (L->maxesize)) { ERROR (CHOLMOD_INVALID, "workspace E not large enough") ; return (FALSE) ; } if (!(L->is_ll) || !(L->is_super)) { ERROR (CHOLMOD_INVALID, "L not supernodal") ; return (FALSE) ; } Common->status = CHOLMOD_OK ; ASSERT (IMPLIES (L->n == 0, L->nsuper == 0)) ; if (L->n == 0 || X->ncol == 0) { /* nothing to do */ return (TRUE) ; } /* ---------------------------------------------------------------------- */ /* solve Lx=b using template routine */ /* ---------------------------------------------------------------------- */ switch (L->xtype) { case CHOLMOD_REAL: r_cholmod_super_ltsolve (L, X, E, Common) ; break ; case CHOLMOD_COMPLEX: c_cholmod_super_ltsolve (L, X, E, Common) ; break ; } if (CHECK_BLAS_INT && !Common->blas_ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large for the BLAS") ; } return (Common->blas_ok) ; } #endif #endif JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Supernodal/License.txt0000664000175000017500000000203114224052371021105 00000000000000CHOLMOD/Supernodal Module. Copyright (C) 2005-2006, Timothy A. Davis CHOLMOD is also available under other licenses; contact authors for details. http://www.suitesparse.com Note that this license is for the CHOLMOD/Supernodal module only. All CHOLMOD modules are licensed separately. -------------------------------------------------------------------------------- This Module 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 of the License, or (at your option) any later version. This Module 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 Module; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Supernodal/gpl.txt0000664000175000017500000004313314224052371020315 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 of the License, 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Supernodal/t_cholmod_super_solve.c0000664000175000017500000002556514224052371023545 00000000000000/* ========================================================================== */ /* === Supernodal/t_cholmod_super_solve ===================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Supernodal Module. Copyright (C) 2005-2006, Timothy A. Davis * The CHOLMOD/Supernodal Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Template routine for cholmod_super_solve. Supports real or complex L. */ #include "cholmod_template.h" static void TEMPLATE (cholmod_super_lsolve) ( /* ---- input ---- */ cholmod_factor *L, /* factor to use for the forward solve */ /* ---- output ---- */ cholmod_dense *X, /* b on input, solution to Lx=b on output */ /* ---- workspace ---- */ cholmod_dense *E, /* workspace of size nrhs*(L->maxesize) */ /* --------------- */ cholmod_common *Common ) { double *Lx, *Xx, *Ex ; double minus_one [2], one [2] ; Int *Lpi, *Lpx, *Ls, *Super ; Int nsuper, k1, k2, psi, psend, psx, nsrow, nscol, ii, s, nsrow2, n, ps2, j, i, d, nrhs ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ nrhs = X->ncol ; Ex = E->x ; Xx = X->x ; n = L->n ; d = X->d ; nsuper = L->nsuper ; Lpi = L->pi ; Lpx = L->px ; Ls = L->s ; Super = L->super ; Lx = L->x ; minus_one [0] = -1.0 ; minus_one [1] = 0 ; one [0] = 1.0 ; one [1] = 0 ; /* ---------------------------------------------------------------------- */ /* solve Lx=b */ /* ---------------------------------------------------------------------- */ if (nrhs == 1) { for (s = 0 ; s < nsuper ; s++) { k1 = Super [s] ; k2 = Super [s+1] ; psi = Lpi [s] ; psend = Lpi [s+1] ; psx = Lpx [s] ; nsrow = psend - psi ; nscol = k2 - k1 ; nsrow2 = nsrow - nscol ; ps2 = psi + nscol ; ASSERT ((size_t) nsrow2 <= L->maxesize) ; /* L1 is nscol-by-nscol, lower triangular with non-unit diagonal. * L2 is nsrow2-by-nscol. L1 and L2 have leading dimension of * nsrow. x1 is nscol-by-nsrow, with leading dimension n. * E is nsrow2-by-1, with leading dimension nsrow2. */ /* gather X into E */ for (ii = 0 ; ii < nsrow2 ; ii++) { /* Ex [ii] = Xx [Ls [ps2 + ii]] ; */ ASSIGN (Ex,-,ii, Xx,-,Ls [ps2 + ii]) ; } #ifdef REAL /* solve L1*x1 (that is, x1 = L1\x1) */ BLAS_dtrsv ("L", "N", "N", nscol, /* N: L1 is nscol-by-nscol */ Lx + ENTRY_SIZE*psx, nsrow, /* A, LDA: L1 */ Xx + ENTRY_SIZE*k1, 1) ; /* X, INCX: x1 */ /* E = E - L2*x1 */ BLAS_dgemv ("N", nsrow2, nscol, /* M, N: L2 is nsrow2-by-nscol */ minus_one, /* ALPHA: -1 */ Lx + ENTRY_SIZE*(psx + nscol), /* A, LDA: L2 */ nsrow, Xx + ENTRY_SIZE*k1, 1, /* X, INCX: x1 */ one, /* BETA: 1 */ Ex, 1) ; /* Y, INCY: E */ #else /* solve L1*x1 (that is, x1 = L1\x1) */ BLAS_ztrsv ("L", "N", "N", nscol, /* N: L1 is nscol-by-nscol */ Lx + ENTRY_SIZE*psx, nsrow, /* A, LDA: L1 */ Xx + ENTRY_SIZE*k1, 1) ; /* X, INCX: x1 */ /* E = E - L2*x1 */ BLAS_zgemv ("N", nsrow2, nscol, /* M, N: L2 is nsrow2-by-nscol */ minus_one, /* ALPHA: -1 */ Lx + ENTRY_SIZE*(psx + nscol), /* A, LDA: L2 */ nsrow, Xx + ENTRY_SIZE*k1, 1, /* X, INCX: x1 */ one, /* BETA: 1 */ Ex, 1) ; /* Y, INCY: E */ #endif /* scatter E back into X */ for (ii = 0 ; ii < nsrow2 ; ii++) { /* Xx [Ls [ps2 + ii]] = Ex [ii] ; */ ASSIGN (Xx,-,Ls [ps2 + ii], Ex,-,ii) ; } } } else { for (s = 0 ; s < nsuper ; s++) { k1 = Super [s] ; k2 = Super [s+1] ; psi = Lpi [s] ; psend = Lpi [s+1] ; psx = Lpx [s] ; nsrow = psend - psi ; nscol = k2 - k1 ; nsrow2 = nsrow - nscol ; ps2 = psi + nscol ; ASSERT ((size_t) nsrow2 <= L->maxesize) ; /* E is nsrow2-by-nrhs, with leading dimension nsrow2. */ /* gather X into E */ for (ii = 0 ; ii < nsrow2 ; ii++) { i = Ls [ps2 + ii] ; for (j = 0 ; j < nrhs ; j++) { /* Ex [ii + j*nsrow2] = Xx [i + j*d] ; */ ASSIGN (Ex,-,ii+j*nsrow2, Xx,-,i+j*d) ; } } #ifdef REAL /* solve L1*x1 */ BLAS_dtrsm ("L", "L", "N", "N", nscol, nrhs, /* M, N: x1 is nscol-by-nrhs */ one, /* ALPHA: 1 */ Lx + ENTRY_SIZE*psx, nsrow, /* A, LDA: L1 */ Xx + ENTRY_SIZE*k1, d) ; /* B, LDB: x1 */ /* E = E - L2*x1 */ if (nsrow2 > 0) { BLAS_dgemm ("N", "N", nsrow2, nrhs, nscol, /* M, N, K */ minus_one, /* ALPHA: -1 */ Lx + ENTRY_SIZE*(psx + nscol), /* A, LDA: L2 */ nsrow, Xx + ENTRY_SIZE*k1, d, /* B, LDB: X1 */ one, /* BETA: 1 */ Ex, nsrow2) ; /* C, LDC: E */ } #else /* solve L1*x1 */ BLAS_ztrsm ("L", "L", "N", "N", nscol, nrhs, /* M, N: x1 is nscol-by-nrhs */ one, /* ALPHA: 1 */ Lx + ENTRY_SIZE*psx, nsrow, /* A, LDA: L1 */ Xx + ENTRY_SIZE*k1, d) ; /* B, LDB: x1 */ /* E = E - L2*x1 */ if (nsrow2 > 0) { BLAS_zgemm ("N", "N", nsrow2, nrhs, nscol, /* M, N, K */ minus_one, /* ALPHA: -1 */ Lx + ENTRY_SIZE*(psx + nscol), /* A, LDA: L2 */ nsrow, Xx + ENTRY_SIZE*k1, d, /* B, LDB: X1 */ one, /* BETA: 1 */ Ex, nsrow2) ; /* C, LDC: E */ } #endif /* scatter E back into X */ for (ii = 0 ; ii < nsrow2 ; ii++) { i = Ls [ps2 + ii] ; for (j = 0 ; j < nrhs ; j++) { /* Xx [i + j*d] = Ex [ii + j*nsrow2] ; */ ASSIGN (Xx,-,i+j*d, Ex,-,ii+j*nsrow2) ; } } } } } static void TEMPLATE (cholmod_super_ltsolve) ( /* ---- input ---- */ cholmod_factor *L, /* factor to use for the forward solve */ /* ---- output ---- */ cholmod_dense *X, /* b on input, solution to Lx=b on output */ /* ---- workspace ---- */ cholmod_dense *E, /* workspace of size nrhs*(L->maxesize) */ /* --------------- */ cholmod_common *Common ) { double *Lx, *Xx, *Ex ; double minus_one [2], one [2] ; Int *Lpi, *Lpx, *Ls, *Super ; Int nsuper, k1, k2, psi, psend, psx, nsrow, nscol, ii, s, nsrow2, n, ps2, j, i, d, nrhs ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ nrhs = X->ncol ; Ex = E->x ; Xx = X->x ; n = L->n ; d = X->d ; nsuper = L->nsuper ; Lpi = L->pi ; Lpx = L->px ; Ls = L->s ; Super = L->super ; Lx = L->x ; minus_one [0] = -1.0 ; minus_one [1] = 0 ; one [0] = 1.0 ; one [1] = 0 ; /* ---------------------------------------------------------------------- */ /* solve L'x=b */ /* ---------------------------------------------------------------------- */ if (nrhs == 1) { for (s = nsuper-1 ; s >= 0 ; s--) { k1 = Super [s] ; k2 = Super [s+1] ; psi = Lpi [s] ; psend = Lpi [s+1] ; psx = Lpx [s] ; nsrow = psend - psi ; nscol = k2 - k1 ; nsrow2 = nsrow - nscol ; ps2 = psi + nscol ; ASSERT ((size_t) nsrow2 <= L->maxesize) ; /* L1 is nscol-by-nscol, lower triangular with non-unit diagonal. * L2 is nsrow2-by-nscol. L1 and L2 have leading dimension of * nsrow. x1 is nscol-by-nsrow, with leading dimension n. * E is nsrow2-by-1, with leading dimension nsrow2. */ /* gather X into E */ for (ii = 0 ; ii < nsrow2 ; ii++) { /* Ex [ii] = Xx [Ls [ps2 + ii]] ; */ ASSIGN (Ex,-,ii, Xx,-,Ls [ps2 + ii]) ; } #ifdef REAL /* x1 = x1 - L2'*E */ BLAS_dgemv ("C", nsrow2, nscol, /* M, N: L2 is nsrow2-by-nscol */ minus_one, /* ALPHA: -1 */ Lx + ENTRY_SIZE*(psx + nscol), /* A, LDA: L2 */ nsrow, Ex, 1, /* X, INCX: Ex */ one, /* BETA: 1 */ Xx + ENTRY_SIZE*k1, 1) ; /* Y, INCY: x1 */ /* solve L1'*x1 */ BLAS_dtrsv ("L", "C", "N", nscol, /* N: L1 is nscol-by-nscol */ Lx + ENTRY_SIZE*psx, nsrow, /* A, LDA: L1 */ Xx + ENTRY_SIZE*k1, 1) ; /* X, INCX: x1 */ #else /* x1 = x1 - L2'*E */ BLAS_zgemv ("C", nsrow2, nscol, /* M, N: L2 is nsrow2-by-nscol */ minus_one, /* ALPHA: -1 */ Lx + ENTRY_SIZE*(psx + nscol), /* A, LDA: L2 */ nsrow, Ex, 1, /* X, INCX: Ex */ one, /* BETA: 1 */ Xx + ENTRY_SIZE*k1, 1) ; /* Y, INCY: x1 */ /* solve L1'*x1 */ BLAS_ztrsv ("L", "C", "N", nscol, /* N: L1 is nscol-by-nscol */ Lx + ENTRY_SIZE*psx, nsrow, /* A, LDA: L1 */ Xx + ENTRY_SIZE*k1, 1) ; /* X, INCX: x1 */ #endif } } else { for (s = nsuper-1 ; s >= 0 ; s--) { k1 = Super [s] ; k2 = Super [s+1] ; psi = Lpi [s] ; psend = Lpi [s+1] ; psx = Lpx [s] ; nsrow = psend - psi ; nscol = k2 - k1 ; nsrow2 = nsrow - nscol ; ps2 = psi + nscol ; ASSERT ((size_t) nsrow2 <= L->maxesize) ; /* E is nsrow2-by-nrhs, with leading dimension nsrow2. */ /* gather X into E */ for (ii = 0 ; ii < nsrow2 ; ii++) { i = Ls [ps2 + ii] ; for (j = 0 ; j < nrhs ; j++) { /* Ex [ii + j*nsrow2] = Xx [i + j*d] ; */ ASSIGN (Ex,-,ii+j*nsrow2, Xx,-,i+j*d) ; } } #ifdef REAL /* x1 = x1 - L2'*E */ if (nsrow2 > 0) { BLAS_dgemm ("C", "N", nscol, nrhs, nsrow2, /* M, N, K */ minus_one, /* ALPHA: -1 */ Lx + ENTRY_SIZE*(psx + nscol), /* A, LDA: L2 */ nsrow, Ex, nsrow2, /* B, LDB: E */ one, /* BETA: 1 */ Xx + ENTRY_SIZE*k1, d) ; /* C, LDC: x1 */ } /* solve L1'*x1 */ BLAS_dtrsm ("L", "L", "C", "N", nscol, nrhs, /* M, N: x1 is nscol-by-nrhs */ one, /* ALPHA: 1 */ Lx + ENTRY_SIZE*psx, nsrow, /* A, LDA: L1 */ Xx + ENTRY_SIZE*k1, d) ; /* B, LDB: x1 */ #else /* x1 = x1 - L2'*E */ if (nsrow2 > 0) { BLAS_zgemm ("C", "N", nscol, nrhs, nsrow2, /* M, N, K */ minus_one, /* ALPHA: -1 */ Lx + ENTRY_SIZE*(psx + nscol), /* A, LDA: L2 */ nsrow, Ex, nsrow2, /* B, LDB: E */ one, /* BETA: 1 */ Xx + ENTRY_SIZE*k1, d) ; /* C, LDC: x1 */ } /* solve L1'*x1 */ BLAS_ztrsm ("L", "L", "C", "N", nscol, nrhs, /* M, N: x1 is nscol-by-nrhs */ one, /* ALPHA: 1 */ Lx + ENTRY_SIZE*psx, nsrow, /* A, LDA: L1 */ Xx + ENTRY_SIZE*k1, d) ; /* B, LDB: x1 */ #endif } } } #undef PATTERN #undef REAL #undef COMPLEX #undef ZOMPLEX JAGS-4.3.2/src/modules/glm/SSparse/CHOLMOD/Supernodal/t_cholmod_super_numeric.c0000664000175000017500000012332314224052371024046 00000000000000/* ========================================================================== */ /* === Supernodal/t_cholmod_super_numeric =================================== */ /* ========================================================================== */ /* ----------------------------------------------------------------------------- * CHOLMOD/Supernodal Module. Copyright (C) 2005-2012, Timothy A. Davis * The CHOLMOD/Supernodal Module is licensed under Version 2.0 of the GNU * General Public License. See gpl.txt for a text of the license. * CHOLMOD is also available under other licenses; contact authors for details. * http://www.suitesparse.com * -------------------------------------------------------------------------- */ /* Template routine for cholmod_super_numeric. All xtypes supported, except * that a zomplex A and F result in a complex L (there is no supernodal * zomplex L). */ /* ========================================================================== */ /* === complex arithmetic =================================================== */ /* ========================================================================== */ #include "cholmod_template.h" #undef L_ENTRY #undef L_CLEAR #undef L_ASSIGN #undef L_MULTADD #undef L_ASSEMBLE #undef L_ASSEMBLESUB #ifdef REAL /* -------------------------------------------------------------------------- */ /* A, F, and L are all real */ /* -------------------------------------------------------------------------- */ #define L_ENTRY 1 #define L_CLEAR(Lx,p) Lx [p] = 0 #define L_ASSIGN(Lx,q, Ax,Az,p) Lx [q] = Ax [p] #define L_MULTADD(Lx,q, Ax,Az,p, f) Lx [q] += Ax [p] * f [0] #define L_ASSEMBLE(Lx,q,b) Lx [q] += b [0] #define L_ASSEMBLESUB(Lx,q,C,p) Lx [q] -= C [p] #else /* -------------------------------------------------------------------------- */ /* A and F are complex or zomplex, L and C are complex */ /* -------------------------------------------------------------------------- */ #define L_ENTRY 2 #define L_CLEAR(Lx,p) Lx [2*(p)] = 0 ; Lx [2*(p)+1] = 0 #define L_ASSEMBLE(Lx,q,b) Lx [2*(q)] += b [0] ; #define L_ASSEMBLESUB(Lx,q,C,p) \ Lx [2*(q) ] -= C [2*(p) ] ; \ Lx [2*(q)+1] -= C [2*(p)+1] ; #ifdef COMPLEX /* -------------------------------------------------------------------------- */ /* A, F, L, and C are all complex */ /* -------------------------------------------------------------------------- */ #define L_ASSIGN(Lx,q, Ax,Az,p) \ Lx [2*(q) ] = Ax [2*(p) ] ; \ Lx [2*(q)+1] = Ax [2*(p)+1] #define L_MULTADD(Lx,q, Ax,Az,p, f) \ Lx [2*(q) ] += Ax [2*(p) ] * f [0] - Ax [2*(p)+1] * f [1] ; \ Lx [2*(q)+1] += Ax [2*(p)+1] * f [0] + Ax [2*(p) ] * f [1] #else /* -------------------------------------------------------------------------- */ /* A and F are zomplex, L and C is complex */ /* -------------------------------------------------------------------------- */ #define L_ASSIGN(Lx,q, Ax,Az,p) \ Lx [2*(q) ] = Ax [p] ; \ Lx [2*(q)+1] = Az [p] ; #define L_MULTADD(Lx,q, Ax,Az,p, f) \ Lx [2*(q) ] += Ax [p] * f [0] - Az [p] * f [1] ; \ Lx [2*(q)+1] += Az [p] * f [0] + Ax [p] * f [1] #endif #endif /* ========================================================================== */ /* === t_cholmod_super_numeric ============================================== */ /* ========================================================================== */ /* This function returns FALSE only if integer overflow occurs in the BLAS. * It returns TRUE otherwise whether or not the matrix is positive definite. */ static int TEMPLATE (cholmod_super_numeric) ( /* ---- input ---- */ cholmod_sparse *A, /* matrix to factorize */ cholmod_sparse *F, /* F = A' or A(:,f)' */ double beta [2], /* beta*I is added to diagonal of matrix to factorize */ /* ---- in/out --- */ cholmod_factor *L, /* factorization */ /* -- workspace -- */ cholmod_dense *Cwork, /* size (L->maxcsize)-by-1 */ /* --------------- */ cholmod_common *Common ) { double one [2], zero [2], tstart ; double *Lx, *Ax, *Fx, *Az, *Fz, *C ; Int *Super, *Head, *Ls, *Lpi, *Lpx, *Map, *SuperMap, *RelativeMap, *Next, *Lpos, *Fp, *Fi, *Fnz, *Ap, *Ai, *Anz, *Iwork, *Next_save, *Lpos_save, *Previous; Int nsuper, n, j, i, k, s, p, pend, k1, k2, nscol, psi, psx, psend, nsrow, pj, d, kd1, kd2, info, ndcol, ndrow, pdi, pdx, pdend, pdi1, pdi2, pdx1, ndrow1, ndrow2, px, dancestor, sparent, dnext, nsrow2, ndrow3, pk, pf, pfend, stype, Apacked, Fpacked, q, imap, repeat_supernode, nscol2, ss, tail, nscol_new = 0; /* ---------------------------------------------------------------------- */ /* declarations for the GPU */ /* ---------------------------------------------------------------------- */ /* these variables are not used if the GPU module is not installed */ #ifdef GPU_BLAS Int ndescendants, mapCreatedOnGpu, supernodeUsedGPU, idescendant, dlarge, dsmall, skips ; int iHostBuff, iDevBuff, useGPU, GPUavailable ; cholmod_gpu_pointers *gpu_p, gpu_pointer_struct ; gpu_p = &gpu_pointer_struct ; #endif /* ---------------------------------------------------------------------- */ /* guard against integer overflow in the BLAS */ /* ---------------------------------------------------------------------- */ /* If integer overflow occurs in the BLAS, Common->status is set to * CHOLMOD_TOO_LARGE, and the contents of Lx are undefined. */ Common->blas_ok = TRUE ; /* ---------------------------------------------------------------------- */ /* get inputs */ /* ---------------------------------------------------------------------- */ nsuper = L->nsuper ; n = L->n ; C = Cwork->x ; /* workspace of size L->maxcsize */ one [0] = 1.0 ; /* ALPHA for *syrk, *herk, *gemm, and *trsm */ one [1] = 0. ; zero [0] = 0. ; /* BETA for *syrk, *herk, and *gemm */ zero [1] = 0. ; /* Iwork must be of size 2n + 5*nsuper, allocated in the caller, * cholmod_super_numeric. The memory cannot be allocated here because the * cholmod_super_numeric initializes SuperMap, and cholmod_allocate_work * does not preserve existing workspace if the space needs to be increase * in size. */ /* allocate integer workspace */ Iwork = Common->Iwork ; SuperMap = Iwork ; /* size n (i/i/l) */ RelativeMap = Iwork + n ; /* size n (i/i/l) */ Next = Iwork + 2*((size_t) n) ; /* size nsuper*/ Lpos = Iwork + 2*((size_t) n) + nsuper ; /* size nsuper*/ Next_save = Iwork + 2*((size_t) n) + 2*((size_t) nsuper) ;/* size nsuper*/ Lpos_save = Iwork + 2*((size_t) n) + 3*((size_t) nsuper) ;/* size nsuper*/ Previous = Iwork + 2*((size_t) n) + 4*((size_t) nsuper) ;/* size nsuper*/ Map = Common->Flag ; /* size n, use Flag as workspace for Map array */ Head = Common->Head ; /* size n+1, only Head [0..nsuper-1] used */ Ls = L->s ; Lpi = L->pi ; Lpx = L->px ; Super = L->super ; Lx = L->x ; #ifdef GPU_BLAS /* local copy of useGPU */ if ( (Common->useGPU == 1) && L->useGPU) { /* Initialize the GPU. If not found, don't use it. */ useGPU = TEMPLATE2 (CHOLMOD (gpu_init)) (C, L, Common, nsuper, n, Lpi[nsuper]-Lpi[0], gpu_p) ; } else { useGPU = 0; } /* fprintf (stderr, "local useGPU %d\n", useGPU) ; */ #endif #ifndef NTIMER /* clear GPU / CPU statistics */ Common->CHOLMOD_CPU_GEMM_CALLS = 0 ; Common->CHOLMOD_CPU_SYRK_CALLS = 0 ; Common->CHOLMOD_CPU_TRSM_CALLS = 0 ; Common->CHOLMOD_CPU_POTRF_CALLS = 0 ; Common->CHOLMOD_GPU_GEMM_CALLS = 0 ; Common->CHOLMOD_GPU_SYRK_CALLS = 0 ; Common->CHOLMOD_GPU_TRSM_CALLS = 0 ; Common->CHOLMOD_GPU_POTRF_CALLS = 0 ; Common->CHOLMOD_CPU_GEMM_TIME = 0 ; Common->CHOLMOD_CPU_SYRK_TIME = 0 ; Common->CHOLMOD_CPU_TRSM_TIME = 0 ; Common->CHOLMOD_CPU_POTRF_TIME = 0 ; Common->CHOLMOD_GPU_GEMM_TIME = 0 ; Common->CHOLMOD_GPU_SYRK_TIME = 0 ; Common->CHOLMOD_GPU_TRSM_TIME = 0 ; Common->CHOLMOD_GPU_POTRF_TIME = 0 ; Common->CHOLMOD_ASSEMBLE_TIME = 0 ; Common->CHOLMOD_ASSEMBLE_TIME2 = 0 ; #endif stype = A->stype ; if (stype != 0) { /* F not accessed */ Fp = NULL ; Fi = NULL ; Fx = NULL ; Fz = NULL ; Fnz = NULL ; Fpacked = TRUE ; } else { Fp = F->p ; Fi = F->i ; Fx = F->x ; Fz = F->z ; Fnz = F->nz ; Fpacked = F->packed ; } Ap = A->p ; Ai = A->i ; Ax = A->x ; Az = A->z ; Anz = A->nz ; Apacked = A->packed ; /* clear the Map so that changes in the pattern of A can be detected */ #pragma omp parallel for num_threads(CHOLMOD_OMP_NUM_THREADS) \ if ( n > 128 ) schedule (static) for (i = 0 ; i < n ; i++) { Map [i] = EMPTY ; } /* If the matrix is not positive definite, the supernode s containing the * first zero or negative diagonal entry of L is repeated (but factorized * only up to just before the problematic diagonal entry). The purpose is * to provide MATLAB with [R,p]=chol(A); columns 1 to p-1 of L=R' are * required, where L(p,p) is the problematic diagonal entry. The * repeat_supernode flag tells us whether this is the repeated supernode. * Once supernode s is repeated, the factorization is terminated. */ repeat_supernode = FALSE ; #ifdef GPU_BLAS if ( useGPU ) { /* Case of GPU, zero all supernodes at one time for better performance*/ TEMPLATE2 (CHOLMOD (gpu_clear_memory))(Lx, L->xsize, CHOLMOD_OMP_NUM_THREADS); } #endif /* ---------------------------------------------------------------------- */ /* supernodal numerical factorization */ /* ---------------------------------------------------------------------- */ for (s = 0 ; s < nsuper ; s++) { /* ------------------------------------------------------------------ */ /* get the size of supernode s */ /* ------------------------------------------------------------------ */ k1 = Super [s] ; /* s contains columns k1 to k2-1 of L */ k2 = Super [s+1] ; nscol = k2 - k1 ; /* # of columns in all of s */ psi = Lpi [s] ; /* pointer to first row of s in Ls */ psx = Lpx [s] ; /* pointer to first row of s in Lx */ psend = Lpi [s+1] ; /* pointer just past last row of s in Ls */ nsrow = psend - psi ; /* # of rows in all of s */ PRINT1 (("====================================================\n" "S "ID" k1 "ID" k2 "ID" nsrow "ID" nscol "ID" psi "ID" psend " ""ID" psx "ID"\n", s, k1, k2, nsrow, nscol, psi, psend, psx)) ; /* ------------------------------------------------------------------ */ /* zero the supernode s */ /* ------------------------------------------------------------------ */ ASSERT ((size_t) (psx + nsrow*nscol) <= L->xsize) ; pend = psx + nsrow * nscol ; /* s is nsrow-by-nscol */ #ifdef GPU_BLAS if ( !useGPU ) #endif { /* Case of no GPU, zero individual supernodes */ #pragma omp parallel for num_threads(CHOLMOD_OMP_NUM_THREADS) \ schedule (static) if ( pend - psx > 1024 ) for (p = psx ; p < pend ; p++) { L_CLEAR (Lx,p); } } /* ------------------------------------------------------------------ */ /* construct the scattered Map for supernode s */ /* ------------------------------------------------------------------ */ /* If row i is the kth row in s, then Map [i] = k. Similarly, if * column j is the kth column in s, then Map [j] = k. */ #pragma omp parallel for num_threads(CHOLMOD_OMP_NUM_THREADS) \ if ( nsrow > 128 ) for (k = 0 ; k < nsrow ; k++) { PRINT1 ((" "ID" map "ID"\n", Ls [psi+k], k)) ; Map [Ls [psi + k]] = k ; } /* ------------------------------------------------------------------ */ /* when using GPU, reorder supernodes by levels.*/ /* (all supernodes in a level are independent) */ /* ------------------------------------------------------------------ */ #ifdef GPU_BLAS if ( useGPU ) { TEMPLATE2 (CHOLMOD (gpu_reorder_descendants)) ( Common, Super, &s, Lpi, Lpos, Head, Next, Previous, &ndescendants, &tail, &mapCreatedOnGpu, gpu_p ) ; } #endif /* ------------------------------------------------------------------ */ /* copy matrix into supernode s (lower triangular part only) */ /* ------------------------------------------------------------------ */ pk = psx ; #pragma omp parallel for private ( p, pend, pfend, pf, i, j, imap, q ) \ num_threads(CHOLMOD_OMP_NUM_THREADS) if ( k2-k1 > 64 ) for (k = k1 ; k < k2 ; k++) { if (stype != 0) { /* copy the kth column of A into the supernode */ p = Ap [k] ; pend = (Apacked) ? (Ap [k+1]) : (p + Anz [k]) ; for ( ; p < pend ; p++) { /* row i of L is located in row Map [i] of s */ i = Ai [p] ; if (i >= k) { /* This test is here simply to avoid a segfault. If * the test is false, the numeric factorization of A * is undefined. It does not detect all invalid * entries, only some of them (when debugging is * enabled, and Map is cleared after each step, then * all entries not in the pattern of L are detected). */ imap = Map [i] ; if (imap >= 0 && imap < nsrow) { /* Lx [Map [i] + pk] = Ax [p] ; */ L_ASSIGN (Lx,(imap+(psx+(k-k1)*nsrow)), Ax,Az,p) ; } } } } else { double fjk[2]; /* copy the kth column of A*F into the supernode */ pf = Fp [k] ; pfend = (Fpacked) ? (Fp [k+1]) : (p + Fnz [k]) ; for ( ; pf < pfend ; pf++) { j = Fi [pf] ; /* fjk = Fx [pf] ; */ L_ASSIGN (fjk,0, Fx,Fz,pf) ; p = Ap [j] ; pend = (Apacked) ? (Ap [j+1]) : (p + Anz [j]) ; for ( ; p < pend ; p++) { i = Ai [p] ; if (i >= k) { /* See the discussion of imap above. */ imap = Map [i] ; if (imap >= 0 && imap < nsrow) { /* Lx [Map [i] + pk] += Ax [p] * fjk ; */ L_MULTADD (Lx,(imap+(psx+(k-k1)*nsrow)), Ax,Az,p, fjk) ; } } } } } } /* add beta to the diagonal of the supernode, if nonzero */ if (beta [0] != 0.0) { /* note that only the real part of beta is used */ pk = psx ; for (k = k1 ; k < k2 ; k++) { /* Lx [pk] += beta [0] ; */ L_ASSEMBLE (Lx,pk, beta) ; pk += nsrow + 1 ; /* advance to the next diagonal entry */ } } PRINT1 (("Supernode with just A: repeat: "ID"\n", repeat_supernode)) ; DEBUG (CHOLMOD(dump_super) (s, Super, Lpi, Ls, Lpx, Lx, L_ENTRY, Common)) ; PRINT1 (("\n\n")) ; /* ------------------------------------------------------------------ */ /* save/restore the list of supernodes */ /* ------------------------------------------------------------------ */ if (!repeat_supernode) { /* Save the list of pending descendants in case s is not positive * definite. Also save Lpos for each descendant d, so that we can * find which part of d is used to update s. */ for (d = Head [s] ; d != EMPTY ; d = Next [d]) { Lpos_save [d] = Lpos [d] ; Next_save [d] = Next [d] ; } } else { for (d = Head [s] ; d != EMPTY ; d = Next [d]) { Lpos [d] = Lpos_save [d] ; Next [d] = Next_save [d] ; } } /* ------------------------------------------------------------------ */ /* update supernode s with each pending descendant d */ /* ------------------------------------------------------------------ */ #ifndef NDEBUG for (d = Head [s] ; d != EMPTY ; d = Next [d]) { PRINT1 (("\nWill update "ID" with Child: "ID"\n", s, d)) ; DEBUG (CHOLMOD(dump_super) (d, Super, Lpi, Ls, Lpx, Lx, L_ENTRY, Common)) ; } PRINT1 (("\nNow factorizing supernode "ID":\n", s)) ; #endif #ifdef GPU_BLAS /* initialize the buffer counter */ if ( useGPU ) { Common->ibuffer = 0; supernodeUsedGPU = 0; idescendant = 0; d = Head[s]; dnext = d; dlarge = Next[d]; dsmall = tail; GPUavailable = 1; skips = 0; } else { dnext = Head[s]; } #else /* GPU module not installed */ dnext = Head[s]; #endif while #ifdef GPU_BLAS ( (!useGPU && (dnext != EMPTY)) || (useGPU && (idescendant < ndescendants))) #else ( dnext != EMPTY ) #endif { #ifdef GPU_BLAS if ( useGPU ) { /* Conditionally select the next descendant supernode to * assemble. * + first, select the largest descendant * + subsequently, if gpu host buffers are available, select * the largest remaining descendant for assembly on the GPU * + otherwise select the smallest remaining descendant for * assembly on the CPU * * The objective is to keep the GPU busy assembling the largest * descendants, and simultaneously keep the CPU busy assembling * the smallest descendants. * * As this is called for every descendent supernode, moving * this code to t_cholmod_gpu incurs substantial overhead - * ~20 GF/s on audikw_1 - so it is being left here. */ iHostBuff = (Common->ibuffer) % CHOLMOD_HOST_SUPERNODE_BUFFERS; cudaError_t cuErr; if ( idescendant > 0 ) { if ( GPUavailable == -1 || skips > 0) { d = dsmall; dsmall = Previous[dsmall]; skips--; } else { cuErr = cudaEventQuery ( Common->updateCBuffersFree[iHostBuff] ); if ( cuErr == cudaSuccess ) { /* buffers are available, so assemble a large * descendant (anticipating that this will be * assembled on the GPU) */ d = dlarge; dlarge = Next[dlarge]; GPUavailable = 1; skips = 0; } else { /* buffers are not available, so the GPU is busy, * so assemble a small descendant (anticipating * that it will be assembled on the host) */ d = dsmall; dsmall = Previous[dsmall]; GPUavailable = 0; /* if the GPUs are busy, then do this many * supernodes on the CPU before querying GPUs * again. */ skips = CHOLMOD_GPU_SKIP; } } } idescendant++; } else { d = dnext; } #else /* GPU module not installed at compile time */ d = dnext ; #endif /* -------------------------------------------------------------- */ /* get the size of supernode d */ /* -------------------------------------------------------------- */ kd1 = Super [d] ; /* d contains cols kd1 to kd2-1 of L */ kd2 = Super [d+1] ; ndcol = kd2 - kd1 ; /* # of columns in all of d */ pdi = Lpi [d] ; /* pointer to first row of d in Ls */ pdx = Lpx [d] ; /* pointer to first row of d in Lx */ pdend = Lpi [d+1] ; /* pointer just past last row of d in Ls */ ndrow = pdend - pdi ; /* # rows in all of d */ PRINT1 (("Child: ")) ; DEBUG (CHOLMOD(dump_super) (d, Super, Lpi, Ls, Lpx, Lx, L_ENTRY, Common)) ; /* -------------------------------------------------------------- */ /* find the range of rows of d that affect rows k1 to k2-1 of s */ /* -------------------------------------------------------------- */ p = Lpos [d] ; /* offset of 1st row of d affecting s */ pdi1 = pdi + p ; /* ptr to 1st row of d affecting s in Ls */ pdx1 = pdx + p ; /* ptr to 1st row of d affecting s in Lx */ /* there must be at least one row remaining in d to update s */ ASSERT (pdi1 < pdend) ; PRINT1 (("Lpos[d] "ID" pdi1 "ID" Ls[pdi1] "ID"\n", Lpos[d], pdi1, Ls [pdi1])) ; ASSERT (Ls [pdi1] >= k1 && Ls [pdi1] < k2) ; for (pdi2 = pdi1 ; pdi2 < pdend && Ls [pdi2] < k2 ; pdi2++) ; ndrow1 = pdi2 - pdi1 ; /* # rows in first part of d */ ndrow2 = pdend - pdi1 ; /* # rows in remaining d */ /* rows Ls [pdi1 ... pdi2-1] are in the range k1 to k2-1. Since d * affects s, this set cannot be empty. */ ASSERT (pdi1 < pdi2 && pdi2 <= pdend) ; PRINT1 (("ndrow1 "ID" ndrow2 "ID"\n", ndrow1, ndrow2)) ; DEBUG (for (p = pdi1 ; p < pdi2 ; p++) PRINT1 (("Ls["ID"] "ID"\n", p, Ls[p]))) ; /* -------------------------------------------------------------- */ /* construct the update matrix C for this supernode d */ /* -------------------------------------------------------------- */ /* C = L (k1:n-1, kd1:kd2-1) * L (k1:k2-1, kd1:kd2-1)', except * that k1:n-1 refers to all of the rows in L, but many of the * rows are all zero. Supernode d holds columns kd1 to kd2-1 of L. * Nonzero rows in the range k1:k2-1 are in the list * Ls [pdi1 ... pdi2-1], of size ndrow1. Nonzero rows in the range * k2:n-1 are in the list Ls [pdi2 ... pdend], of size ndrow2. Let * L1 = L (Ls [pdi1 ... pdi2-1], kd1:kd2-1), and let * L2 = L (Ls [pdi2 ... pdend], kd1:kd2-1). C is ndrow2-by-ndrow1. * Let C1 be the first ndrow1 rows of C and let C2 be the last * ndrow2-ndrow1 rows of C. Only the lower triangular part of C1 * needs to be computed since C1 is symmetric. */ /* maxcsize is the largest size of C for all pairs (d,s) */ ASSERT (ndrow2 * ndrow1 <= ((Int) L->maxcsize)) ; /* compute leading ndrow1-by-ndrow1 lower triangular block of C, * C1 = L1*L1' */ ndrow3 = ndrow2 - ndrow1 ; /* number of rows of C2 */ ASSERT (ndrow3 >= 0) ; #ifdef GPU_BLAS if ( useGPU ) { /* set up GPU to assemble new supernode */ if ( GPUavailable == 1) { if ( ndrow2 * L_ENTRY >= CHOLMOD_ND_ROW_LIMIT && ndcol * L_ENTRY >= CHOLMOD_ND_COL_LIMIT ) { if ( ! mapCreatedOnGpu ) { TEMPLATE2 ( CHOLMOD (gpu_initialize_supernode)) ( Common, nscol, nsrow, psi, gpu_p ); mapCreatedOnGpu = 1; } } else { /* we've reached the limit of GPU-eligible descendants * flag to stop stop performing cudaEventQueries */ GPUavailable = -1; } } } #endif #ifdef GPU_BLAS if ( !useGPU || GPUavailable!=1 || !TEMPLATE2 (CHOLMOD (gpu_updateC)) (ndrow1, ndrow2, ndrow, ndcol, nsrow, pdx1, pdi1, Lx, C, Common, gpu_p)) #endif { /* GPU not installed, or not used */ #ifndef NTIMER Common->CHOLMOD_CPU_SYRK_CALLS++ ; tstart = SuiteSparse_time () ; #endif #ifdef REAL BLAS_dsyrk ("L", "N", ndrow1, ndcol, /* N, K: L1 is ndrow1-by-ndcol*/ one, /* ALPHA: 1 */ Lx + L_ENTRY*pdx1, ndrow, /* A, LDA: L1, ndrow */ zero, /* BETA: 0 */ C, ndrow2) ; /* C, LDC: C1 */ #else BLAS_zherk ("L", "N", ndrow1, ndcol, /* N, K: L1 is ndrow1-by-ndcol*/ one, /* ALPHA: 1 */ Lx + L_ENTRY*pdx1, ndrow, /* A, LDA: L1, ndrow */ zero, /* BETA: 0 */ C, ndrow2) ; /* C, LDC: C1 */ #endif #ifndef NTIMER Common->CHOLMOD_CPU_SYRK_TIME += SuiteSparse_time () - tstart ; #endif /* compute remaining (ndrow2-ndrow1)-by-ndrow1 block of C, * C2 = L2*L1' */ if (ndrow3 > 0) { #ifndef NTIMER Common->CHOLMOD_CPU_GEMM_CALLS++ ; tstart = SuiteSparse_time () ; #endif #ifdef REAL BLAS_dgemm ("N", "C", ndrow3, ndrow1, ndcol, /* M, N, K */ one, /* ALPHA: 1 */ Lx + L_ENTRY*(pdx1 + ndrow1), /* A, LDA: L2 */ ndrow, /* ndrow */ Lx + L_ENTRY*pdx1, /* B, LDB: L1 */ ndrow, /* ndrow */ zero, /* BETA: 0 */ C + L_ENTRY*ndrow1, /* C, LDC: C2 */ ndrow2) ; #else BLAS_zgemm ("N", "C", ndrow3, ndrow1, ndcol, /* M, N, K */ one, /* ALPHA: 1 */ Lx + L_ENTRY*(pdx1 + ndrow1), /* A, LDA: L2 */ ndrow, /* ndrow */ Lx + L_ENTRY*pdx1, /* B, LDB: L1, ndrow */ ndrow, zero, /* BETA: 0 */ C + L_ENTRY*ndrow1, /* C, LDC: C2 */ ndrow2) ; #endif #ifndef NTIMER Common->CHOLMOD_CPU_GEMM_TIME += SuiteSparse_time () - tstart ; #endif } /* ---------------------------------------------------------- */ /* construct relative map to assemble d into s */ /* ---------------------------------------------------------- */ DEBUG (CHOLMOD(dump_real) ("C", C, ndrow2, ndrow1, TRUE, L_ENTRY, Common)) ; #pragma omp parallel for num_threads(CHOLMOD_OMP_NUM_THREADS) \ if ( ndrow2 > 64 ) for (i = 0 ; i < ndrow2 ; i++) { RelativeMap [i] = Map [Ls [pdi1 + i]] ; ASSERT (RelativeMap [i] >= 0 && RelativeMap [i] < nsrow) ; } /* ---------------------------------------------------------- */ /* assemble C into supernode s using the relative map */ /* ---------------------------------------------------------- */ #pragma omp parallel for private ( j, i, px, q ) \ num_threads(CHOLMOD_OMP_NUM_THREADS) if (ndrow1 > 64 ) for (j = 0 ; j < ndrow1 ; j++) /* cols k1:k2-1 */ { ASSERT (RelativeMap [j] == Map [Ls [pdi1 + j]]) ; ASSERT (RelativeMap [j] >= 0 && RelativeMap [j] < nscol) ; px = psx + RelativeMap [j] * nsrow ; for (i = j ; i < ndrow2 ; i++) /* rows k1:n-1 */ { ASSERT (RelativeMap [i] == Map [Ls [pdi1 + i]]) ; ASSERT (RelativeMap [i] >= j && RelativeMap[i] < nsrow); /* Lx [px + RelativeMap [i]] -= C [i + pj] ; */ q = px + RelativeMap [i] ; L_ASSEMBLESUB (Lx,q, C, i+ndrow2*j) ; } } } #ifdef GPU_BLAS else { supernodeUsedGPU = 1; /* GPU was used for this supernode*/ Common->ibuffer++; /* gpu_updateC is asynchronous, so use * the next host buffer for the next * supernode */ Common->ibuffer = Common->ibuffer% (CHOLMOD_HOST_SUPERNODE_BUFFERS*CHOLMOD_DEVICE_STREAMS); } #endif /* -------------------------------------------------------------- */ /* prepare this supernode d for its next ancestor */ /* -------------------------------------------------------------- */ dnext = Next [d] ; if (!repeat_supernode) { /* If node s is being repeated, Head [dancestor] has already * been cleared (set to EMPTY). It must remain EMPTY. The * dancestor will not be factorized since the factorization * terminates at node s. */ Lpos [d] = pdi2 - pdi ; if (Lpos [d] < ndrow) { dancestor = SuperMap [Ls [pdi2]] ; ASSERT (dancestor > s && dancestor < nsuper) ; /* place d in the link list of its next ancestor */ Next [d] = Head [dancestor] ; Head [dancestor] = d ; } } } /* end of descendant supernode loop */ #ifdef GPU_BLAS if ( useGPU ) { iHostBuff = (Common->ibuffer)%CHOLMOD_HOST_SUPERNODE_BUFFERS; iDevBuff = (Common->ibuffer)%CHOLMOD_DEVICE_STREAMS; /* combine updates assembled on the GPU with updates * assembled on the CPU */ TEMPLATE2 ( CHOLMOD (gpu_final_assembly )) ( Common, Lx, psx, nscol, nsrow, supernodeUsedGPU, &iHostBuff, &iDevBuff, gpu_p ); } #endif PRINT1 (("\nSupernode with contributions A: repeat: "ID"\n", repeat_supernode)) ; DEBUG (CHOLMOD(dump_super) (s, Super, Lpi, Ls, Lpx, Lx, L_ENTRY, Common)) ; PRINT1 (("\n\n")) ; /* ------------------------------------------------------------------ */ /* factorize diagonal block of supernode s in LL' */ /* ------------------------------------------------------------------ */ /* The current supernode s is ready to factorize. It has been updated * by all descendant supernodes. Let S = the current supernode, which * holds rows k1:n-1 and columns k1:k2-1 of the updated matrix. It * splits into two parts: the square diagonal block S1, and the * rectangular part S2. Here, S1 is factorized into L1*L1' and * overwritten by L1. * * If supernode s is being repeated, only factorize it up to but not * including the column containing the problematic entry. */ nscol2 = (repeat_supernode) ? (nscol_new) : (nscol) ; #ifdef GPU_BLAS if ( !useGPU || !supernodeUsedGPU || !TEMPLATE2 (CHOLMOD (gpu_lower_potrf))(nscol2, nsrow, psx, Lx, &info, Common, gpu_p)) #endif { /* Note that the GPU will not be used for the triangular solve */ #ifdef GPU_BLAS supernodeUsedGPU = 0; #endif #ifndef NTIMER Common->CHOLMOD_CPU_POTRF_CALLS++ ; tstart = SuiteSparse_time () ; #endif #ifdef REAL LAPACK_dpotrf ("L", nscol2, /* N: nscol2 */ Lx + L_ENTRY*psx, nsrow, /* A, LDA: S1, nsrow */ info) ; /* INFO */ #else LAPACK_zpotrf ("L", nscol2, /* N: nscol2 */ Lx + L_ENTRY*psx, nsrow, /* A, LDA: S1, nsrow */ info) ; /* INFO */ #endif #ifndef NTIMER Common->CHOLMOD_CPU_POTRF_TIME += SuiteSparse_time ()- tstart ; #endif } /* ------------------------------------------------------------------ */ /* check if the matrix is not positive definite */ /* ------------------------------------------------------------------ */ if (repeat_supernode) { /* the leading part has been refactorized; it must have succeeded */ info = 0 ; /* zero out the rest of this supernode */ p = psx + nsrow * nscol_new ; pend = psx + nsrow * nscol ; /* s is nsrow-by-nscol */ for ( ; p < pend ; p++) { /* Lx [p] = 0 ; */ L_CLEAR (Lx,p) ; } } /* info is set to one in LAPACK_*potrf if blas_ok is FALSE. It is * set to zero in dpotrf/zpotrf if the factorization was successful. */ if (CHECK_BLAS_INT && !Common->blas_ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large for the BLAS") ; } if (info != 0) { /* Matrix is not positive definite. dpotrf/zpotrf do NOT report an * error if the diagonal of L has NaN's, only if it has a zero. */ if (Common->status == CHOLMOD_OK) { ERROR (CHOLMOD_NOT_POSDEF, "matrix not positive definite") ; } /* L->minor is the column of L that contains a zero or negative * diagonal term. */ L->minor = k1 + info - 1 ; /* clear the link lists of all subsequent supernodes */ for (ss = s+1 ; ss < nsuper ; ss++) { Head [ss] = EMPTY ; } /* zero this supernode, and all remaining supernodes */ pend = L->xsize ; for (p = psx ; p < pend ; p++) { /* Lx [p] = 0. ; */ L_CLEAR (Lx,p) ; } /* If L is indefinite, it still contains useful information. * Supernodes 0 to s-1 are valid, similar to MATLAB [R,p]=chol(A), * where the 1-based p is identical to the 0-based L->minor. Since * L->minor is in the current supernode s, it and any columns to the * left of it in supernode s are also all zero. This differs from * [R,p]=chol(A), which contains nonzero rows 1 to p-1. Fix this * by setting repeat_supernode to TRUE, and repeating supernode s. * * If Common->quick_return_if_not_posdef is true, then the entire * supernode s is not factorized; it is left as all zero. */ if (info == 1 || Common->quick_return_if_not_posdef) { /* If the first column of supernode s contains a zero or * negative diagonal entry, then it is already properly set to * zero. Also, info will be 1 if integer overflow occured in * the BLAS. */ Head [s] = EMPTY ; #ifdef GPU_BLAS if ( useGPU ) { CHOLMOD (gpu_end) (Common) ; } #endif return (Common->status >= CHOLMOD_OK) ; } else { /* Repeat supernode s, but only factorize it up to but not * including the column containing the problematic diagonal * entry. */ repeat_supernode = TRUE ; s-- ; nscol_new = info - 1 ; continue ; } } /* ------------------------------------------------------------------ */ /* compute the subdiagonal block and prepare supernode for its parent */ /* ------------------------------------------------------------------ */ nsrow2 = nsrow - nscol2 ; if (nsrow2 > 0) { /* The current supernode is columns k1 to k2-1 of L. Let L1 be the * diagonal block (factorized by dpotrf/zpotrf above; rows/cols * k1:k2-1), and L2 be rows k2:n-1 and columns k1:k2-1 of L. The * triangular system to solve is L2*L1' = S2, where S2 is * overwritten with L2. More precisely, L2 = S2 / L1' in MATLAB * notation. */ #ifdef GPU_BLAS if ( !useGPU || !supernodeUsedGPU || !TEMPLATE2 (CHOLMOD(gpu_triangular_solve)) (nsrow2, nscol2, nsrow, psx, Lx, Common, gpu_p)) #endif { #ifndef NTIMER Common->CHOLMOD_CPU_TRSM_CALLS++ ; tstart = SuiteSparse_time () ; #endif #ifdef REAL BLAS_dtrsm ("R", "L", "C", "N", nsrow2, nscol2, /* M, N */ one, /* ALPHA: 1 */ Lx + L_ENTRY*psx, nsrow, /* A, LDA: L1, nsrow */ Lx + L_ENTRY*(psx + nscol2), /* B, LDB, L2, nsrow */ nsrow) ; #else BLAS_ztrsm ("R", "L", "C", "N", nsrow2, nscol2, /* M, N */ one, /* ALPHA: 1 */ Lx + L_ENTRY*psx, nsrow, /* A, LDA: L1, nsrow */ Lx + L_ENTRY*(psx + nscol2), /* B, LDB, L2, nsrow */ nsrow) ; #endif #ifndef NTIMER Common->CHOLMOD_CPU_TRSM_TIME += SuiteSparse_time () - tstart ; #endif } if (CHECK_BLAS_INT && !Common->blas_ok) { ERROR (CHOLMOD_TOO_LARGE, "problem too large for the BLAS") ; } if (!repeat_supernode) { /* Lpos [s] is offset of first row of s affecting its parent */ Lpos [s] = nscol ; sparent = SuperMap [Ls [psi + nscol]] ; ASSERT (sparent != EMPTY) ; ASSERT (Ls [psi + nscol] >= Super [sparent]) ; ASSERT (Ls [psi + nscol] < Super [sparent+1]) ; ASSERT (SuperMap [Ls [psi + nscol]] == sparent) ; ASSERT (sparent > s && sparent < nsuper) ; /* place s in link list of its parent */ Next [s] = Head [sparent] ; Head [sparent] = s ; } } else { #ifdef GPU_BLAS TEMPLATE2 ( CHOLMOD (gpu_copy_supernode) ) ( Common, Lx, psx, nscol, nscol2, nsrow, supernodeUsedGPU, iHostBuff, gpu_p); #endif } Head [s] = EMPTY ; /* link list for supernode s no longer needed */ /* clear the Map (debugging only, to detect changes in pattern of A) */ DEBUG (for (k = 0 ; k < nsrow ; k++) Map [Ls [psi + k]] = EMPTY) ; DEBUG (CHOLMOD(dump_super) (s, Super, Lpi, Ls, Lpx, Lx, L_ENTRY, Common)) ; if (repeat_supernode) { /* matrix is not positive definite; finished clean-up for supernode * containing negative diagonal */ #ifdef GPU_BLAS if ( useGPU ) { CHOLMOD (gpu_end) (Common) ; } #endif return (Common->status >= CHOLMOD_OK) ; } } /* success; matrix is positive definite */ L->minor = n ; #ifdef GPU_BLAS if ( useGPU ) { CHOLMOD (gpu_end) (Common) ; } #endif return (Common->status >= CHOLMOD_OK) ; } #undef PATTERN #undef REAL #undef COMPLEX #undef ZOMPLEX JAGS-4.3.2/src/modules/glm/samplers/0000755000175000017500000000000014400711327014110 500000000000000JAGS-4.3.2/src/modules/glm/samplers/Makefile.am0000664000175000017500000000433014224052515016067 00000000000000noinst_LTLIBRARIES = libglmsampler.la libglmsampler_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/glm/CSparse \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include libglmsampler_la_SOURCES = GLMFactory.cc GLMSampler.cc GLMMethod.cc \ KS.cc \ IWLSFactory.cc \ IWLS.cc LGMix.cc AuxMixPoisson.cc AuxMixBinomial.cc Outcome.cc \ NormalLinear.cc BinaryProbit.cc BinaryLogit.cc Classify.cc \ IWLSOutcome.cc HolmesHeld.cc HolmesHeldFactory.cc GLMBlock.cc \ GLMGibbs.cc GLMGenericFactory.cc HolmesHeldGibbs.cc PolyaGamma.cc PGcommon.cc \ ScaledWishart.cc ScaledWishartFactory.cc SampleWishart.cc \ ScaledGamma.cc ScaledGammaFactory.cc \ LogisticLinear.cc TLinear.cc OrderedLogit.cc OrderedProbit.cc \ RESampler.cc REMethod.cc REFactory.cc \ REGamma.cc REGammaSlicer.cc REGammaFactory.cc \ REScaledGamma.cc REScaledGammaFactory.cc \ REScaledWishart.cc REScaledWishartFactory.cc \ MNormalLinear.cc \ REMethod2.cc REFactory2.cc \ REGammaSlicer2.cc REGamma2.cc REGammaFactory2.cc \ REScaledGamma2.cc REScaledGammaFactory2.cc \ REScaledWishart2.cc REScaledWishartFactory2.cc noinst_HEADERS = GLMFactory.h GLMSampler.h GLMMethod.h \ KS.h \ IWLSFactory.h IWLS.h LGMix.h \ AuxMixPoisson.h AuxMixBinomial.h Outcome.h \ NormalLinear.h BinaryProbit.h BinaryLogit.h Classify.h \ IWLSOutcome.h HolmesHeld.h HolmesHeldFactory.h GLMBlock.h \ GLMGibbs.h GLMGenericFactory.h HolmesHeldGibbs.h PolyaGamma.h PG.h \ ScaledWishart.h ScaledWishartFactory.h SampleWishart.h \ ScaledGamma.h ScaledGammaFactory.h \ LogisticLinear.h TLinear.h OrderedLogit.h OrderedProbit.h \ RESampler.h REMethod.h REFactory.h \ REGamma.h REGammaSlicer.h REGammaFactory.h \ REScaledGamma.h REScaledGammaFactory.h \ REScaledWishart.h REScaledWishartFactory.h \ MNormalLinear.h \ REMethod2.h REFactory2.h \ REGammaSlicer2.h REGamma2.h REGammaFactory2.h \ REScaledGamma2.h REScaledGammaFactory2.h \ REScaledWishart2.h REScaledWishartFactory2.h if CANCHECK check_LTLIBRARIES = libglmsamptest.la libglmsamptest_la_SOURCES = testglmsamp.cc testglmsamp.h libglmsamptest_la_CPPFLAGS = -I$(top_srcdir)/src/include libglmsamptest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) endif JAGS-4.3.2/src/modules/glm/samplers/GLMFactory.h0000664000175000017500000001025714224052515016160 00000000000000#ifndef GLM_FACTORY_H_ #define GLM_FACTORY_H_ #include "GLMMethod.h" #include namespace jags { class LinkNode; class SingletonGraphView; namespace glm { class GLMSampler; /** * @short Abstract factory for GLM samplers * * All factory objects for samplers that handle generalized linear * models (GLMs) must recognize the same basic structures in the * graph. They differ only by the allowed link function(s) and * outcome distribution(s) for the GLM, and the update methods * that they use for sampling. */ class GLMFactory : public SamplerFactory { std::string _name; SingletonGraphView * makeView(StochasticNode *snode, Graph const &graph, bool gibbs) const; bool checkDescendants(GraphView const *view) const; public: GLMFactory(std::string const &name); virtual ~GLMFactory(); /** * Creates a newly-allocated Sampler for the set of candidate nodes, * or a NULL pointer. Sub-classes of GLMFactory only have to * implement the abstract member function newMethod. */ GLMSampler * makeSampler(std::list const &free_nodes, Graph const &graph, bool gibbs) const; /** * Wraps GLMFactory#makeSampler and returns a single * newly-allocated sampler in a vector. */ std::vector makeSamplers(std::list const &free_nodes, Graph const &graph) const; /** * Checks that an outcome variable in a GLM has the correct * family and link function. * * @param snode Stochastic node representing an outcome variable */ virtual bool checkOutcome(StochasticNode const *snode) const = 0; /** * Function for returning a newly allocated GLMMethod. This * is called by GLMFactory#makeSampler * * @param view Pointer to a GraphView object for all sampled nodes. * * @param sub_views Vector of pointers to SingletonGraphView * objects with length equal to the number of sampled * nodes. Each sub-view corresponds to a single sampled node. * * @param chain Number of the chain (starting from 0) to which * the sampling method will be applied. * * @param gibbs Flag indicating whether sampling method should do * Gibbs updates, in which nodes are updated individually. If false * then all nodes should be updated in a block. */ virtual GLMMethod * newMethod(GraphView const *view, std::vector const &sub_views, unsigned int chain, bool gibbs) const = 0; /** * Returns the string provided as the parameter "name" in the * constructor. */ std::string name() const; /** * Returns true if the factory can only work with outcome * variables that are observed. The default implementation * returns false. * * If a sampling method uses auxiliary variables, then * generally it cannot work with unobserved outcomes. With * auxiliary variable sampling the observed outcome is * considered to be a deterministic function of the auxiliary * variables. When an unobserved outcome variable is updated * (by a sampling method independent of this one) it may be * inconsistent with the current values of the auxiliary * variables, leaving them in an invalid state. An exception * is when the auxiliary variables can be sampled directly, * without reference to the current values. */ virtual bool fixedOutcome() const; /** * Returns true if the factory can only work on a GLM with a * fixed design matrix (i.e. one that does not change between * iterations) and false otherwise. GLMs with variable design * matrices occur in the context of missing data and * measurement error models. The default implementation * returns false. * * Note that the same restrictions as for the fixedOutome * function apply for auxiliary variables. */ virtual bool fixedDesign() const; /** * Makes random effects variance samplers. * * Samplers for the variances of random effects in a GLM may * exploit the same data augmentation used by the GLMSampler. */ void makeRESamplers(std::list const &free_nodes, GLMSampler const *s, Graph const &graph, std::vector &samplers) const; }; }} #endif /* GLM_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/GLMSampler.h0000664000175000017500000000300014224052515016140 00000000000000#ifndef GLM_SAMPLER_H_ #define GLM_SAMPLER_H_ #include #include namespace jags { class GraphView; class SingletonGraphView; struct RNG; namespace glm { class GLMMethod; /** * @short Base class for GLM samplers. */ class GLMSampler : public Sampler { GraphView const *_view; std::vector _sub_views; std::vector _methods; std::string _name; friend class REFactory2; public: /** * Constructor. * * @param view Pointer to a GraphView object for all sampled nodes. * * @param sub_views Vector of pointers to SingletonGraphView * objects with length equal to the number of sampled * nodes. Each sub-view corresponds to a single sampled node. * The GLMSampler object takes ownership of these sub-views * and deletes them when its destructor is called. * * @param methods Vector of sampling methods */ GLMSampler(GraphView *view, std::vector const &sub_views, std::vector const &methods, std::string const &name); /** * Destructor * * Deletes the sub-views and the methods passed to the constructor. */ ~GLMSampler(); void update(std::vector const &rngs); bool isAdaptive() const; void adaptOff(); bool checkAdaptation() const; std::string name() const; /* Gives access to the vector of GLMMethod objects used by the sampler. */ std::vector const &methods(); }; }} #endif /* GLM_SAMPLER_H_ */ JAGS-4.3.2/src/modules/glm/samplers/GLMMethod.h0000664000175000017500000000632614224052515015773 00000000000000#ifndef GLM_METHOD_H_ #define GLM_METHOD_H_ #include #include #include extern "C" { #include } namespace jags { struct RNG; class GraphView; class SingletonGraphView; namespace glm { class Outcome; /** * @short Abstract class for sampling generalized linear models. * * GLMMethod provides a base class for sampling methods that work * on generalized linear models (GLMs). Most of the update * machinery is provided by GLMMethod itself. * * GLMMethod uses sparse matrix algebra provided by the * CHOLMOD library. In the context of a hierarchical model, * mixed models appear identical to fixed-effect models except * that mixed models have a design matrix that is sparse. The use * of CHOLMOD, along with auxiliary variable sampling, * allows us to handle both fixed and random effects in a * consistent way without needing to distinguish between them or * relying on asymptotic approximations. */ class GLMMethod : public MutableSampleMethod { protected: GraphView const *_view; unsigned int _chain; std::vector _sub_views; std::vector _outcomes; cholmod_sparse *_x; cholmod_factor *_factor; //??? void symbolic(); void calDesign() const; private: std::vector _fixed; unsigned int _length_max; unsigned _nz_prior; friend class REMethod2; public: /** * Constructor. * * @param view Pointer to a GraphView object for all sampled nodes. * * @param sub_views Vector of pointers to SingletonGraphView * objects with length equal to the number of sampled * nodes. Each sub-view corresponds to a single sampled node. * * @param outcomes Vector of pointers to Outcome objects with length * equal to the number of stochastic children of the sampled nodes. * The GLMMethod objects takes ownership of each Outcome in the vector * and frees the memory in the destructor. * * @param chain Number of the chain (starting from 0) to which * the sampling method will be applied. */ GLMMethod(GraphView const *view, std::vector const &sub_views, std::vector const &outcomes, unsigned int chain); /** * Virtual destructor */ virtual ~GLMMethod(); /** * Calculates the coefficients of the posterior distribution * of the regression parameters. GLMMethod uses a canonical * parametrization (b, A) such that "A" is the posterior * precision of the parameters and the posterior mean "mu" * solves (A %*% mu = b). * * @param b Dense vector such that (b = A %*% mu), where "mu" * is the posterior mean and "A" is the posterior precision. * * @param A Posterior precision represented as a sparse matrix. */ void calCoef(double *&b, cholmod_sparse *&A); /** * Returns false. Sampling methods inheriting from GLMMethod * are not adaptive. */ bool isAdaptive() const; /** * Does nothing, as GLMMethod is not adaptive. */ void adaptOff(); /** * Returns true, as GLMMethod is not adaptive */ bool checkAdaptation() const; /** * Returns the name of the sampler */ std::string name() const; }; }} #endif /* GLM_METHOD_H_ */ JAGS-4.3.2/src/modules/glm/samplers/KS.h0000664000175000017500000000211314224052371014516 00000000000000#ifndef KS_H_ #define KS_H_ namespace jags { struct RNG; namespace glm { /** * Utility function used by the BinaryLogit outcome class. * * A variable "Z" with logistic distribution may be considered as * a scale mixture of normal distributions with variance lambda, * where lambda=(2*psi)^2 and "psi" has a Kolmogorov-Smirnov * distribution. Given Z, this function draws a sample from the * posterior distribution of lambda. * * Although the posterior distribution of lambda given Z cannot * be expressed in closed form, it can be efficiently sampled using * a series approximation as described by Devroye (1986) Non-Uniform * Random Variate Generation, Springer-Verlag, New York. Note that * this book is currently available for free on line at * http://luc.devroye.org/rnbookindex.html * * @param Z value of a random variable with logistic distribution * * @param rng Random number generator used for sampling */ double sample_lambda(double Z, RNG *rng); }} #endif /* KS_H_ */ JAGS-4.3.2/src/modules/glm/samplers/IWLSFactory.h0000664000175000017500000000312114224052515016307 00000000000000#ifndef IWLS_FACTORY_H_ #define IWLS_FACTORY_H_ #include "GLMFactory.h" namespace jags { namespace glm { /** * @short Factory object for iteratively weighted least squares */ class IWLSFactory : public GLMFactory { public: IWLSFactory(); /** * Checks that the outcome variable is a normal, binomial, or * Poisson variable. For normal outcomes, checks that the link * is identity. * * The IWLS method is potentially open to other distributional * families, but in the BUGS language, these are not * parameterized in terms of their mean and precision. */ bool checkOutcome(StochasticNode const *snode) const; /** * Returns a newly allocated object of class IWLS */ GLMMethod *newMethod(GraphView const *view, std::vector const &sub_views, unsigned int chain, bool gibbs) const; /** * Returns false if any parents of the candidate node are * unobserved. The IWLS method relies on an asymptotic * approximation which holds only for fixed effects models. * In order to exclude random effects, we reject candidate * nodes that have unobserved parents. */ bool canSample(StochasticNode const *snode) const; /** * Returns true. The IWLS method relies on an asymptotic * approximation that holds only for fixed effects models. In * order to exclude random effects, we require the design * matrix to be fixed. This is because it is possible to * reparameterize a random effect as a fixed effect with a * varying coefficient. */ bool fixedDesign() const; }; }} #endif /* IWLS_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/IWLS.h0000664000175000017500000000255114224052515014765 00000000000000#ifndef IWLS_H_ #define IWLS_H_ #include "GLMBlock.h" namespace jags { class LinkNode; namespace glm { /** * @short Sampling method for GLMs with Iteratively Weighted Least Squares * * A stochastic version of the Iteratively Weighted Least Squares * algorithm (IWLS) was proposed by Gammerman D (1997). Efficient * sampling from the posterior distribution in generalized linear * mixed models. Statistics and Computing 7:57-68. The algorithm * is a Metropolis-Hastings algorithm that uses IWLS to generate a * proposal. * * The IWLS method is restricted to fixed effects as it relies * on an asymptotic approximation that does not hold for random * effects models. */ class IWLS : public GLMBlock { double logPTransition(std::vector const &xorig, std::vector const &x, double *b, cholmod_sparse *A); public: IWLS(GraphView const *view, std::vector const &sub_views, std::vector const &outcomes, unsigned int chain); /** * Generates a new proposal from an approximation to the posterior * distribution derived by a single IWLS step, then carries out * a Metropolis-Hastings acceptance step. */ void update(RNG *rng); }; }} #endif /* IWLS_H_ */ JAGS-4.3.2/src/modules/glm/samplers/LGMix.h0000664000175000017500000000300514224052515015162 00000000000000#ifndef LG_MIX_H_ #define LG_MIX_H_ #include namespace jags { struct RNG; namespace glm { /** * @short Finite mixture representation of negative log-gamma distribution * * Represents a negative log gamma distribution with integer shape * n > 0 and scale 1 as a finite mixture of normals. This is used * by the AuxMixPoisson and AuxMixBinomial Outcome classes. */ class LGMix { double _n; int _r; int _ncomp; double _weights[10]; double _means[10]; double _variances[10]; void updateShapeExact(int n); void updateShapeApprox(double n); void updateShape(double n); public: LGMix(double n); /** * Updates the mixture representation * * @param z Value sampled from negative log gamma distribution * with shape parameter n. * @param n Value of n, which may be different from value used in * constructor. * @param rng Random number generator */ void update(double z, double n, RNG *rng); /** * Rturns the mean of the current normal component */ double mean() const; /** * Returns the precision of the current normal component */ double precision() const; /** * Gets the parameters of the mixture distribution. * * This is not required by the GLM machinery, bu it is useful * to expose the parameters of the mixture distribution for * testing purposes. */ void getParameters(std::vector &weights, std::vector &means, std::vector &variances); }; }} #endif /* LG_MIX_H */ JAGS-4.3.2/src/modules/glm/samplers/AuxMixPoisson.h0000664000175000017500000000345614224052515017002 00000000000000#ifndef AUX_MIX_POISSON_H_ #define AUX_MIX_POISSON_H_ #include "Outcome.h" namespace jags { namespace glm { class LGMix; /** * @short Finite normal mixture approximation for Poisson variables * * Represents a Poisson outcome with log link in terms of one or * two underlying continous auxiliary variables and then * approximates the distribution of the auxiliary variables as a * mixture of normals. * * The auxiliary variables are based on inter-arrival times of a * Poisson process. If the Poisson count is zero, only one * auxiliary variable is required. Otherwise two are used. */ class AuxMixPoisson : public Outcome { double const &_y; LGMix *_mix1, *_mix2; // the normal mixtures double _tau1, _tau2; // inter-arrival times public: /** * Constructor * * @param snode Stochastic node representing a Poisson outcome * variable of a GLM with log link. * * @param chain Index number of the chain (starting from zero). */ AuxMixPoisson(StochasticNode const *snode, unsigned int chain); ~AuxMixPoisson(); /** * Samples the auxiliary variables from their posterior * distribution given the outcome and then calculates a new * normal approximation */ void update(RNG *rng); /** * Returns a weighted mean of the residuals from the current * normal approximation. The residuals are weighted by their * precisions. This provides a single value to AMMethod, even * when there are two auxiliary variables. */ double value() const; /** * Returns the sum of the precisions of the two auxiliary variables */ double precision() const; /** * AuxMixPoisson represents Poisson outcomes with a log link */ static bool canRepresent (StochasticNode const *snode); }; }} #endif /* AUX_MIX_POISSON_H_ */ JAGS-4.3.2/src/modules/glm/samplers/AuxMixBinomial.h0000664000175000017500000000335114224052515017074 00000000000000#ifndef AUX_MIX_BINOM_H_ #define AUX_MIX_BINOM_H_ #include "Outcome.h" namespace jags { namespace glm { class LGMix; /** * @short Finite normal mixture approximation for Binomial * logistic variables * * Represents a binomial outcome with logit link in terms of an * underlying continuous auxiliary variable. The distribution of * the auxiliary variable is approximated by a finite mixture of * normals. */ class AuxMixBinomial : public Outcome { double const &_nb; // sample size of binomial distribution double const &_y; // value of binomial random variable double _y_star; // aggregated utility LGMix *_mix; // normal mixture public: /** * @param snode Stochastic node representing the true outcome * variable of a GLM * * @param chain Index number of the chain (starting from zero) * to use */ AuxMixBinomial(StochasticNode const *snode, unsigned int chain); ~AuxMixBinomial(); /** * Samples the auxiliary variable from its posterior distribution * given y and calculates a new normal mixture approximation */ void update(RNG *rng); /** * Returns the residual of the auxiliary variable according to * the current normal approximation */ double value() const; /** * Returns the precision of the auxiliary variable according to * the current normal approximation */ double precision() const; /** * AuxMixBinomial represents binary or binomial outcomes with * a logistic link */ static bool canRepresent (StochasticNode const *snode); }; }} #endif /* AUX_MIX_BINOM_H_ */ JAGS-4.3.2/src/modules/glm/samplers/Outcome.h0000664000175000017500000000534214224052515015623 00000000000000#ifndef GLM_OUTCOME_H_ #define GLM_OUTCOME_H_ namespace jags { struct RNG; class StochasticNode; namespace glm { /** * @short Outcome for a generalized linear model. * * The Outcome class provides an abstract interface to the outcome * variable of a generalized linear model. Some GLMs can be * reduced to a normal linear model by augmentation with auxiliary * (latent) variables. Other GLM methods use a local linear * approximation. The Outcome class encapsulates this by * providing member functions "value", "mean" and "precision", * corresponding to the normal approximation, as well as functions * for updating any auxiliary variables, which may be hidden * inside the Outcome object. */ class Outcome { protected: double const &_lp; unsigned int _length; double const *_vmean; public: /** * Constructor * * @param snode Stochastic node representing the true outcome * variable of a GLM * * @param chain Index number of the chain (starting from zero) * to use */ Outcome(StochasticNode const *snode, unsigned int chain); /** * Virtual destructor */ virtual ~Outcome(); /** * Returns the value of the linear predictor, which is the * mean of the normal approximation. */ virtual double mean() const; /** * Returns the precision of the normal approximation. */ virtual double precision() const = 0; /** * Returns the value of the normal approximation. */ virtual double value() const = 0; /** * FIXME */ virtual double logMHRatio() const; /** * Updates the auxiliary variables using the current value of * the linear predictor. The default implementation does * nothing. * * @param rng Random number generator */ virtual void update(RNG *rng); /** * Updates the auxiliary variables marginalizing over the * distribution of the linear predictor. The default * implementation does nothing. * * @param mean Expected value of the linear predictor. * @param var Variance of the linear predictor. * @param rng Random number generator. */ virtual void update(double mean, double var, RNG *rng); /** * Returns true if the contribution to the canonical parameter * "b" is fixed at any given iteration. The default returns false. */ virtual bool fixedb() const; /** * Returns true if the contribution to the canonical parameter * "A" is fixed at any given iteration. The default returns false. */ virtual bool fixedA() const; /** * Returns the length of the node represented by the Outcome */ unsigned int length() const; virtual double const *vmean() const; virtual double const *vprecision() const; virtual double const *vvalue() const; }; }} #endif /* GLM_OUTCOME_H_ */ JAGS-4.3.2/src/modules/glm/samplers/NormalLinear.h0000664000175000017500000000105014224052515016563 00000000000000#ifndef NORMAL_LINEAR_H_ #define NORMAL_LINEAR_H_ #include #include "Outcome.h" #include namespace jags { class StochasticNode; namespace glm { class NormalLinear : public Outcome { double const &_value; double const &_precision; public: NormalLinear(StochasticNode const *snode, unsigned int chain); double value() const; double precision() const; static bool canRepresent(StochasticNode const *snode); bool fixedb() const; bool fixedA() const; }; }} #endif /* NORMAL_LINEAR_H_ */ JAGS-4.3.2/src/modules/glm/samplers/BinaryProbit.h0000664000175000017500000000111014224052515016601 00000000000000#ifndef BINARY_PROBIT_H_ #define BINARY_PROBIT_H_ #include #include "Outcome.h" #include namespace jags { class StochasticNode; namespace glm { class BinaryProbit : public Outcome { double const &_y; double _z; public: BinaryProbit(StochasticNode const *snode, unsigned int chain); double value() const; double precision() const; void update(RNG *rng); void update(double mean, double var, RNG *rng); bool fixedA() const; static bool canRepresent(StochasticNode const *snode); }; }} #endif /* BINARY_PROBIT_H_ */ JAGS-4.3.2/src/modules/glm/samplers/BinaryLogit.h0000664000175000017500000000202214224052515016423 00000000000000#ifndef BINARY_LOGIT_H_ #define BINARY_LOGIT_H_ #include #include "Outcome.h" #include namespace jags { class StochasticNode; namespace glm { /* * @short Binary outcome with logistic link * * Outcome for binary logistic regression models, based on Holmes * C and Held L (2006). Bayesian Auxiliary Variables Models for * Binary and Multinomial Regression, Bayesian Analysis, * 1:148-168. * * The binary outcome is represented in terms of a latent logistic * distribution which, in turn, is represented as a scale mixture of * normals */ class BinaryLogit : public Outcome { double const &_y; double _z; double _tau; double _sigma2; public: BinaryLogit(StochasticNode const *snode, unsigned int chain); double value() const; double precision() const; void update(RNG *rng); void update(double mean, double var, RNG *rng); static bool canRepresent(StochasticNode const *snode); }; }} #endif /* BINARY_LOGIT_H_ */ JAGS-4.3.2/src/modules/glm/samplers/Classify.h0000664000175000017500000000172714224052515015770 00000000000000#ifndef CLASSIFY_H_ #define CLASSIFY_H_ namespace jags { class StochasticNode; namespace glm { /** * Enumerates distribution families for generalized linear models */ enum GLMFamily {GLM_NORMAL, GLM_BERNOULLI, GLM_BINOMIAL, GLM_POISSON, GLM_LOGISTIC, GLM_T, GLM_ORDLOGIT, GLM_ORDPROBIT, GLM_MNORMAL, GLM_UNKNOWN}; /** * Enumerates link functions for generalized linear models */ enum GLMLink {LNK_LINEAR, LNK_LOG, LNK_LOGIT, LNK_PROBIT, LNK_UNKNOWN}; /** * Utility function that classifies the distribution of a * stochastic node into one of the classes defined by the * enumeration GLMFamily. */ GLMFamily getFamily(StochasticNode const *snode); /** * Utility function that classifies the link function of a * stochastic node into one of the classes defined by the * enumeration GLMLink. */ GLMLink getLink(StochasticNode const *snode); }} #endif /* CLASSIFY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/IWLSOutcome.h0000664000175000017500000000216614224052515016323 00000000000000#ifndef IWLS_OUTCOME_H_ #define IWLS_OUTCOME_H_ #include "Outcome.h" #include "Classify.h" namespace jags { class LinkNode; namespace glm { /** * @short Outcome for GLMs with Iteratively Weighted Least Squares * * The IWLSOutcome method uses a local linear approximation as * used by the IWLS algorithm */ class IWLSOutcome : public Outcome { LinkNode const * _link; GLMFamily _family; double const &_y; double const &_scale; unsigned int _chain; public: IWLSOutcome(StochasticNode const *snode, unsigned int chain); /** * Returns the value of the outcome variable in a local linear * approximation to the GLM */ double value() const; /** * Returns the precision of the outcome variable in a local * linear approximation to the GLM */ double precision() const; /** * Returns the variance function */ double var() const; /** * IWLSOutcome can currently represent Poisson outcomes with log link * and Bernoulli or Binomial outcomes with probit or logit link. */ static bool canRepresent(StochasticNode const *snode); }; }} #endif /* IWLS_OUTCOME_H_ */ JAGS-4.3.2/src/modules/glm/samplers/HolmesHeld.h0000664000175000017500000000313514224052515016232 00000000000000#ifndef HOLMES_HELD_H_ #define HOLMES_HELD_H_ #include "GLMBlock.h" namespace jags { namespace glm { /** * @short Holmes-Held sampler for binary GLMs * * Sampler for probit and logistic regression models with binary * outcome data, based on Holmes C and Held L (2006). Bayesian * Auxiliary Variables Models for Binary and Multinomial * Regression, Bayesian Analysis, 1:148-168. */ class HolmesHeld : public GLMBlock { public: /** * Constructor. * * @see GLMMethod#GLMMethod */ HolmesHeld(GraphView const *view, std::vector const &sub_views, std::vector const &outcomes, unsigned int chain); /** * Updates the auxiliary variables marginalizing over the * value of the linear predictor. This function is called by * GLMBlock#update. * * In the parent GLMBlock class, the posterior precision of * the regression parameters is represented by the matrix "A" * and the posterior mean "mu" solves A %*% mu = b. * * In this call, "N" holds the factorization * P %*% A %*% t(P) = L %*% D %*% t(L) * where P is a permutation matrix chosen to make * the factorization more efficient, and "w" solves * the equation L %*% w = P %*% b, * * These values are then used to calculate the marginal mean * and variance of the latent outcome z[], which forms a * multivariate truncated normal distribution. Each element of * z[] is updated in turn by Gibbs sampling. */ void updateAuxiliary(cholmod_dense *b, cholmod_factor *N, RNG *rng); }; }} #endif /* HOLMES_HELD_H_ */ JAGS-4.3.2/src/modules/glm/samplers/HolmesHeldFactory.h0000664000175000017500000000206414224052515017562 00000000000000#ifndef HOLMES_HELD_FACTORY_H_ #define HOLMES_HELD_FACTORY_H_ #include "GLMFactory.h" namespace jags { namespace glm { /** * @short Factory object for the Holmes-Held sampling method */ class HolmesHeldFactory : public GLMFactory { public: HolmesHeldFactory(); /** * Checks that the outcome variable is a Bernoulli random * variable or a binomial variable with size fixed to 1, and * the link function is logit or probit. Linear models with * identity link are also permitted. */ bool checkOutcome(StochasticNode const *snode) const; /** * Returns a newly allocated object of class * HolmesHeld/HolmesHeldGibbs, unless we have a pure linear * model with normal outcome variables. In this case, an * object of class GLMBlock/GLMGibbs is returned. * * This function is called by GLMFactory#makeSampler */ GLMMethod * newMethod(GraphView const *view, std::vector const &sub_views, unsigned int chain, bool gibbs) const; }; }} #endif /* HOLMES_HELD_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/GLMBlock.h0000664000175000017500000000560314224052515015602 00000000000000#ifndef GLM_BLOCK_H_ #define GLM_BLOCK_H_ #include "GLMMethod.h" #include namespace jags { struct RNG; class GraphView; class SingletonGraphView; namespace glm { class Outcome; /** * @short Block sampler for generalized linear models. */ class GLMBlock : public GLMMethod { public: /** * Constructor. * * @param view Pointer to a GraphView object for all sampled nodes. * * @param sub_views Vector of pointers to SingletonGraphView * objects with length equal to the number of sampled * nodes. Each sub-view corresponds to a single sampled node. * * @param outcomes Vector of pointers to Outcome objects with length * equal to the number of stochastic children of the sampled nodes. * The GLMMethod objects takes ownership of each Outcome in the vector * and frees the memory in the destructor. * * @param chain Number of the chain (starting from 0) to which * the sampling method will be applied. */ GLMBlock(GraphView const *view, std::vector const &sub_views, std::vector const &outcomes, unsigned int chain); /** * Updates the regression parameters by treating the GLM as a * linear model (LM). All regression parameters are updated * together in a block. * * @param rng Random number generator used for sampling */ void update(RNG *rng); /** * Updates auxiliary variables. The default method does * nothing. Sampling methods that use auxiliary variables to * reduce the GLM to a linear model must provide their own * implementation. * * This function is called by updateLM. Internally, updateLM * calculates the posterior mean "mu" by solving the equation * (A %*% mu = b) where "A" is the posterior precision. The * same dense vector is used to hold "b" (before solving the * equation) and "mu" (after solving the equation). If * updateLM is called with parameter "chol" set to false then * updateAuxiliary is called before solving the equation: thus * the first argument (y) should contain the canonical * parameter (b). If updateLM is called with "chol" set to * true then updateAuxiliary is called after solving the * equation: thus the first argument (y) should contain the * posterior mean. * * IMPORTANT NOTE: GLMMethod uses a parameterization in which * the current value of the parameters is considered the * origin. The value of "y" (mu or b) may need to be adjusted * for this centring by an implementation of updateAuxiliary. * * @param y Dense vector which may be either the posterior * mean "mu" or (A %*% mu), where "A" is the posterior * precision. * * @param N Cholesky factorization of the posterior precision "A". * * @param rng Random number generator used for sampling. */ virtual void updateAuxiliary(cholmod_dense *y, cholmod_factor *N, RNG *rng); }; }} #endif /* GLM_BLOCK_H_ */ JAGS-4.3.2/src/modules/glm/samplers/GLMGibbs.h0000664000175000017500000000334314224052515015575 00000000000000#ifndef GLM_GIBBS_H_ #define GLM_GIBBS_H_ #include "GLMMethod.h" #include namespace jags { struct RNG; class GraphView; class SingletonGraphView; namespace glm { class Outcome; class GLMGibbs : public GLMMethod { public: /** * Constructor. * * @param view Pointer to a GraphView object for all sampled nodes. * * @param sub_views Vector of pointers to SingletonGraphView * objects with length equal to the number of sampled * nodes. Each sub-view corresponds to a single sampled node. * * @param outcomes Vector of pointers to Outcome objects with length * equal to the number of stochastic children of the sampled nodes. * The GLMMethod objects takes ownership of each Outcome in the vector * and frees the memory in the destructor. * * @param chain Number of the chain (starting from 0) to which * the sampling method will be applied. * * @param link Boolean flag that is passed to the utility * function checkLinear when checking to see if we have a * valid GLM. If link is true then the last deterministic * descendents in view (i.e. those with no deterministic * descendants) may be link nodes. */ GLMGibbs(GraphView const *view, std::vector const &sub_views, std::vector const &outcomes, unsigned int chain); /** * Updates the regression parameters element-wise (i.e. with * Gibbs sampling). Although Gibbs sampling less efficient * than the block-updating provided by GLMBlock, it is more * widely applicable. In particular, if the regression * parameters have a truncated normal prior, the model is * still amenable to Gibbs sampling. */ void update(RNG *rng); }; }} #endif /* GLM_GIBBS_H_ */ JAGS-4.3.2/src/modules/glm/samplers/GLMGenericFactory.h0000664000175000017500000000127214224052515017452 00000000000000#ifndef GLM_GENERIC_FACTORY_H_ #define GLM_GENERIC_FACTORY_H_ #include "GLMFactory.h" namespace jags { namespace glm { /** * @short Factory object for generic GLM */ class GLMGenericFactory : public GLMFactory { public: GLMGenericFactory(); /** * Returns true if the outcome can be represented as a mixture * of normals. */ bool checkOutcome(StochasticNode const *snode) const; /** * Returns a newly allocated object of class GLMMethod. */ GLMMethod * newMethod(GraphView const *view, std::vector const &sub_views, unsigned int chain, bool gibbs) const; }; }} #endif /* GLM_GENERIC_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/HolmesHeldGibbs.h0000664000175000017500000000157014224052515017202 00000000000000#ifndef HOLMES_HELD_GIBBS_H_ #define HOLMES_HELD_GIBBS_H_ #include "GLMMethod.h" namespace jags { namespace glm { /** * @short Holmes Held sampler for binary GLMs * * Sampler for probit and logistic regression models with binary * outcome data, based on Holmes C and Held L (2006). Bayesian * Auxiliary Variables Models for Binary and Multinomial * Regression, Bayesian Analysis, 1:148-168. */ class HolmesHeldGibbs : public GLMMethod { public: /** * Constructor. * * @see GLMMethod#GLMMethod */ HolmesHeldGibbs(GraphView const *view, std::vector const &sv, std::vector const &outcomes, unsigned int chain); /** * Updates the regression parameters element-wise (i.e. with * Gibbs sampling). */ void update(RNG *rng); }; }} #endif /* HOLMES_HELD_GIBBS_H_ */ JAGS-4.3.2/src/modules/glm/samplers/PolyaGamma.h0000664000175000017500000000127214224052515016235 00000000000000#ifndef POLYA_GAMMA_H_ #define POLYA_GAMMA_H_ #include #include "Outcome.h" #include namespace jags { class StochasticNode; namespace glm { /* * @short Binary outcome with logistic link * * Outcome for binary logistic regression models, based on * FIXME * */ class PolyaGamma : public Outcome { double const &_y; double const &_n; double _tau; public: PolyaGamma(StochasticNode const *snode, unsigned int chain); double value() const; double precision() const; void update(RNG *rng); static bool canRepresent(StochasticNode const *snode); }; } } #endif /* POLYA_GAMMA_H_ */ JAGS-4.3.2/src/modules/glm/samplers/PG.h0000664000175000017500000000071114224052515014511 00000000000000#ifndef PG_H_ #define PG_H_ namespace jags { struct RNG; namespace glm { /** * Sample from a inverse Gaussian distribution truncated to (0,t) * * @param mu Mean of the inverse Gaussian distribution * @param lambda Shape parameter for the inverse Gaussian distribution * @param t Truncation point * @param rng Random number generator */ double rigauss(double mu, double lambda, double t, RNG *rng); } } #endif /* PG_H_ */ JAGS-4.3.2/src/modules/glm/samplers/ScaledWishart.h0000664000175000017500000000114714224052515016744 00000000000000#ifndef SCALED_WISHART_H_ #define SCALED_WISHART_H_ #include #include namespace jags { class Graph; class SingletonGraphView; class StochasticNode; struct RNG; namespace glm { class ScaledWishart : public SampleMethodNoAdapt { SingletonGraphView const *_gv; unsigned int _chain; std::vector _a; public: ScaledWishart(SingletonGraphView const *gv, unsigned int chain); void update(RNG *rng); static bool canSample(StochasticNode *snode, Graph const &graph); }; } } #endif /* SCALED_WISHART_H_ */ JAGS-4.3.2/src/modules/glm/samplers/ScaledWishartFactory.h0000664000175000017500000000106014224052515020266 00000000000000#ifndef SCALED_WISHART_FACTORY_H_ #define SCALED_WISHART_FACTORY_H_ #include namespace jags { namespace glm { /** * @short Factory for scaled precision parameters * * @see ScaledWishart */ class ScaledWishartFactory : public SingletonFactory { public: ~ScaledWishartFactory(); bool canSample(StochasticNode *snode, Graph const &graph) const; Sampler *makeSampler(StochasticNode *snode, Graph const &g) const; std::string name() const; }; } } #endif /* SCALED_WISHART_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/SampleWishart.h0000664000175000017500000000044614224052515016773 00000000000000#ifndef SAMPLE_WISHART_H_ #define SAMPLE_WISHART_H_ namespace jags { struct RNG; namespace glm { /** @short Sample from Wishart distribution */ void sampleWishart(double *X, int length, double const *R, double df, int nrow, RNG *rng); } } #endif /* SAMPLE_WISHART_H_ */ JAGS-4.3.2/src/modules/glm/samplers/ScaledGamma.h0000664000175000017500000000123414224052515016342 00000000000000#ifndef SCALED_GAMMA_H_ #define SCALED_GAMMA_H_ #include #include namespace jags { class Graph; class SingletonGraphView; class StochasticNode; struct RNG; namespace glm { class ScaledGamma : public SampleMethodNoAdapt { SingletonGraphView const *_gv; unsigned int _chain; std::vector _coef; double _a; bool _fast; void calCoef(); public: ScaledGamma(SingletonGraphView const *gv, unsigned int chain); static bool canSample(StochasticNode *snode, Graph const &graph); void update(RNG *rng); }; } } #endif /* SCALED_GAMMA_H_ */ JAGS-4.3.2/src/modules/glm/samplers/ScaledGammaFactory.h0000664000175000017500000000104414224052515017671 00000000000000#ifndef SCALED_GAMMA_FACTORY_H_ #define SCALED_GAMMA_FACTORY_H_ #include namespace jags { namespace glm { /** * @short Factory for scaled precision parameters * * @see ScaledGamma */ class ScaledGammaFactory : public SingletonFactory { public: ~ScaledGammaFactory(); bool canSample(StochasticNode *snode, Graph const &graph) const; Sampler *makeSampler(StochasticNode *snode, Graph const &g) const; std::string name() const; }; } } #endif /* SCALED_GAMMA_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/LogisticLinear.h0000664000175000017500000000115614224052515017117 00000000000000#ifndef LOGISTIC_LINEAR_H_ #define LOGISTIC_LINEAR_H_ #include #include "Outcome.h" #include namespace jags { class StochasticNode; namespace glm { class LogisticLinear : public Outcome { double const &_value; double const &_mean; double const &_precision; double _lambda; public: LogisticLinear(StochasticNode const *snode, unsigned int chain); double value() const; double precision() const; void update(RNG *rng); static bool canRepresent(StochasticNode const *snode); }; } } #endif /* LOGISTIC_LINEAR_H_ */ JAGS-4.3.2/src/modules/glm/samplers/TLinear.h0000664000175000017500000000114314224052515015541 00000000000000#ifndef T_LINEAR_H_ #define T_LINEAR_H_ #include #include "Outcome.h" #include namespace jags { class StochasticNode; namespace glm { class TLinear : public Outcome { double const &_value; double const &_mean; double const &_precision; double const &_df; double _lambda; public: TLinear(StochasticNode const *snode, unsigned int chain); double value() const; double precision() const; void update(RNG *rng); static bool canRepresent(StochasticNode const *snode); }; } } #endif /* T_LINEAR_H_ */ JAGS-4.3.2/src/modules/glm/samplers/OrderedLogit.h0000664000175000017500000000213314224052515016566 00000000000000#ifndef ORDERED_LOGIT_H_ #define ORDERED_LOGIT_H_ #include #include "Outcome.h" #include namespace jags { class StochasticNode; namespace glm { /* * @short Ordered categorical outcome with logistic link * * Outcome for ordered logistic regression models, based on Holmes * C and Held L (2006). Bayesian Auxiliary Variables Models for * Binary and Multinomial Regression, Bayesian Analysis, * 1:148-168. * * The categorical outcome is represented in terms of a latent logistic * distribution which, in turn, is represented as a scale mixture of * normals */ class OrderedLogit : public Outcome { double const &_y; double const *_cuts; const unsigned int _ncut; double _z; double _tau; double _sigma2; public: OrderedLogit(StochasticNode const *snode, unsigned int chain); double value() const; double precision() const; void update(RNG *rng); void update(double mean, double var, RNG *rng); static bool canRepresent(StochasticNode const *snode); }; }} #endif /* ORDERED_LOGIT_H_ */ JAGS-4.3.2/src/modules/glm/samplers/OrderedProbit.h0000664000175000017500000000176414224052515016760 00000000000000#ifndef ORDERED_PROBIT_H_ #define ORDERED_PROBIT_H_ #include #include "Outcome.h" #include namespace jags { class StochasticNode; namespace glm { /* * @short Ordered categorical outcome with probit link * * Outcome for ordered logistic regression models, based on Holmes * C and Held L (2006). Bayesian Auxiliary Variables Models for * Binary and Multinomial Regression, Bayesian Analysis, * 1:148-168. * * The categorical outcome is represented in terms of a latent normal * normals */ class OrderedProbit : public Outcome { double const &_y; double const *_cuts; const unsigned int _ncut; double _z; public: OrderedProbit(StochasticNode const *snode, unsigned int chain); double value() const; double precision() const; void update(RNG *rng); void update(double mean, double var, RNG *rng); static bool canRepresent(StochasticNode const *snode); }; }} #endif /* ORDERED_PROBIT_H_ */ JAGS-4.3.2/src/modules/glm/samplers/RESampler.h0000664000175000017500000000410514224052515016036 00000000000000#ifndef RE_SAMPLER_H_ #define RE_SAMPLER_H_ #include namespace jags { struct RNG; class SingletonGraphView; namespace glm { class REMethod; /** * @short Multi-level sampler for random effects and their precision * * A vector of REMethod objects is used to update each chain * in parallel. */ class RESampler : public Sampler { SingletonGraphView *_tau; GraphView *_eps; std::vector _sub_eps; std::vector _methods; const std::string _name; public: /** * Constructor. * * @param view Multilevel view of the sample graph, passed * directly to the parent class Sampler, which takes * ownership of it * * @param tau view of the precision parameter and its * descendants. The RESampler takes ownership and deletes when * its destructor is called. * * @param eps view of the random effects and their descendants. * The RESampler takes ownership. * * @param sub_eps vector of singleton views: one for each * random effect. The RESampler takes ownership. * * @param methods Vector of pointers to REMethod * objects, of length equal to the number of chains. These * must be dynamically allocated, as the * RESampler will take ownership of them, and * will delete them when its destructor is called * * @param name The name of the sampler, which will be returned * by the member function name. */ RESampler(GraphView *view, SingletonGraphView *tau, GraphView *eps, std::vector sub_eps, std::vector const &methods, std::string const &name); ~RESampler(); void update(std::vector const &rngs); bool isAdaptive() const; void adaptOff(); bool checkAdaptation() const; /** * Returns the name of the sampler, as given to the constructor */ std::string name() const; }; } // namespace glm } // namespace jags #endif /* RE_SAMPLER_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REMethod.h0000664000175000017500000000624414224052515015661 00000000000000#ifndef RE_METHOD_H_ #define RE_METHOD_H_ #include "GLMMethod.h" #include namespace jags { struct RNG; class GraphView; class SingletonGraphView; namespace glm { class Outcome; /** * @short Sample method for random effects and their variance. */ class REMethod : public GLMMethod { protected: SingletonGraphView const *_tau; GraphView const *_eps; cholmod_dense *_z; public: /** * Constructor. * * @param view Pointer to a GraphView object for all sampled nodes. * * @param sub_views Vector of pointers to SingletonGraphView * objects with length equal to the number of sampled * nodes. Each sub-view corresponds to a single sampled node. * * @param outcomes Vector of pointers to Outcome objects with length * equal to the number of stochastic children of the sampled nodes. * The GLMMethod objects takes ownership of each Outcome in the vector * and frees the memory in the destructor. * * @param chain Number of the chain (starting from 0) to which * the sampling method will be applied. * * @param link Boolean flag that is passed to the utility * function checkLinear when checking to see if we have a * valid GLM. If link is true then the last deterministic * descendents in view (i.e. those with no deterministic * descendants) may be link nodes. */ REMethod(SingletonGraphView const *tau, GraphView const *eps, std::vector const &sub_eps, std::vector const &outcomes, unsigned int chain); ~REMethod(); /** * Updates the random effects * * @param rng Random number generator used for sampling */ void updateEps(RNG *rng); virtual void updateSigma(RNG *rng) = 0; virtual void updateTau(RNG *rng) = 0; void update(RNG *rng); void calDesignSigma(); /** * The likelihood for the standard deviation parameters sigma * may be expressed in canonical form as *
	 * - t(delta) %*% A %*% delta/2 + t(delta) %*% b
	 * 
* where *
	 * delta = sigma - sigma0
	 * 
* and sigma0 is the current value. * * This function adds the likelihood contributions to A and b. * * @param A pointer to an m x m matrix. On entry, A be non-zero * (representing contributions from the prior): the contributions * from the likelihood are added. * * @param b pointer to an m-vector. On entry, b may be non-zero: * the contributions from the likelihood are added. * * @param sigma0 current value of the standard deviation parameters. * The log likelihood is standardized so that the value at sigma0 * is zero. * * @param m length of sigma vector * */ void calCoefSigma(double *A, double *b, double const *sigma0, unsigned int m) const; /** * Calculates the likelihood for sigma, the vector of standard * deviation parameters for the random effects * * @param sigma proposed value of the standard deviation parameters * * @param sigma0 current value of the standard deviation parameters * * @param m length of sigma vector * * @see calCoefSigma */ double logLikelihoodSigma(double const *sigma, double const *sigma0, unsigned int m) const; }; }} #endif /* RE_METHOD_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REFactory.h0000664000175000017500000000230314224052515016040 00000000000000#ifndef RE_FACTORY_H_ #define RE_FACTORY_H_ #include namespace jags { class SingletonGraphView; class GraphView; namespace glm { class REMethod; class Outcome; /** * @short Factory for scaled precision parameters * * @see ScaledGamma */ class REFactory : public SamplerFactory { std::string _name; public: bool checkOutcome(StochasticNode const *snode) const; bool checkTau(SingletonGraphView const *tau) const; bool checkEps(GraphView const *eps) const; //public: REFactory(std::string const &name); ~REFactory(); std::vector makeSamplers(std::list const &nodes, Graph const &graph) const; Sampler *makeSampler(std::list const &free_nodes, Graph const &graph) const; std::string name() const; virtual bool canSample(StochasticNode *snode) const = 0; virtual REMethod * newMethod(SingletonGraphView const *tau, GraphView const *eps, std::vector const & veps, std::vector const &outcomes, unsigned int chain) const = 0; }; } } #endif /* RE_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REGamma.h0000664000175000017500000000122614224052515015456 00000000000000#ifndef RE_GAMMA_H_ #define RE_GAMMA_H_ #include "REMethod.h" #include "REGammaSlicer.h" namespace jags { namespace glm { /** * @short Random effects sampler for gamma precision */ class REGamma : public REMethod { REGammaSlicer _slicer; public: REGamma(SingletonGraphView const *tau, GraphView const *eps, std::vector const &veps, std::vector const &outcomes, unsigned int chain); void updateTau(RNG *rng); void updateSigma(RNG *rng); bool isAdaptive() const; void adaptOff(); bool checkAdaptation() const; }; } } #endif /* RE_GAMMA_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REGammaSlicer.h0000664000175000017500000000122614224052515016620 00000000000000#ifndef RE_GAMMA_SLICER_H_ #define RE_GAMMA_SLICER_H_ #include namespace jags { namespace glm { class REGamma; class REGammaSlicer : public Slicer { REGamma const *_regamma; double const *_shape; double const *_rate; double _sigma, _sigma0; public: REGammaSlicer(REGamma const *regamma, double const *shape, double const *rate, double sigma); double value() const; void setValue(double x); void getLimits(double *lower, double *upper) const; double logDensity() const; void setSigma(double x); void update(RNG *rng); }; } } #endif /* RE_GAMMA_SLICER_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REGammaFactory.h0000664000175000017500000000116414224052515017007 00000000000000#ifndef RE_GAMMA_FACTORY_H_ #define RE_GAMMA_FACTORY_H_ #include "REFactory.h" namespace jags { namespace glm { /** * @short Factory for random effects with gamma precision * * @see REGamma */ class REGammaFactory : public REFactory { public: REGammaFactory(); ~REGammaFactory(); bool canSample(StochasticNode *snode) const; REMethod * newMethod(SingletonGraphView const *tau, GraphView const *eps, std::vector const & veps, std::vector const &outcomes, unsigned int chain) const; }; } } #endif /* RE_GAMMA_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REScaledGamma.h0000664000175000017500000000110014224052515016561 00000000000000#ifndef RE_SCALED_GAMMA_H_ #define RE_SCALED_GAMMA_H_ #include "REMethod.h" namespace jags { namespace glm { /** * @short Random effects sampler for scaled gamma precision */ class REScaledGamma : public REMethod { double _sigma; public: REScaledGamma(SingletonGraphView const *tau, GraphView const *eps, std::vector const &veps, std::vector const &outcomes, unsigned int chain); void updateTau(RNG *rng); void updateSigma(RNG *rng); }; } } #endif /* RE_SCALED_GAMMA_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REScaledGammaFactory.h0000664000175000017500000000125014224052515020117 00000000000000#ifndef RE_SCALED_GAMMA_FACTORY_H_ #define RE_SCALED_GAMMA_FACTORY_H_ #include "REFactory.h" namespace jags { namespace glm { /** * @short Factory for random effects with scaled gamma precision * * @see REScaledGamma */ class REScaledGammaFactory : public REFactory { public: REScaledGammaFactory(); ~REScaledGammaFactory(); bool canSample(StochasticNode *snode) const; REMethod * newMethod(SingletonGraphView const *tau, GraphView const *eps, std::vector const & veps, std::vector const &outcomes, unsigned int chain) const; }; } } #endif /* RE_SCALED_GAMMA_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REScaledWishart.h0000664000175000017500000000114114224052515017165 00000000000000#ifndef RE_SCALED_WISHART_H_ #define RE_SCALED_WISHART_H_ #include "REMethod.h" namespace jags { namespace glm { /** * @short Random effects sampler for scaled Wishart precision */ class REScaledWishart : public REMethod { std::vector _sigma; public: REScaledWishart(SingletonGraphView const *tau, GraphView const *eps, std::vector const &veps, std::vector const &outcomes, unsigned int chain); void updateTau(RNG *rng); void updateSigma(RNG *rng); }; } } #endif /* RE_SCALED_WISHART_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REScaledWishartFactory.h0000664000175000017500000000127014224052515020520 00000000000000#ifndef RE_SCALED_WISHART_FACTORY_H_ #define RE_SCALED_WISHART_FACTORY_H_ #include "REFactory.h" namespace jags { namespace glm { /** * @short Factory for random effects with scaled wishart precision * * @see REScaledWishart */ class REScaledWishartFactory : public REFactory { public: REScaledWishartFactory(); ~REScaledWishartFactory(); bool canSample(StochasticNode *snode) const; REMethod * newMethod(SingletonGraphView const *tau, GraphView const *eps, std::vector const & veps, std::vector const &outcomes, unsigned int chain) const; }; } } #endif /* RE_SCALED_WISHART_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/MNormalLinear.h0000664000175000017500000000117214224052515016705 00000000000000#ifndef M_NORMAL_LINEAR_H_ #define M_NORMAL_LINEAR_H_ #include #include "Outcome.h" #include namespace jags { class StochasticNode; namespace glm { class MNormalLinear : public Outcome { double const *_value; double const *_mean; double const *_precision; public: MNormalLinear(StochasticNode const *snode, unsigned int chain); double value() const; double precision() const; double const *vvalue() const; double const *vmean() const; double const *vprecision() const; static bool canRepresent(StochasticNode const *snode); }; }} #endif /* M_NORMAL_LINEAR_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REMethod2.h0000664000175000017500000000522314224052515015737 00000000000000#ifndef RE_METHOD2_H_ #define RE_METHOD2_H_ #include extern "C" { #include } #include namespace jags { struct RNG; class GraphView; class SingletonGraphView; namespace glm { class GLMMethod; class Outcome; /** * @short Sample method for random effects and their variance. */ class REMethod2 : public MutableSampleMethod { protected: SingletonGraphView const *_tau; GraphView const *_eps; std::vector const &_outcomes; cholmod_sparse const *_x; const unsigned int _chain; cholmod_dense *_z; std::vector _indices; public: /** * Constructor. * * @param tau Pointer to a SingletonGraphView object with the * precision parameter of the random effects as the sampled node. * * @param glmmethod Pointer to a GLMMethod object that updates the * random effects (and other nodes that constitute a linear * predictor for a GLM). */ REMethod2(SingletonGraphView const *tau, GLMMethod const *glmmethod); ~REMethod2(); /** * Updates the random effects * * @param rng Random number generator used for sampling */ virtual void updateSigma(RNG *rng) = 0; virtual void updateTau(RNG *rng) = 0; void update(RNG *rng); void calDesignSigma(); /** * The likelihood for the standard deviation parameters sigma * may be expressed in canonical form as *
	 * - t(delta) %*% A %*% delta/2 + t(delta) %*% b
	 * 
* where *
	 * delta = sigma - sigma0
	 * 
* and sigma0 is the current value. * * This function adds the likelihood contributions to A and b. * * @param A pointer to an m x m matrix. On entry, A be non-zero * (representing contributions from the prior): the contributions * from the likelihood are added. * * @param b pointer to an m-vector. On entry, b may be non-zero: * the contributions from the likelihood are added. * * @param sigma0 current value of the standard deviation parameters. * The log likelihood is standardized so that the value at sigma0 * is zero. * * @param m length of sigma vector * */ void calCoefSigma(double *A, double *b, double const *sigma0, unsigned int m) const; /** * Calculates the likelihood for sigma, the vector of standard * deviation parameters for the random effects * * @param sigma proposed value of the standard deviation parameters * * @param sigma0 current value of the standard deviation parameters * * @param m length of sigma vector * * @see calCoefSigma */ double logLikelihoodSigma(double const *sigma, double const *sigma0, unsigned int m) const; }; }} #endif /* RE_METHOD2_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REFactory2.h0000664000175000017500000000163014224052371016124 00000000000000#ifndef RE_FACTORY2_H_ #define RE_FACTORY2_H_ #include #include #include #include namespace jags { class SingletonGraphView; class GraphView; class Graph; namespace glm { class REMethod2; class GLMSampler; class GLMMethod; class REFactory2 { const std::string _name; public: bool checkTau(SingletonGraphView const *tau, GraphView const *glmview) const; REFactory2(std::string const &name); virtual ~REFactory2(); Sampler *makeSampler(std::list const &free_nodes, std::set &used_nodes, GLMSampler const *glmsampler, Graph const &graph) const; virtual bool canSample(StochasticNode *snode) const = 0; virtual REMethod2 * newMethod(SingletonGraphView const *tau, GLMMethod const *randef) const = 0; }; } } #endif /* RE_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REGammaSlicer2.h0000664000175000017500000000124014224052515016676 00000000000000#ifndef RE_GAMMA_SLICER2_H_ #define RE_GAMMA_SLICER2_H_ #include namespace jags { namespace glm { class REGamma2; class REGammaSlicer2 : public Slicer { REGamma2 const *_regamma; double const *_shape; double const *_rate; double _sigma, _sigma0; public: REGammaSlicer2(REGamma2 const *regamma, double const *shape, double const *rate, double sigma); double value() const; void setValue(double x); void getLimits(double *lower, double *upper) const; double logDensity() const; void setSigma(double x); void update(RNG *rng); }; } } #endif /* RE_GAMMA_SLICER2_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REGamma2.h0000664000175000017500000000104214224052515015534 00000000000000#ifndef RE_GAMMA2_H_ #define RE_GAMMA2_H_ #include "REMethod2.h" #include "REGammaSlicer2.h" namespace jags { namespace glm { /** * @short Random effects sampler for gamma precision */ class REGamma2 : public REMethod2 { REGammaSlicer2 _slicer; public: REGamma2(SingletonGraphView const *tau, GLMMethod const *glmmethod); void updateTau(RNG *rng); void updateSigma(RNG *rng); bool isAdaptive() const; void adaptOff(); bool checkAdaptation() const; }; } } #endif /* RE_GAMMA2_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REGammaFactory2.h0000664000175000017500000000100114224052515017057 00000000000000#ifndef RE_GAMMA_FACTORY2_H_ #define RE_GAMMA_FACTORY2_H_ #include "REFactory2.h" namespace jags { namespace glm { /** * @short Factory for random effects with gamma precision * * @see REGamma2 */ class REGammaFactory2 : public REFactory2 { public: REGammaFactory2(); ~REGammaFactory2(); bool canSample(StochasticNode *snode) const; REMethod2 * newMethod(SingletonGraphView const *tau, GLMMethod const *randef) const; }; } } #endif /* RE_GAMMA_FACTORY_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REScaledGamma2.h0000664000175000017500000000104414224052515016652 00000000000000#ifndef RE_SCALED_GAMMA2_H_ #define RE_SCALED_GAMMA2_H_ #include "REMethod2.h" namespace jags { namespace glm { /** * @short Random effects sampler for scaled gamma precision */ class REScaledGamma2 : public REMethod2 { double _sigma; public: REScaledGamma2(SingletonGraphView const *tau, GLMMethod const *glmmethod); void updateTau(RNG *rng); void updateSigma(RNG *rng); bool isAdaptive() const; void adaptOff(); bool checkAdaptation() const; }; } } #endif /* RE_SCALED_GAMMA2_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REScaledGammaFactory2.h0000664000175000017500000000106614224052515020206 00000000000000#ifndef RE_SCALED_GAMMA_FACTORY2_H_ #define RE_SCALED_GAMMA_FACTORY2_H_ #include "REFactory2.h" namespace jags { namespace glm { /** * @short Factory for random effects with scaled gamma precision * * @see REScaledGamma2 */ class REScaledGammaFactory2 : public REFactory2 { public: REScaledGammaFactory2(); ~REScaledGammaFactory2(); bool canSample(StochasticNode *snode) const; REMethod2 * newMethod(SingletonGraphView const *tau, GLMMethod const *randef) const; }; } } #endif /* RE_SCALED_GAMMA_FACTORY2_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REScaledWishart2.h0000664000175000017500000000107714224052515017257 00000000000000#ifndef RE_SCALED_WISHART2_H_ #define RE_SCALED_WISHART2_H_ #include "REMethod2.h" namespace jags { namespace glm { /** * @short Random effects sampler for scaled Wishart precision */ class REScaledWishart2 : public REMethod2 { std::vector _sigma; public: REScaledWishart2(SingletonGraphView const *tau, GLMMethod const *glmmethod); void updateTau(RNG *rng); void updateSigma(RNG *rng); bool isAdaptive() const; void adaptOff(); bool checkAdaptation() const; }; } } #endif /* RE_SCALED_WISHART2_H_ */ JAGS-4.3.2/src/modules/glm/samplers/REScaledWishartFactory2.h0000664000175000017500000000111114224052515020574 00000000000000#ifndef RE_SCALED_WISHART_FACTORY2_H_ #define RE_SCALED_WISHART_FACTORY2_H_ #include "REFactory2.h" namespace jags { namespace glm { /** * @short Factory for random effects with scaled wishart precision * * @see REScaledWishart2 */ class REScaledWishartFactory2 : public REFactory2 { public: REScaledWishartFactory2(); ~REScaledWishartFactory2(); bool canSample(StochasticNode *snode) const; REMethod2 * newMethod(SingletonGraphView const *tau, GLMMethod const *glmmethod) const; }; } } #endif /* RE_SCALED_WISHART_FACTORY2_H_ */ JAGS-4.3.2/src/modules/glm/samplers/Makefile.in0000644000175000017500000031043114400675236016107 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/samplers ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libglmsampler_la_LIBADD = am_libglmsampler_la_OBJECTS = libglmsampler_la-GLMFactory.lo \ libglmsampler_la-GLMSampler.lo libglmsampler_la-GLMMethod.lo \ libglmsampler_la-KS.lo libglmsampler_la-IWLSFactory.lo \ libglmsampler_la-IWLS.lo libglmsampler_la-LGMix.lo \ libglmsampler_la-AuxMixPoisson.lo \ libglmsampler_la-AuxMixBinomial.lo libglmsampler_la-Outcome.lo \ libglmsampler_la-NormalLinear.lo \ libglmsampler_la-BinaryProbit.lo \ libglmsampler_la-BinaryLogit.lo libglmsampler_la-Classify.lo \ libglmsampler_la-IWLSOutcome.lo libglmsampler_la-HolmesHeld.lo \ libglmsampler_la-HolmesHeldFactory.lo \ libglmsampler_la-GLMBlock.lo libglmsampler_la-GLMGibbs.lo \ libglmsampler_la-GLMGenericFactory.lo \ libglmsampler_la-HolmesHeldGibbs.lo \ libglmsampler_la-PolyaGamma.lo libglmsampler_la-PGcommon.lo \ libglmsampler_la-ScaledWishart.lo \ libglmsampler_la-ScaledWishartFactory.lo \ libglmsampler_la-SampleWishart.lo \ libglmsampler_la-ScaledGamma.lo \ libglmsampler_la-ScaledGammaFactory.lo \ libglmsampler_la-LogisticLinear.lo libglmsampler_la-TLinear.lo \ libglmsampler_la-OrderedLogit.lo \ libglmsampler_la-OrderedProbit.lo \ libglmsampler_la-RESampler.lo libglmsampler_la-REMethod.lo \ libglmsampler_la-REFactory.lo libglmsampler_la-REGamma.lo \ libglmsampler_la-REGammaSlicer.lo \ libglmsampler_la-REGammaFactory.lo \ libglmsampler_la-REScaledGamma.lo \ libglmsampler_la-REScaledGammaFactory.lo \ libglmsampler_la-REScaledWishart.lo \ libglmsampler_la-REScaledWishartFactory.lo \ libglmsampler_la-MNormalLinear.lo \ libglmsampler_la-REMethod2.lo libglmsampler_la-REFactory2.lo \ libglmsampler_la-REGammaSlicer2.lo \ libglmsampler_la-REGamma2.lo \ libglmsampler_la-REGammaFactory2.lo \ libglmsampler_la-REScaledGamma2.lo \ libglmsampler_la-REScaledGammaFactory2.lo \ libglmsampler_la-REScaledWishart2.lo \ libglmsampler_la-REScaledWishartFactory2.lo libglmsampler_la_OBJECTS = $(am_libglmsampler_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libglmsamptest_la_LIBADD = am__libglmsamptest_la_SOURCES_DIST = testglmsamp.cc testglmsamp.h @CANCHECK_TRUE@am_libglmsamptest_la_OBJECTS = \ @CANCHECK_TRUE@ libglmsamptest_la-testglmsamp.lo libglmsamptest_la_OBJECTS = $(am_libglmsamptest_la_OBJECTS) libglmsamptest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libglmsamptest_la_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libglmsamptest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libglmsampler_la-AuxMixBinomial.Plo \ ./$(DEPDIR)/libglmsampler_la-AuxMixPoisson.Plo \ ./$(DEPDIR)/libglmsampler_la-BinaryLogit.Plo \ ./$(DEPDIR)/libglmsampler_la-BinaryProbit.Plo \ ./$(DEPDIR)/libglmsampler_la-Classify.Plo \ ./$(DEPDIR)/libglmsampler_la-GLMBlock.Plo \ ./$(DEPDIR)/libglmsampler_la-GLMFactory.Plo \ ./$(DEPDIR)/libglmsampler_la-GLMGenericFactory.Plo \ ./$(DEPDIR)/libglmsampler_la-GLMGibbs.Plo \ ./$(DEPDIR)/libglmsampler_la-GLMMethod.Plo \ ./$(DEPDIR)/libglmsampler_la-GLMSampler.Plo \ ./$(DEPDIR)/libglmsampler_la-HolmesHeld.Plo \ ./$(DEPDIR)/libglmsampler_la-HolmesHeldFactory.Plo \ ./$(DEPDIR)/libglmsampler_la-HolmesHeldGibbs.Plo \ ./$(DEPDIR)/libglmsampler_la-IWLS.Plo \ ./$(DEPDIR)/libglmsampler_la-IWLSFactory.Plo \ ./$(DEPDIR)/libglmsampler_la-IWLSOutcome.Plo \ ./$(DEPDIR)/libglmsampler_la-KS.Plo \ ./$(DEPDIR)/libglmsampler_la-LGMix.Plo \ ./$(DEPDIR)/libglmsampler_la-LogisticLinear.Plo \ ./$(DEPDIR)/libglmsampler_la-MNormalLinear.Plo \ ./$(DEPDIR)/libglmsampler_la-NormalLinear.Plo \ ./$(DEPDIR)/libglmsampler_la-OrderedLogit.Plo \ ./$(DEPDIR)/libglmsampler_la-OrderedProbit.Plo \ ./$(DEPDIR)/libglmsampler_la-Outcome.Plo \ ./$(DEPDIR)/libglmsampler_la-PGcommon.Plo \ ./$(DEPDIR)/libglmsampler_la-PolyaGamma.Plo \ ./$(DEPDIR)/libglmsampler_la-REFactory.Plo \ ./$(DEPDIR)/libglmsampler_la-REFactory2.Plo \ ./$(DEPDIR)/libglmsampler_la-REGamma.Plo \ ./$(DEPDIR)/libglmsampler_la-REGamma2.Plo \ ./$(DEPDIR)/libglmsampler_la-REGammaFactory.Plo \ ./$(DEPDIR)/libglmsampler_la-REGammaFactory2.Plo \ ./$(DEPDIR)/libglmsampler_la-REGammaSlicer.Plo \ ./$(DEPDIR)/libglmsampler_la-REGammaSlicer2.Plo \ ./$(DEPDIR)/libglmsampler_la-REMethod.Plo \ ./$(DEPDIR)/libglmsampler_la-REMethod2.Plo \ ./$(DEPDIR)/libglmsampler_la-RESampler.Plo \ ./$(DEPDIR)/libglmsampler_la-REScaledGamma.Plo \ ./$(DEPDIR)/libglmsampler_la-REScaledGamma2.Plo \ ./$(DEPDIR)/libglmsampler_la-REScaledGammaFactory.Plo \ ./$(DEPDIR)/libglmsampler_la-REScaledGammaFactory2.Plo \ ./$(DEPDIR)/libglmsampler_la-REScaledWishart.Plo \ ./$(DEPDIR)/libglmsampler_la-REScaledWishart2.Plo \ ./$(DEPDIR)/libglmsampler_la-REScaledWishartFactory.Plo \ ./$(DEPDIR)/libglmsampler_la-REScaledWishartFactory2.Plo \ ./$(DEPDIR)/libglmsampler_la-SampleWishart.Plo \ ./$(DEPDIR)/libglmsampler_la-ScaledGamma.Plo \ ./$(DEPDIR)/libglmsampler_la-ScaledGammaFactory.Plo \ ./$(DEPDIR)/libglmsampler_la-ScaledWishart.Plo \ ./$(DEPDIR)/libglmsampler_la-ScaledWishartFactory.Plo \ ./$(DEPDIR)/libglmsampler_la-TLinear.Plo \ ./$(DEPDIR)/libglmsamptest_la-testglmsamp.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libglmsampler_la_SOURCES) $(libglmsamptest_la_SOURCES) DIST_SOURCES = $(libglmsampler_la_SOURCES) \ $(am__libglmsamptest_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libglmsampler.la libglmsampler_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/glm/CSparse \ -I$(top_srcdir)/src/modules/glm/SSparse/config \ -I$(top_srcdir)/src/modules/glm/SSparse/CHOLMOD/Include libglmsampler_la_SOURCES = GLMFactory.cc GLMSampler.cc GLMMethod.cc \ KS.cc \ IWLSFactory.cc \ IWLS.cc LGMix.cc AuxMixPoisson.cc AuxMixBinomial.cc Outcome.cc \ NormalLinear.cc BinaryProbit.cc BinaryLogit.cc Classify.cc \ IWLSOutcome.cc HolmesHeld.cc HolmesHeldFactory.cc GLMBlock.cc \ GLMGibbs.cc GLMGenericFactory.cc HolmesHeldGibbs.cc PolyaGamma.cc PGcommon.cc \ ScaledWishart.cc ScaledWishartFactory.cc SampleWishart.cc \ ScaledGamma.cc ScaledGammaFactory.cc \ LogisticLinear.cc TLinear.cc OrderedLogit.cc OrderedProbit.cc \ RESampler.cc REMethod.cc REFactory.cc \ REGamma.cc REGammaSlicer.cc REGammaFactory.cc \ REScaledGamma.cc REScaledGammaFactory.cc \ REScaledWishart.cc REScaledWishartFactory.cc \ MNormalLinear.cc \ REMethod2.cc REFactory2.cc \ REGammaSlicer2.cc REGamma2.cc REGammaFactory2.cc \ REScaledGamma2.cc REScaledGammaFactory2.cc \ REScaledWishart2.cc REScaledWishartFactory2.cc noinst_HEADERS = GLMFactory.h GLMSampler.h GLMMethod.h \ KS.h \ IWLSFactory.h IWLS.h LGMix.h \ AuxMixPoisson.h AuxMixBinomial.h Outcome.h \ NormalLinear.h BinaryProbit.h BinaryLogit.h Classify.h \ IWLSOutcome.h HolmesHeld.h HolmesHeldFactory.h GLMBlock.h \ GLMGibbs.h GLMGenericFactory.h HolmesHeldGibbs.h PolyaGamma.h PG.h \ ScaledWishart.h ScaledWishartFactory.h SampleWishart.h \ ScaledGamma.h ScaledGammaFactory.h \ LogisticLinear.h TLinear.h OrderedLogit.h OrderedProbit.h \ RESampler.h REMethod.h REFactory.h \ REGamma.h REGammaSlicer.h REGammaFactory.h \ REScaledGamma.h REScaledGammaFactory.h \ REScaledWishart.h REScaledWishartFactory.h \ MNormalLinear.h \ REMethod2.h REFactory2.h \ REGammaSlicer2.h REGamma2.h REGammaFactory2.h \ REScaledGamma2.h REScaledGammaFactory2.h \ REScaledWishart2.h REScaledWishartFactory2.h @CANCHECK_TRUE@check_LTLIBRARIES = libglmsamptest.la @CANCHECK_TRUE@libglmsamptest_la_SOURCES = testglmsamp.cc testglmsamp.h @CANCHECK_TRUE@libglmsamptest_la_CPPFLAGS = -I$(top_srcdir)/src/include @CANCHECK_TRUE@libglmsamptest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/samplers/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/samplers/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libglmsampler.la: $(libglmsampler_la_OBJECTS) $(libglmsampler_la_DEPENDENCIES) $(EXTRA_libglmsampler_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libglmsampler_la_OBJECTS) $(libglmsampler_la_LIBADD) $(LIBS) libglmsamptest.la: $(libglmsamptest_la_OBJECTS) $(libglmsamptest_la_DEPENDENCIES) $(EXTRA_libglmsamptest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libglmsamptest_la_LINK) $(am_libglmsamptest_la_rpath) $(libglmsamptest_la_OBJECTS) $(libglmsamptest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-AuxMixBinomial.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-AuxMixPoisson.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-BinaryLogit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-BinaryProbit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-Classify.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-GLMBlock.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-GLMFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-GLMGenericFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-GLMGibbs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-GLMMethod.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-GLMSampler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-HolmesHeld.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-HolmesHeldFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-HolmesHeldGibbs.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-IWLS.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-IWLSFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-IWLSOutcome.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-KS.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-LGMix.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-LogisticLinear.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-MNormalLinear.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-NormalLinear.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-OrderedLogit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-OrderedProbit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-Outcome.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-PGcommon.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-PolyaGamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REFactory2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REGamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REGamma2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REGammaFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REGammaFactory2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REGammaSlicer.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REGammaSlicer2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REMethod.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REMethod2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-RESampler.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REScaledGamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REScaledGamma2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REScaledGammaFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REScaledGammaFactory2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REScaledWishart.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REScaledWishart2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REScaledWishartFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-REScaledWishartFactory2.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-SampleWishart.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-ScaledGamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-ScaledGammaFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-ScaledWishart.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-ScaledWishartFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsampler_la-TLinear.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmsamptest_la-testglmsamp.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libglmsampler_la-GLMFactory.lo: GLMFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-GLMFactory.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-GLMFactory.Tpo -c -o libglmsampler_la-GLMFactory.lo `test -f 'GLMFactory.cc' || echo '$(srcdir)/'`GLMFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-GLMFactory.Tpo $(DEPDIR)/libglmsampler_la-GLMFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GLMFactory.cc' object='libglmsampler_la-GLMFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-GLMFactory.lo `test -f 'GLMFactory.cc' || echo '$(srcdir)/'`GLMFactory.cc libglmsampler_la-GLMSampler.lo: GLMSampler.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-GLMSampler.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-GLMSampler.Tpo -c -o libglmsampler_la-GLMSampler.lo `test -f 'GLMSampler.cc' || echo '$(srcdir)/'`GLMSampler.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-GLMSampler.Tpo $(DEPDIR)/libglmsampler_la-GLMSampler.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GLMSampler.cc' object='libglmsampler_la-GLMSampler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-GLMSampler.lo `test -f 'GLMSampler.cc' || echo '$(srcdir)/'`GLMSampler.cc libglmsampler_la-GLMMethod.lo: GLMMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-GLMMethod.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-GLMMethod.Tpo -c -o libglmsampler_la-GLMMethod.lo `test -f 'GLMMethod.cc' || echo '$(srcdir)/'`GLMMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-GLMMethod.Tpo $(DEPDIR)/libglmsampler_la-GLMMethod.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GLMMethod.cc' object='libglmsampler_la-GLMMethod.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-GLMMethod.lo `test -f 'GLMMethod.cc' || echo '$(srcdir)/'`GLMMethod.cc libglmsampler_la-KS.lo: KS.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-KS.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-KS.Tpo -c -o libglmsampler_la-KS.lo `test -f 'KS.cc' || echo '$(srcdir)/'`KS.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-KS.Tpo $(DEPDIR)/libglmsampler_la-KS.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='KS.cc' object='libglmsampler_la-KS.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-KS.lo `test -f 'KS.cc' || echo '$(srcdir)/'`KS.cc libglmsampler_la-IWLSFactory.lo: IWLSFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-IWLSFactory.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-IWLSFactory.Tpo -c -o libglmsampler_la-IWLSFactory.lo `test -f 'IWLSFactory.cc' || echo '$(srcdir)/'`IWLSFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-IWLSFactory.Tpo $(DEPDIR)/libglmsampler_la-IWLSFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='IWLSFactory.cc' object='libglmsampler_la-IWLSFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-IWLSFactory.lo `test -f 'IWLSFactory.cc' || echo '$(srcdir)/'`IWLSFactory.cc libglmsampler_la-IWLS.lo: IWLS.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-IWLS.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-IWLS.Tpo -c -o libglmsampler_la-IWLS.lo `test -f 'IWLS.cc' || echo '$(srcdir)/'`IWLS.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-IWLS.Tpo $(DEPDIR)/libglmsampler_la-IWLS.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='IWLS.cc' object='libglmsampler_la-IWLS.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-IWLS.lo `test -f 'IWLS.cc' || echo '$(srcdir)/'`IWLS.cc libglmsampler_la-LGMix.lo: LGMix.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-LGMix.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-LGMix.Tpo -c -o libglmsampler_la-LGMix.lo `test -f 'LGMix.cc' || echo '$(srcdir)/'`LGMix.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-LGMix.Tpo $(DEPDIR)/libglmsampler_la-LGMix.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LGMix.cc' object='libglmsampler_la-LGMix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-LGMix.lo `test -f 'LGMix.cc' || echo '$(srcdir)/'`LGMix.cc libglmsampler_la-AuxMixPoisson.lo: AuxMixPoisson.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-AuxMixPoisson.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-AuxMixPoisson.Tpo -c -o libglmsampler_la-AuxMixPoisson.lo `test -f 'AuxMixPoisson.cc' || echo '$(srcdir)/'`AuxMixPoisson.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-AuxMixPoisson.Tpo $(DEPDIR)/libglmsampler_la-AuxMixPoisson.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='AuxMixPoisson.cc' object='libglmsampler_la-AuxMixPoisson.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-AuxMixPoisson.lo `test -f 'AuxMixPoisson.cc' || echo '$(srcdir)/'`AuxMixPoisson.cc libglmsampler_la-AuxMixBinomial.lo: AuxMixBinomial.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-AuxMixBinomial.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-AuxMixBinomial.Tpo -c -o libglmsampler_la-AuxMixBinomial.lo `test -f 'AuxMixBinomial.cc' || echo '$(srcdir)/'`AuxMixBinomial.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-AuxMixBinomial.Tpo $(DEPDIR)/libglmsampler_la-AuxMixBinomial.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='AuxMixBinomial.cc' object='libglmsampler_la-AuxMixBinomial.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-AuxMixBinomial.lo `test -f 'AuxMixBinomial.cc' || echo '$(srcdir)/'`AuxMixBinomial.cc libglmsampler_la-Outcome.lo: Outcome.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-Outcome.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-Outcome.Tpo -c -o libglmsampler_la-Outcome.lo `test -f 'Outcome.cc' || echo '$(srcdir)/'`Outcome.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-Outcome.Tpo $(DEPDIR)/libglmsampler_la-Outcome.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Outcome.cc' object='libglmsampler_la-Outcome.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-Outcome.lo `test -f 'Outcome.cc' || echo '$(srcdir)/'`Outcome.cc libglmsampler_la-NormalLinear.lo: NormalLinear.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-NormalLinear.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-NormalLinear.Tpo -c -o libglmsampler_la-NormalLinear.lo `test -f 'NormalLinear.cc' || echo '$(srcdir)/'`NormalLinear.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-NormalLinear.Tpo $(DEPDIR)/libglmsampler_la-NormalLinear.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='NormalLinear.cc' object='libglmsampler_la-NormalLinear.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-NormalLinear.lo `test -f 'NormalLinear.cc' || echo '$(srcdir)/'`NormalLinear.cc libglmsampler_la-BinaryProbit.lo: BinaryProbit.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-BinaryProbit.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-BinaryProbit.Tpo -c -o libglmsampler_la-BinaryProbit.lo `test -f 'BinaryProbit.cc' || echo '$(srcdir)/'`BinaryProbit.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-BinaryProbit.Tpo $(DEPDIR)/libglmsampler_la-BinaryProbit.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='BinaryProbit.cc' object='libglmsampler_la-BinaryProbit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-BinaryProbit.lo `test -f 'BinaryProbit.cc' || echo '$(srcdir)/'`BinaryProbit.cc libglmsampler_la-BinaryLogit.lo: BinaryLogit.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-BinaryLogit.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-BinaryLogit.Tpo -c -o libglmsampler_la-BinaryLogit.lo `test -f 'BinaryLogit.cc' || echo '$(srcdir)/'`BinaryLogit.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-BinaryLogit.Tpo $(DEPDIR)/libglmsampler_la-BinaryLogit.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='BinaryLogit.cc' object='libglmsampler_la-BinaryLogit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-BinaryLogit.lo `test -f 'BinaryLogit.cc' || echo '$(srcdir)/'`BinaryLogit.cc libglmsampler_la-Classify.lo: Classify.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-Classify.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-Classify.Tpo -c -o libglmsampler_la-Classify.lo `test -f 'Classify.cc' || echo '$(srcdir)/'`Classify.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-Classify.Tpo $(DEPDIR)/libglmsampler_la-Classify.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='Classify.cc' object='libglmsampler_la-Classify.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-Classify.lo `test -f 'Classify.cc' || echo '$(srcdir)/'`Classify.cc libglmsampler_la-IWLSOutcome.lo: IWLSOutcome.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-IWLSOutcome.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-IWLSOutcome.Tpo -c -o libglmsampler_la-IWLSOutcome.lo `test -f 'IWLSOutcome.cc' || echo '$(srcdir)/'`IWLSOutcome.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-IWLSOutcome.Tpo $(DEPDIR)/libglmsampler_la-IWLSOutcome.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='IWLSOutcome.cc' object='libglmsampler_la-IWLSOutcome.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-IWLSOutcome.lo `test -f 'IWLSOutcome.cc' || echo '$(srcdir)/'`IWLSOutcome.cc libglmsampler_la-HolmesHeld.lo: HolmesHeld.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-HolmesHeld.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-HolmesHeld.Tpo -c -o libglmsampler_la-HolmesHeld.lo `test -f 'HolmesHeld.cc' || echo '$(srcdir)/'`HolmesHeld.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-HolmesHeld.Tpo $(DEPDIR)/libglmsampler_la-HolmesHeld.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='HolmesHeld.cc' object='libglmsampler_la-HolmesHeld.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-HolmesHeld.lo `test -f 'HolmesHeld.cc' || echo '$(srcdir)/'`HolmesHeld.cc libglmsampler_la-HolmesHeldFactory.lo: HolmesHeldFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-HolmesHeldFactory.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-HolmesHeldFactory.Tpo -c -o libglmsampler_la-HolmesHeldFactory.lo `test -f 'HolmesHeldFactory.cc' || echo '$(srcdir)/'`HolmesHeldFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-HolmesHeldFactory.Tpo $(DEPDIR)/libglmsampler_la-HolmesHeldFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='HolmesHeldFactory.cc' object='libglmsampler_la-HolmesHeldFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-HolmesHeldFactory.lo `test -f 'HolmesHeldFactory.cc' || echo '$(srcdir)/'`HolmesHeldFactory.cc libglmsampler_la-GLMBlock.lo: GLMBlock.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-GLMBlock.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-GLMBlock.Tpo -c -o libglmsampler_la-GLMBlock.lo `test -f 'GLMBlock.cc' || echo '$(srcdir)/'`GLMBlock.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-GLMBlock.Tpo $(DEPDIR)/libglmsampler_la-GLMBlock.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GLMBlock.cc' object='libglmsampler_la-GLMBlock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-GLMBlock.lo `test -f 'GLMBlock.cc' || echo '$(srcdir)/'`GLMBlock.cc libglmsampler_la-GLMGibbs.lo: GLMGibbs.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-GLMGibbs.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-GLMGibbs.Tpo -c -o libglmsampler_la-GLMGibbs.lo `test -f 'GLMGibbs.cc' || echo '$(srcdir)/'`GLMGibbs.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-GLMGibbs.Tpo $(DEPDIR)/libglmsampler_la-GLMGibbs.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GLMGibbs.cc' object='libglmsampler_la-GLMGibbs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-GLMGibbs.lo `test -f 'GLMGibbs.cc' || echo '$(srcdir)/'`GLMGibbs.cc libglmsampler_la-GLMGenericFactory.lo: GLMGenericFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-GLMGenericFactory.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-GLMGenericFactory.Tpo -c -o libglmsampler_la-GLMGenericFactory.lo `test -f 'GLMGenericFactory.cc' || echo '$(srcdir)/'`GLMGenericFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-GLMGenericFactory.Tpo $(DEPDIR)/libglmsampler_la-GLMGenericFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='GLMGenericFactory.cc' object='libglmsampler_la-GLMGenericFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-GLMGenericFactory.lo `test -f 'GLMGenericFactory.cc' || echo '$(srcdir)/'`GLMGenericFactory.cc libglmsampler_la-HolmesHeldGibbs.lo: HolmesHeldGibbs.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-HolmesHeldGibbs.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-HolmesHeldGibbs.Tpo -c -o libglmsampler_la-HolmesHeldGibbs.lo `test -f 'HolmesHeldGibbs.cc' || echo '$(srcdir)/'`HolmesHeldGibbs.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-HolmesHeldGibbs.Tpo $(DEPDIR)/libglmsampler_la-HolmesHeldGibbs.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='HolmesHeldGibbs.cc' object='libglmsampler_la-HolmesHeldGibbs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-HolmesHeldGibbs.lo `test -f 'HolmesHeldGibbs.cc' || echo '$(srcdir)/'`HolmesHeldGibbs.cc libglmsampler_la-PolyaGamma.lo: PolyaGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-PolyaGamma.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-PolyaGamma.Tpo -c -o libglmsampler_la-PolyaGamma.lo `test -f 'PolyaGamma.cc' || echo '$(srcdir)/'`PolyaGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-PolyaGamma.Tpo $(DEPDIR)/libglmsampler_la-PolyaGamma.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='PolyaGamma.cc' object='libglmsampler_la-PolyaGamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-PolyaGamma.lo `test -f 'PolyaGamma.cc' || echo '$(srcdir)/'`PolyaGamma.cc libglmsampler_la-PGcommon.lo: PGcommon.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-PGcommon.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-PGcommon.Tpo -c -o libglmsampler_la-PGcommon.lo `test -f 'PGcommon.cc' || echo '$(srcdir)/'`PGcommon.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-PGcommon.Tpo $(DEPDIR)/libglmsampler_la-PGcommon.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='PGcommon.cc' object='libglmsampler_la-PGcommon.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-PGcommon.lo `test -f 'PGcommon.cc' || echo '$(srcdir)/'`PGcommon.cc libglmsampler_la-ScaledWishart.lo: ScaledWishart.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-ScaledWishart.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-ScaledWishart.Tpo -c -o libglmsampler_la-ScaledWishart.lo `test -f 'ScaledWishart.cc' || echo '$(srcdir)/'`ScaledWishart.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-ScaledWishart.Tpo $(DEPDIR)/libglmsampler_la-ScaledWishart.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ScaledWishart.cc' object='libglmsampler_la-ScaledWishart.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-ScaledWishart.lo `test -f 'ScaledWishart.cc' || echo '$(srcdir)/'`ScaledWishart.cc libglmsampler_la-ScaledWishartFactory.lo: ScaledWishartFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-ScaledWishartFactory.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-ScaledWishartFactory.Tpo -c -o libglmsampler_la-ScaledWishartFactory.lo `test -f 'ScaledWishartFactory.cc' || echo '$(srcdir)/'`ScaledWishartFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-ScaledWishartFactory.Tpo $(DEPDIR)/libglmsampler_la-ScaledWishartFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ScaledWishartFactory.cc' object='libglmsampler_la-ScaledWishartFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-ScaledWishartFactory.lo `test -f 'ScaledWishartFactory.cc' || echo '$(srcdir)/'`ScaledWishartFactory.cc libglmsampler_la-SampleWishart.lo: SampleWishart.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-SampleWishart.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-SampleWishart.Tpo -c -o libglmsampler_la-SampleWishart.lo `test -f 'SampleWishart.cc' || echo '$(srcdir)/'`SampleWishart.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-SampleWishart.Tpo $(DEPDIR)/libglmsampler_la-SampleWishart.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SampleWishart.cc' object='libglmsampler_la-SampleWishart.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-SampleWishart.lo `test -f 'SampleWishart.cc' || echo '$(srcdir)/'`SampleWishart.cc libglmsampler_la-ScaledGamma.lo: ScaledGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-ScaledGamma.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-ScaledGamma.Tpo -c -o libglmsampler_la-ScaledGamma.lo `test -f 'ScaledGamma.cc' || echo '$(srcdir)/'`ScaledGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-ScaledGamma.Tpo $(DEPDIR)/libglmsampler_la-ScaledGamma.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ScaledGamma.cc' object='libglmsampler_la-ScaledGamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-ScaledGamma.lo `test -f 'ScaledGamma.cc' || echo '$(srcdir)/'`ScaledGamma.cc libglmsampler_la-ScaledGammaFactory.lo: ScaledGammaFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-ScaledGammaFactory.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-ScaledGammaFactory.Tpo -c -o libglmsampler_la-ScaledGammaFactory.lo `test -f 'ScaledGammaFactory.cc' || echo '$(srcdir)/'`ScaledGammaFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-ScaledGammaFactory.Tpo $(DEPDIR)/libglmsampler_la-ScaledGammaFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ScaledGammaFactory.cc' object='libglmsampler_la-ScaledGammaFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-ScaledGammaFactory.lo `test -f 'ScaledGammaFactory.cc' || echo '$(srcdir)/'`ScaledGammaFactory.cc libglmsampler_la-LogisticLinear.lo: LogisticLinear.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-LogisticLinear.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-LogisticLinear.Tpo -c -o libglmsampler_la-LogisticLinear.lo `test -f 'LogisticLinear.cc' || echo '$(srcdir)/'`LogisticLinear.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-LogisticLinear.Tpo $(DEPDIR)/libglmsampler_la-LogisticLinear.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='LogisticLinear.cc' object='libglmsampler_la-LogisticLinear.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-LogisticLinear.lo `test -f 'LogisticLinear.cc' || echo '$(srcdir)/'`LogisticLinear.cc libglmsampler_la-TLinear.lo: TLinear.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-TLinear.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-TLinear.Tpo -c -o libglmsampler_la-TLinear.lo `test -f 'TLinear.cc' || echo '$(srcdir)/'`TLinear.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-TLinear.Tpo $(DEPDIR)/libglmsampler_la-TLinear.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='TLinear.cc' object='libglmsampler_la-TLinear.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-TLinear.lo `test -f 'TLinear.cc' || echo '$(srcdir)/'`TLinear.cc libglmsampler_la-OrderedLogit.lo: OrderedLogit.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-OrderedLogit.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-OrderedLogit.Tpo -c -o libglmsampler_la-OrderedLogit.lo `test -f 'OrderedLogit.cc' || echo '$(srcdir)/'`OrderedLogit.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-OrderedLogit.Tpo $(DEPDIR)/libglmsampler_la-OrderedLogit.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='OrderedLogit.cc' object='libglmsampler_la-OrderedLogit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-OrderedLogit.lo `test -f 'OrderedLogit.cc' || echo '$(srcdir)/'`OrderedLogit.cc libglmsampler_la-OrderedProbit.lo: OrderedProbit.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-OrderedProbit.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-OrderedProbit.Tpo -c -o libglmsampler_la-OrderedProbit.lo `test -f 'OrderedProbit.cc' || echo '$(srcdir)/'`OrderedProbit.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-OrderedProbit.Tpo $(DEPDIR)/libglmsampler_la-OrderedProbit.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='OrderedProbit.cc' object='libglmsampler_la-OrderedProbit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-OrderedProbit.lo `test -f 'OrderedProbit.cc' || echo '$(srcdir)/'`OrderedProbit.cc libglmsampler_la-RESampler.lo: RESampler.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-RESampler.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-RESampler.Tpo -c -o libglmsampler_la-RESampler.lo `test -f 'RESampler.cc' || echo '$(srcdir)/'`RESampler.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-RESampler.Tpo $(DEPDIR)/libglmsampler_la-RESampler.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='RESampler.cc' object='libglmsampler_la-RESampler.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-RESampler.lo `test -f 'RESampler.cc' || echo '$(srcdir)/'`RESampler.cc libglmsampler_la-REMethod.lo: REMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REMethod.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REMethod.Tpo -c -o libglmsampler_la-REMethod.lo `test -f 'REMethod.cc' || echo '$(srcdir)/'`REMethod.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REMethod.Tpo $(DEPDIR)/libglmsampler_la-REMethod.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REMethod.cc' object='libglmsampler_la-REMethod.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REMethod.lo `test -f 'REMethod.cc' || echo '$(srcdir)/'`REMethod.cc libglmsampler_la-REFactory.lo: REFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REFactory.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REFactory.Tpo -c -o libglmsampler_la-REFactory.lo `test -f 'REFactory.cc' || echo '$(srcdir)/'`REFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REFactory.Tpo $(DEPDIR)/libglmsampler_la-REFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REFactory.cc' object='libglmsampler_la-REFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REFactory.lo `test -f 'REFactory.cc' || echo '$(srcdir)/'`REFactory.cc libglmsampler_la-REGamma.lo: REGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REGamma.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REGamma.Tpo -c -o libglmsampler_la-REGamma.lo `test -f 'REGamma.cc' || echo '$(srcdir)/'`REGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REGamma.Tpo $(DEPDIR)/libglmsampler_la-REGamma.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REGamma.cc' object='libglmsampler_la-REGamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REGamma.lo `test -f 'REGamma.cc' || echo '$(srcdir)/'`REGamma.cc libglmsampler_la-REGammaSlicer.lo: REGammaSlicer.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REGammaSlicer.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REGammaSlicer.Tpo -c -o libglmsampler_la-REGammaSlicer.lo `test -f 'REGammaSlicer.cc' || echo '$(srcdir)/'`REGammaSlicer.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REGammaSlicer.Tpo $(DEPDIR)/libglmsampler_la-REGammaSlicer.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REGammaSlicer.cc' object='libglmsampler_la-REGammaSlicer.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REGammaSlicer.lo `test -f 'REGammaSlicer.cc' || echo '$(srcdir)/'`REGammaSlicer.cc libglmsampler_la-REGammaFactory.lo: REGammaFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REGammaFactory.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REGammaFactory.Tpo -c -o libglmsampler_la-REGammaFactory.lo `test -f 'REGammaFactory.cc' || echo '$(srcdir)/'`REGammaFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REGammaFactory.Tpo $(DEPDIR)/libglmsampler_la-REGammaFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REGammaFactory.cc' object='libglmsampler_la-REGammaFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REGammaFactory.lo `test -f 'REGammaFactory.cc' || echo '$(srcdir)/'`REGammaFactory.cc libglmsampler_la-REScaledGamma.lo: REScaledGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REScaledGamma.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REScaledGamma.Tpo -c -o libglmsampler_la-REScaledGamma.lo `test -f 'REScaledGamma.cc' || echo '$(srcdir)/'`REScaledGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REScaledGamma.Tpo $(DEPDIR)/libglmsampler_la-REScaledGamma.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REScaledGamma.cc' object='libglmsampler_la-REScaledGamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REScaledGamma.lo `test -f 'REScaledGamma.cc' || echo '$(srcdir)/'`REScaledGamma.cc libglmsampler_la-REScaledGammaFactory.lo: REScaledGammaFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REScaledGammaFactory.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REScaledGammaFactory.Tpo -c -o libglmsampler_la-REScaledGammaFactory.lo `test -f 'REScaledGammaFactory.cc' || echo '$(srcdir)/'`REScaledGammaFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REScaledGammaFactory.Tpo $(DEPDIR)/libglmsampler_la-REScaledGammaFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REScaledGammaFactory.cc' object='libglmsampler_la-REScaledGammaFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REScaledGammaFactory.lo `test -f 'REScaledGammaFactory.cc' || echo '$(srcdir)/'`REScaledGammaFactory.cc libglmsampler_la-REScaledWishart.lo: REScaledWishart.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REScaledWishart.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REScaledWishart.Tpo -c -o libglmsampler_la-REScaledWishart.lo `test -f 'REScaledWishart.cc' || echo '$(srcdir)/'`REScaledWishart.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REScaledWishart.Tpo $(DEPDIR)/libglmsampler_la-REScaledWishart.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REScaledWishart.cc' object='libglmsampler_la-REScaledWishart.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REScaledWishart.lo `test -f 'REScaledWishart.cc' || echo '$(srcdir)/'`REScaledWishart.cc libglmsampler_la-REScaledWishartFactory.lo: REScaledWishartFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REScaledWishartFactory.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REScaledWishartFactory.Tpo -c -o libglmsampler_la-REScaledWishartFactory.lo `test -f 'REScaledWishartFactory.cc' || echo '$(srcdir)/'`REScaledWishartFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REScaledWishartFactory.Tpo $(DEPDIR)/libglmsampler_la-REScaledWishartFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REScaledWishartFactory.cc' object='libglmsampler_la-REScaledWishartFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REScaledWishartFactory.lo `test -f 'REScaledWishartFactory.cc' || echo '$(srcdir)/'`REScaledWishartFactory.cc libglmsampler_la-MNormalLinear.lo: MNormalLinear.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-MNormalLinear.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-MNormalLinear.Tpo -c -o libglmsampler_la-MNormalLinear.lo `test -f 'MNormalLinear.cc' || echo '$(srcdir)/'`MNormalLinear.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-MNormalLinear.Tpo $(DEPDIR)/libglmsampler_la-MNormalLinear.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='MNormalLinear.cc' object='libglmsampler_la-MNormalLinear.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-MNormalLinear.lo `test -f 'MNormalLinear.cc' || echo '$(srcdir)/'`MNormalLinear.cc libglmsampler_la-REMethod2.lo: REMethod2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REMethod2.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REMethod2.Tpo -c -o libglmsampler_la-REMethod2.lo `test -f 'REMethod2.cc' || echo '$(srcdir)/'`REMethod2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REMethod2.Tpo $(DEPDIR)/libglmsampler_la-REMethod2.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REMethod2.cc' object='libglmsampler_la-REMethod2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REMethod2.lo `test -f 'REMethod2.cc' || echo '$(srcdir)/'`REMethod2.cc libglmsampler_la-REFactory2.lo: REFactory2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REFactory2.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REFactory2.Tpo -c -o libglmsampler_la-REFactory2.lo `test -f 'REFactory2.cc' || echo '$(srcdir)/'`REFactory2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REFactory2.Tpo $(DEPDIR)/libglmsampler_la-REFactory2.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REFactory2.cc' object='libglmsampler_la-REFactory2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REFactory2.lo `test -f 'REFactory2.cc' || echo '$(srcdir)/'`REFactory2.cc libglmsampler_la-REGammaSlicer2.lo: REGammaSlicer2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REGammaSlicer2.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REGammaSlicer2.Tpo -c -o libglmsampler_la-REGammaSlicer2.lo `test -f 'REGammaSlicer2.cc' || echo '$(srcdir)/'`REGammaSlicer2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REGammaSlicer2.Tpo $(DEPDIR)/libglmsampler_la-REGammaSlicer2.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REGammaSlicer2.cc' object='libglmsampler_la-REGammaSlicer2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REGammaSlicer2.lo `test -f 'REGammaSlicer2.cc' || echo '$(srcdir)/'`REGammaSlicer2.cc libglmsampler_la-REGamma2.lo: REGamma2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REGamma2.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REGamma2.Tpo -c -o libglmsampler_la-REGamma2.lo `test -f 'REGamma2.cc' || echo '$(srcdir)/'`REGamma2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REGamma2.Tpo $(DEPDIR)/libglmsampler_la-REGamma2.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REGamma2.cc' object='libglmsampler_la-REGamma2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REGamma2.lo `test -f 'REGamma2.cc' || echo '$(srcdir)/'`REGamma2.cc libglmsampler_la-REGammaFactory2.lo: REGammaFactory2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REGammaFactory2.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REGammaFactory2.Tpo -c -o libglmsampler_la-REGammaFactory2.lo `test -f 'REGammaFactory2.cc' || echo '$(srcdir)/'`REGammaFactory2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REGammaFactory2.Tpo $(DEPDIR)/libglmsampler_la-REGammaFactory2.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REGammaFactory2.cc' object='libglmsampler_la-REGammaFactory2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REGammaFactory2.lo `test -f 'REGammaFactory2.cc' || echo '$(srcdir)/'`REGammaFactory2.cc libglmsampler_la-REScaledGamma2.lo: REScaledGamma2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REScaledGamma2.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REScaledGamma2.Tpo -c -o libglmsampler_la-REScaledGamma2.lo `test -f 'REScaledGamma2.cc' || echo '$(srcdir)/'`REScaledGamma2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REScaledGamma2.Tpo $(DEPDIR)/libglmsampler_la-REScaledGamma2.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REScaledGamma2.cc' object='libglmsampler_la-REScaledGamma2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REScaledGamma2.lo `test -f 'REScaledGamma2.cc' || echo '$(srcdir)/'`REScaledGamma2.cc libglmsampler_la-REScaledGammaFactory2.lo: REScaledGammaFactory2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REScaledGammaFactory2.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REScaledGammaFactory2.Tpo -c -o libglmsampler_la-REScaledGammaFactory2.lo `test -f 'REScaledGammaFactory2.cc' || echo '$(srcdir)/'`REScaledGammaFactory2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REScaledGammaFactory2.Tpo $(DEPDIR)/libglmsampler_la-REScaledGammaFactory2.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REScaledGammaFactory2.cc' object='libglmsampler_la-REScaledGammaFactory2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REScaledGammaFactory2.lo `test -f 'REScaledGammaFactory2.cc' || echo '$(srcdir)/'`REScaledGammaFactory2.cc libglmsampler_la-REScaledWishart2.lo: REScaledWishart2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REScaledWishart2.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REScaledWishart2.Tpo -c -o libglmsampler_la-REScaledWishart2.lo `test -f 'REScaledWishart2.cc' || echo '$(srcdir)/'`REScaledWishart2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REScaledWishart2.Tpo $(DEPDIR)/libglmsampler_la-REScaledWishart2.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REScaledWishart2.cc' object='libglmsampler_la-REScaledWishart2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REScaledWishart2.lo `test -f 'REScaledWishart2.cc' || echo '$(srcdir)/'`REScaledWishart2.cc libglmsampler_la-REScaledWishartFactory2.lo: REScaledWishartFactory2.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmsampler_la-REScaledWishartFactory2.lo -MD -MP -MF $(DEPDIR)/libglmsampler_la-REScaledWishartFactory2.Tpo -c -o libglmsampler_la-REScaledWishartFactory2.lo `test -f 'REScaledWishartFactory2.cc' || echo '$(srcdir)/'`REScaledWishartFactory2.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsampler_la-REScaledWishartFactory2.Tpo $(DEPDIR)/libglmsampler_la-REScaledWishartFactory2.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='REScaledWishartFactory2.cc' object='libglmsampler_la-REScaledWishartFactory2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsampler_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmsampler_la-REScaledWishartFactory2.lo `test -f 'REScaledWishartFactory2.cc' || echo '$(srcdir)/'`REScaledWishartFactory2.cc libglmsamptest_la-testglmsamp.lo: testglmsamp.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsamptest_la_CPPFLAGS) $(CPPFLAGS) $(libglmsamptest_la_CXXFLAGS) $(CXXFLAGS) -MT libglmsamptest_la-testglmsamp.lo -MD -MP -MF $(DEPDIR)/libglmsamptest_la-testglmsamp.Tpo -c -o libglmsamptest_la-testglmsamp.lo `test -f 'testglmsamp.cc' || echo '$(srcdir)/'`testglmsamp.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmsamptest_la-testglmsamp.Tpo $(DEPDIR)/libglmsamptest_la-testglmsamp.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testglmsamp.cc' object='libglmsamptest_la-testglmsamp.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmsamptest_la_CPPFLAGS) $(CPPFLAGS) $(libglmsamptest_la_CXXFLAGS) $(CXXFLAGS) -c -o libglmsamptest_la-testglmsamp.lo `test -f 'testglmsamp.cc' || echo '$(srcdir)/'`testglmsamp.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libglmsampler_la-AuxMixBinomial.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-AuxMixPoisson.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-BinaryLogit.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-BinaryProbit.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-Classify.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMBlock.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMGenericFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMGibbs.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMMethod.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMSampler.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-HolmesHeld.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-HolmesHeldFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-HolmesHeldGibbs.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-IWLS.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-IWLSFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-IWLSOutcome.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-KS.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-LGMix.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-LogisticLinear.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-MNormalLinear.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-NormalLinear.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-OrderedLogit.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-OrderedProbit.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-Outcome.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-PGcommon.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-PolyaGamma.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REFactory2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGamma.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGamma2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGammaFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGammaFactory2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGammaSlicer.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGammaSlicer2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REMethod.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REMethod2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-RESampler.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledGamma.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledGamma2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledGammaFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledGammaFactory2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledWishart.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledWishart2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledWishartFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledWishartFactory2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-SampleWishart.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-ScaledGamma.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-ScaledGammaFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-ScaledWishart.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-ScaledWishartFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-TLinear.Plo -rm -f ./$(DEPDIR)/libglmsamptest_la-testglmsamp.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libglmsampler_la-AuxMixBinomial.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-AuxMixPoisson.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-BinaryLogit.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-BinaryProbit.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-Classify.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMBlock.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMGenericFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMGibbs.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMMethod.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-GLMSampler.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-HolmesHeld.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-HolmesHeldFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-HolmesHeldGibbs.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-IWLS.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-IWLSFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-IWLSOutcome.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-KS.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-LGMix.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-LogisticLinear.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-MNormalLinear.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-NormalLinear.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-OrderedLogit.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-OrderedProbit.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-Outcome.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-PGcommon.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-PolyaGamma.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REFactory2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGamma.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGamma2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGammaFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGammaFactory2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGammaSlicer.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REGammaSlicer2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REMethod.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REMethod2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-RESampler.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledGamma.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledGamma2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledGammaFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledGammaFactory2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledWishart.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledWishart2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledWishartFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-REScaledWishartFactory2.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-SampleWishart.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-ScaledGamma.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-ScaledGammaFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-ScaledWishart.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-ScaledWishartFactory.Plo -rm -f ./$(DEPDIR)/libglmsampler_la-TLinear.Plo -rm -f ./$(DEPDIR)/libglmsamptest_la-testglmsamp.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/samplers/GLMFactory.cc0000664000175000017500000003071614224052515016320 00000000000000#include #include "GLMFactory.h" #include "GLMSampler.h" #include "REGammaFactory2.h" #include "REScaledGammaFactory2.h" #include "REScaledWishartFactory2.h" #include #include #include #include #include #include #include #include #include #include #include #include #include using std::set; using std::vector; using std::map; using std::stable_sort; using std::string; using std::list; using std::pair; using std::copy; namespace jags { /* Aggregates candidate Nodes with common stochastic children. */ static bool aggregate(SingletonGraphView const *candidate, set &stochastic_children, Graph const &graph) { // Check that there is some overlap in stochastic children between // candidate node and current set. vector const &candidate_children = candidate->stochasticChildren(); bool overlap = false; for (unsigned int i = 0; i < candidate_children.size(); ++i) { if (stochastic_children.count(candidate_children[i]) > 0) { stochastic_children.insert(candidate_children.begin(), candidate_children.end()); return true; } } return overlap; } typedef pair ViewScore; struct less_viewscore { /* Comparison operator for ViewScore objects that ranks them in order of the score (second member of the pair); */ bool operator()(ViewScore const &x, ViewScore const &y) const { return x.second < y.second; }; }; vector sort_by_children(vector const &candidates) { // Utility function called by makeSampler when we have a set // of candidates for sampling that are not jointly linear. To // find a maximal subset of linear candidates we first sort in // increasing order of the number of shared outcome // variables. The heuristic reasoning is that a candidate with // few shared outcomes has few opportunities for a quadratic // interaction with another candidate. map cmap; // Score map for candidates // First pass. Calculate scores for stochastic children equal // to the number of candidates that they depend on, minus 1. for (vector::const_iterator p = candidates.begin(); p != candidates.end(); ++p) { vector const &sc = (*p)->stochasticChildren(); for (vector::const_iterator q = sc.begin(); q != sc.end(); ++q) { map::iterator s = cmap.find(*q); if (s == cmap.end()) { cmap[*q] = 0; } else { s->second++; } } } vector vscores; // Second pass. For each candidate, add up the scores of // stochastic children. This is the number of stochastic // children shared with other candidates. for (vector::const_iterator p = candidates.begin(); p != candidates.end(); ++p) { ViewScore pshared(*p,0); vector const &sc = (*p)->stochasticChildren(); for (vector::const_iterator q = sc.begin(); q != sc.end(); ++q) { map::iterator s = cmap.find(*q); pshared.second += s->second; } vscores.push_back(pshared); } // Now sort candidates in score order stable_sort(vscores.begin(), vscores.end(), less_viewscore()); vector sorted_candidates; for (vector::const_iterator p = vscores.begin(); p != vscores.end(); ++p) { sorted_candidates.push_back(p->first); } return sorted_candidates; } static bool isLink(DeterministicNode const *dnode) { return dynamic_cast(dnode) != 0; } vector get_linear_subset(vector const &candidates, bool fixed, bool link) { vector linear; set ancestors; set link_children; pair::iterator, bool> p; for (vector::const_iterator c = candidates.begin(); c != candidates.end(); ++c) { vector ::iterator> new_ancestors; vector ::iterator> new_link_children; StochasticNode *snode = (*c)->node(); p = ancestors.insert(snode); new_ancestors.push_back(p.first); bool ok = true; vector const &dn = (*c)->deterministicChildren(); for (unsigned int j = 0; j < dn.size(); ++j) { if (link_children.count(dn[j])) { ok = false; break; } if (dn[j]->isClosed(ancestors, DNODE_LINEAR, fixed)) { p = ancestors.insert(dn[j]); if (p.second) { new_ancestors.push_back(p.first); } } else if (link && isLink(dn[j])) { list::const_iterator i; for (i = dn[j]->deterministicChildren()->begin(); i != dn[j]->deterministicChildren()->end(); ++i) { p = link_children.insert(*i); if (p.second) { new_link_children.push_back(p.first); } } } else { ok = false; break; } } if (!ok) { // Non-linear interaction found. Unwind additions to // ancestors and link_children for (unsigned int i = 0; i < new_ancestors.size(); ++i) { ancestors.erase(new_ancestors[i]); } for (unsigned int i = 0; i < new_link_children.size(); ++i) { link_children.erase(new_link_children[i]); } } linear.push_back(ok); } return linear; } namespace glm { GLMFactory::GLMFactory(string const &name) : _name(name) {} bool GLMFactory::checkDescendants(GraphView const *view) const { // Check stochastic children vector const &stoch_nodes = view->stochasticChildren(); for (unsigned int i = 0; i < stoch_nodes.size(); ++i) { if (isBounded(stoch_nodes[i])) { return false; //Truncated outcome variable } if (!checkOutcome(stoch_nodes[i])) { return false; //Invalid outcome or link } if (fixedOutcome() && !isObserved(stoch_nodes[i])) { return false; //Unobserved outcome not allowed by sampler } //Check that other parameters do not depend on snode vector const ¶m = stoch_nodes[i]->parents(); for (unsigned int j = 1; j < param.size(); ++j) { if (view->isDependent(param[j])) { return false; } } } // Check linearity of deterministic descendants if (!checkLinear(view, fixedDesign(), true)) return false; return true; } SingletonGraphView * GLMFactory::makeView(StochasticNode *snode, Graph const &graph, bool gibbs) const { /* Returns a newly allocated GraphView if node can be sampled, otherwise zero pointer. */ string dname = snode->distribution()->name(); if (dname != "dnorm" && dname != "dmnorm") return 0; //Must have normal prior if (gibbs && snode->length() != 1) { return 0; } if (!gibbs && isBounded(snode)) { return 0; } SingletonGraphView *view = new SingletonGraphView(snode, graph); if (!checkDescendants(view)) { delete view; return 0; } else { return view; } } GLMFactory::~GLMFactory() {} GLMSampler * GLMFactory::makeSampler(list const &free_nodes, Graph const &graph, bool gibbs) const { // Find candidate nodes that could be part of a GLM. vector candidates; for (list::const_iterator p = free_nodes.begin(); p != free_nodes.end(); ++p) { if (SingletonGraphView *up = makeView(*p, graph, gibbs)) { candidates.push_back(up); } } if (candidates.empty()) { return 0; } // Now try to aggregate nodes into a joint linear model unsigned int Nc = candidates.size(); vector keep(Nc, false); vector resolved(Nc, false); GraphView *view = 0; keep[0] = true; set stoch_children; stoch_children.insert(candidates[0]->stochasticChildren().begin(), candidates[0]->stochasticChildren().end()); // Aggregate nodes with common stochastic children. // This requires multiple passes through candidate nodes bool loop = true; while (loop) { loop = false; for (unsigned int j = 1; j < candidates.size(); ++j) { if (!keep[j]) { keep[j] = aggregate(candidates[j], stoch_children, graph); if (keep[j]) { loop = true; } } } } // Remove candidate nodes that are stochastic children of // another candidate node. All GLMMethod algorithms rely on // the stochastic parents of the sampled nodes being fixed // within any update. set all_children; for (unsigned int j = 0; j < candidates.size(); ++j) { if (keep[j]) { vector const &children_j = candidates[j]->stochasticChildren(); all_children.insert(children_j.begin(), children_j.end()); } } for (unsigned int j = 0; j < candidates.size(); ++j) { if (keep[j]) { if (all_children.count(candidates[j]->node())) { keep[j] = false; } } } // vector sample_nodes; vector sub_views; for (unsigned int j = 0; j < Nc; ++j) { if (keep[j]) { sub_views.push_back(candidates[j]); sample_nodes.push_back(candidates[j]->node()); } else { delete candidates[j]; candidates[j] = 0; } } if (sub_views.empty()) { return 0; } view = new GraphView(sample_nodes, graph); if (!checkLinear(view, fixedDesign(), true)) { // Candidates are not jointly linear candidates = sub_views; sample_nodes.clear(); sub_views.clear(); delete view; // Find maximal linear subset vector sorted_candidates = sort_by_children(candidates); vector keep = get_linear_subset(sorted_candidates, fixedDesign(), true); for (unsigned int j = 0; j < sorted_candidates.size(); ++j) { if (keep[j]) { sub_views.push_back(sorted_candidates[j]); sample_nodes.push_back(sorted_candidates[j]->node()); } else { delete sorted_candidates[j]; } } view = new GraphView(sample_nodes, graph); } /* FIXME * * The overhead of a GLM sampling method for a univariate * sampler is too large So we skip univariate nodes. However, * by returning a null pointer at this point we terminate the * factory and so will miss a block of nodes that could be * sampled together later. * * What we need to do here is to mark this node to be skipped in any * later call. */ if (sub_views.size() == 1 && view->length() == 1) { delete view; delete sub_views.back(); return 0; } unsigned int Nch = nchain(view); vector methods(Nch, 0); vector const_sub_views(sub_views.size()); copy(sub_views.begin(), sub_views.end(), const_sub_views.begin()); for (unsigned int ch = 0; ch < Nch; ++ch) { methods[ch] = newMethod(view, const_sub_views, ch, gibbs); } string nm = _name; if (gibbs) nm.append("-Gibbs"); return new GLMSampler(view, sub_views, methods, nm); } string GLMFactory::name() const { return _name; } vector GLMFactory::makeSamplers(list const &nodes, Graph const &graph) const { vector ans; if (GLMSampler *s = makeSampler(nodes, graph, false)) { ans.push_back(s); makeRESamplers(nodes, s, graph, ans); } else if (GLMSampler *s = makeSampler(nodes, graph, true)) { ans.push_back(s); } return ans; } bool GLMFactory::fixedDesign() const { return false; } bool GLMFactory::fixedOutcome() const { return false; } void GLMFactory::makeRESamplers(list const &free_nodes, GLMSampler const *s, Graph const &graph, vector &samplers) const { REGammaFactory2 gfac; REScaledGammaFactory2 sgfac; REScaledWishartFactory2 swfac; set used_nodes; used_nodes.insert(s->nodes().begin(), s->nodes().end()); while (Sampler *resampler = gfac.makeSampler(free_nodes, used_nodes, s, graph)) { samplers.push_back(resampler); } while (Sampler *resampler = sgfac.makeSampler(free_nodes, used_nodes, s, graph)) { samplers.push_back(resampler); } while (Sampler *resampler = swfac.makeSampler(free_nodes, used_nodes, s, graph)) { samplers.push_back(resampler); } } }} JAGS-4.3.2/src/modules/glm/samplers/GLMSampler.cc0000664000175000017500000000326514224052515016313 00000000000000#include #include "GLMSampler.h" #include "GLMMethod.h" #include #include using std::vector; using std::string; namespace jags { namespace glm { GLMSampler::GLMSampler(GraphView *view, vector const &sub_views, vector const &methods, std::string const &name) : Sampler(view), _view(view), _sub_views(sub_views), _methods(methods), _name(name) { //FIXME We need a pointer _view here because the friend class //REFactory2 needs access to it and cannot get it from the parent //Sampler class. Need to add an extractor function. } GLMSampler::~GLMSampler() { while (!_sub_views.empty()) { delete _sub_views.back(); _sub_views.pop_back(); } for (unsigned int ch = 0; ch < _methods.size(); ++ch) { delete _methods[ch]; } } void GLMSampler::update(vector const &rngs) { for (unsigned int ch = 0; ch < rngs.size(); ++ch) { _methods[ch]->update(rngs[ch]); } } void GLMSampler::adaptOff() { for (unsigned int ch = 0; ch < _methods.size(); ++ch) { _methods[ch]->adaptOff(); } } bool GLMSampler::checkAdaptation() const { for (unsigned int ch = 0; ch < _methods.size(); ++ch) { if (!_methods[ch]->checkAdaptation()) return false; } return true; } bool GLMSampler::isAdaptive() const { for (unsigned int ch = 0; ch < _methods.size(); ++ch) { if (_methods[ch]->isAdaptive()) return true; } return false; } string GLMSampler::name() const { return _name; } vector const &GLMSampler::methods() { return _methods; } }} JAGS-4.3.2/src/modules/glm/samplers/GLMMethod.cc0000664000175000017500000002754614224052515016140 00000000000000#include #include #include #include #include #include "GLMMethod.h" #include "Outcome.h" #include #include #include #include #include //#include #include #include #include #include #include using std::string; using std::vector; using std::set; using std::copy; using std::sqrt; extern cholmod_common *glm_wk; namespace jags { static void getIndices(set const &schildren, vector const &allchildren, vector const &allrows, vector &indices) { indices.clear(); for (unsigned int i = 0; i < allchildren.size(); ++i) { if (schildren.count(allchildren[i])) { for (unsigned int j = allrows[i]; j < allrows[i+1]; ++j) { indices.push_back(j); } } } } namespace glm { void GLMMethod::calDesign() const { if (allTrue(_fixed)) return; //Move along, nothing to see here vector const &snodes = _view->nodes(); int *Xi = static_cast(_x->i); int *Xp = static_cast(_x->p); double *Xx = static_cast(_x->x); unsigned int nrow = _x->nrow; unsigned int ncol = _view->length(); if (ncol != _x->ncol) { throwLogicError("Dimension mismatch in GLMMethod::calDesign"); } int c = 0; //column counter vector xnew(_length_max); //Need to set up these vectors so we can map back from a row of //the design matrix to the corresponding outcome. Note that this //is only need when we have multivariate outcomes; with only //scalar outcomes the mapping is trivial vector outcome_ptr(nrow); vector outcome_idx(nrow); unsigned int r = 0; //row counter for (unsigned int i = 0; i < _outcomes.size(); ++i) { for (unsigned int j = 0; j < _outcomes[i]->length(); ++j, ++r) { outcome_ptr[r] = _outcomes[i]; outcome_idx[r] = j; } } for (unsigned int i = 0; i < snodes.size(); ++i) { unsigned int length = snodes[i]->length(); if (!_fixed[i]) { for (unsigned int j = 0; j < length; ++j) { for (int r = Xp[c+j]; r < Xp[c+j+1]; ++r) { unsigned int row = Xi[r]; Xx[r] = - outcome_ptr[row]->vmean()[outcome_idx[row]]; } } double const *xold = snodes[i]->value(_chain); copy(xold, xold + length, xnew.begin()); for (unsigned int j = 0; j < length; ++j) { xnew[j] += 1; _sub_views[i]->setValue(&xnew[0], length, _chain); for (int r = Xp[c+j]; r < Xp[c+j+1]; ++r) { unsigned int row = Xi[r]; Xx[r] += outcome_ptr[row]->vmean()[outcome_idx[row]]; } xnew[j] -= 1; } _sub_views[i]->setValue(&xnew[0], length, _chain); } c += length; } } GLMMethod::GLMMethod(GraphView const *view, vector const &sub_views, vector const &outcomes, unsigned int chain) : _view(view), _chain(chain), _sub_views(sub_views), _outcomes(outcomes), _x(0), _factor(0), _fixed(sub_views.size(), false), _length_max(0), _nz_prior(0) { view->checkFinite(chain); //Check validity of initial values vector const &schildren = view->stochasticChildren(); vector rows(schildren.size() + 1); rows[0] = 0; for (unsigned int i = 0; i < schildren.size(); ++i) { rows[i+1] = rows[i] + schildren[i]->length(); } int ncol = view->length(); int nrow = rows[schildren.size()]; vector Xp(ncol + 1); vector Xi; int c = 0; //column counter int r = 0; //count of number of non-zero entries for (unsigned int p = 0; p < _sub_views.size(); ++p) { set children_p; children_p.insert(sub_views[p]->stochasticChildren().begin(), sub_views[p]->stochasticChildren().end()); vector indices; getIndices(children_p, schildren, rows, indices); unsigned int length = _sub_views[p]->length(); for (unsigned int i = 0; i < length; ++i, ++c) { Xp[c] = r; for (unsigned int j = 0; j < indices.size(); ++j, ++r) { Xi.push_back(indices[j]); } } //Save these values for later calculations _nz_prior += length * length; //No. of non-zeros in prior precision if (length > _length_max) { _length_max = length; //Length of longest sampled node } } Xp[c] = r; //Set up sparse representation of the design matrix _x = cholmod_allocate_sparse(nrow, ncol, r, 1, 1, 0, CHOLMOD_REAL, glm_wk); int *_xp = static_cast(_x->p); int *_xi = static_cast(_x->i); copy(Xp.begin(), Xp.end(), _xp); copy(Xi.begin(), Xi.end(), _xi); // At this point, all elements of _fixed are set to false, so // a call to calDesign calculates the whole design matrix calDesign(); // In future calls to calDesign, we do not want to recalculate // fixed linear terms. for (unsigned int i = 0; i < sub_views.size(); ++i) { // FIXME: For future reference, we will need to make sure this // still works correctly for log-linear models. _fixed[i] = checkLinear(sub_views[i], true, true); } } GLMMethod::~GLMMethod() { while(!_outcomes.empty()) { delete _outcomes.back(); _outcomes.pop_back(); } cholmod_free_sparse(&_x, glm_wk); } /* Symbolic analysis of the posterior precision matrix for the Cholesky decomposition. This only needs to be done once, when the GLMMethod is craeted. It is a stripped-down version of the code in update. Note that the values of the sparse matrices are never referenced. */ void GLMMethod::symbolic() { unsigned int nrow = _view->length(); // Prior contribution cholmod_sparse *Aprior = cholmod_allocate_sparse(nrow, nrow, _nz_prior, 1, 1, 0, CHOLMOD_PATTERN, glm_wk); int *Ap = static_cast(Aprior->p); int *Ai = static_cast(Aprior->i); int c = 0; int r = 0; vector const &snodes = _view->nodes(); for (vector::const_iterator p = snodes.begin(); p != snodes.end(); ++p) { StochasticNode *snode = *p; unsigned int length = snode->length(); /* Fixme: we're assuming the prior precision of each node is dense, whereas it may be sparse. */ int cbase = c; //first column in this diagonal block for (unsigned int j = 0; j < length; ++j, ++c) { Ap[c] = r; for (unsigned int i = 0; i < length; ++i, ++r) { Ai[r] = cbase + i; } } } Ap[c] = r; // Likelihood contribution cholmod_sparse *t_x = cholmod_transpose(_x, 0, glm_wk); cholmod_sort(t_x, glm_wk); cholmod_sparse *Alik = cholmod_aat(t_x, 0, 0, 0, glm_wk); cholmod_sparse *A = cholmod_add(Aprior, Alik, 0, 0, 0, 0, glm_wk); //Free working matrices cholmod_free_sparse(&t_x, glm_wk); cholmod_free_sparse(&Aprior, glm_wk); cholmod_free_sparse(&Alik, glm_wk); A->stype = -1; _factor = cholmod_analyze(A, glm_wk); cholmod_free_sparse(&A, glm_wk); } void GLMMethod::calCoef(double *&b, cholmod_sparse *&A) { // The log of the full conditional density takes the form // -(t(x) %*% A %*% x - 2 * b %*% x)/2 // where A is the posterior precision and the mean mu solves // A %*% mu = b // For computational convenience we take xold, the current value // of the sampled nodes, as the origin unsigned int nrow = _view->length(); b = new double[nrow]; cholmod_sparse *Aprior = cholmod_allocate_sparse(nrow, nrow, _nz_prior, 1, 1, 0, CHOLMOD_REAL, glm_wk); // Set up prior contributions to A, b int *Ap = static_cast(Aprior->p); int *Ai = static_cast(Aprior->i); double *Ax = static_cast(Aprior->x); //FIXME. We are assuming contributions to prior are dense int c = 0; int r = 0; vector const &snodes = _view->nodes(); for (vector::const_iterator p = snodes.begin(); p != snodes.end(); ++p) { StochasticNode *snode = *p; double const *priormean = snode->parents()[0]->value(_chain); double const *priorprec = snode->parents()[1]->value(_chain); double const *xold = snode->value(_chain); unsigned int length = snode->length(); int cbase = c; //first column of this diagonal block for (unsigned int i = 0; i < length; ++i, ++c) { b[c] = 0; Ap[c] = r; for (unsigned int j = 0; j < length; ++j, ++r) { b[c] += priorprec[i + length*j] * (priormean[j] - xold[j]); Ai[r] = cbase + j; Ax[r] = priorprec[i + length*j]; } } } Ap[c] = r; // Recalculate the design matrix, if necessary calDesign(); // Likelihood contributions // // b += t(X) %*% tau %*% (Y - mu) // A += t(X) %*% tau %*% X // where // - X is the design matrix // - tau is the (diagonal) variance matrix of the stochastic children // - mu is the mean of the stochastic children // - Y is the value of the stochastic children /* FIXME: We can also transpose _x into a pre-defined sparse matrix. Try this with the lsat example to see what speed-up it gives. */ cholmod_sparse *t_x = cholmod_transpose(_x, 1, glm_wk); cholmod_sort(t_x, glm_wk); //Needed for multivariate outcomes int *Tp = static_cast(t_x->p); int *Ti = static_cast(t_x->i); double *Tx = static_cast(t_x->x); /* //FIXME: reusing previously defined c,r here for (c = 0; c < t_x->ncol; ++c) { double tau = _outcomes[c]->precision(); double delta = tau * (_outcomes[c]->value() - _outcomes[c]->mean()); //double sigma = sqrt(tau); for (r = Tp[c]; r < Tp[c+1]; ++r) { b[Ti[r]] += Tx[r] * delta; //Tx[r] *= sigma; Tx[r] *= tau; } } */ //FIXME: reusing previously defined c,r here c = 0; for (unsigned int i = 0; i < _outcomes.size(); ++i) { unsigned int m = _outcomes[i]->length(); if (m == 1) { //Scalar outcome double tau = _outcomes[i]->precision(); double delta = tau * (_outcomes[i]->value() - _outcomes[i]->mean()); for (r = Tp[c]; r < Tp[c+1]; ++r) { b[Ti[r]] += Tx[r] * delta; Tx[r] *= tau; } } else { //Multivariate outcome double const *tau = _outcomes[i]->vprecision(); double const *Y = _outcomes[i]->vvalue(); double const *mu = _outcomes[i]->vmean(); vector delta(m,0); for (unsigned int j = 0; j < m; ++j) { for (unsigned int k = 0; k < m; ++k) { delta[j] += tau[m*j+k] * (Y[k] - mu[k]); } } /* Sanity checks */ int nzrow = Tp[c+1] - Tp[c]; for (r = Tp[c]; r < Tp[c+1]; ++r) { int row = Ti[r]; for (unsigned int j = 0; j < m; ++j) { unsigned int col = c + j; if (Tp[col+1] - Tp[col] != nzrow) { string ms("non-zero pattern mismatch in GLMMethod"); throwLogicError(ms); } if (Ti[r+j*nzrow] != row) { string ms("row order mismatch in GLMMethod"); throwLogicError(ms); } } } /* We assume that all columns of t_x corresponding to the same outcome have the same non-zero pattern and the columns are sorted. */ vector TxTau(m); // t_x %*% tau for (r = Tp[c]; r < Tp[c+1]; ++r) { for (unsigned int j = 0; j < m; ++j) { b[Ti[r]] += Tx[r + j*nzrow] * delta[j]; TxTau[j] = 0.0; for (unsigned int k = 0; k < m; ++k) { TxTau[j] += Tx[r + k*nzrow] * tau[m*j+k]; } } for (unsigned int j = 0; j < m; ++j) { Tx[r + j*nzrow] = TxTau[j]; } } } c += m; } cholmod_sparse *Alik = cholmod_ssmult(t_x, _x, CHOLMOD_REAL, 1, 0, glm_wk); cholmod_free_sparse(&t_x, glm_wk); double one[2] = {1, 0}; A = cholmod_add(Aprior, Alik, one, one, 1, 0, glm_wk); cholmod_free_sparse(&Aprior, glm_wk); cholmod_free_sparse(&Alik, glm_wk); } bool GLMMethod::isAdaptive() const { return false; } void GLMMethod::adaptOff() { } bool GLMMethod::checkAdaptation() const { return true; } }} JAGS-4.3.2/src/modules/glm/samplers/KS.cc0000664000175000017500000000655014224052371014665 00000000000000#include #include "KS.h" #include #include #define PI 3.141592653589793238462643383280 #define PI_SQUARE 9.86960440108936 using std::log; using std::exp; using std::pow; using std::sqrt; using std::fabs; namespace jags { static bool r_intvl(double u, double lambda) { // Rejection algorithm based on an alternating series expansion // of the KS distribution. This is valid for lambda > 4/3 if (u==0) { return false; } double z = 1; double x = exp(-lambda/2); int j = 0; while(true) { j++; int j2 = (j+1)*(j+1); z -= j2 * pow(x, j2 - 1); if (z > u) return true; j++; j2 = (j+1)*(j+1); z += j2 * pow(x, j2 - 1); if (z < u) return false; } } static bool l_intvl(double u, double lambda) { // Rejection algorithm based on an alternating series expansion // of the KS distribution. This is valid for lambda < pi^2 if (u==0) { return false; // Avoid numerical problems with log(u) } if (lambda < 1E-3) { return false; //Acceptance probability -> 0 in this range } double h = 0.5*log(2.0) + 2.5*log(PI) - 2.5*log(lambda) - PI_SQUARE/(2 * lambda) + 0.5*lambda; double logu = log(u); double z = 1; double x = exp(-PI_SQUARE/(2*lambda)); double k = lambda / PI_SQUARE; int j = 0; while(true) { j++; z -= k*pow(x, j*j-1); if (h + log(z) > logu) return true; j++; int j2 = (j+1)*(j+1); z += j2*pow(x,j2-1); if (h + log(z) < logu) return false; } } static bool accept(double lambda, RNG *rng) { // Accepts or rejects proposal lambda generated from a GIG // distribution. The rejection algorithm is proposed by Holmes // and Held (2006) and adapted from the original algorithm for // sampling from the KS distribution by Devroye (1986). // We use separate alternating series expansions for lambda <= // 3.1039 and lambda > 3.1039. This cut-off was chosen after // numerical investigation of the series expansions to optimize // convergence. With this cutoff, the error is no more than // 3.6E-5 when the expansion is truncated to the first // term. Hence, although both l_intvl and r_intvl contain infinite // loops, they will exit almost immediately. double u = rng->uniform(); return lambda > 3.1039 ? r_intvl(u, lambda) : l_intvl(u, lambda); } static double gig(double delta, RNG *rng) { // Draws a sample from the generalized inverse gaussian distribution // GIG(0.5, 1, delta^2) = delta/IG(1, delta). // // The IG (Inverse Gaussian) distribution is sampled using the // algorithm of Michael, Schucany and Haas (1976) as described by // Devroye (1986). // // Note that as delta -> 0, GIG(0.5, 1, delta^2) tends to a // chisquare distribution on 1 df. We use this approximation for // small delta. double y = rng->normal(); y = y * y; if (delta <= 1.0E-6 * y) { // Inversion is numerically unstable for delta/y < 1.E-8 return y; } else { y = 1 + (y - sqrt(y * (4*delta + y))) / (2*delta); return (rng->uniform() <= 1/(1 + y)) ? delta/y : delta*y; } } namespace glm { double sample_lambda(double delta, RNG *rng) { delta = fabs(delta); while (true) { //Acceptance probability is at least 0.24 for all delta double lambda = gig(delta, rng); if (accept(lambda, rng)) return lambda; } } }} JAGS-4.3.2/src/modules/glm/samplers/IWLSFactory.cc0000664000175000017500000000333514224052515016454 00000000000000#include #include "IWLSFactory.h" #include "IWLS.h" #include "NormalLinear.h" #include "IWLSOutcome.h" #include #include using std::vector; using std::string; namespace jags { namespace glm { IWLSFactory::IWLSFactory() : GLMFactory("glm::IWLS") {} bool IWLSFactory::checkOutcome(StochasticNode const *snode) const { return NormalLinear::canRepresent(snode) || IWLSOutcome::canRepresent(snode); } GLMMethod * IWLSFactory::newMethod(GraphView const *view, vector const &sub_views, unsigned int chain, bool gibbs) const { bool linear = true; vector outcomes; for (vector::const_iterator p = view->stochasticChildren().begin(); p != view->stochasticChildren().end(); ++p) { Outcome *outcome = 0; if (NormalLinear::canRepresent(*p)) { outcome = new NormalLinear(*p, chain); } else if (IWLSOutcome::canRepresent(*p)) { outcome = new IWLSOutcome(*p, chain); linear = false; } outcomes.push_back(outcome); } if (linear) { return new GLMBlock(view, sub_views, outcomes, chain); } return new IWLS(view, sub_views, outcomes, chain); } bool IWLSFactory::canSample(StochasticNode const *snode) const { vector const &parents = snode->parents(); for (unsigned int i = 0; i < parents.size(); ++i) { if (!parents[i]->isFixed()) return false; } return !isBounded(snode); } bool IWLSFactory::fixedDesign() const { return true; } }} JAGS-4.3.2/src/modules/glm/samplers/IWLS.cc0000664000175000017500000000632214224052371015123 00000000000000#include #include "IWLS.h" #include #include //#include #include #include #include #include #include extern "C" { #include } extern cholmod_common *glm_wk; using std::string; using std::vector; using std::exp; using std::fabs; using std::log; using std::copy; static double logDet(cholmod_factor *F) { //NB Requiring simplicial factorization here. See glm.cc. double *Fx = static_cast(F->x); int *Fp = static_cast(F->p); double y = 0; for (unsigned int r = 0; r < F->n; ++r) { y += log(Fx[Fp[r]]); } return F->is_ll ? 2*y : y; } #define MAX_ITER 100 namespace jags { namespace glm { IWLS::IWLS(GraphView const *view, vector const &sub_views, vector const &outcomes, unsigned int chain) : GLMBlock(view, sub_views, outcomes, chain) { } double IWLS::logPTransition(vector const &xold, vector const &xnew, double *b, cholmod_sparse *A) { A->stype = -1; int ok = cholmod_factorize(A, _factor, glm_wk); if (!ok) { throwRuntimeError("Cholesky decomposition failure in IWLS"); } unsigned int n = _factor->n; //Difference between new and old values vector dx(n); for (unsigned int i = 0; i < n; ++i) { dx[i] = xnew[i] - xold[i]; } //Make permuted copy of b cholmod_dense *w = cholmod_allocate_dense(n, 1, n, CHOLMOD_REAL, glm_wk); int *perm = static_cast(_factor->Perm); double *wx = static_cast(w->x); for (unsigned int i = 0; i < n; ++i) { wx[i] = b[perm[i]]; } //Posterior mean cholmod_dense *mu = cholmod_solve(CHOLMOD_LDLt, _factor, w, glm_wk); double *mux = static_cast(mu->x); //Setup pointers to sparse matrix A int *Ap = static_cast(A->p); int *Ai = static_cast(A->i); double *Ax = static_cast(A->x); double deviance = 0; for (unsigned int r = 0; r < n; ++r) { double Adr = 0; for (int j = Ap[r]; j < Ap[r+1]; ++j) { Adr += Ax[j] * dx[Ai[j]]; } deviance += dx[r] * (Adr - 2 * b[r]) + wx[r] * mux[r]; } deviance -= logDet(_factor); cholmod_free_dense(&w, glm_wk); cholmod_free_dense(&mu, glm_wk); return -deviance/2; } void IWLS::update(RNG *rng) { /* if (_init) { for (unsigned int i = 0; i < MAX_ITER; ++i) { GLMBlock::update(rng, false); } _init = false; return; } */ double *b1, *b2; cholmod_sparse *A1, *A2; double logp = 0; vector xold(_view->length()); _view->getValue(xold, _chain); calCoef(b1, A1); logp -= _view->logFullConditional(_chain); GLMBlock::update(rng); logp += _view->logFullConditional(_chain); vector xnew(_view->length()); _view->getValue(xnew, _chain); calCoef(b2, A2); logp -= logPTransition(xold, xnew, b1, A1); logp += logPTransition(xnew, xold, b2, A2); cholmod_free_sparse(&A1, glm_wk); cholmod_free_sparse(&A2, glm_wk); delete [] b1; delete [] b2; if (logp < 0 && rng->uniform() > exp(logp)) { _view->setValue(xold, _chain); //reject proposal } } }} JAGS-4.3.2/src/modules/glm/samplers/LGMix.cc0000664000175000017500000004406214224052515015330 00000000000000/* * This code was initially written by Rudolf Fruehwirth (Institut fuer * Hochenergiephysik Oesterreichische Akademie der Wissenschaften, * Nikolsdorfer Gasse 18, 1050 Wien), and later adapted to GMRFLib by * H.Rue, then adapted to JAGS by Martyn Plummer. * * This routine approximates the negative log-gamma distribution, with density * * exp(-n*x - exp(-x)) / Gamma(n) * * by a mixture of normals * * \sum_{i=1}^N weights[i] * N(x; means[i], variances[i]) * * with N components. */ #include #include "LGMix.h" #include #include #include #include #include #include using std::sqrt; using std::vector; using std::max_element; using std::upper_bound; using std::copy; /* * Exact mixture parameters are stored for integer n in the range 1 ... 19. * * For n = 1 ... 4; 10 mixture components are required and the * parameters are stored in the 4 x 10 arrays P10 (weights), M10 * (means) and V10 (variances) * * For n = 5 ... 19; 9 components are required and the parameters are * stored in the 15 x 9 arrays P9 (weights), M9 (means) and V9 * (variances) */ static const double P10[4][10] = { {0.00396984425, 0.0396244597, 0.16776747, 0.147036501, 0.125306271, 0.1014852, 0.103758531, 0.115972617, 0.107065659, 0.0880134482}, {0.00396860865, 0.039627049, 0.16777003, 0.147037759, 0.125304523, 0.101481714, 0.103759705, 0.115973128, 0.107065554, 0.0880119305}, {0.00396904734, 0.0396280642, 0.167770514, 0.14703607, 0.12530043, 0.10148242, 0.103759287, 0.115974323, 0.107066971, 0.0880128738}, {0.00396883344, 0.039627504, 0.167771274, 0.147036659, 0.125301189, 0.101481755, 0.103760036, 0.115974339, 0.107065718, 0.0880126919} }; static const double M10[4][10] = { {3.55887454, 2.11415904, 0.968124631, 0.51537638, 0.145465449, -0.145346445, -0.416660312, -0.689002855, -0.974965634, -1.27310004}, {2.78807754, 1.84979328, 0.94844169, 0.577673108, 0.223449219, -0.0831666379, -0.387174155, -0.69613969, -1.01843553, -1.34112844}, {2.43454312, 1.7315327, 0.942157786, 0.60208557, 0.251664821, -0.0644746918, -0.379817508, -0.696781518, -1.0293035, -1.35705784}, {2.30484474, 1.71231656, 0.952907078, 0.601128034, 0.252368847, -0.059032783, -0.375605704, -0.699071542, -1.03734211, -1.3609072} }; static const double V10[4][10] = { {2.62603032, 1.21263644, 0.66586521, 0.256650604, 0.120071142, 0.0649909219, 0.0473513798, 0.046639443, 0.0576541602, 0.0888536903}, {2.39619753, 1.16995764, 0.688870128, 0.307084756, 0.155644328, 0.0899360571, 0.0707828448, 0.0751755614, 0.0990773728, 0.15471843}, {2.16215586, 1.11062998, 0.682294453, 0.324750601, 0.173204837, 0.108063698, 0.0917073596, 0.100257256, 0.131371692, 0.200024832}, {1.92939547, 1.00671896, 0.638983371, 0.322852776, 0.18445103, 0.122217472, 0.106400052, 0.116936918, 0.154113316, 0.233525098} }; static const double P9[15][9] = { {0.0435820277, 0.167794347, 0.147040722, 0.125310654, 0.10147112, 0.10376347, 0.115973878, 0.107056197, 0.0880075845}, {0.0435817033, 0.167795985, 0.1470426, 0.125311016, 0.101470666, 0.103763084, 0.115972864, 0.107055437, 0.0880066471}, {0.0435798639, 0.167797087, 0.147042073, 0.125313291, 0.101470979, 0.103761847, 0.115973234, 0.107054351, 0.0880072753}, {0.043578895, 0.167797426, 0.147041988, 0.125313875, 0.101470922, 0.103761581, 0.115973137, 0.107054001, 0.0880081751}, {0.0435786725, 0.167797743, 0.1470428, 0.125313553, 0.101470946, 0.103761391, 0.115973188, 0.10705364, 0.0880080663}, {0.0435779307, 0.167797788, 0.147042734, 0.125314068, 0.101471449, 0.10376142, 0.115973187, 0.107053473, 0.0880079505}, {0.043576761, 0.167801375, 0.147042624, 0.125314075, 0.101470546, 0.103761069, 0.115973226, 0.107051966, 0.0880083593}, {0.0435771819, 0.167801103, 0.147042441, 0.125313864, 0.101470305, 0.103761519, 0.11597319, 0.107052417, 0.0880079809}, {0.0435778469, 0.167800486, 0.147041951, 0.125313914, 0.101470076, 0.103761707, 0.115973611, 0.107052756, 0.0880076518}, {0.0435786417, 0.16779926, 0.147042119, 0.125313391, 0.101470554, 0.103762378, 0.115973792, 0.107052537, 0.0880073289}, {0.043581505, 0.167797871, 0.147043608, 0.125312521, 0.101469081, 0.103762173, 0.115973414, 0.107054363, 0.0880054639}, {0.0435811435, 0.167798952, 0.147043687, 0.125312616, 0.101468918, 0.103762052, 0.115973417, 0.107053968, 0.0880052462}, {0.0435812603, 0.167798873, 0.147044518, 0.125312321, 0.101468879, 0.103761729, 0.115972692, 0.107054049, 0.0880056789}, {0.0435808733, 0.167799002, 0.147044529, 0.125312675, 0.101468951, 0.103761472, 0.115972643, 0.107053883, 0.0880059719}, {0.0435807283, 0.167799231, 0.14704464, 0.12531292, 0.101468814, 0.103761275, 0.115972628, 0.107053662, 0.088006103} }; static const double M9[15][9] = { {1.31113348, 0.963928895, 0.659198795, 0.240742429, -0.108844644, -0.252087404, -0.6546691, -1.04146524, -1.37874376}, {1.25919247, 0.957217299, 0.66710982, 0.251658342, -0.125234491, -0.240137829, -0.64912733, -1.03921002, -1.37439461}, {1.21602216, 0.94778507, 0.671484869, 0.265435387, -0.104709908, -0.24708343, -0.653441223, -1.04076324, -1.36988994}, {1.18027937, 0.939725546, 0.67760436, 0.293497817, -0.110879079, -0.257696481, -0.655613756, -1.0406543, -1.36465528}, {1.14996911, 0.934206664, 0.686267712, 0.311595579, -0.112948479, -0.274222612, -0.653808807, -1.04092104, -1.35962481}, {1.12841748, 0.932206841, 0.69102714, 0.319038554, -0.109581301, -0.302963892, -0.641448217, -1.03858769, -1.35274157}, {1.10451126, 0.925180162, 0.689947194, 0.309587296, -0.123979787, -0.239246368, -0.658582798, -1.03932069, -1.347407}, {1.08624068, 0.918081034, 0.697616213, 0.330655882, -0.106424319, -0.290644969, -0.644517493, -1.04099153, -1.34370607}, {1.0671125, 0.915784215, 0.70024231, 0.330800476, -0.125598534, -0.244656951, -0.661886313, -1.04447342, -1.33948264}, {1.05721516, 0.918099637, 0.698999193, 0.325014717, -0.153165358, -0.225909041, -0.659788653, -1.03711782, -1.33064663}, {1.02150943, 0.896206397, 0.702224917, 0.344137939, -0.119895501, -0.256590721, -0.641185291, -1.03810889, -1.32943558}, {1.02508782, 0.902555642, 0.699256309, 0.336391119, -0.121902141, -0.242730179, -0.6538063, -1.0385784, -1.32415888}, {0.997274184, 0.88197491, 0.696155279, 0.3460138, -0.128981232, -0.227346713, -0.630322077, -1.03647508, -1.32316505}, {0.995086849, 0.891409674, 0.70171109, 0.341992158, -0.127906113, -0.245952673, -0.638792902, -1.03392281, -1.31486719}, {0.997741814, 0.892112396, 0.698155553, 0.337731787, -0.122630195, -0.240878604, -0.651951415, -1.02898878, -1.3062535} }; static const double V9[15][9] = { {1.5732832, 0.745075965, 0.340530976, 0.206325108, 0.206977107, 0.133034557, 0.123981078, 0.155417698, 0.247661591}, {1.52550277, 0.745216293, 0.347702459, 0.213195645, 0.220928839, 0.147502243, 0.139478204, 0.17271313, 0.269719569}, {1.48970429, 0.74910777, 0.35810967, 0.221696291, 0.216470192, 0.155837875, 0.148481868, 0.185394632, 0.28822907}, {1.46105103, 0.752441091, 0.365198621, 0.220104509, 0.199190433, 0.167708126, 0.15761138, 0.197076001, 0.304425302}, {1.43764551, 0.754190306, 0.367534375, 0.215776065, 0.185257157, 0.180142183, 0.165402413, 0.206954388, 0.318591695}, {1.41468216, 0.75198881, 0.368357589, 0.215271168, 0.178178434, 0.198636491, 0.176790288, 0.218155881, 0.332156859}, {1.39851898, 0.755429842, 0.377058085, 0.229287048, 0.214645547, 0.18489307, 0.178139004, 0.226237823, 0.343708183}, {1.38111403, 0.759024378, 0.379809227, 0.222659694, 0.185443843, 0.206181273, 0.184773494, 0.231840962, 0.353714302}, {1.36922993, 0.759197249, 0.381687395, 0.225704876, 0.199623554, 0.195711194, 0.18270427, 0.236837387, 0.363050264}, {1.35398708, 0.753650144, 0.381381699, 0.231057971, 0.208319112, 0.210190241, 0.194957855, 0.249236388, 0.373774124}, {1.35652837, 0.774748407, 0.400413698, 0.238592235, 0.199467639, 0.230239828, 0.19924794, 0.251600772, 0.380054821}, {1.33546695, 0.763749521, 0.396745563, 0.241905327, 0.212176877, 0.218950701, 0.201882762, 0.257807637, 0.388524892}, {1.33575722, 0.781739895, 0.417799104, 0.256728889, 0.211230256, 0.254750255, 0.208700024, 0.26087813, 0.393822372}, {1.3227643, 0.771070524, 0.406631212, 0.249617029, 0.210958958, 0.249496089, 0.214362668, 0.270024593, 0.402615529}, {1.30630549, 0.765952536, 0.407914566, 0.255018833, 0.226289944, 0.236887588, 0.221124118, 0.280039124, 0.411219814} }; /* * For n >= 20, approximate mixture parameters are calculated using a * rational approximation (see function rational_approx below). The * coefficients of the rational function are stored in an ncomp x 4 * array, where ncomp is the number of components in the approximation. * * Separate coefficents are used for n in the ranges: * (20...49) - 4 components * (50...439) - 3 components * (440...1599) - 2 components * (1600...9999) - 2 components * (1000 ... 30000) - 2 components * * For n > 30000, only a single component is required. In other words * the log-gamma distribution is approximated well by a single normal * distribution. * * Note that the coefficients for (20...49) are given to 12 decimal * places, whereas the others are given to 15 decimal places. This is * the way they were given in the GMRF library. */ /* * n from 20 to 49 */ static const double Coef_p3[4][4] = { {-5.644536495326e-09, -1.266992312621e-06, 0.000000000000e+00, 4.730022618640e+00}, {7.299190941772e-09, 1.387196986613e-06, 0.000000000000e+00, 3.672627139064e+00}, {-1.788056445701e-08, -2.391966642312e-06, 0.000000000000e+00, 4.871566292199e+00}, {9.259794020097e-09, 1.224613603301e-06, 0.000000000000e+00, 3.215154075256e+00} }; static const double Coef_m3[4][4] = { {4.552797222246e-05, 4.638009105861e-02, 9.627160143020e-02, 1.143772956136e+00}, {2.284729919322e-05, -1.095058888700e-02, -1.690501643196e-02, 1.944583776810e+00}, {-3.900177124794e-05, 4.731686443506e-02, -5.610095109269e-01, -6.033854619021e+00}, {-2.486737015928e-05, 2.978371498898e-02, -4.643825308040e-02, -1.105498133467e+00} }; static const double Coef_v3[4][4] = { {-2.191015160635e-05, 9.939739739229e-02, 9.208564449364e-02, 7.148740127686e-01}, {7.060864706965e-05, 1.143203813438e-01, 1.548617268518e-01, 2.428636911969e+00}, {1.823003483481e-04, 1.675101633325e-01, 2.735383307281e-01, 4.861423133312e+00}, {1.613752763707e-04, 1.943336591437e-01, 2.797653349940e-01, 3.840341872065e+00} }; /* * n from 50 to 439 */ static const double Coef_p4[3][4] = { {-5.639545796991280e-10, 4.698743002874532e-07, 0.000000000000000e+00, 4.730482920811330e+00}, {2.651836392450035e-10, -1.280380156002802e-07, 0.000000000000000e+00, 2.093982718501769e+00}, {-2.384482520627535e-11, -1.227680572544847e-07, 0.000000000000000e+00, 3.214956149674574e+00} }; static const double Coef_m4[3][4] = { {-1.653173201148335e-06, 1.036578627632170e-02, 2.349390607953272e-02, 1.432904956685477e+00}, {-8.298537364426537e-07, 5.017456263052972e-03, 5.123168011502721e-02, 6.453910704667408e+00}, {-1.431525987300163e-06, 8.386323466104711e-03, -1.841057020139425e-02, -1.410602407670769e+00} }; static const double Coef_v4[3][4] = { {-2.726183914412441e-07, 2.788507874891710e-02, 2.777086294607445e-02, 8.369406298984288e-01}, {1.118379212729684e-06, 2.433214514397419e-02, 2.778340896223197e-02, 1.489387981224663e+00}, {2.197737873275589e-06, 3.186581505796005e-02, 3.808382220884354e-02, 1.958805931276004e+00} }; /* * n from 440 to 1599 */ static const double Coef_p5[2][4] = { {1.034981541036597e-10, -2.445177000398938e-07, 0.000000000000000e+00, 1.451229377475864e+00}, {-2.291586556531707e-10, 5.414543692806514e-07, 0.000000000000000e+00, 3.216167113242079e+00} }; static const double Coef_m5[2][4] = { {-6.578325435644067e-08, 1.648723149067166e-03, 1.594968525045459e-02, 5.566082591106806e+00}, {-6.292364160498604e-08, 1.618047470065775e-03, -7.091699113800587e-03, -2.516741952410371e+00} }; static const double Coef_v5[2][4] = { {-2.802162650788337e-09, 4.051503597935380e-03, 4.018981069179972e-03, 9.654061278849895e-01}, {3.776558110733883e-08, 5.022619018941299e-03, 5.525253413878772e-03, 1.450507513327352e+00} }; /* * n from 1600 to 9999 */ static const double Coef_p6[2][4] = { {-1.586037487404490e-13, 3.575996226727867e-09, 0.000000000000000e+00, 2.228310599179340e+00}, {1.291237745205579e-13, -2.911316152726367e-09, 0.000000000000000e+00, 1.814126328168031e+00} }; static const double Coef_m6[2][4] = { {-2.419956255676409e-09, 3.245753451748892e-04, 1.895335618211674e-03, 3.388553853864067e+00}, {-2.419411092563945e-09, 3.245669014250788e-04, -2.327930564510444e-03, -4.162274939236667e+00} }; static const double Coef_v6[2][4] = { {-6.024563976875348e-11, -6.540694956580495e-04, -6.582951415419203e-04, 1.006399508694657e+00}, {5.024317053887777e-10, 8.898044793516080e-04, 9.246987493760628e-04, 1.149073788967684e+00} }; /* * n from 10000 to 30000 */ static const double Coef_p7[2][4] = { {-1.663426552872397e-14, 1.141056828884990e-09, 0.000000000000000e+00, 2.228285989630589e+00}, {1.354267905471566e-14, -9.289835742028532e-10, 0.000000000000000e+00, 1.814142639751731e+00} }; static const double Coef_m7[2][4] = { {-8.929405559006038e-11, 6.319814700961324e-05, 4.785131212048377e-04, 4.271922830906078e+00}, {-8.931137480031157e-11, 6.320244393309693e-05, -5.877524860249395e-04, -5.247218808668549e+00} }; static const double Coef_v7[2][4] = { {-1.418731402291282e-12, -5.512224505288543e-06, -5.638714069888806e-06, 1.006201804172733e+00}, {1.576782807097003e-11, 1.914006058179041e-04, 1.959753272178233e-04, 1.087101027065273e+00} }; /* * Approximate mixture parameters using a rational function that is * quadratic in the numerator and linear in the denominator. The * coefficients are in an ncomp x 4 array. If the elements of a row * are a,b,c,d then the rational approximation is: * * (a * n^2 + b * n + 1)/(c * n + d) * */ static void rational_approx(double n, const double (*coef)[4], int ncomp, double *out) { for (int i = 0; i < ncomp; i++) { double num = coef[i][0] * n * n + coef[i][1] * n + 1; double denom = coef[i][2] * n + coef[i][3]; out[i] = num / denom; } } namespace jags { namespace glm { LGMix::LGMix(double n) : _n(n), _r(0), _ncomp(0) { if (n > 0) updateShape(n); } /* * Exact mixture parameters for all integer n less than 20 */ void LGMix::updateShapeExact(int n) { if (n < 5) { _ncomp = 10; n -= 1; copy(P10[n], P10[n] + _ncomp, _weights); copy(M10[n], M10[n] + _ncomp, _means); copy(V10[n], V10[n] + _ncomp, _variances); } else { _ncomp = 9; n -= 5; copy(P9[n], P9[n] + _ncomp, _weights); copy(M9[n], M9[n] + _ncomp, _means); copy(V9[n], V9[n] + _ncomp, _variances); } } /* * Approximate mixture parameters for n >= 20 using rational functions */ void LGMix::updateShapeApprox(double n) { //Upper limit of range of n supported by each approximation const int upper[5] = {50, 440, 1600, 10000, 30000}; //Number of components in each approximation const int ncomp[5] = {4, 3, 2, 2, 2}; //Each element of P,M,V is a 3-dimensional ragged array. //C array syntax doesn't make this evident const double (*P[5])[4] = {Coef_p3, Coef_p4, Coef_p5, Coef_p6, Coef_p7}; const double (*M[5])[4] = {Coef_m3, Coef_m4, Coef_m5, Coef_m6, Coef_m7}; const double (*V[5])[4] = {Coef_v3, Coef_v4, Coef_v5, Coef_v6, Coef_v7}; // Find appropriate range and calculate approximate coefficients for (int r = 0; r < 5; r++) { if (n < upper[r]) { rational_approx(n, P[r], ncomp[r], _weights); rational_approx(n, M[r], ncomp[r], _means); rational_approx(n, V[r], ncomp[r], _variances); _ncomp = ncomp[r]; return; } } //Single component for n > 30000 _weights[0] = 1; _means[0] = 0; _variances[0] = 1; _ncomp = 1; } void LGMix::updateShape(double n) { if (n <= 0) { throwLogicError("shape out of range in LGMix::updateShape"); } else if (n < 20) { int nr = static_cast(n); if (nr != n) { throwLogicError("Invalid shape in LGMix::updateShape"); } updateShapeExact(nr); } else { updateShapeApprox(n); } // Rescale by mean and standard deviation of the negative // log-gamma distribution double mu = -digamma(n); double sigma2 = trigamma(n); double sigma = sqrt(sigma2); for (int i = 0; i < _ncomp; i++) { _means[i] = _means[i] * sigma + mu; _variances[i] *= sigma2; } _n = n; } void LGMix::update(double z, double n, RNG *rng) { // Check whether value of n has changed since last update if (n != _n) updateShape(n); //Log probabilities vector p(_ncomp); for (int i = 0; i < _ncomp; i++) { p[i] = dnorm(z, _means[i], sqrt(_variances[i]), true) + log(_weights[i]); } double maxp = *max_element(p.begin(), p.end()); //Cumulative probabilities (unnormalized) double sump = 0.0; for (int i = 0; i < _ncomp; i++) { sump += exp(p[i] - maxp); p[i] = sump; } //Sample _r from cumulative probabilities double u = rng->uniform() * sump; _r = upper_bound(p.begin(), p.end(), u) - p.begin(); } double LGMix::mean() const { return _means[_r]; } double LGMix::precision() const { return 1/_variances[_r]; } void LGMix::getParameters(vector &weights, vector &means, vector &variances) { weights.clear(); means.clear(); variances.clear(); for (int i = 0; i < _ncomp; ++i) { weights.push_back(_weights[i]); means.push_back(_means[i]); variances.push_back(_variances[i]); } } }} JAGS-4.3.2/src/modules/glm/samplers/AuxMixPoisson.cc0000664000175000017500000000565214224052515017140 00000000000000#include #include "AuxMixPoisson.h" #include "LGMix.h" #include "Classify.h" #include #include #include #include using std::exp; namespace jags { namespace glm { AuxMixPoisson::AuxMixPoisson(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _y(snode->value(chain)[0]), _mix1(0), _mix2(0), _tau1(0), _tau2(0) { _mix1 = new LGMix(1); _mix2 = new LGMix(_y); } AuxMixPoisson::~AuxMixPoisson() { delete _mix1; delete _mix2; } void AuxMixPoisson::update(RNG * rng) { //Time of y'th jump if (_y == 0) { _tau2 = 0; } else { _tau2 = rbeta(_y, 1, rng); _mix2->update(-log(_tau2) - _lp, _y, rng); } //Inter-arrival time to (y+1)'th jump double xi = rng->exponential() / exp(_lp); _tau1 = 1 - _tau2 + xi; _mix1->update(-log(_tau1) - _lp, 1, rng); } /* void AuxMixPoisson::update(double mean, double var, RNG *rng) { double mu1 = _mix1->mean(); double var1 = _mix1->variance()); //Time of y'th jump if (_y == 0) { _tau2 = 0; double nl_tau1 = rnormal(0, rng, mean + mu1, sqrt(var + var1)); _tau1 = exp(-nl_tau1); } else { Somewhat complicated Gibbs update: we use the parameterization -log(taui) = lp + ri; for i = 1,2 where lp is the linear predictor, and ri is the residual, with mean and variance given by _mixi. Components lp, r1, r2 have independent normal priors (conditional on current mixture approximation) but are subject to constraints tau1 <= 1 and tau1 + tau2 > 1. double r1 = -log(_tau1) - _lp; double r2 = -log(_tau2) - _lp; // Update lp given r1, r2 double lp_lower = -r1; double lp_upper = log(exp(-r1) + exp(-r2)); double lp = inormal(lp_lower, lp_upper, rng, mean, var); double mu2 = _mix2->mean(); double var2 = _mix2->variance(); // Update _tau2 given lp, _tau1 _tau1 = exp(-r1 - lp); if (_tau1 < 1) { _tau2 = exp(-inormal(0, -log(1 - _tau1), rng, lp + mu2, sqrt(var2))); } else { _tau2 = exp(-lnormal(0, rng, lp + mu2, sqrt(var2))); } // Update _tau1 given lp, _tau2 _tau1 = exp(-rnormal(-log(1 - _tau2), rng, lp + mu1, sqrt(var1))); } } */ double AuxMixPoisson::precision() const { if (_y == 0) { return _mix1->precision(); } else { return _mix1->precision() + _mix2->precision(); } } double AuxMixPoisson::value() const { if (_y == 0) { return -(_mix1->mean() + log(_tau1)); } else { double w1 = _mix1->precision(); double y1 = -(_mix1->mean() + log(_tau1)); double w2 = _mix2->precision(); double y2 = -(_mix2->mean() + log(_tau2)); return (y1*w1 + y2*w2)/(w1 + w2); } } bool AuxMixPoisson::canRepresent(StochasticNode const *snode) { return getFamily(snode) == GLM_POISSON && getLink(snode) == LNK_LOG; } }} JAGS-4.3.2/src/modules/glm/samplers/AuxMixBinomial.cc0000664000175000017500000000347714224052515017243 00000000000000#include #include "AuxMixBinomial.h" #include "LGMix.h" #include "Classify.h" #include #include #include #include #include using std::exp; namespace jags { namespace glm { static const double one = 1; static double const &getDenominator(StochasticNode const *snode, unsigned int chain) { switch(getFamily(snode)) { case GLM_BERNOULLI: return one; case GLM_BINOMIAL: return snode->parents()[1]->value(chain)[0]; default: throwLogicError("Invalid outcome in AuxMixBinomial"); } return one; //Wall } AuxMixBinomial::AuxMixBinomial(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _nb(getDenominator(snode, chain)), _y(snode->value(chain)[0]), _y_star(0), _mix(0) { _mix = new LGMix(_nb); } AuxMixBinomial::~AuxMixBinomial() { delete _mix; } void AuxMixBinomial::update(RNG *rng) { if (_nb == 0) return; // sample the aggregated utility double lambda = exp(_lp); double u = rgamma(_nb, 1.0, rng); double v = 0.0; if (static_cast(_y) < static_cast(_nb)) { v = rgamma(_nb - _y, 1.0, rng); } _y_star = -log(u / (1.0 + lambda) + v / lambda); // ...then the mixture representation _mix->update(_y_star - _lp, _nb, rng); } double AuxMixBinomial::value() const { if (_nb == 0) { return 0; } else { return _y_star - _mix->mean(); } } double AuxMixBinomial::precision() const { if (_nb == 0) { return 0; } else { return _mix->precision(); } } bool AuxMixBinomial::canRepresent(StochasticNode const *snode) { return (getFamily(snode) == GLM_BINOMIAL || getFamily(snode) == GLM_BERNOULLI) && getLink(snode) == LNK_LOGIT; } }} JAGS-4.3.2/src/modules/glm/samplers/Outcome.cc0000664000175000017500000000270614224052515015762 00000000000000#include "Outcome.h" #include "Classify.h" #include #include #include namespace jags { namespace glm { static Node const *getLinearPredictor(StochasticNode const *snode) { if (getFamily(snode) == GLM_UNKNOWN) { throwLogicError("Invalid distribution in glm::Outcome"); } Node const *lp = snode->parents()[0]; LinkNode const *ln = dynamic_cast(lp); if (ln) { lp = ln->parents()[0]; } return lp; } Outcome::Outcome(StochasticNode const *snode, unsigned int chain) : _lp(getLinearPredictor(snode)->value(chain)[0]), _length(snode->length()), _vmean(getLinearPredictor(snode)->value(chain)) { } Outcome::~Outcome() { } double Outcome::mean() const { return _lp; } void Outcome::update(RNG *rng) { } void Outcome::update(double mean, double var, RNG *rng) { } double Outcome::logMHRatio() const { return 0; } bool Outcome::fixedb() const { return false; } bool Outcome::fixedA() const { return false; } unsigned int Outcome::length() const { return _length; } double const *Outcome::vmean() const { return _vmean; } double const *Outcome::vprecision() const { //FIXME: Bit of a hack return 0; } double const *Outcome::vvalue() const { //FIXME: Bit of a hack return 0; } }} JAGS-4.3.2/src/modules/glm/samplers/NormalLinear.cc0000664000175000017500000000141714224052371016730 00000000000000#include #include "NormalLinear.h" #include "Classify.h" #include namespace jags { namespace glm { NormalLinear::NormalLinear(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _value(snode->value(chain)[0]), _precision(snode->parents()[1]->value(chain)[0]) { } double NormalLinear::value() const { return _value; } double NormalLinear::precision() const { return _precision; } bool NormalLinear::canRepresent(StochasticNode const *snode) { return getFamily(snode) == GLM_NORMAL && getLink(snode) == LNK_LINEAR; } bool NormalLinear::fixedb() const { return true; } bool NormalLinear::fixedA() const { return true; } }} JAGS-4.3.2/src/modules/glm/samplers/BinaryProbit.cc0000664000175000017500000000273614224052515016756 00000000000000#include "BinaryProbit.h" #include "Classify.h" #include #include #include using std::sqrt; namespace jags { namespace glm { BinaryProbit::BinaryProbit(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _y(snode->value(chain)[0]), _z(0) { //Fixme: sanity checks on snode } double BinaryProbit::value() const { return _z; } double BinaryProbit::precision() const { return 1; } void BinaryProbit::update(RNG *rng) { if (_y) { _z = lnormal(0, rng, _lp, 1); } else { _z = rnormal(0, rng, _lp, 1); } } void BinaryProbit::update(double mean, double var, RNG *rng) { if (_y) { _z = lnormal(0, rng, mean, sqrt(var + 1)); } else { _z = rnormal(0, rng, mean, sqrt(var + 1)); } } bool BinaryProbit::canRepresent(StochasticNode const *snode) { Node const *N = 0; switch(getFamily(snode)) { case GLM_BERNOULLI: break; case GLM_BINOMIAL: // We can also model binomial distribution if the denominator is fixed to be 1. N = snode->parents()[1]; if (N->length() != 1) return false; if (!N->isFixed()) return false; if (N->value(0)[0] != 1) return false; break; default: return false; } return getLink(snode) == LNK_PROBIT; } bool BinaryProbit::fixedA() const { return true; } }} JAGS-4.3.2/src/modules/glm/samplers/BinaryLogit.cc0000664000175000017500000000433514224052515016572 00000000000000#include "BinaryLogit.h" #include "Classify.h" #include "KS.h" #include #include #include #include using std::exp; using std::log; using std::sqrt; #define REG_PENALTY 0.001 //Left truncated logistic distribution static double llogit(double left, jags::RNG *rng, double mu) { double qleft = 1/(1 + exp(mu-left)); double x = qleft + (1 - qleft) * rng->uniform(); return mu + log(x) - log(1 - x); } //Right truncated logistic distribution static double rlogit(double right, jags::RNG *rng, double mu) { double qright = 1/(1 + exp(mu-right)); double x = qright * rng->uniform(); return mu + log(x) - log(1 - x); } namespace jags { namespace glm { BinaryLogit::BinaryLogit(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _y(snode->value(chain)[0]), _z(0), _tau(1), _sigma2(1) { //fixme: sanity checks on snode } double BinaryLogit::value() const { return _z; } double BinaryLogit::precision() const { return _tau; } void BinaryLogit::update(RNG *rng) { /* Albert Chib update */ if (_y) { _z = llogit(0, rng, _lp); } else { _z = rlogit(0, rng, _lp); } _sigma2 = sample_lambda(_z - _lp, rng); _tau = REG_PENALTY + 1/_sigma2; } void BinaryLogit::update(double mean, double var, RNG *rng) { /* Holmes-Held update */ if (_y) { _z = lnormal(0, rng, mean, sqrt(var + _sigma2)); } else { _z = rnormal(0, rng, mean, sqrt(var + _sigma2)); } } bool BinaryLogit::canRepresent(StochasticNode const *snode) { //FIXME: Big overlap with BinaryProbit::canRepresent Node const *N = 0; switch(getFamily(snode)) { case GLM_BERNOULLI: break; case GLM_BINOMIAL: // We can also model binomial distribution if the denominator is fixed to be 1. N = snode->parents()[1]; if (N->length() != 1) return false; if (!N->isFixed()) return false; if (N->value(0)[0] != 1) return false; break; default: return false; } return getLink(snode) == LNK_LOGIT; } }} JAGS-4.3.2/src/modules/glm/samplers/Classify.cc0000664000175000017500000000247214224052515016124 00000000000000#include "Classify.h" #include #include #include using std::vector; using std::string; namespace jags { namespace glm { GLMFamily getFamily(StochasticNode const *snode) { string const &name = snode->distribution()->name(); if (name == "dbern") { return GLM_BERNOULLI; } else if (name == "dbin") { return GLM_BINOMIAL; } else if (name == "dpois") { return GLM_POISSON; } else if (name == "dnorm") { return GLM_NORMAL; } else if (name == "dlogis") { return GLM_LOGISTIC; } else if (name == "dt") { return GLM_T; } else if (name == "dordered.logit") { return GLM_ORDLOGIT; } else if (name == "dordered.probit") { return GLM_ORDPROBIT; } else if (name == "dmnorm") { return GLM_MNORMAL; } else { return GLM_UNKNOWN; } } GLMLink getLink(StochasticNode const *snode) { vector const ¶m = snode->parents(); LinkNode const *lnode = dynamic_cast(param[0]); if (lnode) { string const &linkname = lnode->linkName(); if (linkname == "log") return LNK_LOG; else if (linkname == "logit") return LNK_LOGIT; else if (linkname == "probit") return LNK_PROBIT; else return LNK_UNKNOWN; } else { return LNK_LINEAR; } } }} JAGS-4.3.2/src/modules/glm/samplers/IWLSOutcome.cc0000664000175000017500000000352314224052371016457 00000000000000#include #include "IWLSOutcome.h" #include "Classify.h" #include #include #include namespace jags { namespace glm { /* * Work-around for the binomial distribution where the outcome of * Y ~ dbin(p, N) is Y/N */ static double const &getScale(StochasticNode const *snode, unsigned int chain) { static const double one = 1; if (getFamily(snode) == GLM_BINOMIAL) { Node const *N = snode->parents()[1]; return N->value(chain)[0]; } else { return one; } } IWLSOutcome::IWLSOutcome(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _link(dynamic_cast(snode->parents()[0])), _family(getFamily(snode)), _y(snode->value(chain)[0]), _scale(getScale(snode, chain)), _chain(chain) { } double IWLSOutcome::precision() const { double grad = _link->grad(_chain); return (_scale * grad * grad)/ var(); } double IWLSOutcome::value() const { double mu = _link->value(_chain)[0]; double grad = _link->grad(_chain); return _lp + (_y / _scale - mu) / grad; } double IWLSOutcome::var() const { double mu = _link->value(_chain)[0]; //FIXME, should be sub-classes switch(_family) { case GLM_BERNOULLI: case GLM_BINOMIAL: return mu * (1 - mu); break; case GLM_POISSON: return mu; break; default: throwLogicError("Invalid GLM family in IWLS"); } return 0; //-Wall } bool IWLSOutcome::canRepresent(StochasticNode const *snode) { GLMFamily family = getFamily(snode); GLMLink link = getLink(snode); switch(family) { case GLM_BINOMIAL: case GLM_BERNOULLI: return link == LNK_PROBIT || link == LNK_LOGIT; case GLM_POISSON: return link == LNK_LOG; default: break; } return false; } }} JAGS-4.3.2/src/modules/glm/samplers/HolmesHeld.cc0000664000175000017500000001302514224052515016367 00000000000000#include #include "HolmesHeld.h" #include "Outcome.h" #include #include #include #include #include #include #include // Regularization penalty for precision #define REG_PENALTY 0.001 using std::vector; using std::string; using std::sqrt; extern cholmod_common *glm_wk; static cholmod_sparse shallow_copy(cholmod_sparse *x, unsigned int c) { //Take a copy of column c of sparse matrix x without allocating //any memory. This is computationally cheaper than calling //cholmod_submatrix, but potentially dangerous if the copy is //passed to a function that tries to modify it. Note that we can //only have one shallow copy in use at a time since they all share //the same array of column pointers given by the static array p. static int p[2]; cholmod_sparse xcopy = *x; double *xx = static_cast(x->x); int *xp = static_cast(x->p); int *xi = static_cast(x->i); xcopy.ncol = 1; int nz = xp[c+1] - xp[c]; xcopy.nzmax = nz; p[0] = 0; p[1] = nz; xcopy.p = &p; xcopy.i = xi + xp[c]; xcopy.x = xx + xp[c]; return xcopy; } namespace jags { namespace glm { HolmesHeld::HolmesHeld(GraphView const *view, vector const &sub_views, vector const &outcomes, unsigned int chain) : GLMBlock(view, sub_views, outcomes, chain) { } void HolmesHeld::updateAuxiliary(cholmod_dense *W, cholmod_factor *N, RNG *rng) { /* In the parent GLMMethod class, the posterior precision of the regression parameters is represented by the matrix "A"; the posterior mean "mu" solves A %*% mu = b. In this call, "N" holds the factorization of P %*% A %*% t(P), where P is a permutation matrix. The factorization takes the form L %*% D %*% t(L), where D is diagonal and L is a lower triangular matrix. The parameter "w" solves L %*% w = P %*% b IMPORTANT NOTE: mu, b use a parameterization in which the current value of the regression parameters is taken as the origin. This requires us to adjust the calculations using the current value of the linear predictor (mu_r). */ vector const &schildren = _view->stochasticChildren(); int nrow = schildren.size(); //Transpose and permute the design matrix cholmod_sparse *t_x = cholmod_transpose(_x, 1, glm_wk); int *fperm = static_cast(_factor->Perm); cholmod_sparse *pt_x = cholmod_submatrix(t_x, fperm, t_x->nrow, 0, -1, 1, 1, glm_wk); cholmod_free_sparse(&t_x, glm_wk); int ncol = _x->ncol; vector d(ncol, 1); if (!_factor->is_ll) { // LDL' decomposition. The diagonal D matrix is stored as // the diagonal of _factor int *fp = static_cast(_factor->p); double *fx = static_cast(_factor->x); for (int r = 0; r < ncol; ++r) { d[r] = fx[fp[r]]; } } double *Wx = static_cast(W->x); cholmod_dense *U = 0, *Y = 0, *E = 0; cholmod_sparse *uset = 0; cholmod_dense *X = cholmod_allocate_dense(ncol, 1, ncol, CHOLMOD_REAL, glm_wk); double *Xx = static_cast(X->x); for (int r = 0; r < nrow; ++r) { // We need to do this loop with minimal memory // allocation. The cholmod_solve2 function uses a // dense/sparse pair X/xset for input and another // dense/sparse pair U/uset for output: U, uset, and // workspaces Y and E are allocated on first use and then // reused in subsequent calls (See CHOLMOD // documentation). We also use the utility function // shallow_copy to access each column of pt_x without // further memory allocation. if (_outcomes[r]->fixedb()) continue; cholmod_sparse xset = shallow_copy(pt_x, r); double *xx = static_cast(xset.x); int *xp = static_cast(xset.p); int *xi = static_cast(xset.i); //Copy non-zero elements of column r to dense vector X for (int j = 0; j < xp[1]; ++j) { int c = xi[j]; Xx[c] = xx[j]; } cholmod_solve2(CHOLMOD_L, _factor, X, &xset, &U, &uset, &Y, &E, glm_wk); double mu_r = _outcomes[r]->mean(); // See IMPORTANT NOTE above double tau_r = _outcomes[r]->precision(); //Calculate mean and precision of z[r] conditional //on z[s] for s != r double zr_mean = 0; double gr = 0; int *up = static_cast(uset->p); int *ui = static_cast(uset->i); double *Ux = static_cast(U->x); for (int j = 0; j < up[1]; ++j) { int c = ui[j]; zr_mean += Ux[c] * Wx[c] / d[c]; gr += Ux[c] * Ux[c] / d[c]; } double Hr = gr * tau_r; // diagonal of hat matrix if (1 - Hr <= 0) { continue; } zr_mean -= Hr * (_outcomes[r]->value() - mu_r); zr_mean /= (1 - Hr); double zr_var = gr / (1 - Hr); double zold = _outcomes[r]->value(); _outcomes[r]->update(zr_mean + mu_r, zr_var, rng); //Add new contribution of row r back to b double zdelta = (_outcomes[r]->value() - zold) * tau_r; for (int j = 0; j < up[1]; ++j) { int c = ui[j]; Wx[c] += Ux[c] * zdelta; } } //Free workspace cholmod_free_sparse(&pt_x, glm_wk); cholmod_free_sparse(&uset, glm_wk); cholmod_free_dense(&U, glm_wk); cholmod_free_dense(&Y, glm_wk); cholmod_free_dense(&E, glm_wk); cholmod_free_dense(&X, glm_wk); } }} JAGS-4.3.2/src/modules/glm/samplers/HolmesHeldFactory.cc0000664000175000017500000000327614224052515017726 00000000000000#include #include "BinaryProbit.h" #include "BinaryLogit.h" #include "OrderedLogit.h" #include "OrderedProbit.h" #include "HolmesHeldFactory.h" #include "HolmesHeld.h" #include "HolmesHeldGibbs.h" #include #include using std::vector; namespace jags { namespace glm { HolmesHeldFactory::HolmesHeldFactory() : GLMFactory("glm::Holmes-Held") {} bool HolmesHeldFactory::checkOutcome(StochasticNode const *snode) const { return (BinaryProbit::canRepresent(snode) || BinaryLogit::canRepresent(snode) || OrderedLogit::canRepresent(snode) || OrderedProbit::canRepresent(snode)); } GLMMethod * HolmesHeldFactory::newMethod(GraphView const *view, vector const &subviews, unsigned int chain, bool gibbs) const { vector outcomes; vector::const_iterator p; for (p = view->stochasticChildren().begin(); p != view->stochasticChildren().end(); ++p) { Outcome *outcome = 0; if (BinaryProbit::canRepresent(*p)) { outcome = new BinaryProbit(*p, chain); } else if (BinaryLogit::canRepresent(*p)) { outcome = new BinaryLogit(*p, chain); } else if (OrderedLogit::canRepresent(*p)) { outcome = new OrderedLogit(*p, chain); } else if (OrderedProbit::canRepresent(*p)) { outcome = new OrderedProbit(*p, chain); } else { throwLogicError("Invalid outcome in HolmesHeldFactory"); } outcomes.push_back(outcome); } if (gibbs) { return new HolmesHeldGibbs(view, subviews, outcomes, chain); } else { return new HolmesHeld(view, subviews, outcomes, chain); } } }} JAGS-4.3.2/src/modules/glm/samplers/GLMBlock.cc0000664000175000017500000000613314224052515015737 00000000000000#include #include "GLMBlock.h" #include "Outcome.h" #include #include #include #include #include using std::vector; using std::sqrt; extern cholmod_common *glm_wk; namespace jags { namespace glm { GLMBlock::GLMBlock(GraphView const *view, vector const &sub_views, vector const &outcomes, unsigned int chain) : GLMMethod(view, sub_views, outcomes, chain) { calDesign(); symbolic(); } void GLMBlock::update(RNG *rng) { // The log of the full conditional density takes the form // -(t(x) %*% A %*% x - 2 * b %*% x)/2 // where A is the posterior precision and the mean mu solves // A %*% mu = b // For computational convenience we take xold, the current value // of the sampled nodes, as the origin // Update outcomes for (vector::const_iterator p = _outcomes.begin(); p != _outcomes.end(); ++p) { (*p)->update(rng); } double *b = 0; cholmod_sparse *A = 0; calCoef(b, A); // Get LDL' decomposition of posterior precision A->stype = -1; int ok = cholmod_factorize(A, _factor, glm_wk); cholmod_free_sparse(&A, glm_wk); if (!ok) { throwRuntimeError("Cholesky decomposition failure in GLMBlock"); } // Use the LDL' decomposition to generate a new sample // with mean mu such that A %*% mu = b and precision A. unsigned int nrow = _view->length(); cholmod_dense *w = cholmod_allocate_dense(nrow, 1, nrow, CHOLMOD_REAL, glm_wk); // Permute RHS double *wx = static_cast(w->x); int *perm = static_cast(_factor->Perm); for (unsigned int i = 0; i < nrow; ++i) { wx[i] = b[perm[i]]; } cholmod_dense *u1 = cholmod_solve(CHOLMOD_L, _factor, w, glm_wk); updateAuxiliary(u1, _factor, rng); double *u1x = static_cast(u1->x); if (_factor->is_ll) { // LL' decomposition for (unsigned int r = 0; r < nrow; ++r) { u1x[r] += rng->normal(); } } else { // LDL' decomposition. The diagonal D matrix is stored // as the diagonal of _factor int *fp = static_cast(_factor->p); double *fx = static_cast(_factor->x); for (unsigned int r = 0; r < nrow; ++r) { u1x[r] += rng->normal() * sqrt(fx[fp[r]]); } } cholmod_dense *u2 = cholmod_solve(CHOLMOD_DLt, _factor, u1, glm_wk); // Permute solution double *u2x = static_cast(u2->x); for (unsigned int i = 0; i < nrow; ++i) { b[perm[i]] = u2x[i]; } cholmod_free_dense(&w, glm_wk); cholmod_free_dense(&u1, glm_wk); cholmod_free_dense(&u2, glm_wk); //Shift origin back to original scale int r = 0; for (vector::const_iterator p = _view->nodes().begin(); p != _view->nodes().end(); ++p) { unsigned int length = (*p)->length(); double const *xold = (*p)->value(_chain); for (unsigned int i = 0; i < length; ++i, ++r) { b[r] += xold[i]; } } _view->setValue(b, nrow, _chain); delete [] b; } void GLMBlock::updateAuxiliary(cholmod_dense *b, cholmod_factor *N, RNG *rng) { } }} JAGS-4.3.2/src/modules/glm/samplers/GLMGibbs.cc0000664000175000017500000000461414224052515015735 00000000000000#include #include "GLMGibbs.h" #include "Outcome.h" #include #include #include #include #include #include using std::vector; using std::sqrt; extern cholmod_common *glm_wk; namespace jags { namespace glm { GLMGibbs::GLMGibbs(GraphView const *view, vector const &sub_views, vector const &outcomes, unsigned int chain) : GLMMethod(view, sub_views, outcomes, chain) { if (_view->length() != _sub_views.size()) { throwLogicError("updateLMGibbs can only act on scalar nodes"); } calDesign(); } void GLMGibbs::update(RNG *rng) { // Update element-wise. Less efficient than GLMBlock#update // but does not require a Cholesky decomposition, and is // necessary for truncated parameters // Update outcomes for (vector::const_iterator p = _outcomes.begin(); p != _outcomes.end(); ++p) { (*p)->update(rng); } double *b = 0; cholmod_sparse *A = 0; calCoef(b, A); if (A->stype != 0) { throwLogicError("Wrong stype in GLMGibbs::update"); } int nrow = _view->length(); vector theta(nrow); _view->getValue(theta, _chain); int *Ap = static_cast(A->p); int *Ai = static_cast(A->i); double *Ax = static_cast(A->x); //Extract diagonal from A vector diagA(nrow); for (int c = 0; c < nrow; ++c) { for (int j = Ap[c]; j < Ap[c+1]; ++j) { if (Ai[j] == c) { diagA[c] = Ax[j]; break; } } } //Update element-wise for (int i = 0; i < nrow; ++i) { double theta_old = theta[i]; double mu = theta[i] + b[i]/diagA[i]; double sigma = sqrt(1/diagA[i]); StochasticNode const *snode = _sub_views[i]->node(); double const *l = snode->lowerLimit(_chain); double const *u = snode->upperLimit(_chain); if (l && u) { theta[i] = inormal(*l, *u, rng, mu, sigma); } else if (l) { theta[i] = lnormal(*l, rng, mu, sigma); } else if (u) { theta[i] = rnormal(*u, rng, mu, sigma); } else { theta[i] = mu + rng->normal() * sigma; } double delta = theta[i] - theta_old; for (int j = Ap[i]; j < Ap[i+1]; ++j) { b[Ai[j]] -= delta * Ax[j]; } } cholmod_free_sparse(&A, glm_wk); delete [] b; _view->setValue(theta, _chain); } }} JAGS-4.3.2/src/modules/glm/samplers/GLMGenericFactory.cc0000664000175000017500000000524514224052515017614 00000000000000#include #include #include "GLMGenericFactory.h" #include "AuxMixPoisson.h" #include "AuxMixBinomial.h" #include "NormalLinear.h" #include "LogisticLinear.h" //#include "BinaryLogit.h" #include "BinaryProbit.h" #include "PolyaGamma.h" #include "OrderedLogit.h" #include "OrderedProbit.h" #include "MNormalLinear.h" #include "GLMBlock.h" #include "GLMGibbs.h" #include #include #include #include #include using std::vector; namespace jags { namespace glm { GLMGenericFactory::GLMGenericFactory() : GLMFactory("glm::Generic") {} bool GLMGenericFactory::checkOutcome(StochasticNode const *snode) const { return NormalLinear::canRepresent(snode) || LogisticLinear::canRepresent(snode) || //BinaryLogit::canRepresent(snode) || PolyaGamma::canRepresent(snode) || BinaryProbit::canRepresent(snode) || AuxMixPoisson::canRepresent(snode) || AuxMixBinomial::canRepresent(snode) || OrderedLogit::canRepresent(snode) || OrderedProbit::canRepresent(snode) || MNormalLinear::canRepresent(snode); } GLMMethod * GLMGenericFactory::newMethod(GraphView const *view, vector const &sub_views, unsigned int chain, bool gibbs) const { vector outcomes; for (vector::const_iterator p = view->stochasticChildren().begin(); p != view->stochasticChildren().end(); ++p) { Outcome *outcome = 0; if (NormalLinear::canRepresent(*p)) { outcome = new NormalLinear(*p, chain); } else if (LogisticLinear::canRepresent(*p)) { outcome = new LogisticLinear(*p, chain); } else if (PolyaGamma::canRepresent(*p)) { outcome = new PolyaGamma(*p, chain); } else if (BinaryProbit::canRepresent(*p)) { outcome = new BinaryProbit(*p, chain); } else if (AuxMixBinomial::canRepresent(*p)) { outcome = new AuxMixBinomial(*p, chain); } else if (AuxMixPoisson::canRepresent(*p)) { outcome = new AuxMixPoisson(*p, chain); } else if (OrderedLogit::canRepresent(*p)) { outcome = new OrderedLogit(*p, chain); } else if (OrderedProbit::canRepresent(*p)) { outcome = new OrderedProbit(*p, chain); } else if (MNormalLinear::canRepresent(*p)) { outcome = new MNormalLinear(*p, chain); } else { throwLogicError("Invalid outcome in GLMGenericFactory"); } outcomes.push_back(outcome); } if (gibbs) { return new GLMGibbs(view, sub_views, outcomes, chain); } else { return new GLMBlock(view, sub_views, outcomes, chain); } } }} JAGS-4.3.2/src/modules/glm/samplers/HolmesHeldGibbs.cc0000664000175000017500000000601114224052515017333 00000000000000#include #include "HolmesHeldGibbs.h" #include "Outcome.h" #include #include #include #include #include #include #include #include using std::vector; using std::sqrt; extern cholmod_common *glm_wk; namespace jags { namespace glm { HolmesHeldGibbs::HolmesHeldGibbs(GraphView const *view, vector const &sv, vector const &outcomes, unsigned int chain) : GLMMethod(view, sv, outcomes, chain) { } void HolmesHeldGibbs::update(RNG *rng) { // Update outcomes for (vector::const_iterator p = _outcomes.begin(); p != _outcomes.end(); ++p) { (*p)->update(rng); } double *b = 0; cholmod_sparse *A = 0; calCoef(b, A); if (A->stype != 0) { throwLogicError("Wrong stype in HolmesHeldGibbs::update"); } int nrow = _view->length(); vector theta(nrow); _view->getValue(theta, _chain); vector theta_old(theta); int *Ap = static_cast(A->p); int *Ai = static_cast(A->i); double *Ax = static_cast(A->x); //Extract diagonal from A vector diagA(nrow); for (int c = 0; c < nrow; ++c) { for (int j = Ap[c]; j < Ap[c+1]; ++j) { if (Ai[j] == c) { diagA[c] = Ax[j]; break; } } } //Transpose design matrix cholmod_sparse *t_x = cholmod_transpose(_x, 1, glm_wk); double *xx = static_cast(t_x->x); int *xp = static_cast(t_x->p); int *xi = static_cast(t_x->i); //Update element-wise for (unsigned int c = 0; c < t_x->ncol; ++c) { double eta = _outcomes[c]->mean(); double z_old = _outcomes[c]->value(); for (int r = xp[c]; r < xp[c+1]; ++r) { int i = xi[r]; double theta_i = theta[i]; double mu = theta[i] + b[i]/diagA[i]; double sigma = sqrt(1/diagA[i]); StochasticNode const *snode = _sub_views[i]->node(); double const *l = snode->lowerLimit(_chain); double const *u = snode->upperLimit(_chain); if (l && u) { theta[i] = inormal(*l, *u, rng, mu, sigma); } else if (l) { theta[i] = lnormal(*l, rng, mu, sigma); } else if (u) { theta[i] = rnormal(*u, rng, mu, sigma); } else { theta[i] = mu + rng->normal() * sigma; } double delta = theta[i] - theta_i; for (int j = Ap[i]; j < Ap[i+1]; ++j) { b[Ai[j]] -= delta * Ax[j]; } eta += (theta[i] - theta_old[i]) * xx[r]; } _outcomes[c]->update(eta, 0, rng); double z_new = _outcomes[c]->value(); double tau_c = _outcomes[c]->precision(); double delta_z = (z_new - z_old) * tau_c; for (int j = xp[c]; j < xp[c+1]; ++j) { b[xi[j]] += delta_z * xx[j]; } } cholmod_free_sparse(&A, glm_wk); delete [] b; _view->setValue(theta, _chain); } } } JAGS-4.3.2/src/modules/glm/samplers/PolyaGamma.cc0000664000175000017500000001041514224052515016372 00000000000000#include "PolyaGamma.h" #include "Classify.h" #include "PG.h" #include #include #include #include #include using std::exp; using std::log; using std::sqrt; using std::abs; static double one = 1; namespace jags { namespace glm { //Optimal cutoff between left and right expansions of the //Jacobi density from Devroye static const double TRUNC=0.64; static inline double phi(double x) { //Cumulative distribution function of a standard normal return pnorm(x, 0.0, 1.0, true, false); } static double pigauss(double z) { // P(X <= TRUNC) if X has an inverse Gaussian distribution with // mu = 1/z; lambda = 1 const double ITRUNC_SQRT = 1 / sqrt(TRUNC); double b = (TRUNC * z - 1) * ITRUNC_SQRT; double a = -(TRUNC * z + 1) * ITRUNC_SQRT; return phi(b) + exp(2 * z) * phi(a); } static double a(double n, double x) { // Alternating series expansion of the Jacobi density n += 0.5; double K = n * M_PI; if (x > TRUNC) { return K * exp(-K * K * x / 2); } else if (x > 0) { double logy = -1.5 * log(x) - 2*n*n/x; return K * pow(M_2_PI, 1.5) * exp(logy); } else { return 0; //x == 0 } } static double rpolya_gamma(double z, RNG *rng) { /* Sample from Polya-gamma PG(1, abs(z)) In fact we are sampling from a Jacobi density, exploiting the fact that PG(1, z) = J(1, z/2)/4; hence the transformation of z on input and the return value on exit. */ z = abs(z)/2; double K = M_PI * M_PI / 8 + z * z / 2; double p = M_PI * exp(-K*TRUNC) / (2 * K); double q = 2 * exp(-z) * pigauss(z); for (unsigned int i = 0; i < 10; ++i) { double X; if (rng->uniform() < p/(p+q)) { // Sample from the tail with an exponential proposal double E = rng->exponential(); X = TRUNC + E/K; } else { // Sample from the body with a truncated IG proposal double mu = 1/z; X = rigauss(mu, 1, TRUNC, rng); } double S = a(0, X); double Y = rng->uniform() * S; for(int n = 1; ; ++n) { if (n % 2 == 1) { // odd terms S -= a(n, X); if (Y <= S) return X/4; } else { // even terms S += a(n, X); if (Y > S) break; } if (n > 1000) { throwLogicError("Infinite loop in PolyaGamma?"); } } } throwLogicError("Failed to sample Polya-Gamma"); return 0; //-Wall } static double const & getSize(StochasticNode const *snode, unsigned int chain) { if (getFamily(snode) == GLM_BERNOULLI) { return one; } else if (getFamily(snode) == GLM_BINOMIAL) { Node const *N = snode->parents()[1]; return N->value(chain)[0]; } else { throwLogicError("Invalid outcome for PolyaGamma"); } return one; //-Wall } PolyaGamma::PolyaGamma(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _y(snode->value(chain)[0]), _n(getSize(snode, chain)), _tau(1) { //fixme: sanity checks on snode } double PolyaGamma::value() const { return (_y - _n/2)/_tau; } double PolyaGamma::precision() const { return _tau; } void PolyaGamma::update(RNG *rng) { unsigned int N = static_cast(_n); _tau = 0.0; for (unsigned int i = 0; i < N; ++i) { _tau += rpolya_gamma(_lp, rng); } } bool PolyaGamma::canRepresent(StochasticNode const *snode) { switch(getFamily(snode)) { case GLM_BERNOULLI: break; case GLM_BINOMIAL: if (!snode->parents()[1]->isFixed() || snode->parents()[1]->value(0)[0] > 19) { /* PolyaGamma competes with AuxMixBinomial for representing binomial outcomes with logit link. PolyaGamma is more efficient for small N, but its complexity is O(N), so it is much slower for large N. Where is the cutoff? For N = 20, the number of mixture components used by AuxMixBinomial drops from 9 to 4 (See LGMix.cc), so this may be a good choice. FIXME: This means we only use PolyaGamma for small *fixed* N. */ return false; } break; default: return false; } return getLink(snode) == LNK_LOGIT; } } } JAGS-4.3.2/src/modules/glm/samplers/PGcommon.cc0000664000175000017500000000336014224052515016063 00000000000000#include "PG.h" #include #include #include using jags::RNG; static double rigauss_body(double mu, double lambda, double t, RNG *rng) { // Sample truncated IG(mu, lambda) I(0,t) using accept-reject sampling // with a truncated inverse chi-square as proposal. This is efficient // when the truncation point t is in the body of the distribution. // Rescale the problem to sample Z ~ IG(mu/lambda, 1) I(0, t/lambda) mu /= lambda; t /= lambda; double alpha, Z; do { Z = lnormal(1/sqrt(t), rng); Z = 1/(Z*Z); //Chi-square truncated to (0,t) alpha = exp(-Z / (2 * mu * mu)); //acceptance probability } while (rng->uniform() > alpha); return Z * lambda; // Rescale the problem to sample X ~ IG(mu, lambda) } static double rigauss_tail(double mu, double lambda, double t, RNG *rng) { // Generate truncated IG(mu, lambda) I(0, t) by rejection sampling // This is efficient when the truncation point t is in the tail of // the distribution. double X; do { // Repeatedly generate X ~ IG(mu, lambda) according to // Devroye (1986) until X < t double Y = rng->normal(); Y *= Y; double muY = mu * Y; X = mu + mu * (muY - sqrt((4 * lambda + muY) * muY)) / (2 * lambda); if (rng->uniform() > mu / (mu + X)) { X = mu * mu / X; } } while (X > t); return X; } namespace jags { namespace glm { double rigauss(double mu, double lambda, double t, RNG *rng) { // Sample from the inverse Gaussian distribution with // mean mu and shape lambda, truncated to the interval (0, t) if (mu > t) { return rigauss_body(mu, lambda, t, rng); } else { return rigauss_tail(mu, lambda, t, rng); } } } } JAGS-4.3.2/src/modules/glm/samplers/ScaledWishart.cc0000664000175000017500000001503014224052515017076 00000000000000#include #include "ScaledWishart.h" #include #include #include #include #include #include #include #include #include #include #include #include using std::vector; using std::set; using std::sqrt; using std::string; using std::copy; using std::reverse; #include #define F77_DPOTRF F77_FUNC(dpotrf,DPOTRF) #define F77_DTRTRI F77_FUNC(dtrtri, DTRTRI) #define F77_DTRMM F77_FUNC(dtrmm, DTRMM) #define F77_DSYRK F77_FUNC(dsyrk, DSYRK) extern "C" { void F77_DPOTRF (const char *uplo, const int *n, double *a, const int *lda, const int *info); void F77_DTRTRI (const char *uplo, const char *diag, const int *n, double *a, const int *lda, const int *info); void F77_DTRMM(const char *side, const char *uplo, const char *transa, const char *diag, const int *m, const int *n, const double *alpha, const double *a, const int *lda, double *b, const int *ldb); void F77_DSYRK(const char *uplo, const char *trans, const int *n, const int *k, const double *alpha, const double *a, const int *lda, const double *beta, double *c, const int *ldc); } //FIXME We would not need this if we could call bugs::DWish::sampleWishart static void sampleWishart(double *X, int length, double const *R, double k, int nrow, jags::RNG *rng) { int info = 0; /* Generate random Wishart variable, using an algorithm proposed by Bill Venables and originally implemented in S. */ if (length != nrow*nrow) { jags::throwLogicError("invalid length in DWish::randomSample"); } /* Get Cholesky decomposition of the inverse of R. First we factorize R (dpotrf) and then we invert the triangular factor (dtrtri). At the end, C contains the upper triangular Cholesky factor. NB We must reverse the elements of the matrix at start and end of the calculations. */ vector C(length); copy(R, R + length, C.rbegin()); F77_DPOTRF("L", &nrow, &C[0], &nrow, &info); if (info != 0) { jags::throwRuntimeError("Failed to get Cholesky decomposition of R"); } F77_DTRTRI("L", "N", &nrow, &C[0], &nrow, &info); if (info != 0) { jags::throwRuntimeError("Failed to invert Cholesky decomposition of R"); } reverse(C.begin(), C.end()); /* Generate square root of Wishart random variable: - diagonal elements are square root of Chi square - upper off-diagonal elements are normal - lower off-diagonal elements are zero */ vector Z(length); for (int j = 0; j < nrow; j++) { double *Z_j = &Z[j*nrow]; //jth column of Z for (int i = 0; i < j; i++) { Z_j[i] = rnorm(0, 1, rng); } Z_j[j] = sqrt(rchisq(k - j, rng)); for (int i = j + 1; i < nrow; i++) { Z_j[i] = 0; } } // Z = Z %*% C double one = 1; F77_DTRMM("R", "U", "N", "N", &nrow, &nrow, &one, &C[0], &nrow, &Z[0], &nrow); // X = t(Z) %*% Z double zero = 0; F77_DSYRK("U", "T", &nrow, &nrow, &one, &Z[0], &nrow, &zero, X, &nrow); // Copy upper triangle of X to lower triangle for (int i = 0; i < nrow; ++i) { for (int j = 0; j < i; ++j) { X[j * nrow + i] = X[i * nrow + j]; } } } namespace jags { namespace glm { /* static inline double getPrecision0(StochasticNode const *snode, unsigned int chain) { //Returns the first element of the precision matrix for a node //with a multivariate normal distribution. return snode->parents()[1]->value(chain)[0]; } */ bool ScaledWishart::canSample(StochasticNode *snode, Graph const &graph) { if (snode->distribution()->name() != "dscaled.wishart") return false; if (isBounded(snode)) return false; SingletonGraphView gv(snode, graph); vector const &schild = gv.stochasticChildren(); // Check stochastic children for (unsigned int i = 0; i < schild.size(); ++i) { if (isBounded(schild[i])) { return false; //Bounded } if (schild[i]->distribution()->name() != "dmnorm" && schild[i]->distribution()->name() != "dnorm") { return false; } if (schild[i]->parents()[1] != snode) { return false; } if (gv.isDependent(schild[i]->parents()[0])) { return false; //mean parameter depends on snode } } if (!gv.deterministicChildren().empty()) { return false; } return true; } ScaledWishart::ScaledWishart(SingletonGraphView const *gv, unsigned int chain) : SampleMethodNoAdapt(), _gv(gv), _chain(chain) { vector const &par = _gv->node()->parents(); unsigned int nrow = par[0]->dim()[0]; double const *S = par[0]->value(_chain); //Prior scale double df = *par[1]->value(_chain); //Prior degrees of freedom double const *x = gv->node()->value(_chain); _a = vector(nrow); for (unsigned int k = 0; k < nrow; ++k) { double shape = (nrow + df)/2; // shape double rate = df * x[k*nrow+k] + 1/(S[k]*S[k]); // 1/scale _a[k] = shape/rate; } } void ScaledWishart::update(RNG *rng) { vector const ¶m = _gv->node()->parents(); double tdf = *param[1]->value(_chain); double const *S = param[0]->value(_chain); int nrow = param[0]->dim()[0]; int N = nrow * nrow; double const *x = _gv->node()->value(_chain); //Update hyper-parameters _a for (int i = 0; i < nrow; ++i) { double shape = (nrow + tdf)/2; double rate = tdf * x[i*nrow+i] + 1/(S[i]*S[i]); _a[i] = rgamma(shape, 1/rate, rng); } //Prior contribution to Wishart parameters double wdf = nrow + tdf - 1; //Degrees of freedom for Wishart vector R(N, 0); //Scale matrix for Wishart for (int i = 0; i < nrow; ++i) { R[i*nrow+i] = 2 * tdf * _a[i]; } //Likelihood contribution to Wishart parameters vector const &schild = _gv->stochasticChildren(); for (vector::const_iterator p = schild.begin(); p != schild.end(); ++p) { double const *Y = (*p)->value(_chain); double const *mu = (*p)->parents()[0]->value(_chain); for (int i = 0; i < nrow; i++) { for (int j = 0; j < nrow; j++) { R[i*nrow + j] += (Y[i] - mu[i]) * (Y[j] - mu[j]); } } wdf += 1; } vector xnew(N); sampleWishart(&xnew[0], N, &R[0], wdf, nrow, rng); _gv->setValue(xnew, _chain); } } } JAGS-4.3.2/src/modules/glm/samplers/ScaledWishartFactory.cc0000664000175000017500000000206214224052515020427 00000000000000#include #include "ScaledWishartFactory.h" #include "ScaledWishart.h" #include #include #include using std::vector; using std::string; namespace jags { namespace glm { ScaledWishartFactory::~ScaledWishartFactory() { //Nothing to do here; only for vtable. } bool ScaledWishartFactory::canSample(StochasticNode *snode, Graph const &graph) const { return ScaledWishart::canSample(snode, graph); } Sampler *ScaledWishartFactory::makeSampler(StochasticNode *snode, Graph const &graph) const { unsigned int nchain = snode->nchain(); vector methods(nchain, 0); SingletonGraphView *gv = new SingletonGraphView(snode, graph); for (unsigned int ch = 0; ch < nchain; ++ch) { methods[ch] = new ScaledWishart(gv, ch); } return new MutableSampler(gv, methods, "glm::ScaledWishart"); } string ScaledWishartFactory::name() const { return "glm::ScaledWishart"; } } } JAGS-4.3.2/src/modules/glm/samplers/SampleWishart.cc0000664000175000017500000000651414224052515017133 00000000000000#include #include "SampleWishart.h" #include #include #include #include #include #include using std::vector; using std::sqrt; using std::copy; using std::reverse; #define F77_DPOTRF F77_FUNC(dpotrf,DPOTRF) #define F77_DTRTRI F77_FUNC(dtrtri, DTRTRI) #define F77_DTRMM F77_FUNC(dtrmm, DTRMM) #define F77_DSYRK F77_FUNC(dsyrk, DSYRK) extern "C" { void F77_DPOTRF (const char *uplo, const int *n, double *a, const int *lda, const int *info); void F77_DTRTRI (const char *uplo, const char *diag, const int *n, double *a, const int *lda, const int *info); void F77_DTRMM(const char *side, const char *uplo, const char *transa, const char *diag, const int *m, const int *n, const double *alpha, const double *a, const int *lda, double *b, const int *ldb); void F77_DSYRK(const char *uplo, const char *trans, const int *n, const int *k, const double *alpha, const double *a, const int *lda, const double *beta, double *c, const int *ldc); } namespace jags { namespace glm { //FIXME We would not need this if we could call //bugs::DWish::sampleWishart void sampleWishart(double *X, int length, double const *R, double df, int nrow, RNG *rng) { if (df <= nrow) { throwLogicError("Invalid df in sampleWishart"); } int info = 0; /* Generate random Wishart variable, using an algorithm proposed by Bill Venables and originally implemented in S. */ if (length != nrow*nrow) { throwLogicError("invalid length in sampleWishart"); } /* Get Cholesky decomposition of the inverse of R. First we factorize R (dpotrf) and then we invert the triangular factor (dtrtri). At the end, C contains the upper triangular Cholesky factor. NB We must reverse the elements of the matrix at start and end of the calculations. */ vector C(length); copy(R, R + length, C.rbegin()); F77_DPOTRF("L", &nrow, &C[0], &nrow, &info); if (info != 0) { throwRuntimeError("Failed to get Cholesky decomposition of R"); } F77_DTRTRI("L", "N", &nrow, &C[0], &nrow, &info); if (info != 0) { throwRuntimeError("Failed to invert Cholesky decomposition of R"); } reverse(C.begin(), C.end()); /* Generate square root of Wishart random variable: - diagonal elements are square root of Chi square - upper off-diagonal elements are normal - lower off-diagonal elements are zero */ vector Z(length); for (int j = 0; j < nrow; j++) { double *Z_j = &Z[j*nrow]; //jth column of Z for (int i = 0; i < j; i++) { Z_j[i] = rnorm(0, 1, rng); } Z_j[j] = sqrt(rchisq(df - j, rng)); for (int i = j + 1; i < nrow; i++) { Z_j[i] = 0; } } // Z = Z %*% C double one = 1; F77_DTRMM("R", "U", "N", "N", &nrow, &nrow, &one, &C[0], &nrow, &Z[0], &nrow); // X = t(Z) %*% Z double zero = 0; F77_DSYRK("U", "T", &nrow, &nrow, &one, &Z[0], &nrow, &zero, X, &nrow); // Copy upper triangle of X to lower triangle for (int i = 0; i < nrow; ++i) { for (int j = 0; j < i; ++j) { X[j * nrow + i] = X[i * nrow + j]; } } } } //namespace glm } //namespace jags JAGS-4.3.2/src/modules/glm/samplers/ScaledGamma.cc0000664000175000017500000001042514224052515016502 00000000000000#include #include "ScaledGamma.h" #include #include #include #include #include #include #include #include #include #include using std::vector; using std::fill; namespace jags { namespace glm { static inline double getScale(StochasticNode const *snode, unsigned int chain) { return *snode->parents()[1]->value(chain); } void ScaledGamma::calCoef() { const double xold = _gv->node()->value(_chain)[0]; vector const &sch = _gv->stochasticChildren(); for (unsigned int i = 0; i < sch.size(); ++i) { _coef[i] = getScale(sch[i], _chain); } double val = 2 * xold; _gv->setValue(&val, 1, _chain); for (unsigned int i = 0; i < sch.size(); ++i) { if (_coef[i] == getScale(sch[i], _chain)) { _coef[i] = 0; } else { _coef[i] /= xold; } } _gv->setValue(&xold, 1, _chain); } ScaledGamma::ScaledGamma(SingletonGraphView const *gv, unsigned int chain) : SampleMethodNoAdapt(), _gv(gv), _chain(chain), _coef(gv->stochasticChildren().size()) { if(gv->deterministicChildren().empty()) { fill(_coef.begin(), _coef.end(), 1); _fast = true; } else if (checkScale(gv, true)) { //One-off calculation of fixed scale transformation calCoef(); _fast = true; } else { _fast = false; } //Initialize hyper-parameter _a to its prior mean vector const &par = gv->node()->parents(); double S = *par[0]->value(chain); //Prior scale double df = *par[1]->value(chain); //Prior degrees of freedom double x = gv->node()->value(chain)[0]; double a_shape = (1 + df)/2; // shape double a_rate = df * x + 1/(S*S); // 1/scale _a = a_shape/a_rate; } bool ScaledGamma::canSample(StochasticNode *snode, Graph const &graph) { if (snode->distribution()->name() != "dscaled.gamma") return false; if (isBounded(snode)) return false; SingletonGraphView gv(snode, graph); // Check stochastic children vector const &stoch_nodes = gv.stochasticChildren(); for (unsigned int i = 0; i < stoch_nodes.size(); ++i) { if (isBounded(stoch_nodes[i])) { return false; } if (stoch_nodes[i]->distribution()->name() != "dnorm") { return false; } if (gv.isDependent(stoch_nodes[i]->parents()[0])) { return false; //non-scale parameter depends on snode } } // Check deterministic descendants are scale transformations if (!checkScale(&gv, false)) { return false; } return true; //We made it! } static void sample_gamma(double &x, double shape, double rate, RNG *rng, bool relax) { double scale = 1/rate; if (relax) { double K = 19; double u = pgamma(x, shape, scale, true, false); double r = rbinom(K, u, rng); if (r > K - r) { u *= rbeta(K - r + 1, 2*r - K, rng); } else if (r < K - r) { u = 1 - (1-u) * rbeta(r + 1, K - 2*r, rng); } x = qgamma(u, shape, scale, true, false); } else { x = rgamma(shape, scale, rng); } } void ScaledGamma::update(RNG *rng) { vector const &sch = _gv->stochasticChildren(); unsigned int nchildren = sch.size(); double r = 0; //shape double mu = 0; //rate (1/scale) // Likelihood if (!_fast) calCoef(); for (unsigned int i = 0; i < nchildren; ++i) { if (_coef[i] == 0) continue; StochasticNode const *schild = sch[i]; vector const &cparam = schild->parents(); double Y = *schild->value(_chain); double m = *cparam[0]->value(_chain); //location parameter r += 0.5; mu += _coef[i] * (Y - m) * (Y - m) / 2; } vector const &par = _gv->node()->parents(); double S = *par[0]->value(_chain); double df = *par[1]->value(_chain); double x = _gv->node()->value(_chain)[0]; bool first = rng->uniform() < 0.5 ; sample_gamma(_a, (1 + df)/2, df * x + 1/(S*S), rng, first); sample_gamma( x, r + df/2, mu + df * _a, rng, true); sample_gamma(_a, (1 + df)/2, df * x + 1/(S*S), rng, !first); _gv->setValue(&x, 1, _chain); } } } JAGS-4.3.2/src/modules/glm/samplers/ScaledGammaFactory.cc0000664000175000017500000000203414224052515020027 00000000000000#include #include "ScaledGammaFactory.h" #include "ScaledGamma.h" #include #include #include using std::vector; using std::string; namespace jags { namespace glm { ScaledGammaFactory::~ScaledGammaFactory() { //Nothing to do here; only for vtable. } bool ScaledGammaFactory::canSample(StochasticNode *snode, Graph const &graph) const { return ScaledGamma::canSample(snode, graph); } Sampler *ScaledGammaFactory::makeSampler(StochasticNode *snode, Graph const &graph) const { unsigned int nchain = snode->nchain(); vector methods(nchain, 0); SingletonGraphView *gv = new SingletonGraphView(snode, graph); for (unsigned int ch = 0; ch < nchain; ++ch) { methods[ch] = new ScaledGamma(gv, ch); } return new MutableSampler(gv, methods, "glm::ScaledGamma"); } string ScaledGammaFactory::name() const { return "glm::ScaledGamma"; } } } JAGS-4.3.2/src/modules/glm/samplers/LogisticLinear.cc0000664000175000017500000000175614224052371017263 00000000000000#include #include "LogisticLinear.h" #include "Classify.h" #include "KS.h" #include #include #include using std::sqrt; #define REG_PENALTY 0.001 namespace jags { namespace glm { LogisticLinear::LogisticLinear(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _value(snode->value(chain)[0]), _mean(snode->parents()[0]->value(chain)[0]), _precision(snode->parents()[1]->value(chain)[0]), _lambda(1) { } void LogisticLinear::update(RNG * rng) { double Z = (_value - _mean) * sqrt(_precision); _lambda = sample_lambda(Z, rng); } double LogisticLinear::value() const { return _value; } double LogisticLinear::precision() const { return _precision * (REG_PENALTY + 1/_lambda); } bool LogisticLinear::canRepresent(StochasticNode const *snode) { return getFamily(snode) == GLM_LOGISTIC && getLink(snode) == LNK_LINEAR; } } } JAGS-4.3.2/src/modules/glm/samplers/TLinear.cc0000664000175000017500000000172514224052371015705 00000000000000#include #include #include "TLinear.h" #include "Classify.h" //#include #include namespace jags { namespace glm { TLinear::TLinear(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _value(snode->value(chain)[0]), _mean(snode->parents()[0]->value(chain)[0]), _precision(snode->parents()[1]->value(chain)[0]), _df(snode->parents()[2]->value(chain)[0]), _lambda(1) { } void TLinear::update(RNG * rng) { double delta = _value - _mean; double r = (_df + 1.0)/2; double mu = (_df + _precision * delta * delta)/2; _lambda = rgamma(r, 1/mu, rng); } double TLinear::value() const { return _value; } double TLinear::precision() const { return _precision * _lambda; } bool TLinear::canRepresent(StochasticNode const *snode) { return getFamily(snode) == GLM_T && getLink(snode) == LNK_LINEAR; } } } JAGS-4.3.2/src/modules/glm/samplers/OrderedLogit.cc0000664000175000017500000000463514224052371016735 00000000000000#include "OrderedLogit.h" #include "Classify.h" #include "KS.h" #include #include #include #include using std::exp; using std::log; using std::sqrt; #define REG_PENALTY 0.001 //Left truncated logistic distribution static double llogit(double left, jags::RNG *rng, double mu) { double qleft = 1/(1 + exp(mu-left)); double x = qleft + (1 - qleft) * rng->uniform(); return mu + log(x) - log(1 - x); } //Right truncated logistic distribution static double rlogit(double right, jags::RNG *rng, double mu) { double qright = 1/(1 + exp(mu-right)); double x = qright * rng->uniform(); return mu + log(x) - log(1 - x); } //Interval truncated logistic distribution static double ilogit(double left, double right, jags::RNG *rng, double mu) { double qleft = 1/(1 + exp(mu-left)); double qright = 1/(1 + exp(mu-right)); double x = qleft + (qright - qleft) * rng->uniform(); return mu + log(x) - log(1 - x); } namespace jags { namespace glm { OrderedLogit::OrderedLogit(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _y(snode->value(chain)[0]), _cuts(snode->parents()[1]->value(chain)), _ncut(snode->parents()[1]->length()), _z(0), _tau(1), _sigma2(1) { //fixme: sanity checks on snode } double OrderedLogit::value() const { return _z; } double OrderedLogit::precision() const { return _tau; } void OrderedLogit::update(RNG *rng) { /* Albert Chib update */ unsigned int x = static_cast(_y) - 1; if (x == 0) { _z = rlogit(_cuts[0], rng, _lp); } else if (x == _ncut) { _z = llogit(_cuts[_ncut - 1], rng, _lp); } else { _z = ilogit(_cuts[x-1], _cuts[x], rng, _lp); } _sigma2 = sample_lambda(_z - _lp, rng); _tau = REG_PENALTY + 1/_sigma2; } void OrderedLogit::update(double mean, double var, RNG *rng) { /* Holmes-Held update */ unsigned int x = static_cast(_y) - 1; if (x == 0) { _z = rnormal(_cuts[0], rng, mean, sqrt(var + _sigma2)); } else if (x == _ncut) { _z = lnormal(_cuts[_ncut - 1], rng, mean, sqrt(var + _sigma2)); } else { _z = inormal(_cuts[x-1], _cuts[x], rng, mean, sqrt(var + _sigma2)); } } bool OrderedLogit::canRepresent(StochasticNode const *snode) { return getFamily(snode) == GLM_ORDLOGIT && getLink(snode) == LNK_LINEAR; } }} JAGS-4.3.2/src/modules/glm/samplers/OrderedProbit.cc0000664000175000017500000000303314224052371017105 00000000000000#include "OrderedProbit.h" #include "Classify.h" #include "KS.h" #include #include #include #include using std::exp; using std::log; using std::sqrt; namespace jags { namespace glm { OrderedProbit::OrderedProbit(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _y(snode->value(chain)[0]), _cuts(snode->parents()[1]->value(chain)), _ncut(snode->parents()[1]->length()), _z(0) { //fixme: sanity checks on snode } double OrderedProbit::value() const { return _z; } double OrderedProbit::precision() const { return 1; } void OrderedProbit::update(RNG *rng) { /* Albert Chib update */ unsigned int x = static_cast(_y) - 1; if (x == 0) { _z = rnormal(_cuts[0], rng, _lp); } else if (x == _ncut) { _z = lnormal(_cuts[_ncut - 1], rng, _lp); } else { _z = inormal(_cuts[x-1], _cuts[x], rng, _lp); } } void OrderedProbit::update(double mean, double var, RNG *rng) { /* Holmes-Held update */ unsigned int x = static_cast(_y) - 1; if (x == 0) { _z = rnormal(_cuts[0], rng, mean, sqrt(var + 1)); } else if (x == _ncut) { _z = lnormal(_cuts[_ncut - 1], rng, mean, sqrt(var + 1)); } else { _z = inormal(_cuts[x-1], _cuts[x], rng, mean, sqrt(var + 1)); } } bool OrderedProbit::canRepresent(StochasticNode const *snode) { return getFamily(snode) == GLM_ORDPROBIT && getLink(snode) == LNK_LINEAR; } }} JAGS-4.3.2/src/modules/glm/samplers/RESampler.cc0000664000175000017500000000301014224052515016166 00000000000000#include "RESampler.h" #include "REMethod.h" #include #include #include using std::vector; using std::string; namespace jags { namespace glm { RESampler::RESampler(GraphView *view, SingletonGraphView *tau, GraphView *eps, vector sub_eps, vector const &methods, string const &name) : Sampler(view), _tau(tau), _eps(eps), _sub_eps(sub_eps), _methods(methods), _name(name) { } RESampler::~RESampler() { delete _tau; delete _eps; for (unsigned int i = 0; i < _sub_eps.size(); ++i) { delete _sub_eps[i]; } for (unsigned int ch = 0; ch < _methods.size(); ++ch) { delete _methods[ch]; } } void RESampler::update(vector const &rngs) { for (unsigned int ch = 0; ch < rngs.size(); ++ch) { _methods[ch]->update(rngs[ch]); } } void RESampler::adaptOff() { for (unsigned int ch = 0; ch < _methods.size(); ++ch) { _methods[ch]->adaptOff(); } } bool RESampler::checkAdaptation() const { for (unsigned int ch = 0; ch < _methods.size(); ++ch) { if (!_methods[ch]->checkAdaptation()) return false; } return true; } bool RESampler::isAdaptive() const { for (unsigned int ch = 0; ch < _methods.size(); ++ch) { if (_methods[ch]->isAdaptive()) return true; } return false; } string RESampler::name() const { return _name; } } //namespace glm } //namespace jags JAGS-4.3.2/src/modules/glm/samplers/REMethod.cc0000664000175000017500000001743414224052515016022 00000000000000#include #include "REMethod.h" #include "Outcome.h" #include #include #include #include #include #include #include using std::vector; using std::sqrt; using std::fill; extern cholmod_common *glm_wk; namespace jags { namespace glm { static unsigned int sumLengths(vector const &outcomes) { unsigned int s = 0; for (unsigned int i = 0; i < outcomes.size(); ++i) { s += outcomes[i]->length(); } return s; } REMethod::REMethod(SingletonGraphView const *tau, GraphView const *eps, vector const &sub_eps, vector const &outcomes, unsigned int chain) : GLMMethod(eps, sub_eps, outcomes, chain), _tau(tau), _eps(eps) { calDesign(); symbolic(); unsigned int nrow = sumLengths(_outcomes); unsigned int ncol = eps->nodes()[0]->length(); _z = cholmod_allocate_dense(nrow, ncol, nrow, CHOLMOD_REAL, glm_wk); } REMethod::~REMethod() { cholmod_free_dense(&_z, glm_wk); } //FIXME: This is largely copy-pasted from GLMBlock. Surely no need //to reproduce it here? void REMethod::updateEps(RNG *rng) { // The log of the full conditional density takes the form // -(t(x) %*% A %*% x - 2 * b %*% x)/2 // where A is the posterior precision and the mean mu solves // A %*% mu = b // For computational convenience we take xold, the // current value of the sampled nodes, as the origin double *b = 0; cholmod_sparse *A = 0; calCoef(b, A); // Get LDL' decomposition of posterior precision A->stype = -1; int ok = cholmod_factorize(A, _factor, glm_wk); cholmod_free_sparse(&A, glm_wk); if (!ok) { throwRuntimeError("Cholesky decomposition failure in REMethod"); } // Use the LDL' decomposition to generate a new sample // with mean mu such that A %*% mu = b and precision A. unsigned int nrow = _view->length(); cholmod_dense *w = cholmod_allocate_dense(nrow, 1, nrow, CHOLMOD_REAL, glm_wk); // Permute RHS double *wx = static_cast(w->x); int *perm = static_cast(_factor->Perm); for (unsigned int i = 0; i < nrow; ++i) { wx[i] = b[perm[i]]; } cholmod_dense *u1 = cholmod_solve(CHOLMOD_L, _factor, w, glm_wk); double *u1x = static_cast(u1->x); if (_factor->is_ll) { // LL' decomposition for (unsigned int r = 0; r < nrow; ++r) { u1x[r] += rng->normal(); } } else { // LDL' decomposition. The diagonal D matrix is stored // as the diagonal of _factor int *fp = static_cast(_factor->p); double *fx = static_cast(_factor->x); for (unsigned int r = 0; r < nrow; ++r) { u1x[r] += rng->normal() * sqrt(fx[fp[r]]); } } cholmod_dense *u2 = cholmod_solve(CHOLMOD_DLt, _factor, u1, glm_wk); // Permute solution double *u2x = static_cast(u2->x); for (unsigned int i = 0; i < nrow; ++i) { b[perm[i]] = u2x[i]; } cholmod_free_dense(&w, glm_wk); cholmod_free_dense(&u1, glm_wk); cholmod_free_dense(&u2, glm_wk); //Shift origin back to original scale int r = 0; for (vector::const_iterator p = _view->nodes().begin(); p != _view->nodes().end(); ++p) { unsigned int length = (*p)->length(); double const *xold = (*p)->value(_chain); for (unsigned int i = 0; i < length; ++i, ++r) { b[r] += xold[i]; } } _view->setValue(b, nrow, _chain); delete [] b; } void REMethod::calDesignSigma() { //Sanity checks unsigned int Neps = _eps->nodes().size(); if (_z->nrow != _x->nrow) { throwLogicError("Row mismatch in REMethod"); } if (_x->ncol != _z->ncol * Neps || _x->ncol != _eps->length()) { throwLogicError("Column mismatch in REMethod"); } //Set up access to sparse design matrix for eps int *Xp = static_cast(_x->p); int *Xi = static_cast(_x->i); double *Xx = static_cast(_x->x); //Set up access to dense design matrix for sigma double *Zx = static_cast(_z->x); //Set all elements of _z to zero. fill(Zx, Zx + _z->nzmax, 0); //If there are m columns of _z then _z[,i] is the sum of //every mth column of _x (starting with _x[,i]), //multiplied by the corresponding random effect vector const &eps=_eps->nodes(); for (unsigned int i = 0; i < Neps; ++i) { double const *eval = eps[i]->value(_chain); double const *emean = eps[i]->parents()[0]->value(_chain); for (unsigned int zcol = 0; zcol < _z->ncol; ++zcol) { int xcol = i * _z->ncol + zcol; for (int xi = Xp[xcol]; xi < Xp[xcol+1]; ++xi) { int row = Xi[xi]; int zi = _z->nrow * zcol + row; Zx[zi] += Xx[xi] * (eval[zcol] - emean[zcol]); } } } } void REMethod::update(RNG *rng) { // Update outcomes for (vector::const_iterator p = _outcomes.begin(); p != _outcomes.end(); ++p) { (*p)->update(rng); } updateEps(rng); //Update random effects updateTau(rng); //Sufficient parameterization updateSigma(rng); //Ancillary parameterization } void REMethod::calCoefSigma(double *A, double *b, double const *sigma0, unsigned int m) const { double const *Zx = static_cast(_z->x); unsigned int N = _outcomes.size(); int xrow = 0; for (unsigned int i = 0; i < N; ++i) { unsigned int n = _outcomes[i]->length(); if (n == 1) { //Scalar outcome double Y = _outcomes[i]->value(); double mu = _outcomes[i]->mean(); double lambda = _outcomes[i]->precision(); vector X(m); for (unsigned int j = 0; j < m; ++j) { X[j] = Zx[j * _z->nrow + xrow]/sigma0[j]; } for (unsigned int j = 0; j < m; ++j) { for (unsigned int k = 0; k < m; ++k) { A[j*m + k] += X[j] * X[k] * lambda; } b[j] += (Y - mu) * X[j] * lambda; } } else { //Multivariate outcome double const *Y = _outcomes[i]->vvalue(); double const *mu = _outcomes[i]->vmean(); double const *lambda = _outcomes[i]->vprecision(); // delta = Y - mu vector delta(n); for (unsigned int p = 0; p < n; ++p) { delta[p] = Y[p] - mu[p]; } //X = Scaled design matrix for outcome i vector X(m*n); //n x m matrix for (unsigned int j = 0; j < m; ++j) { double const *Zj = &Zx[j * _z->nrow + xrow]; for (unsigned int p = 0; p < n; ++p) { X[j*n + p] = Zj[p]/sigma0[j]; } } // Tx = lambda %*% X (n x m matrix) vector TX(n*m, 0); for (unsigned int j = 0; j < m; ++j) { for (unsigned int p = 0; p < n; ++p) { b[j] += delta[p] * X[j*n + p]; for (unsigned int q = 0; q < n; ++q) { TX[j*n + p] += lambda[n*p + q] * X[j*n + q]; } } } for (unsigned int j = 0; j < m; ++j) { for (unsigned int p = 0; p < n; ++p) { b[j] += delta[p] * TX[j*n + p]; for (unsigned int k = 0; k < m; ++k) { A[j*m + k] += X[j*n + p] * TX[k*n + p]; } } } } xrow += n; } } double REMethod::logLikelihoodSigma(double const *sigma, double const *sigma0, unsigned int m) const { vector A(m*m, 0); vector b(m, 0); calCoefSigma(&A[0], &b[0], sigma0, m); vector delta(m); for (unsigned int i = 0; i < m; ++i) { delta[i] = sigma[i] - sigma0[i]; } double loglik = 0; for (unsigned int i = 0; i < m; ++i) { loglik += b[i] * delta[i]; for (unsigned int j = 0; j < m; ++j) { loglik -= delta[i] * A[i*m + j] * delta[j] /2.0; } } return loglik; } } } JAGS-4.3.2/src/modules/glm/samplers/REFactory.cc0000664000175000017500000001335714224052515016211 00000000000000#include #include "REFactory.h" #include "RESampler.h" #include "REMethod.h" #include "AuxMixPoisson.h" #include "AuxMixBinomial.h" #include "NormalLinear.h" #include "LogisticLinear.h" #include "BinaryProbit.h" #include "PolyaGamma.h" #include "OrderedLogit.h" #include "OrderedProbit.h" #include "MNormalLinear.h" #include #include #include #include #include #include #include #include #include #include using std::vector; using std::string; using std::list; namespace jags { namespace glm { REFactory::REFactory(std::string const &name) : _name(name) {} bool REFactory::checkOutcome(StochasticNode const *snode) const { return NormalLinear::canRepresent(snode) || LogisticLinear::canRepresent(snode) || PolyaGamma::canRepresent(snode) || BinaryProbit::canRepresent(snode) || AuxMixPoisson::canRepresent(snode) || AuxMixBinomial::canRepresent(snode) || OrderedLogit::canRepresent(snode) || OrderedProbit::canRepresent(snode) || MNormalLinear::canRepresent(snode); } bool REFactory::checkTau(SingletonGraphView const *tau) const { if (!tau->deterministicChildren().empty()) { return false; } vector const &eps = tau->stochasticChildren(); for (unsigned int i = 0; i < eps.size(); ++i) { if (isObserved(eps[i])) { return false; } if (isBounded(eps[i])) { return false; } if (eps[i]->distribution()->name() != "dnorm" && eps[i]->distribution()->name() != "dmnorm") { return false; } Node const *mu_tau = eps[i]->parents()[1]; if (mu_tau != tau->node()) { return false; } if (tau->isDependent(eps[i]->parents()[0])) { return false; //mean parameter depends on snode } } return true; //We made it! } bool REFactory::checkEps(GraphView const *eps) const { vector const &stoch_nodes = eps->stochasticChildren(); for (unsigned int i = 0; i < stoch_nodes.size(); ++i) { if (isBounded(stoch_nodes[i])) { return false; //Truncated outcome variable } if (!checkOutcome(stoch_nodes[i])) { return false; //Invalid outcome or link } //Check that other parameters do not depend on snode vector const ¶m = stoch_nodes[i]->parents(); for (unsigned int j = 1; j < param.size(); ++j) { if (eps->isDependent(param[j])) { return false; } } } // Check linearity of deterministic descendants if (!checkLinear(eps, false, true)) return false; return true; } REFactory::~REFactory() {} Sampler * REFactory::makeSampler( list const &free_nodes, Graph const &graph) const { SingletonGraphView *tau = 0; GraphView *eps = 0; for (list::const_iterator p = free_nodes.begin(); p != free_nodes.end(); ++p) { if (canSample(*p)) { tau = new SingletonGraphView(*p, graph); if (checkTau(tau)) { eps = new GraphView(tau->stochasticChildren(), graph); if (checkEps(eps)) { break; } } delete eps; eps = 0; delete tau; tau = 0; } } if (!tau || !eps) { return 0; } vector sub_eps; vector const_sub_eps; for (unsigned int i = 0; i < eps->nodes().size(); ++i) { SingletonGraphView *gv = new SingletonGraphView(eps->nodes()[i], graph); sub_eps.push_back(gv); const_sub_eps.push_back(gv); } unsigned int Nch = nchain(tau); vector methods(Nch, 0); for (unsigned int ch = 0; ch < Nch; ++ch) { vector outcomes; vector const &sch = eps->stochasticChildren(); for (vector::const_iterator p = sch.begin(); p != sch.end(); ++p) { Outcome *outcome = 0; if (NormalLinear::canRepresent(*p)) { outcome = new NormalLinear(*p, ch); } else if (LogisticLinear::canRepresent(*p)) { outcome = new LogisticLinear(*p, ch); } else if (PolyaGamma::canRepresent(*p)) { outcome = new PolyaGamma(*p, ch); } else if (BinaryProbit::canRepresent(*p)) { outcome = new BinaryProbit(*p, ch); } else if (AuxMixBinomial::canRepresent(*p)) { outcome = new AuxMixBinomial(*p, ch); } else if (AuxMixPoisson::canRepresent(*p)) { outcome = new AuxMixPoisson(*p, ch); } else if (OrderedLogit::canRepresent(*p)) { outcome = new OrderedLogit(*p, ch); } else if (OrderedProbit::canRepresent(*p)) { outcome = new OrderedProbit(*p, ch); } else if (MNormalLinear::canRepresent(*p)) { outcome = new MNormalLinear(*p, ch); } else { throwLogicError("Invalid outcome in REFactory"); } outcomes.push_back(outcome); } methods[ch] = newMethod(tau, eps, const_sub_eps, outcomes,ch); } /* Create a single GraphView containing all sampled nodes (from tau and from eps). This is required by the Sampler class. Note that this is a multilevel GraphView. */ vector snodes = eps->nodes(); snodes.push_back(tau->node()); GraphView *view = new GraphView(snodes, graph, true); return new RESampler(view, tau, eps, sub_eps, methods, _name); } vector REFactory::makeSamplers(list const &nodes, Graph const &graph) const { if (Sampler *s = makeSampler(nodes, graph)) { return vector(1, s); } return vector(); } string REFactory::name() const { return _name; } } // namespace glm } //namespace jags JAGS-4.3.2/src/modules/glm/samplers/REGamma.cc0000664000175000017500000000446114224052371015620 00000000000000#include #include "REGamma.h" #include #include #include #include #include using std::vector; using std::sqrt; namespace jags { //Utility functions used by the constructor static inline double const * SHAPE(SingletonGraphView const *tau, unsigned int chain) { return tau->node()->parents()[0]->value(chain); } static inline double const * RATE(SingletonGraphView const *tau, unsigned int chain) { return tau->node()->parents()[1]->value(chain); } static inline double SIGMA(SingletonGraphView const *tau, unsigned int chain) { return 1.0/sqrt(*tau->node()->value(chain)); } namespace glm { class Outcome; REGamma::REGamma(SingletonGraphView const *tau, GraphView const *eps, vector const &sub_eps, vector const &outcomes, unsigned int chain) : REMethod(tau, eps, sub_eps, outcomes, chain), _slicer(this, SHAPE(tau, chain), RATE(tau, chain), SIGMA(tau, chain)) { } void REGamma::updateTau(RNG *rng) { vector const &par = _tau->node()->parents(); double shape = *par[0]->value(_chain); double rate = *par[1]->value(_chain); //(1/scale) // Likelihood //vector const &sch = _tau->stochasticChildren(); vector const &eps = _eps->nodes(); for (unsigned int i = 0; i < eps.size(); ++i) { double Y = *eps[i]->value(_chain); double mu = *eps[i]->parents()[0]->value(_chain); shape += 0.5; rate += (Y - mu) * (Y - mu) / 2.0; } double x = rgamma(shape, 1.0/rate, rng); _tau->setValue(&x, 1, _chain); } void REGamma::updateSigma(RNG *rng) { double tau = _tau->node()->value(_chain)[0]; double sigma0 = 1/sqrt(tau); calDesignSigma(); _slicer.setSigma(sigma0); _slicer.update(rng); double sigma1 = _slicer.value(); //Set new value of precision parameter double x = 1/(sigma1 * sigma1); _tau->setValue(&x, 1, _chain); } bool REGamma::isAdaptive() const { return true; } void REGamma::adaptOff() { _slicer.adaptOff(); } bool REGamma::checkAdaptation() const { return _slicer.checkAdaptation(); } } } JAGS-4.3.2/src/modules/glm/samplers/REGammaSlicer.cc0000664000175000017500000000246714224052371016766 00000000000000#include "REGammaSlicer.h" #include "REGamma.h" #include namespace jags { namespace glm { REGammaSlicer::REGammaSlicer(REGamma const *regamma, double const *shape, double const *rate, double sigma) : Slicer(1, 10), _regamma(regamma), _shape(shape), _rate(rate), _sigma(sigma), _sigma0(sigma) { } double REGammaSlicer::value() const { return _sigma; } void REGammaSlicer::setValue(double x) { _sigma = x; } void REGammaSlicer::setSigma(double x) { _sigma0 = _sigma = x; } void REGammaSlicer::getLimits(double *lower, double *upper) const { *lower = 1e-06; *upper = 1e06; } double REGammaSlicer::logDensity() const { /* Log gamma prior on tau, the precision parameter, with a Jacobian term for the transformation to the standard deviation parameter _sigma */ double tau = 1/(_sigma * _sigma); double scale = 1/(*_rate); double logprior = dgamma(tau, *_shape, scale, 1) - 3 * log(_sigma); /* For the likelihood, We refer back to the REGamma object that owns this REGammaSlicer object. */ double loglik = _regamma->logLikelihoodSigma(&_sigma, &_sigma0, 1); return logprior + loglik; } void REGammaSlicer::update(RNG *rng) { updateStep(rng); } } } JAGS-4.3.2/src/modules/glm/samplers/REGammaFactory.cc0000664000175000017500000000135114224052371017143 00000000000000#include #include "REGammaFactory.h" #include "REGamma.h" #include using std::vector; namespace jags { namespace glm { REGammaFactory::REGammaFactory() : REFactory("glm::REGamma") {} REGammaFactory::~REGammaFactory() {} bool REGammaFactory::canSample(StochasticNode *snode) const { return snode->distribution()->name() == "dgamma"; } REMethod * REGammaFactory::newMethod( SingletonGraphView const *tau, GraphView const *eps, vector const & sub_eps, vector const &outcomes, unsigned int chain) const { return new REGamma(tau, eps, sub_eps, outcomes, chain); } } // namespace glm } //namespace jags JAGS-4.3.2/src/modules/glm/samplers/REScaledGamma.cc0000664000175000017500000000447514224052371016741 00000000000000#include #include "REScaledGamma.h" #include "Outcome.h" #include "RESampler.h" #include #include #include #include #include #include #include using std::vector; using std::sqrt; extern cholmod_common *glm_wk; namespace jags { namespace glm { REScaledGamma::REScaledGamma(SingletonGraphView const *tau, GraphView const *eps, vector const &sub_eps, vector const &outcomes, unsigned int chain) : REMethod(tau, eps, sub_eps, outcomes, chain) { //Initialize hyper-parameter _sigma vector const &par = tau->node()->parents(); double S = *par[0]->value(chain); //Prior scale double df = *par[1]->value(chain); //Prior degrees of freedom double x = tau->node()->value(chain)[0]; double a_shape = (1 + df)/2; // shape double a_rate = df * x + 1/(S*S); // 1/scale _sigma = sqrt(a_shape/a_rate); } void REScaledGamma::updateTau(RNG *rng) { double df = *_tau->node()->parents()[1]->value(_chain); // Prior double shape = df/2.0; double rate = df * _sigma * _sigma / 2.0; // 1/scale // Likelihood vector const &eps = _eps->nodes(); for (unsigned int i = 0; i < eps.size(); ++i) { double Y = *eps[i]->value(_chain); double mu = *eps[i]->parents()[0]->value(_chain); shape += 0.5; rate += (Y - mu) * (Y - mu) / 2.0; } double x = rgamma(shape, 1.0/rate, rng); _tau->setValue(&x, 1, _chain); } void REScaledGamma::updateSigma(RNG *rng) { double sigma0 = _sigma; calDesignSigma(); //Prior scale vector const &par = _tau->node()->parents(); double S = *par[0]->value(_chain); //Get parameters of posterior distribution for _sigma //Precision is A and mean is b/A double priorprec = 1.0/(S*S); double A = priorprec; double b = - _sigma * priorprec; calCoefSigma(&A, &b, &_sigma, 1); //Set new value of sigma _sigma = lnormal(0, rng, _sigma + b/A, 1/sqrt(A)); //Rescale tau double tau = *_tau->node()->value(_chain); tau *= (sigma0 * sigma0)/(_sigma * _sigma); _tau->setValue(&tau, 1, _chain); } } } JAGS-4.3.2/src/modules/glm/samplers/REScaledGammaFactory.cc0000664000175000017500000000145414224052371020263 00000000000000#include #include "REScaledGammaFactory.h" #include "REScaledGamma.h" #include using std::vector; namespace jags { namespace glm { REScaledGammaFactory::REScaledGammaFactory() : REFactory("glm::REScaledGamma") {} REScaledGammaFactory::~REScaledGammaFactory() {} bool REScaledGammaFactory::canSample(StochasticNode *snode) const { return snode->distribution()->name() == "dscaled.gamma"; } REMethod * REScaledGammaFactory::newMethod( SingletonGraphView const *tau, GraphView const *eps, vector const & sub_eps, vector const &outcomes, unsigned int chain) const { return new REScaledGamma(tau, eps, sub_eps, outcomes, chain); } } // namespace glm } //namespace jags JAGS-4.3.2/src/modules/glm/samplers/REScaledWishart.cc0000664000175000017500000000744114224052515017334 00000000000000#include #include "REScaledWishart.h" #include "Outcome.h" #include "RESampler.h" #include "SampleWishart.h" #include #include #include #include #include #include #include using std::vector; using std::sqrt; extern cholmod_common *glm_wk; namespace jags { namespace glm { REScaledWishart::REScaledWishart(SingletonGraphView const *tau, GraphView const *eps, vector const &sub_eps, vector const &outcomes, unsigned int chain) : REMethod(tau, eps, sub_eps, outcomes, chain), _sigma(eps->nodes()[0]->length()) { vector const &par = tau->node()->parents(); double const *S = par[0]->value(chain); //Prior scale double tdf = *par[1]->value(chain); //Prior degrees of freedom double const *x = tau->node()->value(chain); //Initialize hyper-parameter _sigma unsigned int m = _sigma.size(); for (unsigned int j = 0; j < m; ++j) { double a_shape = (m + tdf)/2.0; double a_rate = tdf * x[j + m*j] + 1.0/(S[j]*S[j]); double a = a_shape/a_rate; _sigma[j] = sqrt(2*a); } } void REScaledWishart::updateTau(RNG *rng) { int m = _sigma.size(); int m2 = m * m; double tdf = *_tau->node()->parents()[1]->value(_chain); //Prior double wdf = m + tdf - 1; //Degrees of freedom for Wishart vector R(m2, 0); //Scale matrix for Wishart for (int j = 0; j < m; ++j) { R[j*m + j] = tdf * _sigma[j] * _sigma[j]; } //Likelihood vector const &eps = _eps->nodes(); for (vector::const_iterator p = eps.begin(); p != eps.end(); ++p) { double const *Y = (*p)->value(_chain); double const *mu = (*p)->parents()[0]->value(_chain); //FIXME: We could use blas call dsyr here for (int j = 0; j < m; j++) { for (int k = 0; k < m; k++) { R[j*m + k] += (Y[j] - mu[j]) * (Y[k] - mu[k]); } } wdf += 1; } vector xnew(m2); sampleWishart(&xnew[0], m2, &R[0], wdf, m, rng); _tau->setValue(xnew, _chain); } void REScaledWishart::updateSigma(RNG *rng) { vector sigma0 = _sigma; calDesignSigma(); //Prior scale vector const &par = _tau->node()->parents(); double const *S = par[0]->value(_chain); unsigned int m = _z->ncol; unsigned int m2 = m * m; //Get parameters of posterior distribution for _sigma //Precision is A and mean is inverse(A) %*% b //We work on a scale where the current value sigma0 is the origin vector A(m2, 0); vector b(m, 0); for (unsigned int j = 0; j < m; ++j) { double priorprec = 1.0/(S[j] * S[j]); A[j * m + j] = priorprec; b[j] = - sigma0[j] * priorprec; } calCoefSigma(&A[0], &b[0], &sigma0[0], m); //Sample each sigma from its full conditional //Fixme: wouldn't it be better to do block sampling here? //Fixme: not reversible for (unsigned int j = 0; j < m; ++j) { double sigma_mean = _sigma[j] + b[j]/A[j*m+j]; double sigma_sd = sqrt(1.0/A[j*m+j]); _sigma[j] = lnormal(0, rng, sigma_mean, sigma_sd); double delta = _sigma[j] - sigma0[j]; for (unsigned int k = 0; k < m; ++k) { b[k] -= delta * A[m*j + k]; } } //Rescale tau double const *tau0 = _tau->node()->value(_chain); vector scale(m); for (unsigned int j = 0; j < m; ++j) { scale[j] = sigma0[j]/_sigma[j]; } vector tau_scaled(m2); for (unsigned int j = 0; j < m; ++j) { for (unsigned int k = 0; k < m; ++k) { tau_scaled[j*m+k] = tau0[j*m+k] * scale[j] * scale[k]; } } _tau->setValue(tau_scaled, _chain); } } } JAGS-4.3.2/src/modules/glm/samplers/REScaledWishartFactory.cc0000664000175000017500000000150214224052515020654 00000000000000#include #include "REScaledWishartFactory.h" #include "REScaledWishart.h" #include using std::vector; namespace jags { namespace glm { REScaledWishartFactory::REScaledWishartFactory() : REFactory("glm::REScaledWishart") {} REScaledWishartFactory::~REScaledWishartFactory() {} bool REScaledWishartFactory::canSample(StochasticNode *snode) const { return snode->distribution()->name() == "dscaled.wishart"; } REMethod * REScaledWishartFactory::newMethod( SingletonGraphView const *tau, GraphView const *eps, vector const & sub_eps, vector const &outcomes, unsigned int chain) const { return new REScaledWishart(tau, eps, sub_eps, outcomes, chain); } } // namespace glm } //namespace jags JAGS-4.3.2/src/modules/glm/samplers/MNormalLinear.cc0000664000175000017500000000164014224052371017043 00000000000000#include #include "MNormalLinear.h" #include "Classify.h" #include namespace jags { namespace glm { MNormalLinear::MNormalLinear(StochasticNode const *snode, unsigned int chain) : Outcome(snode, chain), _value(snode->value(chain)), _mean(snode->parents()[0]->value(chain)), _precision(snode->parents()[1]->value(chain)) { } double MNormalLinear::value() const { return 0; } double MNormalLinear::precision() const { return 0; } bool MNormalLinear::canRepresent(StochasticNode const *snode) { return snode->distribution()->name() == "dmnorm" && getLink(snode) == LNK_LINEAR; } double const *MNormalLinear::vvalue() const { return _value; } double const *MNormalLinear::vmean() const { return _mean; } double const *MNormalLinear::vprecision() const { return _precision; } }} JAGS-4.3.2/src/modules/glm/samplers/REMethod2.cc0000664000175000017500000001332614224052515016100 00000000000000#include #include "REMethod2.h" #include "GLMMethod.h" #include "Outcome.h" #include #include #include #include #include #include #include #include using std::vector; using std::sqrt; using std::fill; using std::set; extern cholmod_common *glm_wk; namespace jags { namespace glm { static unsigned int sumLengths(vector const &outcomes) { unsigned int s = 0; for (unsigned int i = 0; i < outcomes.size(); ++i) { s += outcomes[i]->length(); } return s; } REMethod2::REMethod2(SingletonGraphView const *tau, GLMMethod const *glmmethod) : _tau(tau), _eps(glmmethod->_view), _outcomes(glmmethod->_outcomes), _x(glmmethod->_x), _chain(glmmethod->_chain) { vector const &enodes = _eps->nodes(); vector const &schild = tau->stochasticChildren(); set sset; sset.insert(schild.begin(), schild.end()); for (unsigned int i = 0; i < enodes.size(); ++i) { if (sset.count(enodes[i])) { if (tau->isDependent(enodes[i]->parents()[0])) { throwLogicError("Invalid REMethod2"); } _indices.push_back(i); } } if (_indices.size() != schild.size()) { throwLogicError("Invalid REMethod2"); } unsigned int nrow = sumLengths(_outcomes); unsigned int ncol = tau->stochasticChildren()[0]->length(); _z = cholmod_allocate_dense(nrow, ncol, nrow, CHOLMOD_REAL, glm_wk); } REMethod2::~REMethod2() { cholmod_free_dense(&_z, glm_wk); } void REMethod2::calDesignSigma() { //Sanity checks //unsigned int Neps = _eps->nodes().size(); if (_z->nrow != _x->nrow) { throwLogicError("Row mismatch in REMethod2"); } /* if (_x->ncol != _z->ncol * Neps || _x->ncol != _eps->length()) { throwLogicError("Column mismatch in REMethod2"); } */ //Set up access to sparse design matrix for eps int const *Xp = static_cast(_x->p); int const *Xi = static_cast(_x->i); double const *Xx = static_cast(_x->x); //Set up access to dense design matrix for sigma double *Zx = static_cast(_z->x); //Set all elements of _z to zero. fill(Zx, Zx + _z->nzmax, 0); //If there are m columns of _z then _z[,i] is the sum of //every mth column of _x (starting with _x[,i]), //multiplied by the corresponding random effect vector const &eps=_eps->nodes(); for (unsigned int j = 0; j < _indices.size(); ++j) { unsigned int i = _indices[j]; double const *eval = eps[i]->value(_chain); double const *emean = eps[i]->parents()[0]->value(_chain); for (unsigned int zcol = 0; zcol < _z->ncol; ++zcol) { int xcol = i * _z->ncol + zcol; for (int xi = Xp[xcol]; xi < Xp[xcol+1]; ++xi) { int row = Xi[xi]; int zi = _z->nrow * zcol + row; Zx[zi] += Xx[xi] * (eval[zcol] - emean[zcol]); } } } } void REMethod2::update(RNG *rng) { updateTau(rng); //Sufficient parameterization updateSigma(rng); //Ancillary parameterization } void REMethod2::calCoefSigma(double *A, double *b, double const *sigma0, unsigned int m) const { double const *Zx = static_cast(_z->x); unsigned int N = _outcomes.size(); int xrow = 0; for (unsigned int i = 0; i < N; ++i) { unsigned int n = _outcomes[i]->length(); if (n == 1) { //Scalar outcome double Y = _outcomes[i]->value(); double mu = _outcomes[i]->mean(); double lambda = _outcomes[i]->precision(); vector X(m); for (unsigned int j = 0; j < m; ++j) { X[j] = Zx[j * _z->nrow + xrow]/sigma0[j]; } for (unsigned int j = 0; j < m; ++j) { for (unsigned int k = 0; k < m; ++k) { A[j*m + k] += X[j] * X[k] * lambda; } b[j] += (Y - mu) * X[j] * lambda; } } else { //Multivariate outcome double const *Y = _outcomes[i]->vvalue(); double const *mu = _outcomes[i]->vmean(); double const *lambda = _outcomes[i]->vprecision(); // delta = Y - mu vector delta(n); for (unsigned int p = 0; p < n; ++p) { delta[p] = Y[p] - mu[p]; } //X = Scaled design matrix for outcome i vector X(m*n); //n x m matrix for (unsigned int j = 0; j < m; ++j) { double const *Zj = &Zx[j * _z->nrow + xrow]; for (unsigned int p = 0; p < n; ++p) { X[j*n + p] = Zj[p]/sigma0[j]; } } // Tx = lambda %*% X (n x m matrix) vector TX(n*m, 0); for (unsigned int j = 0; j < m; ++j) { for (unsigned int p = 0; p < n; ++p) { b[j] += delta[p] * X[j*n + p]; for (unsigned int q = 0; q < n; ++q) { TX[j*n + p] += lambda[n*p + q] * X[j*n + q]; } } } for (unsigned int j = 0; j < m; ++j) { for (unsigned int p = 0; p < n; ++p) { b[j] += delta[p] * TX[j*n + p]; for (unsigned int k = 0; k < m; ++k) { A[j*m + k] += X[j*n + p] * TX[k*n + p]; } } } } xrow += n; } } double REMethod2::logLikelihoodSigma(double const *sigma, double const *sigma0, unsigned int m) const { vector A(m*m, 0); vector b(m, 0); calCoefSigma(&A[0], &b[0], sigma0, m); vector delta(m); for (unsigned int i = 0; i < m; ++i) { delta[i] = sigma[i] - sigma0[i]; } double loglik = 0; for (unsigned int i = 0; i < m; ++i) { loglik += b[i] * delta[i]; for (unsigned int j = 0; j < m; ++j) { loglik -= delta[i] * A[i*m + j] * delta[j] /2.0; } } return loglik; } } } JAGS-4.3.2/src/modules/glm/samplers/REFactory2.cc0000664000175000017500000000565214224052515016272 00000000000000#include #include "REFactory2.h" #include "REMethod2.h" #include "GLMSampler.h" #include #include #include #include #include #include using std::vector; using std::string; using std::list; using std::set; namespace jags { namespace glm { REFactory2::REFactory2(std::string const &name) : _name(name) {} bool REFactory2::checkTau(SingletonGraphView const *tau, GraphView const *glmview) const { if (!tau->deterministicChildren().empty()) { return false; } vector const &eps = tau->stochasticChildren(); for (unsigned int i = 0; i < eps.size(); ++i) { if (isObserved(eps[i])) { return false; } if (isBounded(eps[i])) { return false; } if (eps[i]->distribution()->name() != "dnorm" && eps[i]->distribution()->name() != "dmnorm") { return false; } Node const *mu_tau = eps[i]->parents()[1]; if (mu_tau != tau->node()) { return false; } if (tau->isDependent(eps[i]->parents()[0])) { return false; //mean parameter depends on snode } } //Check that all stochastic children of tau are included in //the linear predictor of the glm if (glmview->nodes().size() < eps.size()) { return false; } set lpset; lpset.insert(glmview->nodes().begin(), glmview->nodes().end()); for (unsigned int i = 0; i < eps.size(); ++i) { if (lpset.count(eps[i]) == 0) { return false; } } return true; //We made it! } REFactory2::~REFactory2() {} Sampler * REFactory2::makeSampler( list const &free_nodes, set &used_nodes, GLMSampler const *glmsampler, Graph const &graph) const { SingletonGraphView *tau = 0; for (list::const_iterator p = free_nodes.begin(); p != free_nodes.end(); ++p) { if (used_nodes.count(*p)) continue; if (canSample(*p)) { tau = new SingletonGraphView(*p, graph); if (checkTau(tau, glmsampler->_view)) { break; } else { delete tau; tau = 0; } } } /* Create a single GraphView containing all sampled nodes (from tau and from eps). This is required by the Sampler class. Note that this is a multilevel GraphView. vector snodes = eps->nodes(); snodes.push_back(tau->node()); GraphView *view = new GraphView(snodes, graph, true); */ if (tau) { unsigned int nchain = glmsampler->_methods.size(); vector methods(nchain); for (unsigned int i = 0; i < nchain; ++i) { methods[i] = newMethod(tau, glmsampler->_methods[i]); } used_nodes.insert(tau->node()); return new MutableSampler(tau, methods, _name); } return 0; } } // namespace glm } //namespace jags JAGS-4.3.2/src/modules/glm/samplers/REGammaSlicer2.cc0000664000175000017500000000250314224052371017037 00000000000000#include "REGammaSlicer2.h" #include "REGamma2.h" #include namespace jags { namespace glm { REGammaSlicer2::REGammaSlicer2(REGamma2 const *regamma, double const *shape, double const *rate, double sigma) : Slicer(1, 10), _regamma(regamma), _shape(shape), _rate(rate), _sigma(sigma), _sigma0(sigma) { } double REGammaSlicer2::value() const { return _sigma; } void REGammaSlicer2::setValue(double x) { _sigma = x; } void REGammaSlicer2::setSigma(double x) { _sigma0 = _sigma = x; } void REGammaSlicer2::getLimits(double *lower, double *upper) const { *lower = 1e-06; *upper = 1e06; } double REGammaSlicer2::logDensity() const { /* Log gamma prior on tau, the precision parameter, with a Jacobian term for the transformation to the standard deviation parameter _sigma */ double tau = 1/(_sigma * _sigma); double scale = 1/(*_rate); double logprior = dgamma(tau, *_shape, scale, 1) - 3 * log(_sigma); /* For the likelihood, We refer back to the REGamma object that owns this REGammaSlicer2 object. */ double loglik = _regamma->logLikelihoodSigma(&_sigma, &_sigma0, 1); return logprior + loglik; } void REGammaSlicer2::update(RNG *rng) { updateStep(rng); } } } JAGS-4.3.2/src/modules/glm/samplers/REGamma2.cc0000664000175000017500000000417714224052371015706 00000000000000#include #include "REGamma2.h" #include #include #include #include #include using std::vector; using std::sqrt; namespace jags { //Utility functions used by the constructor static inline double const * SHAPE(SingletonGraphView const *tau, unsigned int chain) { return tau->node()->parents()[0]->value(chain); } static inline double const * RATE(SingletonGraphView const *tau, unsigned int chain) { return tau->node()->parents()[1]->value(chain); } static inline double SIGMA(SingletonGraphView const *tau, unsigned int chain) { return 1.0/sqrt(*tau->node()->value(chain)); } namespace glm { class Outcome; REGamma2::REGamma2(SingletonGraphView const *tau, GLMMethod const *glmmethod) : REMethod2(tau, glmmethod), _slicer(this, SHAPE(tau, _chain), RATE(tau, _chain), SIGMA(tau, _chain)) { } void REGamma2::updateTau(RNG *rng) { vector const &par = _tau->node()->parents(); double shape = *par[0]->value(_chain); double rate = *par[1]->value(_chain); //(1/scale) // Likelihood vector const &eps = _tau->stochasticChildren(); for (unsigned int i = 0; i < eps.size(); ++i) { double Y = *eps[i]->value(_chain); double mu = *eps[i]->parents()[0]->value(_chain); shape += 0.5; rate += (Y - mu) * (Y - mu) / 2.0; } double x = rgamma(shape, 1.0/rate, rng); _tau->setValue(&x, 1, _chain); } void REGamma2::updateSigma(RNG *rng) { double tau = _tau->node()->value(_chain)[0]; double sigma0 = 1/sqrt(tau); calDesignSigma(); _slicer.setSigma(sigma0); _slicer.update(rng); double sigma1 = _slicer.value(); //Set new value of precision parameter double x = 1/(sigma1 * sigma1); _tau->setValue(&x, 1, _chain); } bool REGamma2::isAdaptive() const { return true; } void REGamma2::adaptOff() { _slicer.adaptOff(); } bool REGamma2::checkAdaptation() const { return _slicer.checkAdaptation(); } } } JAGS-4.3.2/src/modules/glm/samplers/REGammaFactory2.cc0000664000175000017500000000115114224052371017223 00000000000000#include #include "REGammaFactory2.h" #include "REGamma2.h" #include using std::vector; namespace jags { namespace glm { REGammaFactory2::REGammaFactory2() : REFactory2("glm::REGamma2") {} REGammaFactory2::~REGammaFactory2() {} bool REGammaFactory2::canSample(StochasticNode *snode) const { return snode->distribution()->name() == "dgamma"; } REMethod2 * REGammaFactory2::newMethod(SingletonGraphView const *tau, GLMMethod const *glmmethod) const { return new REGamma2(tau, glmmethod); } } // namespace glm } //namespace jags JAGS-4.3.2/src/modules/glm/samplers/REScaledGamma2.cc0000664000175000017500000000445014224052371017014 00000000000000#include #include "REScaledGamma2.h" #include #include #include #include #include using std::vector; using std::sqrt; extern cholmod_common *glm_wk; namespace jags { namespace glm { REScaledGamma2::REScaledGamma2(SingletonGraphView const *tau, GLMMethod const *glmmethod) : REMethod2(tau, glmmethod) { //Initialize hyper-parameter _sigma vector const &par = tau->node()->parents(); double S = *par[0]->value(_chain); //Prior scale double df = *par[1]->value(_chain); //Prior degrees of freedom double x = tau->node()->value(_chain)[0]; double a_shape = (1 + df)/2; // shape double a_rate = df * x + 1/(S*S); // 1/scale _sigma = sqrt(a_shape/a_rate); } void REScaledGamma2::updateTau(RNG *rng) { double df = *_tau->node()->parents()[1]->value(_chain); // Prior double shape = df/2.0; double rate = df * _sigma * _sigma / 2.0; // 1/scale // Likelihood vector const &eps = _tau->stochasticChildren(); for (unsigned int i = 0; i < eps.size(); ++i) { double Y = *eps[i]->value(_chain); double mu = *eps[i]->parents()[0]->value(_chain); shape += 0.5; rate += (Y - mu) * (Y - mu) / 2.0; } double x = rgamma(shape, 1.0/rate, rng); _tau->setValue(&x, 1, _chain); } void REScaledGamma2::updateSigma(RNG *rng) { double sigma0 = _sigma; calDesignSigma(); //Prior scale vector const &par = _tau->node()->parents(); double S = *par[0]->value(_chain); //Get parameters of posterior distribution for _sigma //Precision is A and mean is b/A double priorprec = 1.0/(S*S); double A = priorprec; double b = - _sigma * priorprec; calCoefSigma(&A, &b, &_sigma, 1); //Set new value of sigma _sigma = lnormal(0, rng, _sigma + b/A, 1/sqrt(A)); //Rescale tau double tau = *_tau->node()->value(_chain); tau *= (sigma0 * sigma0)/(_sigma * _sigma); _tau->setValue(&tau, 1, _chain); } bool REScaledGamma2::isAdaptive() const { return false; } void REScaledGamma2::adaptOff() { } bool REScaledGamma2::checkAdaptation() const { return true; } } } JAGS-4.3.2/src/modules/glm/samplers/REScaledGammaFactory2.cc0000664000175000017500000000125314224052371020342 00000000000000#include #include "REScaledGammaFactory2.h" #include "REScaledGamma2.h" #include using std::vector; namespace jags { namespace glm { REScaledGammaFactory2::REScaledGammaFactory2() : REFactory2("glm::REScaledGamma2") {} REScaledGammaFactory2::~REScaledGammaFactory2() {} bool REScaledGammaFactory2::canSample(StochasticNode *snode) const { return snode->distribution()->name() == "dscaled.gamma"; } REMethod2 * REScaledGammaFactory2::newMethod(SingletonGraphView const *tau, GLMMethod const *glmmethod) const { return new REScaledGamma2(tau, glmmethod); } } // namespace glm } //namespace jags JAGS-4.3.2/src/modules/glm/samplers/REScaledWishart2.cc0000664000175000017500000000756714224052515017427 00000000000000#include #include "REScaledWishart2.h" #include "Outcome.h" #include "RESampler.h" #include "SampleWishart.h" #include #include #include #include #include #include #include using std::vector; using std::sqrt; extern cholmod_common *glm_wk; namespace jags { namespace glm { REScaledWishart2::REScaledWishart2(SingletonGraphView const *tau, GLMMethod const *glmmethod) : REMethod2(tau, glmmethod) { vector const &par = tau->node()->parents(); double const *S = par[0]->value(_chain); //Prior scale unsigned int nrow = par[0]->length(); double tdf = *par[1]->value(_chain); //Prior degrees of freedom double const *x = tau->node()->value(_chain); //Initialize hyper-parameter _sigma _sigma = vector(nrow); for (unsigned int j = 0; j < nrow; ++j) { double a_shape = (nrow + tdf)/2.0; double a_rate = tdf * x[j + nrow*j] + 1.0/(S[j]*S[j]); double a = a_shape/a_rate; _sigma[j] = sqrt(2*a); } } void REScaledWishart2::updateTau(RNG *rng) { int m = _sigma.size(); int m2 = m * m; double tdf = *_tau->node()->parents()[1]->value(_chain); //Prior double wdf = m + tdf - 1; //Degrees of freedom for Wishart vector R(m2, 0); //Scale matrix for Wishart for (int j = 0; j < m; ++j) { R[j*m + j] = tdf * _sigma[j] * _sigma[j]; } //Likelihood vector const &eps = _tau->stochasticChildren(); for (vector::const_iterator p = eps.begin(); p != eps.end(); ++p) { double const *Y = (*p)->value(_chain); double const *mu = (*p)->parents()[0]->value(_chain); //FIXME: We could use blas call dsyr here for (int j = 0; j < m; j++) { for (int k = 0; k < m; k++) { R[j*m + k] += (Y[j] - mu[j]) * (Y[k] - mu[k]); } } wdf += 1; } vector xnew(m2); sampleWishart(&xnew[0], m2, &R[0], wdf, m, rng); _tau->setValue(xnew, _chain); } void REScaledWishart2::updateSigma(RNG *rng) { vector sigma0 = _sigma; calDesignSigma(); //Prior scale vector const &par = _tau->node()->parents(); double const *S = par[0]->value(_chain); unsigned int m = _z->ncol; unsigned int m2 = m * m; //Get parameters of posterior distribution for _sigma //Precision is A and mean is inverse(A) %*% b //We work on a scale where the current value sigma0 is the origin vector A(m2, 0); vector b(m, 0); for (unsigned int j = 0; j < m; ++j) { double priorprec = 1.0/(S[j] * S[j]); A[j * m + j] = priorprec; b[j] = - sigma0[j] * priorprec; } calCoefSigma(&A[0], &b[0], &sigma0[0], m); //Sample each sigma from its full conditional //Fixme: wouldn't it be better to do block sampling here? //Fixme: not reversible for (unsigned int j = 0; j < m; ++j) { double sigma_mean = _sigma[j] + b[j]/A[j*m+j]; double sigma_sd = sqrt(1.0/A[j*m+j]); _sigma[j] = lnormal(0, rng, sigma_mean, sigma_sd); double delta = _sigma[j] - sigma0[j]; for (unsigned int k = 0; k < m; ++k) { b[k] -= delta * A[m*j + k]; } } //Rescale tau double const *tau0 = _tau->node()->value(_chain); vector scale(m); for (unsigned int j = 0; j < m; ++j) { scale[j] = sigma0[j]/_sigma[j]; } vector tau_scaled(m2); for (unsigned int j = 0; j < m; ++j) { for (unsigned int k = 0; k < m; ++k) { tau_scaled[j*m+k] = tau0[j*m+k] * scale[j] * scale[k]; } } _tau->setValue(tau_scaled, _chain); } bool REScaledWishart2::isAdaptive() const { return false; } void REScaledWishart2::adaptOff() { } bool REScaledWishart2::checkAdaptation() const { return true; } } } JAGS-4.3.2/src/modules/glm/samplers/REScaledWishartFactory2.cc0000664000175000017500000000130314224052515020735 00000000000000#include #include "REScaledWishartFactory2.h" #include "REScaledWishart2.h" #include using std::vector; namespace jags { namespace glm { REScaledWishartFactory2::REScaledWishartFactory2() : REFactory2("glm::REScaledWishart2") {} REScaledWishartFactory2::~REScaledWishartFactory2() {} bool REScaledWishartFactory2::canSample(StochasticNode *snode) const { return snode->distribution()->name() == "dscaled.wishart"; } REMethod2 * REScaledWishartFactory2::newMethod(SingletonGraphView const *tau, GLMMethod const *glmmethod) const { return new REScaledWishart2(tau, glmmethod); } } // namespace glm } //namespace jags JAGS-4.3.2/src/modules/glm/samplers/testglmsamp.cc0000664000175000017500000000212414224052371016701 00000000000000#include "testglmsamp.h" #include "LGMix.h" #include #include #include using std::vector; using std::stringstream; void GLMSampTest::setUp() { } void GLMSampTest::tearDown() { } void GLMSampTest::lgmix() { //CPPUNIT_FAIL("lgmix"); vector means; vector weights; vector variances; for (unsigned int i = 1; i < 30002; ++i) { jags::glm::LGMix lg(i); lg.getParameters(weights, means, variances); double S = 0.0; double S2 = 0.0; double W = 0.0; for (unsigned int j = 0; j < weights.size(); ++j) { W += weights[j]; S += weights[j] * means[j]; } for (unsigned int j = 0; j < weights.size(); ++j) { S2 += weights[j] * ((means[j] - S) * (means[j] - S) + variances[j]); } S += digamma(i); S /= sqrt(trigamma(i)); S2 /= trigamma(i); std::stringstream msg; msg << "n = "; msg << i; CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(msg.str(), 1.0, W, 1.0E-6); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(msg.str(), 0.0, S, 1.0E-2); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(msg.str(), 1.0, sqrt(S2), 1.0E-2); } } JAGS-4.3.2/src/modules/glm/samplers/testglmsamp.h0000664000175000017500000000057614224052371016554 00000000000000#ifndef GLM_SAMP_TEST_H #define GLM_SAMP_TEST_H #include #include class GLMSampTest : public CppUnit::TestFixture , public JAGSFixture { CPPUNIT_TEST_SUITE( GLMSampTest ); CPPUNIT_TEST( lgmix ); CPPUNIT_TEST_SUITE_END(); public: void setUp(); void tearDown(); void lgmix(); }; #endif // GLM_SAMP_TEST_H JAGS-4.3.2/src/modules/glm/distributions/0000755000175000017500000000000014400711327015164 500000000000000JAGS-4.3.2/src/modules/glm/distributions/Makefile.am0000664000175000017500000000107214224052371017143 00000000000000noinst_LTLIBRARIES = libglmdist.la libglmdist_la_CPPFLAGS = -I$(top_srcdir)/src/include libglmdist_la_SOURCES = DScaledGamma.cc DScaledWishart.cc \ DOrdered.cc DOrderedLogit.cc DOrderedProbit.cc noinst_HEADERS = DScaledGamma.h DScaledWishart.h \ DOrdered.h DOrderedLogit.h DOrderedProbit.h ## Test library if CANCHECK check_LTLIBRARIES = libglmdisttest.la libglmdisttest_la_SOURCES = testglmdist.cc testglmdist.h libglmdisttest_la_CPPFLAGS = -I$(top_srcdir)/src/include \ -I$(top_srcdir)/src/modules/base/rngs libglmdisttest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) endif JAGS-4.3.2/src/modules/glm/distributions/DScaledGamma.h0000664000175000017500000000216714224052515017530 00000000000000#ifndef DSCALED_GAMMA_H_ #define DSCALED_GAMMA_H_ #include namespace jags { namespace glm { /** * @short Prior distribution for scalar precision * * The scaled F distribution on 1, n degrees of freedom *
	 * f(x| n1, n2) = s Gamma((n1 + n2)/2) / (Gamma(n1/2) Gamma(n2/2))      
	 *                (n1/n2)^(n1/2) (s x)^(n1/2 - 1)                  
	 *                (1 + (n1/n2) s x)^-(n1 + n2)/2   
	 * 
*/ class DScaledGamma : public RScalarDist { public: DScaledGamma(); double d(double x, PDFType type, std::vector const ¶meters, bool log) const; double p(double x, std::vector const ¶meters, bool lower, bool log) const; double q(double x, std::vector const ¶meters, bool lower, bool log) const; double r(std::vector const ¶meters, RNG *rng) const; /** * Check that s > 0 and n > 0 */ bool checkParameterValue(std::vector const &pars) const; }; } } #endif /* DSCALED_GAMMA_H_ */ JAGS-4.3.2/src/modules/glm/distributions/DScaledWishart.h0000664000175000017500000000363114224052515020124 00000000000000#ifndef DSCALED_WISHART_H_ #define DSCALED_WISHART_H_ #include namespace jags { namespace glm { /** *
 * x[] ~ dwish(S[], k)
 * 
* @short Huang and Wand scaled Wishart distribution */ class DScaledWishart : public ArrayDist { public: DScaledWishart(); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector > const &dims, double const *lower, double const *upper) const; static void sampleWishart(double *x, unsigned int length, double const *scale, unsigned int nrow, double k, RNG *rng); /** * Checks that S is a vector and k is a scalar */ bool checkParameterDim(std::vector > const &dims) const; /** * Checks that S and k are both positive */ bool checkParameterValue(std::vector const ¶meters, std::vector > const &dims) const; std::vector dim(std::vector > const &dims) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector > const &dims) const; bool isSupportFixed(std::vector const &fixmask) const; unsigned int df(std::vector > const &dims) const; }; }} #endif /* DSCALED_WISHART_H_ */ JAGS-4.3.2/src/modules/glm/distributions/DOrdered.h0000664000175000017500000000375314224052515016760 00000000000000#ifndef DORDERED_H_ #define DORDERED_H_ #include namespace jags { namespace glm { /** * @short Base class for ordered categorical distributions */ class DOrdered : public VectorDist { private: double density(double x, double mu, double const *cut, int ncut, bool give_log) const; public: DOrdered(std::string const &name); double logDensity(double const *x, unsigned int length, PDFType type, std::vector const ¶meters, std::vector const &lengths, double const *lower, double const *upper) const; void randomSample(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lbound, double const *ubound, RNG *rng) const; void typicalValue(double *x, unsigned int length, std::vector const ¶meters, std::vector const &lengths, double const *lbound, double const *ubound) const; bool checkParameterValue(std::vector const &par, std::vector const &lengths) const; void support(double *lower, double *upper, unsigned int length, std::vector const ¶meters, std::vector const &lengths) const; bool isSupportFixed(std::vector const &fixmask) const; bool isDiscreteValued(std::vector const &mask) const; bool checkParameterLength(std::vector const &lengths) const; unsigned int length(std::vector const &lengths) const; double KL(std::vector const &par0, std::vector const &par1, std::vector const &lengths) const; virtual double r(double mu, RNG *rng) const = 0; virtual double p(double x, double mu, bool lower, bool give_log) const = 0; }; } } #endif /* DORDERED_H_ */ JAGS-4.3.2/src/modules/glm/distributions/DOrderedLogit.h0000664000175000017500000000054414224052515017752 00000000000000#ifndef DORDERED_LOGIT_H_ #define DORDERED_LOGIT_H_ #include "DOrdered.h" namespace jags { namespace glm { class DOrderedLogit : public DOrdered { public: DOrderedLogit(); double r(double mu, RNG *rng) const; double p(double x, double mu, bool lower, bool give_log) const; }; } } #endif /* DORDERED_LOGIT_H_ */ JAGS-4.3.2/src/modules/glm/distributions/DOrderedProbit.h0000664000175000017500000000055114224052515020131 00000000000000#ifndef DORDERED_PROBIT_H_ #define DORDERED_PROBIT_H_ #include "DOrdered.h" namespace jags { namespace glm { class DOrderedProbit : public DOrdered { public: DOrderedProbit(); double r(double mu, RNG *rng) const; double p(double x, double mu, bool lower, bool give_log) const; }; } } #endif /* DORDERED_PROBIT_H_ */ JAGS-4.3.2/src/modules/glm/distributions/Makefile.in0000644000175000017500000007334514400675236017175 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/modules/glm/distributions ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libglmdist_la_LIBADD = am_libglmdist_la_OBJECTS = libglmdist_la-DScaledGamma.lo \ libglmdist_la-DScaledWishart.lo libglmdist_la-DOrdered.lo \ libglmdist_la-DOrderedLogit.lo libglmdist_la-DOrderedProbit.lo libglmdist_la_OBJECTS = $(am_libglmdist_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libglmdisttest_la_LIBADD = am__libglmdisttest_la_SOURCES_DIST = testglmdist.cc testglmdist.h @CANCHECK_TRUE@am_libglmdisttest_la_OBJECTS = \ @CANCHECK_TRUE@ libglmdisttest_la-testglmdist.lo libglmdisttest_la_OBJECTS = $(am_libglmdisttest_la_OBJECTS) libglmdisttest_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(libglmdisttest_la_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ @CANCHECK_TRUE@am_libglmdisttest_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/libglmdist_la-DOrdered.Plo \ ./$(DEPDIR)/libglmdist_la-DOrderedLogit.Plo \ ./$(DEPDIR)/libglmdist_la-DOrderedProbit.Plo \ ./$(DEPDIR)/libglmdist_la-DScaledGamma.Plo \ ./$(DEPDIR)/libglmdist_la-DScaledWishart.Plo \ ./$(DEPDIR)/libglmdisttest_la-testglmdist.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libglmdist_la_SOURCES) $(libglmdisttest_la_SOURCES) DIST_SOURCES = $(libglmdist_la_SOURCES) \ $(am__libglmdisttest_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libglmdist.la libglmdist_la_CPPFLAGS = -I$(top_srcdir)/src/include libglmdist_la_SOURCES = DScaledGamma.cc DScaledWishart.cc \ DOrdered.cc DOrderedLogit.cc DOrderedProbit.cc noinst_HEADERS = DScaledGamma.h DScaledWishart.h \ DOrdered.h DOrderedLogit.h DOrderedProbit.h @CANCHECK_TRUE@check_LTLIBRARIES = libglmdisttest.la @CANCHECK_TRUE@libglmdisttest_la_SOURCES = testglmdist.cc testglmdist.h @CANCHECK_TRUE@libglmdisttest_la_CPPFLAGS = -I$(top_srcdir)/src/include \ @CANCHECK_TRUE@ -I$(top_srcdir)/src/modules/base/rngs @CANCHECK_TRUE@libglmdisttest_la_CXXFLAGS = $(CPPUNIT_CFLAGS) all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/glm/distributions/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/glm/distributions/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-checkLTLIBRARIES: -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) @list='$(check_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libglmdist.la: $(libglmdist_la_OBJECTS) $(libglmdist_la_DEPENDENCIES) $(EXTRA_libglmdist_la_DEPENDENCIES) $(AM_V_CXXLD)$(CXXLINK) $(libglmdist_la_OBJECTS) $(libglmdist_la_LIBADD) $(LIBS) libglmdisttest.la: $(libglmdisttest_la_OBJECTS) $(libglmdisttest_la_DEPENDENCIES) $(EXTRA_libglmdisttest_la_DEPENDENCIES) $(AM_V_CXXLD)$(libglmdisttest_la_LINK) $(am_libglmdisttest_la_rpath) $(libglmdisttest_la_OBJECTS) $(libglmdisttest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmdist_la-DOrdered.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmdist_la-DOrderedLogit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmdist_la-DOrderedProbit.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmdist_la-DScaledGamma.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmdist_la-DScaledWishart.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libglmdisttest_la-testglmdist.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< libglmdist_la-DScaledGamma.lo: DScaledGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmdist_la-DScaledGamma.lo -MD -MP -MF $(DEPDIR)/libglmdist_la-DScaledGamma.Tpo -c -o libglmdist_la-DScaledGamma.lo `test -f 'DScaledGamma.cc' || echo '$(srcdir)/'`DScaledGamma.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmdist_la-DScaledGamma.Tpo $(DEPDIR)/libglmdist_la-DScaledGamma.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DScaledGamma.cc' object='libglmdist_la-DScaledGamma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmdist_la-DScaledGamma.lo `test -f 'DScaledGamma.cc' || echo '$(srcdir)/'`DScaledGamma.cc libglmdist_la-DScaledWishart.lo: DScaledWishart.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmdist_la-DScaledWishart.lo -MD -MP -MF $(DEPDIR)/libglmdist_la-DScaledWishart.Tpo -c -o libglmdist_la-DScaledWishart.lo `test -f 'DScaledWishart.cc' || echo '$(srcdir)/'`DScaledWishart.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmdist_la-DScaledWishart.Tpo $(DEPDIR)/libglmdist_la-DScaledWishart.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DScaledWishart.cc' object='libglmdist_la-DScaledWishart.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmdist_la-DScaledWishart.lo `test -f 'DScaledWishart.cc' || echo '$(srcdir)/'`DScaledWishart.cc libglmdist_la-DOrdered.lo: DOrdered.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmdist_la-DOrdered.lo -MD -MP -MF $(DEPDIR)/libglmdist_la-DOrdered.Tpo -c -o libglmdist_la-DOrdered.lo `test -f 'DOrdered.cc' || echo '$(srcdir)/'`DOrdered.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmdist_la-DOrdered.Tpo $(DEPDIR)/libglmdist_la-DOrdered.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DOrdered.cc' object='libglmdist_la-DOrdered.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmdist_la-DOrdered.lo `test -f 'DOrdered.cc' || echo '$(srcdir)/'`DOrdered.cc libglmdist_la-DOrderedLogit.lo: DOrderedLogit.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmdist_la-DOrderedLogit.lo -MD -MP -MF $(DEPDIR)/libglmdist_la-DOrderedLogit.Tpo -c -o libglmdist_la-DOrderedLogit.lo `test -f 'DOrderedLogit.cc' || echo '$(srcdir)/'`DOrderedLogit.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmdist_la-DOrderedLogit.Tpo $(DEPDIR)/libglmdist_la-DOrderedLogit.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DOrderedLogit.cc' object='libglmdist_la-DOrderedLogit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmdist_la-DOrderedLogit.lo `test -f 'DOrderedLogit.cc' || echo '$(srcdir)/'`DOrderedLogit.cc libglmdist_la-DOrderedProbit.lo: DOrderedProbit.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libglmdist_la-DOrderedProbit.lo -MD -MP -MF $(DEPDIR)/libglmdist_la-DOrderedProbit.Tpo -c -o libglmdist_la-DOrderedProbit.lo `test -f 'DOrderedProbit.cc' || echo '$(srcdir)/'`DOrderedProbit.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmdist_la-DOrderedProbit.Tpo $(DEPDIR)/libglmdist_la-DOrderedProbit.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DOrderedProbit.cc' object='libglmdist_la-DOrderedProbit.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdist_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libglmdist_la-DOrderedProbit.lo `test -f 'DOrderedProbit.cc' || echo '$(srcdir)/'`DOrderedProbit.cc libglmdisttest_la-testglmdist.lo: testglmdist.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdisttest_la_CPPFLAGS) $(CPPFLAGS) $(libglmdisttest_la_CXXFLAGS) $(CXXFLAGS) -MT libglmdisttest_la-testglmdist.lo -MD -MP -MF $(DEPDIR)/libglmdisttest_la-testglmdist.Tpo -c -o libglmdisttest_la-testglmdist.lo `test -f 'testglmdist.cc' || echo '$(srcdir)/'`testglmdist.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libglmdisttest_la-testglmdist.Tpo $(DEPDIR)/libglmdisttest_la-testglmdist.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='testglmdist.cc' object='libglmdisttest_la-testglmdist.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libglmdisttest_la_CPPFLAGS) $(CPPFLAGS) $(libglmdisttest_la_CXXFLAGS) $(CXXFLAGS) -c -o libglmdisttest_la-testglmdist.lo `test -f 'testglmdist.cc' || echo '$(srcdir)/'`testglmdist.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/libglmdist_la-DOrdered.Plo -rm -f ./$(DEPDIR)/libglmdist_la-DOrderedLogit.Plo -rm -f ./$(DEPDIR)/libglmdist_la-DOrderedProbit.Plo -rm -f ./$(DEPDIR)/libglmdist_la-DScaledGamma.Plo -rm -f ./$(DEPDIR)/libglmdist_la-DScaledWishart.Plo -rm -f ./$(DEPDIR)/libglmdisttest_la-testglmdist.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/libglmdist_la-DOrdered.Plo -rm -f ./$(DEPDIR)/libglmdist_la-DOrderedLogit.Plo -rm -f ./$(DEPDIR)/libglmdist_la-DOrderedProbit.Plo -rm -f ./$(DEPDIR)/libglmdist_la-DScaledGamma.Plo -rm -f ./$(DEPDIR)/libglmdist_la-DScaledWishart.Plo -rm -f ./$(DEPDIR)/libglmdisttest_la-testglmdist.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-checkLTLIBRARIES clean-generic clean-libtool \ clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/glm/distributions/DScaledGamma.cc0000664000175000017500000000262314224052515017663 00000000000000#include #include "DScaledGamma.h" #include #include using std::vector; static inline double S(vector const &par) { return (*par[0]) * (*par[0]); } static inline double logS(vector const &par) { return 2 * log(*par[0]); } static inline double DF(vector const &par) { return *par[1]; } namespace jags { namespace glm { DScaledGamma::DScaledGamma() : RScalarDist("dscaled.gamma", 2, DIST_POSITIVE) {} bool DScaledGamma::checkParameterValue (vector const &par) const { return (*par[0] > 0 && *par[1] > 0); } double DScaledGamma::d(double x, PDFType type, vector const &par, bool give_log) const { if (give_log) { return dF(S(par) * x, DF(par), 1, true) + logS(par); } else { return dF(S(par) * x, DF(par), 1, false) * S(par); } } double DScaledGamma::p(double x, vector const &par, bool lower, bool use_log) const { return pF(S(par) * x, DF(par), 1, lower, use_log); } double DScaledGamma::q(double p, vector const &par, bool lower, bool log_p) const { return qF(p, DF(par), 1, lower, log_p) / S(par); } double DScaledGamma::r(vector const &par, RNG *rng) const { return rF(DF(par), 1, rng) / S(par); } } } JAGS-4.3.2/src/modules/glm/distributions/DScaledWishart.cc0000664000175000017500000001460014224052515020260 00000000000000#include #include #include #include #include #include "DScaledWishart.h" #include #include #include #include #include using std::vector; using std::log; using std::copy; #define SCALE(par) (par[0]) #define DF(par) (*par[1]) #define NROW(dims) (dims[0][0]) #define F77_DSYEV F77_FUNC(dsyev,DSYEV) extern "C" { void F77_DSYEV (const char* jobz, const char* uplo, const int* n, double* a, const int* lda, double* w, double* work, const int* lwork, int* info); } namespace jags { namespace glm { //FIXME: This is copy-pasted from the bugs module static double logdet(double const *a, int n) { // Log determinant of n x n symmetric positive matrix a */ int N = n*n; vector acopy(N); copy(a, a+N, acopy.begin()); vector w(n); int lwork = -1; double worktest = 0; int info = 0; F77_DSYEV("N","U", &n, &acopy[0], &n, &w[0], &worktest, &lwork, &info); if (info != 0) { throwRuntimeError("unable to calculate workspace size for dsyev"); } lwork = static_cast(worktest); double *work = new double[lwork]; F77_DSYEV("N","U", &n, &acopy[0], &n, &w[0], work, &lwork, &info); delete [] work; if (info != 0) { throwRuntimeError("unable to calculate eigenvalues in dsyev"); } if (w[0] <= 0) { throwRuntimeError("Non positive definite matrix in call to logdet"); } double logdet = 0; for (int i = 0; i < n; i++) { logdet += log(w[i]); } return logdet; } static double log_multigamma(double n, unsigned int p) { double y = (p * (p-1) * log(M_PI))/4; for (unsigned int j = 0; j < p; ++j) { y += lgammafn((n-j)/2); } return y; } DScaledWishart::DScaledWishart() : ArrayDist("dscaled.wishart", 2) {} double DScaledWishart::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector > const &dims, double const *lower, double const *upper) const { double const *A = SCALE(par); unsigned int p = NROW(dims); double df = DF(par); double k = p + df - 1; double loglik = (k - p - 1) * logdet(x, p) / 2; for (unsigned int i = 0; i < p; ++i) { loglik -= (k+1) * log(df * x[i*p + i] + 1/(A[i]*A[i])) / 2; } if (type != PDF_PRIOR) { //Normalize density loglik += p * k * log(df) / 2; for (unsigned int i = 0; i < p; ++i) { loglik -= log(A[i]); } loglik += p * lgammafn((k+1)/2) - p * lgammafn(0.5) - - log_multigamma(k, p); } return loglik; } void DScaledWishart::sampleWishart(double *x, unsigned int length, double const *R, unsigned int nrow, double k, RNG *rng) { /* Generate random Wishart variable with diagonal prior matrix Equivalent to DWish(diag(R), k) The algorithm is adapted from bugs::DWish::randomSample but is considerably simpler. */ if (length != nrow * nrow) { throwLogicError("invalid length in DScaledWishart::sampleWishart"); } /* Generate square root of Wishart random variable: - diagonal elements are square root of Chi square - upper off-diagonal elements are normal - lower off-diagonal elements are zero */ vector > Z(nrow, vector(nrow)); for (unsigned int i = 0; i < nrow; ++i) { for (unsigned int l = 0; l < i; ++l) { Z[i][l] = rnorm(0, 1, rng); } Z[i][i] = sqrt(rchisq(k - i, rng)); } /* Take inverse square root of R */ vector scale(nrow); for (unsigned int i = 0; i < nrow; ++i) { scale[i] = 1/sqrt(R[i]); } /* Now put cross-product into x */ for (unsigned int i = 0; i < nrow; i++) { for (unsigned int j = 0; j <= i; j++) { double xx = 0; for (unsigned int l = 0; l <= j; l++) { xx += Z[i][l] * Z[j][l]; } x[nrow * j + i] = x[nrow * i + j] = scale[j] * scale[i] * xx; } } } void DScaledWishart::randomSample(double *x, unsigned int length, vector const &par, vector > const &dims, double const *lower, double const *upper, RNG *rng) const { unsigned int nrow = NROW(dims); double df = DF(par); double const *scale = SCALE(par); vector R(nrow); double k = nrow + df - 1; for (unsigned int i = 0; i < nrow; ++i) { //NB Rmath implementation of gamma is parameterized in terms of //shape and scale, unlike BUGS which uses shape and rate R[i] = 2 * df * rgamma(0.5, scale[i]*scale[i], rng); } sampleWishart(x, length, &R[0], nrow, k, rng); } bool DScaledWishart::checkParameterDim (vector > const &dims) const { return (isVector(dims[0]) || isScalar(dims[0])) && isScalar(dims[1]); } vector DScaledWishart::dim(vector > const &dims) const { if (isScalar(dims[0])) { return vector(1,1); } else { return vector (2, dims[0][0]); } } bool DScaledWishart::checkParameterValue(vector const &par, vector > const &dims) const { if (DF(par) < 1) return false; double const *scale = SCALE(par); unsigned int n = NROW(dims); for (unsigned int i = 0; i < n; ++i) { if (scale[i] <= 0) return false; } return true; } void DScaledWishart::support(double *lower, double *upper, unsigned int length, vector const &par, vector > const &dims) const { for (unsigned int i = 0; i < length; ++i) { if (i % NROW(dims) == i / NROW(dims)) { //Diagonal elements lower[i] = 0; } else { lower[i] = JAGS_NEGINF; } upper[i] = JAGS_POSINF; } } void DScaledWishart::typicalValue(double *x, unsigned int length, vector const &par, vector > const &dims, double const *lower, double const *upper) const { /* Returns the mean as a typical value. */ for (unsigned int i = 0; i < length; ++i) { x[i] = 0; } for (unsigned int i = 0; i < NROW(dims); ++i) { unsigned int k = i * NROW(dims) + i; x[k] = DF(par)/(SCALE(par)[i] * SCALE(par)[i]); } } bool DScaledWishart::isSupportFixed(vector const &fixmask) const { return true; } unsigned int DScaledWishart::df(vector > const &dims) const { return dims[0][0] * (dims[0][0] + 1) / 2; } }} JAGS-4.3.2/src/modules/glm/distributions/DOrdered.cc0000664000175000017500000000710014224052515017104 00000000000000#include #include "DOrdered.h" #include #include #include using std::log; using std::string; using std::vector; #define MU(par) (*par[0]) #define CUT(par) (par[1]) #define NCUT(lengths) (lengths[1]) namespace jags { namespace glm { DOrdered::DOrdered(string const &name) : VectorDist(name, 2) {} bool DOrdered::isDiscreteValued(vector const &mask) const { return true; } bool DOrdered::checkParameterValue(vector const &par, vector const &lengths) const { double const * cut = CUT(par); unsigned int ncut = NCUT(lengths); for (unsigned int i = 1; i < ncut; ++i) { if (cut[i] <= cut[i-1]) return false; } return true; } double DOrdered::density(double x, double mu, double const *cut, int ncut, bool give_log) const { int y = static_cast(x) - 1; if (y < 0 || y > ncut) { return JAGS_NEGINF; } else if (y == 0) { return p(cut[0], mu, true, give_log); } else if (y == ncut) { return p(cut[ncut - 1], mu, false, give_log); } else { double delta = p(cut[y], mu, true, false) - p(cut[y-1], mu, true, false); return give_log ? log(delta) : delta; } } double DOrdered::logDensity(double const *x, unsigned int length, PDFType type, vector const &par, vector const &lengths, double const *lower, double const *upper) const { return density(*x, MU(par), CUT(par), NCUT(lengths), true); } void DOrdered::randomSample(double *x, unsigned int length, vector const &par, vector const &lengths, double const *lower, double const *upper, RNG *rng) const { double y = r(MU(par), rng); for (unsigned int i = 0; i < NCUT(lengths); ++i) { if (y <= CUT(par)[i]) { *x = i + 1; return; } } *x = NCUT(lengths) + 1; } void DOrdered::support(double *lower, double *upper, unsigned int length, vector const &par, vector const &lengths) const { *lower = 1; *upper = NCUT(lengths) + 1; } void DOrdered::typicalValue(double *x, unsigned int length, vector const &par, vector const &lengths, double const *lower, double const *upper) const { double y = MU(par); for (unsigned int i = 0; i < NCUT(lengths); ++i) { if (y <= CUT(par)[i]) { *x = i + 1; return; } } *x = NCUT(lengths); } bool DOrdered::isSupportFixed(vector const &fixmask) const { return true; } bool DOrdered::checkParameterLength(vector const &lengths) const { return lengths[0] == 1 && NCUT(lengths) > 0; } unsigned int DOrdered::length(vector const &lengths) const { return 1; } double DOrdered::KL(vector const &par0, vector const &par1, vector const &lengths) const { double psum0 = 0, psum1 = 0, y = 0; for (unsigned int i = 0; i <= NCUT(lengths); ++i) { double p0 = density(i+1, MU(par0), CUT(par0), NCUT(lengths), false); double p1 = density(i+1, MU(par1), CUT(par1), NCUT(lengths), false); if (p0 == 0) { psum1 += p1; } else if (p1 == 0) { return JAGS_POSINF; } else { y += p0 * (log(p0) - log(p1)); psum0 += p0; psum1 += p1; } } y /= psum0; y -= (log(psum0) - log(psum1)); return y; } } } JAGS-4.3.2/src/modules/glm/distributions/DOrderedLogit.cc0000664000175000017500000000063614224052371020112 00000000000000#include "DOrderedLogit.h" #include namespace jags { namespace glm { DOrderedLogit::DOrderedLogit() : DOrdered("dordered.logit") {} double DOrderedLogit::r(double mu, RNG *rng) const { return rlogis(mu, 1.0, rng); } double DOrderedLogit::p(double x, double mu, bool lower, bool give_log) const { return plogis(x, mu, 1.0, lower, give_log); } } } JAGS-4.3.2/src/modules/glm/distributions/DOrderedProbit.cc0000664000175000017500000000063614224052371020273 00000000000000#include "DOrderedProbit.h" #include namespace jags { namespace glm { DOrderedProbit::DOrderedProbit() : DOrdered("dordered.probit") {} double DOrderedProbit::r(double mu, RNG *rng) const { return rnorm(mu, 1.0, rng); } double DOrderedProbit::p(double x, double mu, bool lower, bool give_log) const { return pnorm(x, mu, 1.0, lower, give_log); } } } JAGS-4.3.2/src/modules/glm/distributions/testglmdist.cc0000664000175000017500000003417514224052515017773 00000000000000#include #include "testglmdist.h" #include "DScaledGamma.h" #include "DScaledWishart.h" #include "DOrderedLogit.h" #include #include #include #include #include #include #include using std::string; using std::vector; using std::sqrt; using std::max; using std::min; using std::multiset; using std::abs; using std::ostringstream; using std::sort; #define F77_DPOTRF F77_FUNC(dpotrf,DPOTRF) #define F77_DPOTRI F77_FUNC(dpotri, DPOTRI) using jags::RScalarDist; extern "C" { void F77_DPOTRF (const char *uplo, const int *n, double *a, const int *lda, const int *info); void F77_DPOTRI (const char *uplo, const int *n, double *a, const int *lda, const int *info); } void GLMDistTest::setUp() { _rng = new jags::base::MersenneTwisterRNG(1234567, jags::KINDERMAN_RAMAGE); _dscaled_gamma = new jags::glm::DScaledGamma(); _dscaled_wishart = new jags::glm::DScaledWishart(); _dordered_logit = new jags::glm::DOrderedLogit(); } void GLMDistTest::tearDown() { delete _rng; delete _dscaled_gamma; delete _dscaled_wishart; delete _dordered_logit; } void GLMDistTest::npar() { //CPPUNIT_ASSERT_MESSAGE("npar check", false); CPPUNIT_ASSERT_EQUAL(_dscaled_gamma->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dscaled_wishart->npar(), 2U); CPPUNIT_ASSERT_EQUAL(_dordered_logit->npar(), 2U); } void GLMDistTest::name() { CPPUNIT_ASSERT_EQUAL(string("dscaled.gamma"), _dscaled_gamma->name()); CPPUNIT_ASSERT_EQUAL(string("dscaled.wishart"), _dscaled_wishart->name()); CPPUNIT_ASSERT_EQUAL(string("dordered.logit"), _dordered_logit->name()); } void GLMDistTest::alias() { CPPUNIT_ASSERT_EQUAL(string(""), _dscaled_gamma->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dscaled_wishart->alias()); CPPUNIT_ASSERT_EQUAL(string(""), _dordered_logit->alias()); } void GLMDistTest::rscalar_rpq(RScalarDist const *dist, vector const &par) { /* Simultaneous test of r, p, and q functions for distributions inheriting from RScalarDist. */ unsigned int nsim = 100; unsigned int nsim2 = 10; unsigned int nquant = 10; CPPUNIT_ASSERT_MESSAGE(dist->name(), checkNPar(dist, par.size())); CPPUNIT_ASSERT_MESSAGE(dist->name(), dist->checkParameterValue(par)); for (unsigned int s = 0; s < nsim; ++s) { //Generate random variable from distribution double y = dist->r(par, _rng); //Pass to distribution function and then to quantile function double p = dist->p(y, par, true, false); CPPUNIT_ASSERT_MESSAGE(dist->name(), p >= 0 && p <= 1); double z = dist->q(p, par, true, false); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); //Now do the same on a log scale double logp = dist->p(y, par, true, true); CPPUNIT_ASSERT_MESSAGE(dist->name(), logp <= 0); z = dist->q(logp, par, true, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); //Using upper tail p = dist->p(y, par, false, false); CPPUNIT_ASSERT_MESSAGE(dist->name(), p >= 0 && p <= 1); z = dist->q(p, par, false, false); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); //Upper tail on log scale logp = dist->p(y, par, false, true); CPPUNIT_ASSERT_MESSAGE(dist->name(), logp <= 0); z = dist->q(logp, par, false, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol*abs(y)); } for (unsigned int s = 0; s < nsim2; ++s) { // Test truncated sampling for (unsigned int i = 0; i <= nquant; ++i) { double plim1 = static_cast(i)/nquant; double lim1 = dist->q(plim1, par, true, false); if (i > 0) { // Test sampling from lower tail double y = dist->randomSample(par, 0, &lim1, _rng); CPPUNIT_ASSERT_MESSAGE(dist->name(), y <= lim1); double logpy = dist->p(y, par, true, true); double z = dist->q(logpy, par, true, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol * abs(y)); } if (i < nquant) { // Test sampling from upper tail double y = dist->randomSample(par, &lim1, 0, _rng); CPPUNIT_ASSERT_MESSAGE(dist->name(), y >= lim1); double logpy = dist->p(y, par, false, true); double z = dist->q(logpy, par, false, true); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol * abs(y)); } for (unsigned int j = i+1; j <= nquant; ++j) { // Test sampling between lower and upper limits double plim2 = static_cast(j)/nquant; double lim2 = dist->q(plim2, par, true, false); double y = dist->randomSample(par, &lim1, &lim2, _rng); CPPUNIT_ASSERT_MESSAGE(dist->name(), y >= lim1 && y <= lim2); double py = dist->p(y, par, true, false); double z = dist->q(py, par, true, false); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), y, z, tol * abs(y)); } } } rscalar_trunclik(dist, par); } static void scalar_trunclik_cont(RScalarDist const *dist, vector const &par, double bound, bool lower) { // Test normalization of truncated likelihood for continuous // variables by approximate integration using the trapezoid method CPPUNIT_ASSERT(!dist->discrete()); CPPUNIT_ASSERT(jags_finite(bound)); //Ensure that the density is finite at the other boundary (ob) //If not then just return as this method will not work double ob = lower ? dist->l(par) : dist->u(par); if (jags_finite(ob)) { if (!jags_finite(dist->d(ob, jags::PDF_FULL, par, false))) { return; } } //Create grid of points for evaluating the likelihood //If lower==false then the grid is in reverse order vector x; unsigned int N = 1000; if (jags_finite(ob)) { x.push_back(ob); } double pmax = dist->p(bound, par, lower, false); for (unsigned int i = 1; i < N; ++i) { x.push_back(dist->q(i*pmax/N, par, lower, false)); } x.push_back(bound); // Calculate likelihood by trapezoid method // FIXME: WE could probably do better double lik = 0; double const *ll = lower ? 0 : &bound; double const *uu = lower ? &bound : 0; double y0 = exp(dist->logDensity(x[0], jags::PDF_FULL, par, ll, uu)); for (unsigned int i = 1; i < x.size(); ++i) { double y = exp(dist->logDensity(x[i], jags::PDF_FULL, par, ll, uu)); lik += (x[i] - x[i-1]) * (y + y0) / 2; y0 = y; } if (!lower) { lik = -lik; //adjust for reverse grid } CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(dist->name(), 1.0, lik, 1.1e-2); } void GLMDistTest::rscalar_trunclik(RScalarDist const *dist, vector const &par) { /* Test likelihood calculations for truncated distributions */ CPPUNIT_ASSERT_MESSAGE(dist->name(), checkNPar(dist, par.size())); CPPUNIT_ASSERT_MESSAGE(dist->name(), dist->checkParameterValue(par)); double ll = dist->q(0.1, par, true, false); double uu = dist->q(0.9, par, true, false); scalar_trunclik_cont(dist, par, ll, true); scalar_trunclik_cont(dist, par, ll, false); scalar_trunclik_cont(dist, par, uu, true); scalar_trunclik_cont(dist, par, uu, false); } /* static vector mkPar(double const &v1) { vector par; par.push_back(&v1); return par; } */ static vector mkPar(double const &v1, double const &v2) { vector par; par.push_back(&v1); par.push_back(&v2); return par; } /* static vector mkPar(double const &v1, double const &v2, double const &v3) { vector par; par.push_back(&v1); par.push_back(&v2); par.push_back(&v3); return par; } */ /* static vector mkPar(double const &v1, double const &v2, double const &v3, double const &v4) { vector par; par.push_back(&v1); par.push_back(&v2); par.push_back(&v3); par.push_back(&v4); return par; } */ void GLMDistTest::rscalar() { rscalar_rpq(_dscaled_gamma, mkPar(0.3, 1)); rscalar_rpq(_dscaled_gamma, mkPar(5.0, 2)); rscalar_rpq(_dscaled_gamma, mkPar(2.0, 3)); rscalar_rpq(_dscaled_gamma, mkPar(0.7, 4)); } static double superror(RScalarDist const *dist, unsigned int N, vector const &par, jags::RNG *rng) { //Calculate test statistic for DKW test multiset xmset; for (unsigned int i =0; i < N; ++i) { double x = dist->r(par, rng); x = fprec(x, 12); xmset.insert(x); } double fhat=0, delta=0; for (multiset::const_iterator q = xmset.begin(); q != xmset.end(); q = xmset.upper_bound(*q)) { double f = dist->p(*q, par, true, false); fhat += static_cast(xmset.count(*q))/N; delta = max(delta, abs(fhat - f)); } return delta; } static double pdkwbound(double n, double t) { return 2*exp(-2*n*t*t); } static double qdkwbound(double n, double p) { return sqrt(log(p/2)/(-2*n)); } void GLMDistTest::dkwtest(RScalarDist const *dist, vector const &par, unsigned int N, double pthresh) { /* Test using the Dvoretzky-Kiefer-Wolfowitz (1956) bound on the difference between the empirical distribution function and the theoretical one, with a tight constant derived by Massart (1990) */ //Sanity checks CPPUNIT_ASSERT_MESSAGE(dist->name(), checkNPar(dist, par.size())); CPPUNIT_ASSERT_MESSAGE(dist->name(), dist->checkParameterValue(par)); double s = superror(dist, N, par, _rng); string msg = dist->name(); if (s >= qdkwbound(N, pthresh)) { ostringstream ostr; ostr << "Distribution " << dist->name() << "("; for (unsigned int i = 0; i < par.size(); ++i) { if (i > 0) ostr << ", "; ostr << *par[i]; } ostr << ")\n"; ostr << "supremum error = " << fprec(s, 2) << " with p-value=" << min(1.0, fround(pdkwbound(N,s), 4)); CPPUNIT_FAIL(ostr.str()); } } //FIXME: We should have a atest for simulation from a truncated distribution void GLMDistTest::dkw() { //DKW test of random number generation and distribution function //See dkwtest for details //CPPUNIT_ASSERT_MESSAGE("dkw check", false); dkwtest(_dscaled_gamma, mkPar(1,1)); dkwtest(_dscaled_gamma, mkPar(1,2)); dkwtest(_dscaled_gamma, mkPar(1,3)); dkwtest(_dscaled_gamma, mkPar(1,4)); dkwtest(_dscaled_gamma, mkPar(3,1)); dkwtest(_dscaled_gamma, mkPar(4,2)); dkwtest(_dscaled_gamma, mkPar(5,3)); dkwtest(_dscaled_gamma, mkPar(6,4)); } static bool inverse_spd (double *A, int n) { /* invert n x n symmetric positive definite matrix A*/ int info = 0; F77_DPOTRF ("L", &n, A, &n, &info); if (info < 0) { CPPUNIT_FAIL("Illegal argument in inverse_spd"); } else if (info > 0) { CPPUNIT_FAIL("Cannot invert matrix: not positive definite"); } F77_DPOTRI ("L", &n, A, &n, &info); for (int i = 0; i < n; ++i) { for (int j = 0; j < i; ++j) { A[i*n + j] = A[j*n + i]; } } if (info != 0) { CPPUNIT_FAIL("Unable to invert symmetric positive definite matrix"); } return true; } void GLMDistTest::dkw_swish(vector const &S, double df, unsigned int r, unsigned int c, unsigned int N, double pthresh) { //Special version of the DKW test for the scaled Wishart distribution //We invert the matrix and look at individual elements of the inverse: //Diagonal elements should be scaled t //Off-diagonal elements should be scaled beta multiset xmset; unsigned int ndim = S.size(); unsigned int length = ndim * ndim; vector x(length); //Set up parameters vector par; par.push_back(&S[0]); par.push_back(&df); //Set up dimensions vector > dims; dims.push_back(vector(1, ndim)); dims.push_back(vector(1, 1)); //Sanity checks CPPUNIT_ASSERT_MESSAGE("scaled.wishart", checkNPar(_dscaled_wishart, par.size())); CPPUNIT_ASSERT_MESSAGE("scaled.wishart", _dscaled_wishart->checkParameterDim(dims)); CPPUNIT_ASSERT_MESSAGE("scaled.wishart", _dscaled_wishart->checkParameterValue(par, dims)); //Calculate maximum error for DKW test. for (unsigned int i = 0; i < N; ++i) { _dscaled_wishart->randomSample(&x[0], x.size(), par, dims, 0, 0, _rng); inverse_spd(&x[0], ndim); double y = x[r*ndim + c]; if (r == c) { //Standard deviation y = sqrt(y) / S[r]; } else { //Correlation y /= sqrt(x[r*ndim+r]*x[c*ndim+c]); y = (y+1)/2; } y = fprec(y, 12); xmset.insert(y); } double fhat=0, delta=0; for (multiset::const_iterator q = xmset.begin(); q != xmset.end(); q = xmset.upper_bound(*q)) { double f; if (r == c) { //For diagonal elements, use half-t distribution f = 2 * pt(*q, df, true, false) - 1; } else { //For off-diagonal elements, use beta-distribution f = pbeta(*q, df/2, df/2, true, false); } fhat += static_cast(xmset.count(*q))/N; delta = max(delta, abs(fhat - f)); } if (delta >= qdkwbound(N, pthresh)) { ostringstream ostr; ostr << "Distribution scaled.wishart(scale=c("; for (unsigned int i = 0; i < S.size(); ++i) { if (i > 0) ostr << ", "; ostr << S[i]; } ostr << "), df=" << df << ")\n"; ostr << "Row = " << r << ", Column = " << c << "\n"; ostr << "supremum error = " << fprec(delta, 2) << " with p-value=" << min(1.0, fround(pdkwbound(N,delta), 4)); CPPUNIT_FAIL(ostr.str()); } } void GLMDistTest::scaled_wishart() { /* Checks that the elements of the inverse matrix have the correct marginal distribution */ //2x2 matrix, unscaled vector S(2,1); for (unsigned int r = 0; r < S.size(); ++r) { for (unsigned int c = 0; c < S.size(); ++c) { dkw_swish(S, 2, r, c); dkw_swish(S, 1, r, c); dkw_swish(S, 4.8, r, c); dkw_swish(S, 10, r, c); } } //3x3 matrix, scaled S.clear(); S.push_back(2); S.push_back(1.3); S.push_back(0.5); for (unsigned int r = 0; r < S.size(); ++r) { for (unsigned int c = 0; c < S.size(); ++c) { dkw_swish(S, 2, r, c); dkw_swish(S, 1, r, c); dkw_swish(S, 1.3, r, c); dkw_swish(S, 3.7, r, c); dkw_swish(S, 5.5, r, c); } } } JAGS-4.3.2/src/modules/glm/distributions/testglmdist.h0000664000175000017500000000261414224052371017626 00000000000000#ifndef GLM_DIST_TEST_H #define GLM_DIST_TEST_H namespace jags { class RScalarDist; class ScalarDist; class VectorDist; class ArrayDist; struct RNG; } #include #include #include "DOrdered.h" class GLMDistTest : public CppUnit::TestFixture, public JAGSFixture { CPPUNIT_TEST_SUITE( GLMDistTest ); CPPUNIT_TEST( npar ); CPPUNIT_TEST( name ); CPPUNIT_TEST( alias ); CPPUNIT_TEST( rscalar ); CPPUNIT_TEST( dkw ); CPPUNIT_TEST( scaled_wishart ); CPPUNIT_TEST_SUITE_END( ); jags::RNG *_rng; jags::RScalarDist *_dscaled_gamma; jags::ArrayDist *_dscaled_wishart; jags::glm::DOrdered *_dordered_logit; void rscalar_rpq(jags::RScalarDist const *dist, std::vector const &par); void rscalar_trunclik(jags::RScalarDist const *dist, std::vector const &par); void dkwtest(jags::RScalarDist const *dist, std::vector const &par, unsigned int N=10000, double pthresh=0.001); void dkw_swish(std::vector const &S, double df, unsigned int r, unsigned int c, unsigned int N=10000, double pthresh=0.001); public: void setUp(); void tearDown(); void npar(); void name(); void alias(); void rscalar(); void dkw(); void scaled_wishart(); }; #endif /* GLM_DIST_TEST_H */ JAGS-4.3.2/src/modules/dic/0000755000175000017500000000000014400711327012242 500000000000000JAGS-4.3.2/src/modules/dic/Makefile.am0000664000175000017500000000115614224052515014224 00000000000000jagsmod_LTLIBRARIES = dic.la dic_la_CPPFLAGS = -I$(top_srcdir)/src/include dic_la_LDFLAGS = -module -avoid-version if WINDOWS dic_la_LDFLAGS += -no-undefined endif dic_la_LIBADD = $(top_builddir)/src/lib/libjags.la dic_la_SOURCES = dic.cc DevianceMean.cc DevianceTrace.cc \ DevianceMonitorFactory.cc PDMonitor.cc PoptMonitor.cc \ PDMonitorFactory.cc PDTrace.cc PDTraceFactory.cc \ WAICMonitorFactory.cc WAICMonitor.cc noinst_HEADERS = DevianceMean.h DevianceTrace.h \ DevianceMonitorFactory.h PDMonitor.h PoptMonitor.h PDMonitorFactory.h \ PDTrace.h PDTraceFactory.h \ WAICMonitorFactory.h WAICMonitor.h JAGS-4.3.2/src/modules/dic/DevianceMean.h0000664000175000017500000000106714224052514014660 00000000000000#ifndef DEVIANCE_MEAN_H_ #define DEVIANCE_MEAN_H_ #include namespace jags { class StochasticNode; namespace dic { class DevianceMean : public Monitor { std::vector _values; std::vector _snodes; unsigned int _n; public: DevianceMean(std::vector const &nodes); std::vector dim() const; std::vector const &value(unsigned int chain) const; void update(); bool poolChains() const; bool poolIterations() const; }; }} #endif /* DEVIANCE_MEAN_H_ */ JAGS-4.3.2/src/modules/dic/DevianceTrace.h0000664000175000017500000000111114224052515015025 00000000000000#ifndef DEVIANCE_TRACE_H_ #define DEVIANCE_TRACE_H_ #include namespace jags { class StochasticNode; namespace dic { class DevianceTrace : public Monitor { std::vector > _values; // sampled values std::vector _snodes; public: DevianceTrace(std::vector const &nodes); std::vector dim() const; std::vector const &value(unsigned int chain) const; void update(); bool poolChains() const; bool poolIterations() const; }; }} #endif /* DEVIANCE_TRACE_H_ */ JAGS-4.3.2/src/modules/dic/DevianceMonitorFactory.h0000664000175000017500000000067514224052515016764 00000000000000#ifndef DEVIANCE_MONITOR_FACTORY_H_ #define DEVIANCE_MONITOR_FACTORY_H_ #include namespace jags { namespace dic { class DevianceMonitorFactory : public MonitorFactory { public: Monitor *getMonitor(std::string const &name, Range const &range, BUGSModel *model, std::string const &type, std::string &msg); std::string name() const; }; }} #endif /* DEVIANCE_MONITOR_FACTORY_H_ */ JAGS-4.3.2/src/modules/dic/PDMonitor.h0000664000175000017500000000154514224052515014216 00000000000000#ifndef PD_MONITOR_H_ #define PD_MONITOR_H_ #include #include namespace jags { class StochasticNode; struct RNG; namespace dic { class PDMonitor : public Monitor { std::vector _snodes; std::vector _rngs; unsigned int _nrep; std::vector _values; std::vector _weights; double _scale; unsigned int _nchain; public: PDMonitor(std::vector const &snodes, std::vector const &rngs, unsigned int nrep, double scale=1); ~PDMonitor(); std::vector dim() const; std::vector const &value(unsigned int chain) const; bool poolChains() const; bool poolIterations() const; void update(); virtual double weight(StochasticNode const *snode, unsigned int ch) const; }; }} #endif /* PD_MONITOR_H_ */ JAGS-4.3.2/src/modules/dic/PoptMonitor.h0000664000175000017500000000075414224052515014636 00000000000000#ifndef POPT_MONITOR_H_ #define POPT_MONITOR_H_ #include "PDMonitor.h" #include class StochasticNode; class CalKL; namespace jags { namespace dic { class PoptMonitor : public PDMonitor { std::vector _snodes; public: PoptMonitor(std::vector const &snodes, std::vector const &rngs, unsigned int nrep); double weight(StochasticNode const *snode, unsigned int ch) const; }; }} #endif /* POPT_MONITOR_H_ */ JAGS-4.3.2/src/modules/dic/PDMonitorFactory.h0000664000175000017500000000064514224052515015546 00000000000000#ifndef PD_MONITOR_FACTORY_H_ #define PD_MONITOR_FACTORY_H_ #include namespace jags { namespace dic { class PDMonitorFactory : public MonitorFactory { public: Monitor *getMonitor(std::string const &name, Range const &range, BUGSModel *model, std::string const &type, std::string &msg); std::string name() const; }; }} #endif /* PD_MONITOR_FACTORY_H_ */ JAGS-4.3.2/src/modules/dic/PDTrace.h0000664000175000017500000000126314224052515013622 00000000000000#ifndef PD_TRACE_H_ #define PD_TRACE_H_ #include #include namespace jags { class StochasticNode; struct RNG; namespace dic { class PDTrace : public Monitor { std::vector _snodes; std::vector _rngs; unsigned int _nrep; unsigned int _nchain; std::vector _values; public: PDTrace(std::vector const &snodes, std::vector const &rngs, unsigned int nrep); ~PDTrace(); std::vector dim() const; std::vector const &value(unsigned int chain) const; bool poolChains() const; bool poolIterations() const; void update(); }; }} #endif /* PD_TRACE_H_ */ JAGS-4.3.2/src/modules/dic/PDTraceFactory.h0000664000175000017500000000063514224052515015154 00000000000000#ifndef PD_TRACE_FACTORY_H_ #define PD_TRACE_FACTORY_H_ #include namespace jags { namespace dic { class PDTraceFactory : public MonitorFactory { public: Monitor *getMonitor(std::string const &name, Range const &range, BUGSModel *model, std::string const &type, std::string &msg); std::string name() const; }; }} #endif /* PD_TRACE_FACTORY_H_ */ JAGS-4.3.2/src/modules/dic/WAICMonitorFactory.h0000664000175000017500000000065214224052515015764 00000000000000#ifndef WAIC_MONITOR_FACTORY_H_ #define WAIC_MONITOR_FACTORY_H_ #include namespace jags { namespace dic { class WAICMonitorFactory : public MonitorFactory { public: Monitor *getMonitor(std::string const &name, Range const &range, BUGSModel *model, std::string const &type, std::string &msg); std::string name() const; }; } } #endif /* WAIC_MONITOR_FACTORY_H_ */ JAGS-4.3.2/src/modules/dic/WAICMonitor.h0000664000175000017500000000141514224052515014432 00000000000000#ifndef WAIC_MONITOR_H_ #define WAIC_MONITOR_H_ #include #include namespace jags { class StochasticNode; struct RNG; namespace dic { class WAICMonitor : public Monitor { std::vector _snodes; unsigned int _nchain; std::vector > _mlik; std::vector > _vlik; std::vector _values; unsigned int _n; public: WAICMonitor(std::vector const &snodes); ~WAICMonitor(); std::vector dim() const; std::vector const &value(unsigned int chain) const; bool poolChains() const; bool poolIterations() const; void update(); }; } } #endif /* WAIC_MONITOR_H_ */ JAGS-4.3.2/src/modules/dic/Makefile.in0000644000175000017500000011054414400675236014244 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ @WINDOWS_TRUE@am__append_1 = -no-undefined subdir = src/modules/dic ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(jagsmoddir)" LTLIBRARIES = $(jagsmod_LTLIBRARIES) dic_la_DEPENDENCIES = $(top_builddir)/src/lib/libjags.la am_dic_la_OBJECTS = dic_la-dic.lo dic_la-DevianceMean.lo \ dic_la-DevianceTrace.lo dic_la-DevianceMonitorFactory.lo \ dic_la-PDMonitor.lo dic_la-PoptMonitor.lo \ dic_la-PDMonitorFactory.lo dic_la-PDTrace.lo \ dic_la-PDTraceFactory.lo dic_la-WAICMonitorFactory.lo \ dic_la-WAICMonitor.lo dic_la_OBJECTS = $(am_dic_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = dic_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(dic_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/dic_la-DevianceMean.Plo \ ./$(DEPDIR)/dic_la-DevianceMonitorFactory.Plo \ ./$(DEPDIR)/dic_la-DevianceTrace.Plo \ ./$(DEPDIR)/dic_la-PDMonitor.Plo \ ./$(DEPDIR)/dic_la-PDMonitorFactory.Plo \ ./$(DEPDIR)/dic_la-PDTrace.Plo \ ./$(DEPDIR)/dic_la-PDTraceFactory.Plo \ ./$(DEPDIR)/dic_la-PoptMonitor.Plo \ ./$(DEPDIR)/dic_la-WAICMonitor.Plo \ ./$(DEPDIR)/dic_la-WAICMonitorFactory.Plo \ ./$(DEPDIR)/dic_la-dic.Plo am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(dic_la_SOURCES) DIST_SOURCES = $(dic_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ jagsmod_LTLIBRARIES = dic.la dic_la_CPPFLAGS = -I$(top_srcdir)/src/include dic_la_LDFLAGS = -module -avoid-version $(am__append_1) dic_la_LIBADD = $(top_builddir)/src/lib/libjags.la dic_la_SOURCES = dic.cc DevianceMean.cc DevianceTrace.cc \ DevianceMonitorFactory.cc PDMonitor.cc PoptMonitor.cc \ PDMonitorFactory.cc PDTrace.cc PDTraceFactory.cc \ WAICMonitorFactory.cc WAICMonitor.cc noinst_HEADERS = DevianceMean.h DevianceTrace.h \ DevianceMonitorFactory.h PDMonitor.h PoptMonitor.h PDMonitorFactory.h \ PDTrace.h PDTraceFactory.h \ WAICMonitorFactory.h WAICMonitor.h all: all-am .SUFFIXES: .SUFFIXES: .cc .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/modules/dic/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/modules/dic/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-jagsmodLTLIBRARIES: $(jagsmod_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(jagsmoddir)'"; \ $(MKDIR_P) "$(DESTDIR)$(jagsmoddir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(jagsmoddir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(jagsmoddir)"; \ } uninstall-jagsmodLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(jagsmod_LTLIBRARIES)'; test -n "$(jagsmoddir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(jagsmoddir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(jagsmoddir)/$$f"; \ done clean-jagsmodLTLIBRARIES: -test -z "$(jagsmod_LTLIBRARIES)" || rm -f $(jagsmod_LTLIBRARIES) @list='$(jagsmod_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } dic.la: $(dic_la_OBJECTS) $(dic_la_DEPENDENCIES) $(EXTRA_dic_la_DEPENDENCIES) $(AM_V_CXXLD)$(dic_la_LINK) -rpath $(jagsmoddir) $(dic_la_OBJECTS) $(dic_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-DevianceMean.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-DevianceMonitorFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-DevianceTrace.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-PDMonitor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-PDMonitorFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-PDTrace.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-PDTraceFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-PoptMonitor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-WAICMonitor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-WAICMonitorFactory.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dic_la-dic.Plo@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< dic_la-dic.lo: dic.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-dic.lo -MD -MP -MF $(DEPDIR)/dic_la-dic.Tpo -c -o dic_la-dic.lo `test -f 'dic.cc' || echo '$(srcdir)/'`dic.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-dic.Tpo $(DEPDIR)/dic_la-dic.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='dic.cc' object='dic_la-dic.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-dic.lo `test -f 'dic.cc' || echo '$(srcdir)/'`dic.cc dic_la-DevianceMean.lo: DevianceMean.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-DevianceMean.lo -MD -MP -MF $(DEPDIR)/dic_la-DevianceMean.Tpo -c -o dic_la-DevianceMean.lo `test -f 'DevianceMean.cc' || echo '$(srcdir)/'`DevianceMean.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-DevianceMean.Tpo $(DEPDIR)/dic_la-DevianceMean.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DevianceMean.cc' object='dic_la-DevianceMean.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-DevianceMean.lo `test -f 'DevianceMean.cc' || echo '$(srcdir)/'`DevianceMean.cc dic_la-DevianceTrace.lo: DevianceTrace.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-DevianceTrace.lo -MD -MP -MF $(DEPDIR)/dic_la-DevianceTrace.Tpo -c -o dic_la-DevianceTrace.lo `test -f 'DevianceTrace.cc' || echo '$(srcdir)/'`DevianceTrace.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-DevianceTrace.Tpo $(DEPDIR)/dic_la-DevianceTrace.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DevianceTrace.cc' object='dic_la-DevianceTrace.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-DevianceTrace.lo `test -f 'DevianceTrace.cc' || echo '$(srcdir)/'`DevianceTrace.cc dic_la-DevianceMonitorFactory.lo: DevianceMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-DevianceMonitorFactory.lo -MD -MP -MF $(DEPDIR)/dic_la-DevianceMonitorFactory.Tpo -c -o dic_la-DevianceMonitorFactory.lo `test -f 'DevianceMonitorFactory.cc' || echo '$(srcdir)/'`DevianceMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-DevianceMonitorFactory.Tpo $(DEPDIR)/dic_la-DevianceMonitorFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='DevianceMonitorFactory.cc' object='dic_la-DevianceMonitorFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-DevianceMonitorFactory.lo `test -f 'DevianceMonitorFactory.cc' || echo '$(srcdir)/'`DevianceMonitorFactory.cc dic_la-PDMonitor.lo: PDMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-PDMonitor.lo -MD -MP -MF $(DEPDIR)/dic_la-PDMonitor.Tpo -c -o dic_la-PDMonitor.lo `test -f 'PDMonitor.cc' || echo '$(srcdir)/'`PDMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-PDMonitor.Tpo $(DEPDIR)/dic_la-PDMonitor.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='PDMonitor.cc' object='dic_la-PDMonitor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-PDMonitor.lo `test -f 'PDMonitor.cc' || echo '$(srcdir)/'`PDMonitor.cc dic_la-PoptMonitor.lo: PoptMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-PoptMonitor.lo -MD -MP -MF $(DEPDIR)/dic_la-PoptMonitor.Tpo -c -o dic_la-PoptMonitor.lo `test -f 'PoptMonitor.cc' || echo '$(srcdir)/'`PoptMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-PoptMonitor.Tpo $(DEPDIR)/dic_la-PoptMonitor.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='PoptMonitor.cc' object='dic_la-PoptMonitor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-PoptMonitor.lo `test -f 'PoptMonitor.cc' || echo '$(srcdir)/'`PoptMonitor.cc dic_la-PDMonitorFactory.lo: PDMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-PDMonitorFactory.lo -MD -MP -MF $(DEPDIR)/dic_la-PDMonitorFactory.Tpo -c -o dic_la-PDMonitorFactory.lo `test -f 'PDMonitorFactory.cc' || echo '$(srcdir)/'`PDMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-PDMonitorFactory.Tpo $(DEPDIR)/dic_la-PDMonitorFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='PDMonitorFactory.cc' object='dic_la-PDMonitorFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-PDMonitorFactory.lo `test -f 'PDMonitorFactory.cc' || echo '$(srcdir)/'`PDMonitorFactory.cc dic_la-PDTrace.lo: PDTrace.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-PDTrace.lo -MD -MP -MF $(DEPDIR)/dic_la-PDTrace.Tpo -c -o dic_la-PDTrace.lo `test -f 'PDTrace.cc' || echo '$(srcdir)/'`PDTrace.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-PDTrace.Tpo $(DEPDIR)/dic_la-PDTrace.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='PDTrace.cc' object='dic_la-PDTrace.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-PDTrace.lo `test -f 'PDTrace.cc' || echo '$(srcdir)/'`PDTrace.cc dic_la-PDTraceFactory.lo: PDTraceFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-PDTraceFactory.lo -MD -MP -MF $(DEPDIR)/dic_la-PDTraceFactory.Tpo -c -o dic_la-PDTraceFactory.lo `test -f 'PDTraceFactory.cc' || echo '$(srcdir)/'`PDTraceFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-PDTraceFactory.Tpo $(DEPDIR)/dic_la-PDTraceFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='PDTraceFactory.cc' object='dic_la-PDTraceFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-PDTraceFactory.lo `test -f 'PDTraceFactory.cc' || echo '$(srcdir)/'`PDTraceFactory.cc dic_la-WAICMonitorFactory.lo: WAICMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-WAICMonitorFactory.lo -MD -MP -MF $(DEPDIR)/dic_la-WAICMonitorFactory.Tpo -c -o dic_la-WAICMonitorFactory.lo `test -f 'WAICMonitorFactory.cc' || echo '$(srcdir)/'`WAICMonitorFactory.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-WAICMonitorFactory.Tpo $(DEPDIR)/dic_la-WAICMonitorFactory.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='WAICMonitorFactory.cc' object='dic_la-WAICMonitorFactory.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-WAICMonitorFactory.lo `test -f 'WAICMonitorFactory.cc' || echo '$(srcdir)/'`WAICMonitorFactory.cc dic_la-WAICMonitor.lo: WAICMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT dic_la-WAICMonitor.lo -MD -MP -MF $(DEPDIR)/dic_la-WAICMonitor.Tpo -c -o dic_la-WAICMonitor.lo `test -f 'WAICMonitor.cc' || echo '$(srcdir)/'`WAICMonitor.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/dic_la-WAICMonitor.Tpo $(DEPDIR)/dic_la-WAICMonitor.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='WAICMonitor.cc' object='dic_la-WAICMonitor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(dic_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o dic_la-WAICMonitor.lo `test -f 'WAICMonitor.cc' || echo '$(srcdir)/'`WAICMonitor.cc mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(jagsmoddir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-jagsmodLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/dic_la-DevianceMean.Plo -rm -f ./$(DEPDIR)/dic_la-DevianceMonitorFactory.Plo -rm -f ./$(DEPDIR)/dic_la-DevianceTrace.Plo -rm -f ./$(DEPDIR)/dic_la-PDMonitor.Plo -rm -f ./$(DEPDIR)/dic_la-PDMonitorFactory.Plo -rm -f ./$(DEPDIR)/dic_la-PDTrace.Plo -rm -f ./$(DEPDIR)/dic_la-PDTraceFactory.Plo -rm -f ./$(DEPDIR)/dic_la-PoptMonitor.Plo -rm -f ./$(DEPDIR)/dic_la-WAICMonitor.Plo -rm -f ./$(DEPDIR)/dic_la-WAICMonitorFactory.Plo -rm -f ./$(DEPDIR)/dic_la-dic.Plo -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-jagsmodLTLIBRARIES install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/dic_la-DevianceMean.Plo -rm -f ./$(DEPDIR)/dic_la-DevianceMonitorFactory.Plo -rm -f ./$(DEPDIR)/dic_la-DevianceTrace.Plo -rm -f ./$(DEPDIR)/dic_la-PDMonitor.Plo -rm -f ./$(DEPDIR)/dic_la-PDMonitorFactory.Plo -rm -f ./$(DEPDIR)/dic_la-PDTrace.Plo -rm -f ./$(DEPDIR)/dic_la-PDTraceFactory.Plo -rm -f ./$(DEPDIR)/dic_la-PoptMonitor.Plo -rm -f ./$(DEPDIR)/dic_la-WAICMonitor.Plo -rm -f ./$(DEPDIR)/dic_la-WAICMonitorFactory.Plo -rm -f ./$(DEPDIR)/dic_la-dic.Plo -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-jagsmodLTLIBRARIES .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-jagsmodLTLIBRARIES clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-jagsmodLTLIBRARIES \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-jagsmodLTLIBRARIES .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/modules/dic/dic.cc0000664000175000017500000000130014224052515013225 00000000000000#include #include "DevianceMonitorFactory.h" #include "PDMonitorFactory.h" #include "PDTraceFactory.h" #include "WAICMonitorFactory.h" using std::vector; namespace jags { namespace dic { class DICModule: public Module { public: DICModule(); ~DICModule(); }; DICModule::DICModule() : Module("dic") { insert(new DevianceMonitorFactory); insert(new PDMonitorFactory); insert(new PDTraceFactory); insert(new WAICMonitorFactory); } DICModule::~DICModule() { vector const &mvec = monitorFactories(); for (unsigned int i = 0; i < mvec.size(); ++i) { delete mvec[i]; } } }} jags::dic::DICModule _dic_module; JAGS-4.3.2/src/modules/dic/DevianceMean.cc0000664000175000017500000000231014224052514015006 00000000000000#include "DevianceMean.h" #include #include using std::vector; using std::string; using std::copy; namespace jags { static vector toNodeVec(vector const &s) { vector ans(s.size()); copy (s.begin(), s.end(), ans.begin()); return ans; } namespace dic { DevianceMean::DevianceMean(vector const &s) : Monitor("mean", toNodeVec(s)), _values(s.size(),0), _snodes(s), _n(0) { } vector DevianceMean::dim() const { return vector(1, _values.size()); } bool DevianceMean::poolChains() const { return true; } bool DevianceMean::poolIterations() const { return true; } vector const &DevianceMean::value(unsigned int chain) const { return _values; } void DevianceMean::update() { _n++; for (unsigned int i = 0; i < _snodes.size(); ++i) { double loglik = 0; unsigned int nchain = _snodes[i]->nchain(); for (unsigned int ch = 0; ch < nchain; ++ch) { loglik += _snodes[i]->logDensity(ch, PDF_FULL) / nchain; } _values[i] += (-2*loglik - _values[i])/_n; } } }} JAGS-4.3.2/src/modules/dic/DevianceTrace.cc0000664000175000017500000000236714224052514015200 00000000000000#include "DevianceTrace.h" #include #include using std::vector; using std::string; using std::copy; namespace jags { static vector toNode(vector const &nodes) { vector ans(nodes.size()); for (unsigned int i = 0; i < nodes.size(); ++i) { ans[i] = nodes[i]; } return ans; } namespace dic { DevianceTrace::DevianceTrace(vector const & snodes) : Monitor("trace", toNode(snodes)), _values(snodes[0]->nchain()), _snodes(snodes) { } vector DevianceTrace::dim() const { return vector(1,1); } vector const &DevianceTrace::value(unsigned int chain) const { return _values[chain]; } void DevianceTrace::update() { unsigned int nchain = _snodes[0]->nchain(); for (unsigned int ch = 0; ch < nchain; ++ch) { double loglik = 0; for (unsigned int i = 0; i < _snodes.size(); ++i) { loglik += _snodes[i]->logDensity(ch, PDF_FULL); } _values[ch].push_back(-2 * loglik); } } bool DevianceTrace::poolChains() const { return false; } bool DevianceTrace::poolIterations() const { return false; } }} JAGS-4.3.2/src/modules/dic/DevianceMonitorFactory.cc0000664000175000017500000000304014224052515017107 00000000000000#include "DevianceMonitorFactory.h" #include "DevianceMean.h" #include "DevianceTrace.h" #include #include #include using std::set; using std::string; using std::vector; namespace jags { namespace dic { Monitor *DevianceMonitorFactory::getMonitor(string const &name, Range const &range, BUGSModel *model, string const &type, string &msg) { if (type != "mean" && type != "trace") return 0; if (name != "deviance") return 0; if (!isNULL(range)) { msg = "cannot monitor a subset of deviance"; return 0; } vector const &snodes = model->stochasticNodes(); vector observed_snodes; for (unsigned int i = 0; i < snodes.size(); ++i) { if (snodes[i]->isFixed()) { observed_snodes.push_back(snodes[i]); } } if (observed_snodes.empty()) { msg = "There are no observed stochastic nodes"; return 0; } Monitor *m = 0; if (type == "mean") { m = new DevianceMean(observed_snodes); m->setName(name); vector onames(observed_snodes.size()); for (unsigned int i = 0; i < observed_snodes.size(); ++i) { onames[i] = model->symtab().getName(observed_snodes[i]); } m->setElementNames(onames); } else if (type == "trace") { m = new DevianceTrace(observed_snodes); m->setName("deviance"); m->setElementNames(vector(1,"deviance")); } return m; } string DevianceMonitorFactory::name() const { return "dic::Deviance"; } }} JAGS-4.3.2/src/modules/dic/PDMonitor.cc0000664000175000017500000000361114224052515014350 00000000000000#include #include "PDMonitor.h" #include #include #include #include using std::vector; using std::string; using std::copy; namespace jags { static vector toNodeVec(vector const &s) { vector ans(s.size()); copy (s.begin(), s.end(), ans.begin()); return ans; } namespace dic { PDMonitor::PDMonitor(vector const &snodes, vector const &rngs, unsigned int nrep, double scale) : Monitor("mean", toNodeVec(snodes)), _snodes(snodes), _rngs(rngs), _nrep(nrep), _values(snodes.size(), 0), _weights(snodes.size(), 0), _scale(scale), _nchain(rngs.size()) { if (_nchain < 2) { throwLogicError("PDMonitor needs at least 2 chains"); } } PDMonitor::~PDMonitor() { } vector PDMonitor::dim() const { return vector (1,_values.size()); } vector const &PDMonitor::value(unsigned int chain) const { return _values; } bool PDMonitor::poolChains() const { return true; } bool PDMonitor::poolIterations() const { return true; } void PDMonitor::update() { vector w(_nchain); for (unsigned int k = 0; k < _values.size(); ++k) { double pdsum = 0; double wsum = 0; for (unsigned int i = 0; i < _nchain; ++i) { w[i] = weight(_snodes[k], i); for (unsigned int j = 0; j < i; ++j) { pdsum += w[i] * w[j] * ( _snodes[k]->KL(i, j, _rngs[i], _nrep) + _snodes[k]->KL(j, i, _rngs[j], _nrep)); wsum += w[i] * w[j]; } } pdsum /= wsum; pdsum *= _scale/2; _weights[k] += wsum; _values[k] += wsum * (pdsum - _values[k])/_weights[k]; } } double PDMonitor::weight(StochasticNode const *snode, unsigned int ch) const { return 1; } }} JAGS-4.3.2/src/modules/dic/PoptMonitor.cc0000664000175000017500000000077114224052371014773 00000000000000#include #include "PoptMonitor.h" #include #include using std::vector; using std::exp; namespace jags { namespace dic { PoptMonitor::PoptMonitor(vector const &snodes, vector const &rngs, unsigned int nrep) : PDMonitor(snodes, rngs, nrep, 2.0) { } double PoptMonitor::weight(StochasticNode const *snode, unsigned int ch) const { return exp(-snode->logDensity(ch, PDF_FULL)); } }} JAGS-4.3.2/src/modules/dic/PDMonitorFactory.cc0000664000175000017500000000355014224052515015702 00000000000000#include "PDMonitorFactory.h" #include "PDMonitor.h" #include "PoptMonitor.h" #include #include #include #include using std::set; using std::string; using std::vector; namespace jags { namespace dic { Monitor *PDMonitorFactory::getMonitor(string const &name, Range const &range, BUGSModel *model, string const &type, string &msg) { if (type != "mean") return 0; if (name != "pD" && name != "popt") return 0; if (!isNULL(range)) { msg = string("Cannot monitor a subset of ") + name; } if (model->nchain() < 2) { msg = string("At least two parallel chains needed to monitor ") + name; return 0; } vector observed_nodes; vector const &snodes = model->stochasticNodes(); for (unsigned int i = 0; i < snodes.size(); ++i) { if (snodes[i]->isFixed()) { if (isSupportFixed(snodes[i])) { observed_nodes.push_back(snodes[i]); } else { msg = "Support of observed nodes is not fixed"; return 0; } } } if (observed_nodes.empty()) { msg = "There are no observed stochastic nodes"; return 0; } unsigned int nchain = model->nchain(); vector rngs; for (unsigned int i = 0; i < nchain; ++i) { rngs.push_back(model->rng(i)); } Monitor *m = 0; if (name =="pD") { m = new PDMonitor(observed_nodes, rngs, 10); } else if (name == "popt") { m = new PoptMonitor(observed_nodes, rngs, 10); } if (m) { m->setName(name); vector onames(observed_nodes.size()); for (unsigned int i = 0; i < observed_nodes.size(); ++i) { onames[i] = model->symtab().getName(observed_nodes[i]); } m->setElementNames(onames); } return m; } string PDMonitorFactory::name() const { return "dic::PD"; } }} JAGS-4.3.2/src/modules/dic/PDTrace.cc0000664000175000017500000000271014224052515013756 00000000000000#include #include "PDTrace.h" #include #include #include using std::vector; using std::string; using std::copy; namespace jags { static vector toNodeVec(vector const &s) { vector ans(s.size()); copy (s.begin(), s.end(), ans.begin()); return ans; } namespace dic { PDTrace::PDTrace(vector const &snodes, vector const &rngs, unsigned int nrep) : Monitor("trace", toNodeVec(snodes)), _snodes(snodes), _rngs(rngs), _nrep(nrep), _nchain(rngs.size()), _values() { if (_nchain < 2) { throwLogicError("PDTrace needs at least 2 chains"); } } PDTrace::~PDTrace() { } vector PDTrace::dim() const { return vector (1,1); } vector const &PDTrace::value(unsigned int chain) const { return _values; } bool PDTrace::poolChains() const { return true; } bool PDTrace::poolIterations() const { return false; } void PDTrace::update() { double pd = 0; for (unsigned int k = 0; k < _snodes.size(); ++k) { for (unsigned int i = 0; i < _nchain; ++i) { for (unsigned int j = 0; j < i; ++j) { pd += _snodes[k]->KL(i, j, _rngs[i], _nrep); pd += _snodes[k]->KL(j, i, _rngs[j], _nrep); } } } pd /= _nchain * (_nchain - 1); _values.push_back(pd); } }} JAGS-4.3.2/src/modules/dic/PDTraceFactory.cc0000664000175000017500000000300314224052515015302 00000000000000#include "PDTraceFactory.h" #include "PDTrace.h" #include #include #include #include using std::set; using std::string; using std::vector; namespace jags { namespace dic { Monitor *PDTraceFactory::getMonitor(string const &name, Range const &range, BUGSModel *model, string const &type, string &msg) { if (name != "pD") return 0; if (type != "trace") return 0; if (model->nchain() < 2) { msg = "at least two chains are required for a pD trace monitor"; return 0; } if (!isNULL(range)) { msg = "cannot monitor a subset of pD"; return 0; } vector observed_nodes; vector const &snodes = model->stochasticNodes(); for (unsigned int i = 0; i < snodes.size(); ++i) { if (snodes[i]->isFixed()) { observed_nodes.push_back(snodes[i]); } if (!isSupportFixed(snodes[i])) { msg = "pD is infinite because at least one observed node does not have fixed support"; return 0; } } if (observed_nodes.empty()) { msg = "there are no observed nodes"; return 0; } unsigned int nchain = model->nchain(); vector rngs; for (unsigned int i = 0; i < nchain; ++i) { rngs.push_back(model->rng(i)); } Monitor *m = new PDTrace(observed_nodes, rngs, 10); m->setName("pD"); m->setElementNames(vector(1,"pD")); return m; } string PDTraceFactory::name() const { return "dic::PDTrace"; } }} JAGS-4.3.2/src/modules/dic/WAICMonitorFactory.cc0000664000175000017500000000244114224052515016120 00000000000000#include "WAICMonitorFactory.h" #include "WAICMonitor.h" #include #include using std::string; using std::vector; namespace jags { namespace dic { Monitor *WAICMonitorFactory::getMonitor(string const &name, Range const &range, BUGSModel *model, string const &type, string &msg) { if (type != "mean") return 0; if (name != "WAIC") return 0; if (!isNULL(range)) msg = string("Cannot monitor a subset of ") + name; vector observed_nodes; vector const &snodes = model->stochasticNodes(); for (vector::const_iterator p = snodes.begin(); p != snodes.end(); ++p) { if (isObserved(*p)) { observed_nodes.push_back(*p); } } if (observed_nodes.empty()) { msg = "There are no observed stochastic nodes"; return 0; } Monitor *m = new WAICMonitor(observed_nodes); m->setName(name); vector onames(observed_nodes.size()); for (unsigned int i = 0; i < observed_nodes.size(); ++i) { onames[i] = model->symtab().getName(observed_nodes[i]); } m->setElementNames(onames); return m; } string WAICMonitorFactory::name() const { return "dic::WAIC"; } } } JAGS-4.3.2/src/modules/dic/WAICMonitor.cc0000664000175000017500000000320214224052515014564 00000000000000#include #include "WAICMonitor.h" #include #include #include #include using std::vector; using std::string; using std::copy; using std::fill; namespace jags { static vector toNodeVec(vector const &s) { vector ans(s.size()); copy (s.begin(), s.end(), ans.begin()); return ans; } namespace dic { WAICMonitor::WAICMonitor(vector const &snodes) : Monitor("mean", toNodeVec(snodes)), _snodes(snodes), _nchain(snodes[0]->nchain()), _mlik(_nchain, vector(snodes.size(), 0)), _vlik(_nchain, vector(snodes.size(), 0)), _values(snodes.size(), 0), _n(1) { } WAICMonitor::~WAICMonitor() { } vector WAICMonitor::dim() const { return vector (1, _snodes.size()); } vector const &WAICMonitor::value(unsigned int chain) const { return _values; } bool WAICMonitor::poolChains() const { return true; } bool WAICMonitor::poolIterations() const { return true; } void WAICMonitor::update() { fill(_values.begin(), _values.end(), 0); for (unsigned int ch = 0; ch < _nchain; ++ch) { for (unsigned int k = 0; k < _snodes.size(); ++k) { double delta = _snodes[k]->logDensity(ch, PDF_LIKELIHOOD) - _mlik[ch][k]; _mlik[ch][k] += delta/_n; if (_n > 1) { _vlik[ch][k] *= static_cast(_n - 2)/(_n - 1); _vlik[ch][k] += delta * delta / _n; } _values[k] += _vlik[ch][k] / _nchain; } } _n++; } } } JAGS-4.3.2/src/terminal/0000755000175000017500000000000014400711327011646 500000000000000JAGS-4.3.2/src/terminal/Makefile.am0000664000175000017500000000414514224052371013631 00000000000000BUILT_SOURCES = parser.hh AM_YFLAGS = -d libexec_PROGRAMS = jags-terminal jags_terminal_SOURCES = parser.yy scanner.ll ReadData.cc if WINDOWS ## 64-bit Windows build fails if we try pre-linking modules (although ## 32-bit Windows allows it). jags_terminal_LDADD = $(LIBLTDL) ${top_builddir}/src/lib/libjags.la else ## We list the modules here so that ltdl can emulate dynamic loading ## on platforms that do not support it, or where the user has chosen ## static linking jags_terminal_LDADD = $(LIBLTDL) ${top_builddir}/src/lib/libjags.la \ -dlopen ${top_builddir}/src/modules/base/basemod.la \ -dlopen ${top_builddir}/src/modules/bugs/bugs.la \ -dlopen ${top_builddir}/src/modules/dic/dic.la \ -dlopen ${top_builddir}/src/modules/glm/glm.la \ -dlopen ${top_builddir}/src/modules/lecuyer/lecuyer.la \ -dlopen ${top_builddir}/src/modules/mix/mix.la \ -dlopen ${top_builddir}/src/modules/msm/msm.la endif jags_terminal_CPPFLAGS= -I$(top_srcdir)/src/include $(LTDLINCL) LEX_OUTPUT_ROOT=lex.zz noinst_HEADERS = ReadData.h ## The shell script is not required under Windows, so we do not ## build or install it. Instead, we install a batch file if WINDOWS dist_bin_SCRIPTS = jags.bat else bin_SCRIPTS = jags # The edit command substitutes paths and filenames into the jags script. # Note that jterm (the name of the installed version of jags-terminal) # is the odd one out as it is a shell variable not # a Makefile variable. In particular, this means that the sed script # must be in double quotes so that it is expanded properly. edit = sed \ -e 's,@jagsmoddir\@,$(jagsmoddir),g' \ -e 's,@libexecdir\@,$(libexecdir),g' \ -e 's,@libdir\@,$(libdir),g' \ -e "s,@jterm\@,$${jterm},g" jags: Makefile $(srcdir)/jags.in rm -f jags jags.tmp jterm=`echo jags-terminal | sed -e '$(program_transform_name)'`; \ $(edit) $(srcdir)/jags.in > jags.tmp chmod +x jags.tmp mv jags.tmp jags endif ## We need to give Automake some additional hints for distribution ## and cleaning of the jags shell script and its source. EXTRA_DIST = jags.in CLEANFILES = jags MAINTAINERCLEANFILES = parser.cc parser.hh scanner.cc JAGS-4.3.2/src/terminal/jags.bat0000664000175000017500000000016014224052371013202 00000000000000setlocal set PATH=@JAGS_HOME@\bin\;%PATH% set LTDL_LIBRARY_PATH=@JAGS_HOME@\modules cls jags-terminal %1 JAGS-4.3.2/src/terminal/ReadData.h0000664000175000017500000000050514224052371013407 00000000000000#ifndef READ_DATA_H_ #define READ_DATA_H_ #include #include #include #include bool readRData(std::vector const *r_assignment_list, std::map &table, std::string &rngname); #endif /* READ_DATA_H_ */ JAGS-4.3.2/src/terminal/Makefile.in0000644000175000017500000011016614400675236013650 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ libexec_PROGRAMS = jags-terminal$(EXEEXT) subdir = src/terminal ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__dist_bin_SCRIPTS_DIST) \ $(noinst_HEADERS) $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(bindir)" PROGRAMS = $(libexec_PROGRAMS) am_jags_terminal_OBJECTS = jags_terminal-parser.$(OBJEXT) \ jags_terminal-scanner.$(OBJEXT) \ jags_terminal-ReadData.$(OBJEXT) jags_terminal_OBJECTS = $(am_jags_terminal_OBJECTS) am__DEPENDENCIES_1 = @WINDOWS_FALSE@jags_terminal_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @WINDOWS_FALSE@ ${top_builddir}/src/lib/libjags.la \ @WINDOWS_FALSE@ ${top_builddir}/src/modules/base/basemod.la \ @WINDOWS_FALSE@ ${top_builddir}/src/modules/bugs/bugs.la \ @WINDOWS_FALSE@ ${top_builddir}/src/modules/dic/dic.la \ @WINDOWS_FALSE@ ${top_builddir}/src/modules/glm/glm.la \ @WINDOWS_FALSE@ ${top_builddir}/src/modules/lecuyer/lecuyer.la \ @WINDOWS_FALSE@ ${top_builddir}/src/modules/mix/mix.la \ @WINDOWS_FALSE@ ${top_builddir}/src/modules/msm/msm.la @WINDOWS_TRUE@jags_terminal_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @WINDOWS_TRUE@ ${top_builddir}/src/lib/libjags.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__dist_bin_SCRIPTS_DIST = jags.bat SCRIPTS = $(bin_SCRIPTS) $(dist_bin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/jags_terminal-ReadData.Po \ ./$(DEPDIR)/jags_terminal-parser.Po \ ./$(DEPDIR)/jags_terminal-scanner.Po am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) LTYACCCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(jags_terminal_SOURCES) DIST_SOURCES = $(jags_terminal_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \ $(top_srcdir)/ylwrap parser.cc parser.hh scanner.cc DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = lex.zz LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ BUILT_SOURCES = parser.hh AM_YFLAGS = -d jags_terminal_SOURCES = parser.yy scanner.ll ReadData.cc @WINDOWS_FALSE@jags_terminal_LDADD = $(LIBLTDL) ${top_builddir}/src/lib/libjags.la \ @WINDOWS_FALSE@-dlopen ${top_builddir}/src/modules/base/basemod.la \ @WINDOWS_FALSE@-dlopen ${top_builddir}/src/modules/bugs/bugs.la \ @WINDOWS_FALSE@-dlopen ${top_builddir}/src/modules/dic/dic.la \ @WINDOWS_FALSE@-dlopen ${top_builddir}/src/modules/glm/glm.la \ @WINDOWS_FALSE@-dlopen ${top_builddir}/src/modules/lecuyer/lecuyer.la \ @WINDOWS_FALSE@-dlopen ${top_builddir}/src/modules/mix/mix.la \ @WINDOWS_FALSE@-dlopen ${top_builddir}/src/modules/msm/msm.la @WINDOWS_TRUE@jags_terminal_LDADD = $(LIBLTDL) ${top_builddir}/src/lib/libjags.la jags_terminal_CPPFLAGS = -I$(top_srcdir)/src/include $(LTDLINCL) noinst_HEADERS = ReadData.h @WINDOWS_TRUE@dist_bin_SCRIPTS = jags.bat @WINDOWS_FALSE@bin_SCRIPTS = jags # The edit command substitutes paths and filenames into the jags script. # Note that jterm (the name of the installed version of jags-terminal) # is the odd one out as it is a shell variable not # a Makefile variable. In particular, this means that the sed script # must be in double quotes so that it is expanded properly. @WINDOWS_FALSE@edit = sed \ @WINDOWS_FALSE@ -e 's,@jagsmoddir\@,$(jagsmoddir),g' \ @WINDOWS_FALSE@ -e 's,@libexecdir\@,$(libexecdir),g' \ @WINDOWS_FALSE@ -e 's,@libdir\@,$(libdir),g' \ @WINDOWS_FALSE@ -e "s,@jterm\@,$${jterm},g" EXTRA_DIST = jags.in CLEANFILES = jags MAINTAINERCLEANFILES = parser.cc parser.hh scanner.cc all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .cc .ll .lo .o .obj .yy $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/terminal/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/terminal/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ } \ ; done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libexecdir)" && rm -f $$files clean-libexecPROGRAMS: @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list parser.hh: parser.cc @if test ! -f $@; then rm -f parser.cc; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) parser.cc; else :; fi jags-terminal$(EXEEXT): $(jags_terminal_OBJECTS) $(jags_terminal_DEPENDENCIES) $(EXTRA_jags_terminal_DEPENDENCIES) @rm -f jags-terminal$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(jags_terminal_OBJECTS) $(jags_terminal_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-dist_binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jags_terminal-ReadData.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jags_terminal-parser.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jags_terminal-scanner.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cc.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< jags_terminal-parser.o: parser.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT jags_terminal-parser.o -MD -MP -MF $(DEPDIR)/jags_terminal-parser.Tpo -c -o jags_terminal-parser.o `test -f 'parser.cc' || echo '$(srcdir)/'`parser.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/jags_terminal-parser.Tpo $(DEPDIR)/jags_terminal-parser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='parser.cc' object='jags_terminal-parser.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o jags_terminal-parser.o `test -f 'parser.cc' || echo '$(srcdir)/'`parser.cc jags_terminal-parser.obj: parser.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT jags_terminal-parser.obj -MD -MP -MF $(DEPDIR)/jags_terminal-parser.Tpo -c -o jags_terminal-parser.obj `if test -f 'parser.cc'; then $(CYGPATH_W) 'parser.cc'; else $(CYGPATH_W) '$(srcdir)/parser.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/jags_terminal-parser.Tpo $(DEPDIR)/jags_terminal-parser.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='parser.cc' object='jags_terminal-parser.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o jags_terminal-parser.obj `if test -f 'parser.cc'; then $(CYGPATH_W) 'parser.cc'; else $(CYGPATH_W) '$(srcdir)/parser.cc'; fi` jags_terminal-scanner.o: scanner.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT jags_terminal-scanner.o -MD -MP -MF $(DEPDIR)/jags_terminal-scanner.Tpo -c -o jags_terminal-scanner.o `test -f 'scanner.cc' || echo '$(srcdir)/'`scanner.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/jags_terminal-scanner.Tpo $(DEPDIR)/jags_terminal-scanner.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='scanner.cc' object='jags_terminal-scanner.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o jags_terminal-scanner.o `test -f 'scanner.cc' || echo '$(srcdir)/'`scanner.cc jags_terminal-scanner.obj: scanner.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT jags_terminal-scanner.obj -MD -MP -MF $(DEPDIR)/jags_terminal-scanner.Tpo -c -o jags_terminal-scanner.obj `if test -f 'scanner.cc'; then $(CYGPATH_W) 'scanner.cc'; else $(CYGPATH_W) '$(srcdir)/scanner.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/jags_terminal-scanner.Tpo $(DEPDIR)/jags_terminal-scanner.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='scanner.cc' object='jags_terminal-scanner.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o jags_terminal-scanner.obj `if test -f 'scanner.cc'; then $(CYGPATH_W) 'scanner.cc'; else $(CYGPATH_W) '$(srcdir)/scanner.cc'; fi` jags_terminal-ReadData.o: ReadData.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT jags_terminal-ReadData.o -MD -MP -MF $(DEPDIR)/jags_terminal-ReadData.Tpo -c -o jags_terminal-ReadData.o `test -f 'ReadData.cc' || echo '$(srcdir)/'`ReadData.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/jags_terminal-ReadData.Tpo $(DEPDIR)/jags_terminal-ReadData.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ReadData.cc' object='jags_terminal-ReadData.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o jags_terminal-ReadData.o `test -f 'ReadData.cc' || echo '$(srcdir)/'`ReadData.cc jags_terminal-ReadData.obj: ReadData.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT jags_terminal-ReadData.obj -MD -MP -MF $(DEPDIR)/jags_terminal-ReadData.Tpo -c -o jags_terminal-ReadData.obj `if test -f 'ReadData.cc'; then $(CYGPATH_W) 'ReadData.cc'; else $(CYGPATH_W) '$(srcdir)/ReadData.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/jags_terminal-ReadData.Tpo $(DEPDIR)/jags_terminal-ReadData.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='ReadData.cc' object='jags_terminal-ReadData.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(jags_terminal_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o jags_terminal-ReadData.obj `if test -f 'ReadData.cc'; then $(CYGPATH_W) 'ReadData.cc'; else $(CYGPATH_W) '$(srcdir)/ReadData.cc'; fi` .ll.cc: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .yy.cc: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f parser.cc -rm -f parser.hh -rm -f scanner.cc -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/jags_terminal-ReadData.Po -rm -f ./$(DEPDIR)/jags_terminal-parser.Po -rm -f ./$(DEPDIR)/jags_terminal-scanner.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binSCRIPTS install-dist_binSCRIPTS \ install-libexecPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/jags_terminal-ReadData.Po -rm -f ./$(DEPDIR)/jags_terminal-parser.Po -rm -f ./$(DEPDIR)/jags_terminal-scanner.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binSCRIPTS uninstall-dist_binSCRIPTS \ uninstall-libexecPROGRAMS .MAKE: all check install install-am install-exec install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-libexecPROGRAMS clean-libtool \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-binSCRIPTS install-data install-data-am \ install-dist_binSCRIPTS install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libexecPROGRAMS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binSCRIPTS uninstall-dist_binSCRIPTS \ uninstall-libexecPROGRAMS .PRECIOUS: Makefile @WINDOWS_FALSE@jags: Makefile $(srcdir)/jags.in @WINDOWS_FALSE@ rm -f jags jags.tmp @WINDOWS_FALSE@ jterm=`echo jags-terminal | sed -e '$(program_transform_name)'`; \ @WINDOWS_FALSE@ $(edit) $(srcdir)/jags.in > jags.tmp @WINDOWS_FALSE@ chmod +x jags.tmp @WINDOWS_FALSE@ mv jags.tmp jags # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/src/terminal/parser.cc0000664000175000017500000036105614400711032013377 00000000000000/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 3 of the License, 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ /* 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, and Bison version. */ #define YYBISON 30802 /* Bison version string. */ #define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Substitute the type names. */ #define YYSTYPE ZZSTYPE /* Substitute the variable and function names. */ #define yyparse zzparse #define yylex zzlex #define yyerror zzerror #define yydebug zzdebug #define yynerrs zznerrs #define yylval zzlval #define yychar zzchar /* First part of user prologue. */ #line 2 "../../../../jags-4-3_patched/src/terminal/parser.yy" #include #ifdef Win32 #include /* For getCurrentDirectory */ #include /* For chdir */ #else #include /* For getcwd, chdir */ #endif //#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //Required for warning about masked distributions after module loading #include #include #include #include "ReadData.h" typedef void(*pt2Func)(); int zzerror(const char *); int zzlex(); int zzlex_destroy(); #define YYERROR_VERBOSE 0 static jags::Console *console; bool interactive; extern int command_buffer_count; void setName(jags::ParseTree *p, std::string *name); std::map _data_table; std::deque _dyn_lib; bool open_data_buffer(std::string const *name); bool open_command_buffer(std::string const *name); void return_to_main_buffer(); void setMonitor(jags::ParseTree const *var, int thin, std::string const &type); void clearMonitor(jags::ParseTree const *var, std::string const &type); void doCoda (jags::ParseTree const *var, std::string const &stem); void doAllCoda (std::string const &stem); void doDump (std::string const &file, jags::DumpType type, unsigned int chain); void dumpMonitors(std::string const &file, std::string const &type); void doSystem(std::string const *command); std::string ExpandFileName(char const *s); static bool getWorkingDirectory(std::string &name); static void errordump(); static void updatestar(long niter, long refresh, int width); // Run adaptation phase until adapted, regardless of iterations: static void autoadaptstar(long maxiter, long refresh, int width); static void adaptstar(long niter, long refresh, int width, bool force); static void setParameters(jags::ParseTree *p, jags::ParseTree *param1); static void setParameters(jags::ParseTree *p, std::vector *parameters); static void setParameters(jags::ParseTree *p, jags::ParseTree *param1, jags::ParseTree *param2); static void loadModule(std::string const &name); static void unloadModule(std::string const &name); static void dumpSamplers(std::string const &file); static void delete_pvec(std::vector *); static void print_unused_variables(std::map const &table, bool data); static void listFactories(jags::FactoryType type); static void listModules(); static void setFactory(std::string const &name, jags::FactoryType type, std::string const &status); static void setSeed(unsigned int seed); static bool Jtry(bool ok); // Needed for update (and adapt) functions to dump variable states: static bool Jtry_dump(bool ok); // Note: on !ok, Jtry(_dump) only exits if !interactive and otherwise returns ok, // so the parent function should evaluate the value and return; if appriopriate #line 174 "parser.cc" # ifndef YY_CAST # ifdef __cplusplus # define YY_CAST(Type, Val) static_cast (Val) # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) # else # define YY_CAST(Type, Val) ((Type) (Val)) # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) # endif # endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif /* Use api.header.include to #include this header instead of duplicating it here. */ #ifndef YY_ZZ_PARSER_HH_INCLUDED # define YY_ZZ_PARSER_HH_INCLUDED /* Debug traces. */ #ifndef ZZDEBUG # if defined YYDEBUG #if YYDEBUG # define ZZDEBUG 1 # else # define ZZDEBUG 0 # endif # else /* ! defined YYDEBUG */ # define ZZDEBUG 0 # endif /* ! defined YYDEBUG */ #endif /* ! defined ZZDEBUG */ #if ZZDEBUG extern int zzdebug; #endif /* Token kinds. */ #ifndef ZZTOKENTYPE # define ZZTOKENTYPE enum zztokentype { ZZEMPTY = -2, ZZEOF = 0, /* "end of file" */ ZZerror = 256, /* error */ ZZUNDEF = 257, /* "invalid token" */ INT = 258, /* INT */ DOUBLE = 259, /* DOUBLE */ NAME = 260, /* NAME */ STRING = 261, /* STRING */ SYSCMD = 262, /* SYSCMD */ ENDCMD = 263, /* ENDCMD */ MODEL = 264, /* MODEL */ DATA = 265, /* DATA */ IN = 266, /* IN */ TO = 267, /* TO */ INITS = 268, /* INITS */ PARAMETERS = 269, /* PARAMETERS */ COMPILE = 270, /* COMPILE */ INITIALIZE = 271, /* INITIALIZE */ ADAPT = 272, /* ADAPT */ AUTOADAPT = 273, /* AUTOADAPT */ FORCEADAPT = 274, /* FORCEADAPT */ UPDATE = 275, /* UPDATE */ BY = 276, /* BY */ MONITORS = 277, /* MONITORS */ MONITOR = 278, /* MONITOR */ TYPE = 279, /* TYPE */ SET = 280, /* SET */ CLEAR = 281, /* CLEAR */ THIN = 282, /* THIN */ CODA = 283, /* CODA */ STEM = 284, /* STEM */ EXIT = 285, /* EXIT */ NCHAINS = 286, /* NCHAINS */ CHAIN = 287, /* CHAIN */ LOAD = 288, /* LOAD */ UNLOAD = 289, /* UNLOAD */ SAMPLER = 290, /* SAMPLER */ SAMPLERS = 291, /* SAMPLERS */ RNGTOK = 292, /* RNGTOK */ FACTORY = 293, /* FACTORY */ FACTORIES = 294, /* FACTORIES */ MODULES = 295, /* MODULES */ SEED = 296, /* SEED */ LIST = 297, /* LIST */ STRUCTURE = 298, /* STRUCTURE */ DIM = 299, /* DIM */ NA = 300, /* NA */ R_NULL = 301, /* R_NULL */ DIMNAMES = 302, /* DIMNAMES */ ITER = 303, /* ITER */ ARROW = 304, /* ARROW */ ENDDATA = 305, /* ENDDATA */ ASINTEGER = 306, /* ASINTEGER */ DOTDATA = 307, /* DOTDATA */ DIRECTORY = 308, /* DIRECTORY */ CD = 309, /* CD */ PWD = 310, /* PWD */ RUN = 311, /* RUN */ ENDSCRIPT = 312 /* ENDSCRIPT */ }; typedef enum zztokentype zztoken_kind_t; #endif /* Token kinds. */ #define ZZEMPTY -2 #define ZZEOF 0 #define ZZerror 256 #define ZZUNDEF 257 #define INT 258 #define DOUBLE 259 #define NAME 260 #define STRING 261 #define SYSCMD 262 #define ENDCMD 263 #define MODEL 264 #define DATA 265 #define IN 266 #define TO 267 #define INITS 268 #define PARAMETERS 269 #define COMPILE 270 #define INITIALIZE 271 #define ADAPT 272 #define AUTOADAPT 273 #define FORCEADAPT 274 #define UPDATE 275 #define BY 276 #define MONITORS 277 #define MONITOR 278 #define TYPE 279 #define SET 280 #define CLEAR 281 #define THIN 282 #define CODA 283 #define STEM 284 #define EXIT 285 #define NCHAINS 286 #define CHAIN 287 #define LOAD 288 #define UNLOAD 289 #define SAMPLER 290 #define SAMPLERS 291 #define RNGTOK 292 #define FACTORY 293 #define FACTORIES 294 #define MODULES 295 #define SEED 296 #define LIST 297 #define STRUCTURE 298 #define DIM 299 #define NA 300 #define R_NULL 301 #define DIMNAMES 302 #define ITER 303 #define ARROW 304 #define ENDDATA 305 #define ASINTEGER 306 #define DOTDATA 307 #define DIRECTORY 308 #define CD 309 #define PWD 310 #define RUN 311 #define ENDSCRIPT 312 /* Value type. */ #if ! defined ZZSTYPE && ! defined ZZSTYPE_IS_DECLARED union ZZSTYPE { #line 99 "../../../../jags-4-3_patched/src/terminal/parser.yy" int intval; double val; std::string *stringptr; jags::ParseTree *ptree; std::vector *pvec; std::vector *vec; std::vector *ivec; #line 359 "parser.cc" }; typedef union ZZSTYPE ZZSTYPE; # define ZZSTYPE_IS_TRIVIAL 1 # define ZZSTYPE_IS_DECLARED 1 #endif extern ZZSTYPE zzlval; int zzparse (void); #endif /* !YY_ZZ_PARSER_HH_INCLUDED */ /* Symbol kind. */ enum yysymbol_kind_t { YYSYMBOL_YYEMPTY = -2, YYSYMBOL_YYEOF = 0, /* "end of file" */ YYSYMBOL_YYerror = 1, /* error */ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ YYSYMBOL_INT = 3, /* INT */ YYSYMBOL_DOUBLE = 4, /* DOUBLE */ YYSYMBOL_NAME = 5, /* NAME */ YYSYMBOL_STRING = 6, /* STRING */ YYSYMBOL_SYSCMD = 7, /* SYSCMD */ YYSYMBOL_ENDCMD = 8, /* ENDCMD */ YYSYMBOL_MODEL = 9, /* MODEL */ YYSYMBOL_DATA = 10, /* DATA */ YYSYMBOL_IN = 11, /* IN */ YYSYMBOL_TO = 12, /* TO */ YYSYMBOL_INITS = 13, /* INITS */ YYSYMBOL_PARAMETERS = 14, /* PARAMETERS */ YYSYMBOL_COMPILE = 15, /* COMPILE */ YYSYMBOL_INITIALIZE = 16, /* INITIALIZE */ YYSYMBOL_ADAPT = 17, /* ADAPT */ YYSYMBOL_AUTOADAPT = 18, /* AUTOADAPT */ YYSYMBOL_FORCEADAPT = 19, /* FORCEADAPT */ YYSYMBOL_UPDATE = 20, /* UPDATE */ YYSYMBOL_BY = 21, /* BY */ YYSYMBOL_MONITORS = 22, /* MONITORS */ YYSYMBOL_MONITOR = 23, /* MONITOR */ YYSYMBOL_TYPE = 24, /* TYPE */ YYSYMBOL_SET = 25, /* SET */ YYSYMBOL_CLEAR = 26, /* CLEAR */ YYSYMBOL_THIN = 27, /* THIN */ YYSYMBOL_CODA = 28, /* CODA */ YYSYMBOL_STEM = 29, /* STEM */ YYSYMBOL_EXIT = 30, /* EXIT */ YYSYMBOL_NCHAINS = 31, /* NCHAINS */ YYSYMBOL_CHAIN = 32, /* CHAIN */ YYSYMBOL_LOAD = 33, /* LOAD */ YYSYMBOL_UNLOAD = 34, /* UNLOAD */ YYSYMBOL_SAMPLER = 35, /* SAMPLER */ YYSYMBOL_SAMPLERS = 36, /* SAMPLERS */ YYSYMBOL_RNGTOK = 37, /* RNGTOK */ YYSYMBOL_FACTORY = 38, /* FACTORY */ YYSYMBOL_FACTORIES = 39, /* FACTORIES */ YYSYMBOL_MODULES = 40, /* MODULES */ YYSYMBOL_SEED = 41, /* SEED */ YYSYMBOL_LIST = 42, /* LIST */ YYSYMBOL_STRUCTURE = 43, /* STRUCTURE */ YYSYMBOL_DIM = 44, /* DIM */ YYSYMBOL_NA = 45, /* NA */ YYSYMBOL_R_NULL = 46, /* R_NULL */ YYSYMBOL_DIMNAMES = 47, /* DIMNAMES */ YYSYMBOL_ITER = 48, /* ITER */ YYSYMBOL_ARROW = 49, /* ARROW */ YYSYMBOL_ENDDATA = 50, /* ENDDATA */ YYSYMBOL_ASINTEGER = 51, /* ASINTEGER */ YYSYMBOL_DOTDATA = 52, /* DOTDATA */ YYSYMBOL_DIRECTORY = 53, /* DIRECTORY */ YYSYMBOL_CD = 54, /* CD */ YYSYMBOL_PWD = 55, /* PWD */ YYSYMBOL_RUN = 56, /* RUN */ YYSYMBOL_ENDSCRIPT = 57, /* ENDSCRIPT */ YYSYMBOL_58_ = 58, /* ',' */ YYSYMBOL_59_ = 59, /* '(' */ YYSYMBOL_60_ = 60, /* ')' */ YYSYMBOL_61_ = 61, /* '[' */ YYSYMBOL_62_ = 62, /* ']' */ YYSYMBOL_63_ = 63, /* ':' */ YYSYMBOL_64_ = 64, /* '*' */ YYSYMBOL_65_ = 65, /* ';' */ YYSYMBOL_66_ = 66, /* '`' */ YYSYMBOL_67_ = 67, /* '=' */ YYSYMBOL_68_c_ = 68, /* 'c' */ YYSYMBOL_YYACCEPT = 69, /* $accept */ YYSYMBOL_input = 70, /* input */ YYSYMBOL_line = 71, /* line */ YYSYMBOL_command = 72, /* command */ YYSYMBOL_model = 73, /* model */ YYSYMBOL_data_in = 74, /* data_in */ YYSYMBOL_data_to = 75, /* data_to */ YYSYMBOL_data = 76, /* data */ YYSYMBOL_data_clear = 77, /* data_clear */ YYSYMBOL_parameters_in = 78, /* parameters_in */ YYSYMBOL_parameters_to = 79, /* parameters_to */ YYSYMBOL_parameters = 80, /* parameters */ YYSYMBOL_compile = 81, /* compile */ YYSYMBOL_initialize = 82, /* initialize */ YYSYMBOL_autoadapt = 83, /* autoadapt */ YYSYMBOL_forceadapt = 84, /* forceadapt */ YYSYMBOL_adapt = 85, /* adapt */ YYSYMBOL_update = 86, /* update */ YYSYMBOL_exit = 87, /* exit */ YYSYMBOL_var = 88, /* var */ YYSYMBOL_range_list = 89, /* range_list */ YYSYMBOL_range_element = 90, /* range_element */ YYSYMBOL_index = 91, /* index */ YYSYMBOL_monitor = 92, /* monitor */ YYSYMBOL_monitor_set = 93, /* monitor_set */ YYSYMBOL_monitor_clear = 94, /* monitor_clear */ YYSYMBOL_monitors_to = 95, /* monitors_to */ YYSYMBOL_file_name = 96, /* file_name */ YYSYMBOL_coda = 97, /* coda */ YYSYMBOL_load = 98, /* load */ YYSYMBOL_unload = 99, /* unload */ YYSYMBOL_samplers_to = 100, /* samplers_to */ YYSYMBOL_list_factories = 101, /* list_factories */ YYSYMBOL_list_modules = 102, /* list_modules */ YYSYMBOL_set_factory = 103, /* set_factory */ YYSYMBOL_set_seed = 104, /* set_seed */ YYSYMBOL_r_assignment_list = 105, /* r_assignment_list */ YYSYMBOL_r_assignment = 106, /* r_assignment */ YYSYMBOL_r_name = 107, /* r_name */ YYSYMBOL_r_data = 108, /* r_data */ YYSYMBOL_r_structure = 109, /* r_structure */ YYSYMBOL_r_attribute_list = 110, /* r_attribute_list */ YYSYMBOL_r_dim = 111, /* r_dim */ YYSYMBOL_r_collection = 112, /* r_collection */ YYSYMBOL_r_integer_collection = 113, /* r_integer_collection */ YYSYMBOL_r_value_collection = 114, /* r_value_collection */ YYSYMBOL_r_value_list = 115, /* r_value_list */ YYSYMBOL_r_value = 116, /* r_value */ YYSYMBOL_r_generic_attribute = 117, /* r_generic_attribute */ YYSYMBOL_r_generic_list = 118, /* r_generic_list */ YYSYMBOL_r_generic_list_element = 119, /* r_generic_list_element */ YYSYMBOL_r_generic_vector = 120, /* r_generic_vector */ YYSYMBOL_r_numeric_vector = 121, /* r_numeric_vector */ YYSYMBOL_r_double_list = 122, /* r_double_list */ YYSYMBOL_r_character_vector = 123, /* r_character_vector */ YYSYMBOL_r_string_list = 124, /* r_string_list */ YYSYMBOL_get_working_dir = 125, /* get_working_dir */ YYSYMBOL_set_working_dir = 126, /* set_working_dir */ YYSYMBOL_read_dir = 127, /* read_dir */ YYSYMBOL_run_script = 128 /* run_script */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; #ifdef short # undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure and (if available) are included so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ # include /* INFRINGES ON USER NAME SPACE */ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YY_STDINT_H # endif #endif /* Narrow types that promote to a signed type and that can represent a signed or unsigned integer of at least N bits. In tables they can save space and decrease cache pressure. Promoting to a signed type helps avoid bugs in integer arithmetic. */ #ifdef __INT_LEAST8_MAX__ typedef __INT_LEAST8_TYPE__ yytype_int8; #elif defined YY_STDINT_H typedef int_least8_t yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef __INT_LEAST16_MAX__ typedef __INT_LEAST16_TYPE__ yytype_int16; #elif defined YY_STDINT_H typedef int_least16_t yytype_int16; #else typedef short yytype_int16; #endif /* Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants. This workaround can likely be removed in 2023, as HPE has promised support for HP-UX 11.23 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of . */ #ifdef __hpux # undef UINT_LEAST8_MAX # undef UINT_LEAST16_MAX # define UINT_LEAST8_MAX 255 # define UINT_LEAST16_MAX 65535 #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; #else typedef short yytype_uint8; #endif #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; #else typedef int yytype_uint16; #endif #ifndef YYPTRDIFF_T # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ # define YYPTRDIFF_T __PTRDIFF_TYPE__ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ # elif defined PTRDIFF_MAX # ifndef ptrdiff_t # include /* INFRINGES ON USER NAME SPACE */ # endif # define YYPTRDIFF_T ptrdiff_t # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX # else # define YYPTRDIFF_T long # define YYPTRDIFF_MAXIMUM LONG_MAX # endif #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM \ YY_CAST (YYPTRDIFF_T, \ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ ? YYPTRDIFF_MAXIMUM \ : YY_CAST (YYSIZE_T, -1))) #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) /* Stored state numbers (used for stacks). */ typedef yytype_int16 yy_state_t; /* State numbers in computations. */ typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define YY_ATTRIBUTE_PURE # endif #endif #ifndef YY_ATTRIBUTE_UNUSED # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # else # define YY_ATTRIBUTE_UNUSED # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YY_USE(E) ((void) (E)) #else # define YY_USE(E) /* empty */ #endif /* Suppress an incorrect diagnostic about yylval being uninitialized. */ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ # if __GNUC__ * 100 + __GNUC_MINOR__ < 407 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") # else # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ # define YY_IGNORE_USELESS_CAST_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") # define YY_IGNORE_USELESS_CAST_END \ _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_END #endif #define YY_ASSERT(E) ((void) (0 && (E))) #if !defined yyoverflow /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* !defined yyoverflow */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined ZZSTYPE_IS_TRIVIAL && ZZSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yy_state_t yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* 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_alloc, Stack) \ do \ { \ YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / YYSIZEOF (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYPTRDIFF_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 306 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 69 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 60 /* YYNRULES -- Number of rules. */ #define YYNRULES 149 /* YYNSTATES -- Number of states. */ #define YYNSTATES 315 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 312 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ (0 <= (YYX) && (YYX) <= YYMAXUTOK \ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_int8 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, 59, 60, 64, 2, 58, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 63, 65, 2, 67, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 61, 2, 62, 2, 2, 66, 2, 2, 68, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 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 }; #if ZZDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { 0, 181, 181, 185, 191, 192, 193, 194, 195, 196, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 227, 239, 244, 252, 258, 264, 276, 282, 308, 322, 325, 329, 335, 344, 356, 360, 366, 373, 377, 382, 386, 391, 395, 400, 404, 409, 412, 415, 421, 424, 429, 432, 438, 441, 442, 445, 448, 451, 454, 457, 461, 465, 471, 474, 480, 486, 498, 499, 502, 505, 508, 511, 516, 519, 522, 529, 534, 539, 545, 551, 558, 565, 573, 581, 584, 587, 592, 595, 600, 608, 609, 610, 615, 616, 620, 627, 635, 636, 637, 638, 641, 644, 649, 650, 653, 656, 660, 666, 667, 670, 671, 677, 680, 681, 684, 685, 688, 689, 690, 691, 692, 693, 696, 697, 700, 701, 704, 705, 708, 709, 714, 725, 733, 757 }; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) #if ZZDEBUG || 0 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "\"end of file\"", "error", "\"invalid token\"", "INT", "DOUBLE", "NAME", "STRING", "SYSCMD", "ENDCMD", "MODEL", "DATA", "IN", "TO", "INITS", "PARAMETERS", "COMPILE", "INITIALIZE", "ADAPT", "AUTOADAPT", "FORCEADAPT", "UPDATE", "BY", "MONITORS", "MONITOR", "TYPE", "SET", "CLEAR", "THIN", "CODA", "STEM", "EXIT", "NCHAINS", "CHAIN", "LOAD", "UNLOAD", "SAMPLER", "SAMPLERS", "RNGTOK", "FACTORY", "FACTORIES", "MODULES", "SEED", "LIST", "STRUCTURE", "DIM", "NA", "R_NULL", "DIMNAMES", "ITER", "ARROW", "ENDDATA", "ASINTEGER", "DOTDATA", "DIRECTORY", "CD", "PWD", "RUN", "ENDSCRIPT", "','", "'('", "')'", "'['", "']'", "':'", "'*'", "';'", "'`'", "'='", "'c'", "$accept", "input", "line", "command", "model", "data_in", "data_to", "data", "data_clear", "parameters_in", "parameters_to", "parameters", "compile", "initialize", "autoadapt", "forceadapt", "adapt", "update", "exit", "var", "range_list", "range_element", "index", "monitor", "monitor_set", "monitor_clear", "monitors_to", "file_name", "coda", "load", "unload", "samplers_to", "list_factories", "list_modules", "set_factory", "set_seed", "r_assignment_list", "r_assignment", "r_name", "r_data", "r_structure", "r_attribute_list", "r_dim", "r_collection", "r_integer_collection", "r_value_collection", "r_value_list", "r_value", "r_generic_attribute", "r_generic_list", "r_generic_list_element", "r_generic_vector", "r_numeric_vector", "r_double_list", "r_character_vector", "r_string_list", "get_working_dir", "set_working_dir", "read_dir", "run_script", YY_NULLPTR }; static const char * yysymbol_name (yysymbol_kind_t yysymbol) { return yytname[yysymbol]; } #endif #define YYPACT_NINF (-206) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) #define YYTABLE_NINF (-1) #define yytable_value_is_error(Yyn) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = { -206, 100, -206, 97, 104, -206, -7, 77, 29, 140, -45, -206, 20, 80, 121, 129, 81, 7, -13, 15, -206, 158, 130, 149, 126, -206, 158, -206, 158, 133, -206, 161, -206, -206, -206, 21, -206, -206, -206, 21, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, 158, -206, 158, 158, -206, 158, 158, 158, 139, 113, 114, 115, 116, 158, 117, 170, 170, 118, 162, 174, 122, 123, -206, -206, -206, -206, 158, 124, -206, -206, -206, -206, -206, -206, -206, 178, 32, -206, 135, 61, -206, -206, -206, -206, -206, 127, 120, 165, 166, 167, 168, 132, 188, 136, 137, 75, 187, 191, -206, 164, 169, -206, 173, 138, -206, 21, -206, 5, 141, 171, 197, 142, 143, 146, 147, 183, -206, -27, -206, 145, 182, 186, 152, 153, 155, 156, 157, 159, 160, -206, -206, -206, -206, 163, -206, 172, 175, -206, -206, -206, -206, -206, 185, 176, 177, 212, 217, 218, 220, 179, 188, -206, 188, 180, 181, 219, 222, 202, 203, 158, 158, 108, 26, 4, 39, 184, 225, -206, 189, 190, 192, 193, 224, -206, -206, 227, 228, 194, 195, 198, 199, 196, 200, 201, 204, 205, 206, -24, -206, 207, 46, -206, 229, 208, -206, -206, -206, -206, 209, 210, 211, 214, 221, -8, 213, -206, -206, -206, -206, -206, 17, 85, -206, -206, 39, -206, 215, -206, -206, -206, -206, 223, 226, 216, 230, 231, -206, 232, 233, 79, -206, -206, -206, -206, 239, 241, -206, -206, -206, 18, 2, 85, -206, 234, 235, -206, -206, 237, 238, -206, 242, 243, -206, -206, -206, -206, -206, -206, -206, -206, -206, 12, 12, 6, 134, 236, 86, -206, -206, 89, 245, 246, -206, -206, 90, 102, 18, 12, -206, -206, 240, -206, 247, -206, 253, -206, -206, -206, -206, -206 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 0, 1, 0, 0, 4, 0, 0, 0, 0, 50, 52, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 0, 0, 148, 0, 146, 0, 0, 3, 0, 10, 11, 12, 39, 13, 14, 15, 45, 16, 17, 19, 20, 18, 21, 27, 22, 69, 70, 23, 24, 25, 26, 31, 32, 33, 34, 35, 29, 30, 28, 7, 6, 9, 0, 37, 0, 0, 42, 0, 0, 0, 0, 57, 53, 55, 59, 0, 62, 0, 0, 73, 0, 0, 86, 84, 82, 83, 88, 89, 0, 0, 94, 147, 149, 8, 5, 106, 105, 0, 0, 99, 0, 0, 36, 41, 40, 49, 48, 46, 0, 0, 0, 0, 0, 80, 0, 71, 78, 0, 0, 0, 98, 0, 0, 90, 0, 0, 38, 0, 100, 0, 43, 0, 0, 0, 0, 0, 0, 0, 68, 0, 64, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 107, 101, 125, 104, 0, 126, 0, 0, 102, 103, 118, 119, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 65, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 0, 0, 123, 0, 0, 58, 54, 56, 60, 0, 0, 0, 75, 74, 0, 0, 87, 85, 93, 91, 92, 0, 0, 111, 120, 0, 122, 0, 47, 81, 72, 79, 0, 0, 0, 0, 0, 109, 0, 0, 0, 112, 113, 124, 44, 0, 0, 97, 96, 95, 0, 0, 0, 110, 0, 0, 138, 142, 0, 0, 137, 0, 0, 127, 132, 134, 117, 116, 115, 114, 76, 77, 0, 0, 0, 0, 0, 0, 128, 130, 0, 0, 0, 140, 144, 0, 0, 0, 0, 135, 136, 0, 133, 0, 139, 0, 143, 131, 129, 141, 145 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -206, -5, -206, -174, 59, -206, -206, -206, -206, -26, -206, -206, -206, -206, -206, -206, -206, -206, 244, -9, -206, -206, -206, -206, -19, -184, -206, 74, -206, -182, -3, -21, -30, -205, -14, -206, -206, -206, -206, -206, -206, -206 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { 0, 1, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 82, 142, 143, 144, 47, 48, 49, 50, 89, 51, 52, 53, 54, 55, 56, 57, 58, 101, 102, 103, 212, 162, 254, 255, 163, 164, 165, 215, 166, 256, 291, 292, 293, 278, 299, 279, 300, 59, 60, 61, 62 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { 94, 198, 95, 213, 65, 141, 156, 216, 156, 156, 270, 157, 79, 73, 86, 248, 270, 290, 271, 66, 79, 156, 270, 74, 271, 83, 98, 99, 84, 249, 156, 175, 80, 81, 236, 176, 237, 98, 99, 105, 70, 106, 107, 156, 108, 109, 110, 159, 158, 159, 159, 251, 116, 160, 272, 273, 160, 257, 274, 277, 272, 273, 159, 275, 274, 126, 98, 99, 160, 275, 161, 159, 161, 161, 295, 118, 119, 160, 211, 85, 276, 281, 129, 75, 159, 161, 276, 100, 67, 68, 252, 280, 131, 78, 161, 131, 311, 130, 100, 147, 2, 3, 148, 69, 239, 63, 240, 4, 5, 6, 7, 133, 64, 8, 9, 10, 11, 12, 13, 14, 15, 155, 16, 17, 76, 18, 130, 100, 19, 253, 20, 208, 77, 21, 22, 90, 23, 266, 297, 267, 298, 96, 24, 209, 302, 210, 303, 302, 307, 304, 308, 71, 72, 25, 26, 27, 28, 29, 206, 207, 309, 91, 310, 87, 88, 92, 93, 121, 122, 97, 111, 112, 113, 114, 115, 79, 120, 123, 117, 135, 124, 125, 127, 128, 132, 134, 136, 137, 138, 139, 140, 141, 149, 151, 145, 146, 150, 153, 152, 167, 169, 170, 171, 168, 154, 172, 173, 174, 177, 178, 179, 180, 181, 182, 183, 193, 184, 190, 185, 186, 194, 195, 187, 196, 202, 203, 204, 205, 218, 223, 224, 188, 241, 225, 189, 191, 199, 192, 197, 200, 201, 246, 268, 217, 297, 247, 269, 282, 250, 219, 220, 313, 221, 222, 226, 227, 230, 228, 229, 314, 231, 232, 214, 283, 233, 234, 294, 238, 242, 243, 244, 245, 312, 235, 296, 258, 261, 0, 0, 0, 0, 0, 259, 104, 0, 260, 0, 0, 0, 0, 262, 263, 0, 0, 284, 285, 286, 287, 0, 264, 265, 288, 289, 301, 305, 0, 306 }; static const yytype_int16 yycheck[] = { 26, 175, 28, 187, 11, 3, 4, 189, 4, 4, 4, 6, 5, 58, 19, 23, 4, 5, 6, 26, 5, 4, 4, 3, 6, 38, 5, 6, 41, 37, 4, 58, 25, 26, 58, 62, 60, 5, 6, 65, 11, 67, 68, 4, 70, 71, 72, 45, 43, 45, 45, 235, 78, 51, 42, 43, 51, 239, 46, 264, 42, 43, 45, 51, 46, 91, 5, 6, 51, 51, 68, 45, 68, 68, 68, 80, 81, 51, 52, 64, 68, 265, 50, 3, 45, 68, 68, 66, 11, 12, 5, 265, 101, 12, 68, 104, 301, 65, 66, 24, 0, 1, 27, 26, 58, 8, 60, 7, 8, 9, 10, 50, 8, 13, 14, 15, 16, 17, 18, 19, 20, 130, 22, 23, 3, 25, 65, 66, 28, 44, 30, 23, 3, 33, 34, 5, 36, 58, 4, 60, 6, 8, 42, 35, 58, 37, 60, 58, 58, 60, 60, 11, 12, 53, 54, 55, 56, 57, 184, 185, 58, 12, 60, 5, 6, 39, 40, 5, 6, 8, 31, 58, 58, 58, 58, 5, 58, 3, 61, 59, 58, 58, 58, 5, 49, 58, 21, 21, 21, 21, 58, 3, 5, 29, 58, 58, 5, 24, 29, 58, 3, 59, 59, 32, 66, 59, 59, 24, 63, 27, 24, 59, 59, 58, 58, 3, 59, 32, 59, 59, 3, 3, 59, 3, 5, 3, 24, 24, 3, 5, 3, 59, 3, 5, 59, 59, 177, 60, 59, 59, 59, 27, 3, 59, 4, 24, 5, 266, 35, 60, 60, 4, 60, 60, 60, 60, 60, 59, 59, 6, 60, 60, 188, 266, 60, 60, 287, 60, 60, 60, 60, 60, 302, 67, 288, 60, 60, -1, -1, -1, -1, -1, 59, 39, -1, 59, -1, -1, -1, -1, 60, 60, -1, -1, 60, 60, 59, 59, -1, 67, 67, 59, 59, 67, 59, -1, 60 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 70, 0, 1, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 25, 28, 30, 33, 34, 36, 42, 53, 54, 55, 56, 57, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 92, 93, 94, 95, 97, 98, 99, 100, 101, 102, 103, 104, 125, 126, 127, 128, 8, 8, 11, 26, 11, 12, 26, 11, 11, 12, 58, 3, 3, 3, 3, 12, 5, 25, 26, 88, 38, 41, 64, 88, 5, 6, 96, 5, 12, 39, 40, 96, 96, 8, 8, 5, 6, 66, 105, 106, 107, 105, 96, 96, 96, 96, 96, 96, 31, 58, 58, 58, 58, 96, 61, 88, 88, 58, 5, 6, 3, 58, 58, 96, 58, 5, 50, 65, 106, 49, 50, 58, 59, 21, 21, 21, 21, 58, 3, 89, 90, 91, 58, 58, 24, 27, 5, 5, 29, 29, 24, 66, 106, 4, 6, 43, 45, 51, 68, 109, 112, 113, 114, 116, 58, 32, 3, 59, 59, 59, 59, 24, 58, 62, 63, 27, 24, 59, 59, 58, 58, 59, 59, 59, 59, 59, 59, 32, 59, 60, 3, 3, 3, 3, 59, 90, 91, 59, 59, 5, 3, 24, 24, 96, 96, 23, 35, 37, 52, 108, 112, 114, 115, 116, 59, 3, 60, 60, 60, 60, 5, 3, 5, 60, 60, 59, 59, 60, 60, 60, 60, 60, 67, 58, 60, 60, 58, 60, 3, 60, 60, 60, 60, 27, 24, 23, 37, 35, 112, 5, 44, 110, 111, 117, 116, 60, 59, 59, 60, 60, 60, 67, 67, 58, 60, 3, 5, 4, 6, 42, 43, 46, 51, 68, 120, 121, 123, 90, 112, 111, 117, 60, 60, 59, 59, 59, 59, 5, 118, 119, 120, 118, 68, 121, 4, 6, 122, 124, 67, 58, 60, 60, 59, 60, 58, 60, 58, 60, 120, 119, 4, 6 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_uint8 yyr1[] = { 0, 69, 70, 70, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 73, 73, 74, 74, 75, 76, 77, 78, 78, 78, 79, 79, 80, 80, 81, 81, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 88, 88, 89, 89, 90, 90, 91, 92, 92, 93, 93, 93, 93, 93, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 97, 97, 98, 99, 100, 101, 101, 101, 102, 103, 103, 103, 104, 105, 105, 105, 106, 106, 106, 107, 107, 107, 108, 108, 109, 109, 110, 110, 110, 110, 111, 111, 112, 112, 113, 114, 114, 115, 115, 116, 116, 117, 118, 118, 119, 119, 120, 120, 120, 120, 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 126, 127, 128 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 0, 2, 1, 2, 2, 1, 2, 2, 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, 2, 3, 1, 3, 3, 2, 3, 8, 1, 3, 8, 3, 3, 1, 6, 1, 2, 7, 2, 7, 2, 7, 2, 7, 1, 1, 4, 1, 3, 1, 3, 1, 1, 1, 3, 8, 2, 7, 7, 11, 11, 3, 8, 3, 8, 1, 1, 2, 7, 2, 7, 2, 2, 3, 7, 7, 7, 2, 9, 9, 9, 3, 1, 2, 3, 3, 3, 3, 1, 1, 3, 1, 3, 6, 4, 1, 1, 3, 3, 3, 3, 1, 1, 4, 1, 4, 1, 3, 1, 1, 3, 1, 3, 1, 3, 1, 4, 1, 4, 4, 1, 1, 4, 1, 3, 1, 4, 1, 3, 1, 2, 1, 2 }; enum { YYENOMEM = -2 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = ZZEMPTY) #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == ZZEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Backward compatibility with an undocumented macro. Use ZZerror or ZZUNDEF. */ #define YYERRCODE ZZUNDEF /* Enable debugging if requested. */ #if ZZDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Kind, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; YY_USE (yyoutput); if (!yyvaluep) return; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); yy_symbol_value_print (yyo, yykind, yyvaluep); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), &yyvsp[(yyi + 1) - (yynrhs)]); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !ZZDEBUG */ # define YYDPRINTF(Args) ((void) 0) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !ZZDEBUG */ /* 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 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus = 0; /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ YYPTRDIFF_T yystacksize = YYINITDEPTH; /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; yy_state_t *yyss = yyssa; yy_state_t *yyssp = yyss; /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp = yyvs; int yyn; /* The return value of yyparse. */ int yyresult; /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yychar = ZZEMPTY; /* Cause a token to be read. */ 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 -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YY_ASSERT (0 <= yystate && yystate < YYNSTATES); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined 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. */ yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; /* 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 (YY_("memory exhausted"), &yyss1, yysize * YYSIZEOF (*yyssp), &yyvs1, yysize * YYSIZEOF (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yy_state_t *yyss1 = yyss; union yyalloc *yyptr = YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YY_IGNORE_USELESS_CAST_BEGIN YYDPRINTF ((stderr, "Stack size increased to %ld\n", YY_CAST (long, yystacksize))); YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ if (yystate == YYFINAL) YYACCEPT; 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. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == ZZEMPTY) { YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (); } if (yychar <= ZZEOF) { yychar = ZZEOF; yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else if (yychar == ZZerror) { /* The scanner already issued an error message, process directly to error recovery. But do not keep the error token as lookahead, it is too special and may lead us to an endless loop in error recovery. */ yychar = ZZUNDEF; yytoken = YYSYMBOL_YYerror; goto yyerrlab1; } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Discard the shifted token. */ yychar = ZZEMPTY; 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]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* input: %empty */ #line 181 "../../../../jags-4-3_patched/src/terminal/parser.yy" { if (interactive && command_buffer_count == 0) std::cout << ". " << std::flush; } #line 1687 "parser.cc" break; case 3: /* input: input line */ #line 185 "../../../../jags-4-3_patched/src/terminal/parser.yy" { if (interactive && command_buffer_count == 0) std::cout << ". " << std::flush; } #line 1696 "parser.cc" break; case 4: /* line: ENDCMD */ #line 191 "../../../../jags-4-3_patched/src/terminal/parser.yy" {} #line 1702 "parser.cc" break; case 5: /* line: command ENDCMD */ #line 192 "../../../../jags-4-3_patched/src/terminal/parser.yy" {} #line 1708 "parser.cc" break; case 6: /* line: error ENDCMD */ #line 193 "../../../../jags-4-3_patched/src/terminal/parser.yy" {if(interactive) yyerrok; else exit(1); } #line 1714 "parser.cc" break; case 7: /* line: run_script */ #line 194 "../../../../jags-4-3_patched/src/terminal/parser.yy" {} #line 1720 "parser.cc" break; case 8: /* line: ENDSCRIPT ENDCMD */ #line 195 "../../../../jags-4-3_patched/src/terminal/parser.yy" {} #line 1726 "parser.cc" break; case 9: /* line: SYSCMD ENDCMD */ #line 196 "../../../../jags-4-3_patched/src/terminal/parser.yy" { doSystem((yyvsp[-1].stringptr)); delete (yyvsp[-1].stringptr);} #line 1732 "parser.cc" break; case 36: /* model: MODEL IN file_name */ #line 227 "../../../../jags-4-3_patched/src/terminal/parser.yy" { std::FILE *file = std::fopen(ExpandFileName(((yyvsp[0].stringptr))->c_str()).c_str(), "r"); if (!file) { std::cerr << "Failed to open file " << *((yyvsp[0].stringptr)) << std::endl; if (!interactive) exit(1); } else { Jtry(console->checkModel(file)); std::fclose(file); } delete (yyvsp[0].stringptr); } #line 1749 "parser.cc" break; case 37: /* model: MODEL CLEAR */ #line 239 "../../../../jags-4-3_patched/src/terminal/parser.yy" { console->clearModel(); } #line 1757 "parser.cc" break; case 38: /* data_in: data r_assignment_list ENDDATA */ #line 244 "../../../../jags-4-3_patched/src/terminal/parser.yy" { std::string rngname; readRData((yyvsp[-1].pvec), _data_table, rngname); if (rngname.size() != 0) { std::cerr << "WARNING: .RNG.name assignment ignored" << std::endl; } delete_pvec((yyvsp[-1].pvec)); } #line 1770 "parser.cc" break; case 39: /* data_in: data */ #line 252 "../../../../jags-4-3_patched/src/terminal/parser.yy" { // Failed to open the data file if (!interactive) exit(1); } #line 1779 "parser.cc" break; case 40: /* data_to: DATA TO file_name */ #line 258 "../../../../jags-4-3_patched/src/terminal/parser.yy" { doDump(*(yyvsp[0].stringptr), jags::DUMP_DATA, 1); delete (yyvsp[0].stringptr); } #line 1788 "parser.cc" break; case 41: /* data: DATA IN file_name */ #line 264 "../../../../jags-4-3_patched/src/terminal/parser.yy" { if(open_data_buffer((yyvsp[0].stringptr))) { std::cout << "Reading data file " << *(yyvsp[0].stringptr) << std::endl; } else { std::cerr << "Unable to open file " << *(yyvsp[0].stringptr) << std::endl << std::flush; if (!interactive) exit(1); } delete (yyvsp[0].stringptr); } #line 1803 "parser.cc" break; case 42: /* data_clear: DATA CLEAR */ #line 276 "../../../../jags-4-3_patched/src/terminal/parser.yy" { std::cout << "Clearing data table " << std::endl; _data_table.clear(); } #line 1812 "parser.cc" break; case 43: /* parameters_in: parameters r_assignment_list ENDDATA */ #line 283 "../../../../jags-4-3_patched/src/terminal/parser.yy" { std::map parameter_table; std::string rngname; readRData((yyvsp[-1].pvec), parameter_table, rngname); delete_pvec((yyvsp[-1].pvec)); /* Set all chains to the same state. If the user sets the RNG state in addition to the parameter values then all chains will be identical! */ if (console->model() == 0) { std::cout << "ERROR: Initial values ignored. " << "(You must compile the model first)" << std::endl; if (!interactive) exit(1); } for (unsigned int i = 1; i <= console->nchain(); ++i) { /* We have to set the name first, because the state or seed might be embedded in the parameter_table */ if (rngname.size() != 0) { Jtry(console->setRNGname(rngname, i)); } Jtry(console->setParameters(parameter_table, i)); } print_unused_variables(parameter_table, false); } #line 1842 "parser.cc" break; case 44: /* parameters_in: parameters r_assignment_list ENDDATA ',' CHAIN '(' INT ')' */ #line 309 "../../../../jags-4-3_patched/src/terminal/parser.yy" { std::map parameter_table; std::string rngname; readRData((yyvsp[-6].pvec), parameter_table, rngname); delete (yyvsp[-6].pvec); /* We have to set the name first, because the state or seed might be embedded in the parameter_table */ if (rngname.size() != 0) { Jtry(console->setRNGname(rngname, (yyvsp[-1].intval))); } Jtry(console->setParameters(parameter_table, (yyvsp[-1].intval))); print_unused_variables(parameter_table, false); } #line 1860 "parser.cc" break; case 45: /* parameters_in: parameters */ #line 322 "../../../../jags-4-3_patched/src/terminal/parser.yy" {} #line 1866 "parser.cc" break; case 46: /* parameters_to: PARAMETERS TO file_name */ #line 325 "../../../../jags-4-3_patched/src/terminal/parser.yy" { doDump(*(yyvsp[0].stringptr), jags::DUMP_PARAMETERS, 1); delete (yyvsp[0].stringptr); } #line 1875 "parser.cc" break; case 47: /* parameters_to: PARAMETERS TO file_name ',' CHAIN '(' INT ')' */ #line 329 "../../../../jags-4-3_patched/src/terminal/parser.yy" { doDump(*(yyvsp[-5].stringptr), jags::DUMP_PARAMETERS, (yyvsp[-1].intval)); delete (yyvsp[-5].stringptr); } #line 1884 "parser.cc" break; case 48: /* parameters: PARAMETERS IN file_name */ #line 335 "../../../../jags-4-3_patched/src/terminal/parser.yy" { if(open_data_buffer((yyvsp[0].stringptr))) { std::cout << "Reading parameter file " << *(yyvsp[0].stringptr) << std::endl; } else { std::cerr << "Unable to open file " << *(yyvsp[0].stringptr) << std::endl << std::flush; } delete (yyvsp[0].stringptr); } #line 1898 "parser.cc" break; case 49: /* parameters: INITS IN file_name */ #line 344 "../../../../jags-4-3_patched/src/terminal/parser.yy" { /* Legacy option to not break existing scripts */ if(open_data_buffer((yyvsp[0].stringptr))) { std::cout << "Reading initial values file " << *(yyvsp[0].stringptr) << std::endl; } else { std::cerr << "Unable to open file " << *(yyvsp[0].stringptr) << std::endl << std::flush; } delete (yyvsp[0].stringptr); } #line 1913 "parser.cc" break; case 50: /* compile: COMPILE */ #line 356 "../../../../jags-4-3_patched/src/terminal/parser.yy" { Jtry(console->compile(_data_table, 1, true)); print_unused_variables(_data_table, true); } #line 1922 "parser.cc" break; case 51: /* compile: COMPILE ',' NCHAINS '(' INT ')' */ #line 360 "../../../../jags-4-3_patched/src/terminal/parser.yy" { Jtry(console->compile(_data_table, (yyvsp[-1].intval), true)); print_unused_variables(_data_table, true); } #line 1931 "parser.cc" break; case 52: /* initialize: INITIALIZE */ #line 366 "../../../../jags-4-3_patched/src/terminal/parser.yy" { if (!console->initialize()) { errordump(); } } #line 1941 "parser.cc" break; case 53: /* autoadapt: AUTOADAPT INT */ #line 373 "../../../../jags-4-3_patched/src/terminal/parser.yy" { long refresh = interactive ? (yyvsp[0].intval)/50 : 0; autoadaptstar((yyvsp[0].intval), refresh, 50); } #line 1950 "parser.cc" break; case 54: /* autoadapt: AUTOADAPT INT ',' BY '(' INT ')' */ #line 377 "../../../../jags-4-3_patched/src/terminal/parser.yy" { autoadaptstar((yyvsp[-5].intval),(yyvsp[-1].intval), 50); } #line 1958 "parser.cc" break; case 55: /* forceadapt: FORCEADAPT INT */ #line 382 "../../../../jags-4-3_patched/src/terminal/parser.yy" { long refresh = interactive ? (yyvsp[0].intval)/50 : 0; adaptstar((yyvsp[0].intval), refresh, 50, true); } #line 1967 "parser.cc" break; case 56: /* forceadapt: FORCEADAPT INT ',' BY '(' INT ')' */ #line 386 "../../../../jags-4-3_patched/src/terminal/parser.yy" { adaptstar((yyvsp[-5].intval),(yyvsp[-1].intval), 50, true); } #line 1975 "parser.cc" break; case 57: /* adapt: ADAPT INT */ #line 391 "../../../../jags-4-3_patched/src/terminal/parser.yy" { long refresh = interactive ? (yyvsp[0].intval)/50 : 0; adaptstar((yyvsp[0].intval), refresh, 50, false); } #line 1984 "parser.cc" break; case 58: /* adapt: ADAPT INT ',' BY '(' INT ')' */ #line 395 "../../../../jags-4-3_patched/src/terminal/parser.yy" { adaptstar((yyvsp[-5].intval),(yyvsp[-1].intval), 50, false); } #line 1992 "parser.cc" break; case 59: /* update: UPDATE INT */ #line 400 "../../../../jags-4-3_patched/src/terminal/parser.yy" { long refresh = interactive ? (yyvsp[0].intval)/50 : 0; updatestar((yyvsp[0].intval), refresh, 50); } #line 2001 "parser.cc" break; case 60: /* update: UPDATE INT ',' BY '(' INT ')' */ #line 404 "../../../../jags-4-3_patched/src/terminal/parser.yy" { updatestar((yyvsp[-5].intval),(yyvsp[-1].intval), 50); } #line 2009 "parser.cc" break; case 61: /* exit: EXIT */ #line 409 "../../../../jags-4-3_patched/src/terminal/parser.yy" { return 0; } #line 2015 "parser.cc" break; case 62: /* var: NAME */ #line 412 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = new jags::ParseTree(jags::P_VAR); setName((yyval.ptree), (yyvsp[0].stringptr)); } #line 2023 "parser.cc" break; case 63: /* var: NAME '[' range_list ']' */ #line 415 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = new jags::ParseTree(jags::P_VAR); setName((yyval.ptree), (yyvsp[-3].stringptr)); setParameters((yyval.ptree), (yyvsp[-1].pvec)); } #line 2032 "parser.cc" break; case 64: /* range_list: range_element */ #line 421 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.pvec) = new std::vector(1, (yyvsp[0].ptree)); } #line 2040 "parser.cc" break; case 65: /* range_list: range_list ',' range_element */ #line 424 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.pvec)=(yyvsp[-2].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 2048 "parser.cc" break; case 66: /* range_element: index */ #line 429 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = new jags::ParseTree(jags::P_RANGE); setParameters((yyval.ptree), (yyvsp[0].ptree)); } #line 2056 "parser.cc" break; case 67: /* range_element: index ':' index */ #line 432 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = new jags::ParseTree(jags::P_RANGE); setParameters((yyval.ptree), (yyvsp[-2].ptree), (yyvsp[0].ptree)); } #line 2064 "parser.cc" break; case 68: /* index: INT */ #line 438 "../../../../jags-4-3_patched/src/terminal/parser.yy" {(yyval.ptree) = new jags::ParseTree(jags::P_VALUE); (yyval.ptree)->setValue((yyvsp[0].intval));} #line 2070 "parser.cc" break; case 71: /* monitor_set: MONITOR SET var */ #line 445 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setMonitor((yyvsp[0].ptree), 1, "trace"); delete (yyvsp[0].ptree); } #line 2078 "parser.cc" break; case 72: /* monitor_set: MONITOR SET var ',' THIN '(' INT ')' */ #line 448 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setMonitor((yyvsp[-5].ptree), (yyvsp[-1].intval), "trace"); delete (yyvsp[-5].ptree); } #line 2086 "parser.cc" break; case 73: /* monitor_set: MONITOR var */ #line 451 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setMonitor((yyvsp[0].ptree), 1, "trace"); delete (yyvsp[0].ptree); } #line 2094 "parser.cc" break; case 74: /* monitor_set: MONITOR var ',' THIN '(' INT ')' */ #line 454 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setMonitor((yyvsp[-5].ptree), (yyvsp[-1].intval), "trace"); delete (yyvsp[-5].ptree); } #line 2102 "parser.cc" break; case 75: /* monitor_set: MONITOR var ',' TYPE '(' NAME ')' */ #line 457 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setMonitor((yyvsp[-5].ptree), 1, *(yyvsp[-1].stringptr)); delete (yyvsp[-1].stringptr); } #line 2111 "parser.cc" break; case 76: /* monitor_set: MONITOR var ',' TYPE '(' NAME ')' THIN '(' INT ')' */ #line 461 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setMonitor((yyvsp[-9].ptree), (yyvsp[-1].intval), *(yyvsp[-5].stringptr)); delete (yyvsp[-5].stringptr); } #line 2120 "parser.cc" break; case 77: /* monitor_set: MONITOR var ',' THIN '(' INT ')' TYPE '(' NAME ')' */ #line 465 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setMonitor((yyvsp[-9].ptree), (yyvsp[-5].intval), *(yyvsp[-1].stringptr)); delete (yyvsp[-1].stringptr); } #line 2129 "parser.cc" break; case 78: /* monitor_clear: MONITOR CLEAR var */ #line 471 "../../../../jags-4-3_patched/src/terminal/parser.yy" { clearMonitor((yyvsp[0].ptree), "trace"); delete (yyvsp[0].ptree); } #line 2137 "parser.cc" break; case 79: /* monitor_clear: MONITOR CLEAR var ',' TYPE '(' NAME ')' */ #line 474 "../../../../jags-4-3_patched/src/terminal/parser.yy" { clearMonitor((yyvsp[-5].ptree), *(yyvsp[-1].stringptr)); delete (yyvsp[-1].stringptr); } #line 2146 "parser.cc" break; case 80: /* monitors_to: MONITORS TO file_name */ #line 481 "../../../../jags-4-3_patched/src/terminal/parser.yy" { dumpMonitors(*(yyvsp[0].stringptr), "trace"); delete (yyvsp[0].stringptr); } #line 2155 "parser.cc" break; case 81: /* monitors_to: MONITORS TO file_name ',' TYPE '(' NAME ')' */ #line 486 "../../../../jags-4-3_patched/src/terminal/parser.yy" { dumpMonitors(*(yyvsp[-5].stringptr), *(yyvsp[-1].stringptr)); delete (yyvsp[-5].stringptr); delete (yyvsp[-1].stringptr); } #line 2165 "parser.cc" break; case 82: /* file_name: NAME */ #line 498 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.stringptr) = (yyvsp[0].stringptr);} #line 2171 "parser.cc" break; case 83: /* file_name: STRING */ #line 499 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.stringptr) = (yyvsp[0].stringptr); } #line 2177 "parser.cc" break; case 84: /* coda: CODA var */ #line 502 "../../../../jags-4-3_patched/src/terminal/parser.yy" { doCoda ((yyvsp[0].ptree), "CODA"); delete (yyvsp[0].ptree); } #line 2185 "parser.cc" break; case 85: /* coda: CODA var ',' STEM '(' file_name ')' */ #line 505 "../../../../jags-4-3_patched/src/terminal/parser.yy" { doCoda ((yyvsp[-5].ptree), *(yyvsp[-1].stringptr)); delete (yyvsp[-5].ptree); delete (yyvsp[-1].stringptr); } #line 2193 "parser.cc" break; case 86: /* coda: CODA '*' */ #line 508 "../../../../jags-4-3_patched/src/terminal/parser.yy" { doAllCoda ("CODA"); } #line 2201 "parser.cc" break; case 87: /* coda: CODA '*' ',' STEM '(' file_name ')' */ #line 511 "../../../../jags-4-3_patched/src/terminal/parser.yy" { doAllCoda (*(yyvsp[-1].stringptr)); delete (yyvsp[-1].stringptr); } #line 2209 "parser.cc" break; case 88: /* load: LOAD file_name */ #line 516 "../../../../jags-4-3_patched/src/terminal/parser.yy" { loadModule(*(yyvsp[0].stringptr)); } #line 2215 "parser.cc" break; case 89: /* unload: UNLOAD NAME */ #line 519 "../../../../jags-4-3_patched/src/terminal/parser.yy" { unloadModule(*(yyvsp[0].stringptr)); } #line 2221 "parser.cc" break; case 90: /* samplers_to: SAMPLERS TO file_name */ #line 523 "../../../../jags-4-3_patched/src/terminal/parser.yy" { dumpSamplers(*(yyvsp[0].stringptr)); delete (yyvsp[0].stringptr); } #line 2230 "parser.cc" break; case 91: /* list_factories: LIST FACTORIES ',' TYPE '(' SAMPLER ')' */ #line 530 "../../../../jags-4-3_patched/src/terminal/parser.yy" { listFactories(jags::SAMPLER_FACTORY); } #line 2238 "parser.cc" break; case 92: /* list_factories: LIST FACTORIES ',' TYPE '(' RNGTOK ')' */ #line 535 "../../../../jags-4-3_patched/src/terminal/parser.yy" { listFactories(jags::RNG_FACTORY); } #line 2246 "parser.cc" break; case 93: /* list_factories: LIST FACTORIES ',' TYPE '(' MONITOR ')' */ #line 540 "../../../../jags-4-3_patched/src/terminal/parser.yy" { listFactories(jags::MONITOR_FACTORY); } #line 2254 "parser.cc" break; case 94: /* list_modules: LIST MODULES */ #line 546 "../../../../jags-4-3_patched/src/terminal/parser.yy" { listModules(); } #line 2262 "parser.cc" break; case 95: /* set_factory: SET FACTORY STRING NAME ',' TYPE '(' SAMPLER ')' */ #line 552 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setFactory(*(yyvsp[-6].stringptr), jags::SAMPLER_FACTORY, *(yyvsp[-5].stringptr)); delete (yyvsp[-6].stringptr); delete (yyvsp[-5].stringptr); } #line 2272 "parser.cc" break; case 96: /* set_factory: SET FACTORY NAME NAME ',' TYPE '(' RNGTOK ')' */ #line 559 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setFactory(*(yyvsp[-6].stringptr), jags::RNG_FACTORY, *(yyvsp[-5].stringptr)); delete (yyvsp[-6].stringptr); delete (yyvsp[-5].stringptr); } #line 2282 "parser.cc" break; case 97: /* set_factory: SET FACTORY NAME NAME ',' TYPE '(' MONITOR ')' */ #line 566 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setFactory(*(yyvsp[-6].stringptr), jags::MONITOR_FACTORY, *(yyvsp[-5].stringptr)); delete (yyvsp[-6].stringptr); delete (yyvsp[-5].stringptr); } #line 2292 "parser.cc" break; case 98: /* set_seed: SET SEED INT */ #line 574 "../../../../jags-4-3_patched/src/terminal/parser.yy" { setSeed((yyvsp[0].intval)); } #line 2300 "parser.cc" break; case 99: /* r_assignment_list: r_assignment */ #line 581 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.pvec) = new std::vector(1, (yyvsp[0].ptree)); } #line 2308 "parser.cc" break; case 100: /* r_assignment_list: r_assignment_list r_assignment */ #line 584 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.pvec) = (yyvsp[-1].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 2316 "parser.cc" break; case 101: /* r_assignment_list: r_assignment_list ';' r_assignment */ #line 587 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.pvec) = (yyvsp[-2].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree)); } #line 2324 "parser.cc" break; case 102: /* r_assignment: r_name ARROW r_structure */ #line 592 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = (yyvsp[0].ptree); setName((yyval.ptree), (yyvsp[-2].stringptr)); } #line 2332 "parser.cc" break; case 103: /* r_assignment: r_name ARROW r_collection */ #line 595 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = new jags::ParseTree(jags::P_ARRAY); setName((yyval.ptree), (yyvsp[-2].stringptr)); setParameters((yyval.ptree), (yyvsp[0].ptree)); } #line 2342 "parser.cc" break; case 104: /* r_assignment: r_name ARROW STRING */ #line 600 "../../../../jags-4-3_patched/src/terminal/parser.yy" { /* Allow this for setting the NAME of the random number generator */ (yyval.ptree) = new jags::ParseTree(jags::P_VAR); setName((yyval.ptree), (yyvsp[-2].stringptr)); jags::ParseTree *p = new jags::ParseTree(jags::P_VAR); setName(p, (yyvsp[0].stringptr)); setParameters((yyval.ptree), p); } #line 2353 "parser.cc" break; case 107: /* r_name: '`' NAME '`' */ #line 610 "../../../../jags-4-3_patched/src/terminal/parser.yy" { /* R >= 2.4.0 uses backticks for quoted names */ (yyval.stringptr) = (yyvsp[-1].stringptr); } #line 2362 "parser.cc" break; case 109: /* r_data: DOTDATA '=' r_collection */ #line 616 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = (yyvsp[0].ptree); } #line 2370 "parser.cc" break; case 110: /* r_structure: STRUCTURE '(' r_data ',' r_attribute_list ')' */ #line 620 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = new jags::ParseTree(jags::P_ARRAY); if ((yyvsp[-1].ptree)) setParameters((yyval.ptree), (yyvsp[-3].ptree), (yyvsp[-1].ptree)); else setParameters((yyval.ptree), (yyvsp[-3].ptree)); } #line 2382 "parser.cc" break; case 111: /* r_structure: STRUCTURE '(' r_data ')' */ #line 627 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = new jags::ParseTree(jags::P_ARRAY); setParameters((yyval.ptree), (yyvsp[-1].ptree)); } #line 2391 "parser.cc" break; case 113: /* r_attribute_list: r_generic_attribute */ #line 636 "../../../../jags-4-3_patched/src/terminal/parser.yy" {(yyval.ptree)=0;} #line 2397 "parser.cc" break; case 115: /* r_attribute_list: r_attribute_list ',' r_dim */ #line 638 "../../../../jags-4-3_patched/src/terminal/parser.yy" {(yyval.ptree)=(yyvsp[0].ptree);} #line 2403 "parser.cc" break; case 116: /* r_dim: DIM '=' r_collection */ #line 641 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = (yyvsp[0].ptree); } #line 2411 "parser.cc" break; case 117: /* r_dim: DIM '=' range_element */ #line 644 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = (yyvsp[0].ptree); } #line 2419 "parser.cc" break; case 120: /* r_integer_collection: ASINTEGER '(' r_value_collection ')' */ #line 653 "../../../../jags-4-3_patched/src/terminal/parser.yy" {(yyval.ptree) = (yyvsp[-1].ptree);} #line 2425 "parser.cc" break; case 121: /* r_value_collection: r_value */ #line 656 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = new jags::ParseTree(jags::P_VECTOR); setParameters((yyval.ptree), (yyvsp[0].ptree)); } #line 2434 "parser.cc" break; case 122: /* r_value_collection: 'c' '(' r_value_list ')' */ #line 660 "../../../../jags-4-3_patched/src/terminal/parser.yy" { (yyval.ptree) = new jags::ParseTree(jags::P_VECTOR); setParameters((yyval.ptree), (yyvsp[-1].pvec)); } #line 2443 "parser.cc" break; case 123: /* r_value_list: r_value */ #line 666 "../../../../jags-4-3_patched/src/terminal/parser.yy" {(yyval.pvec) = new std::vector(1, (yyvsp[0].ptree)); } #line 2449 "parser.cc" break; case 124: /* r_value_list: r_value_list ',' r_value */ #line 667 "../../../../jags-4-3_patched/src/terminal/parser.yy" {(yyval.pvec) = (yyvsp[-2].pvec); (yyval.pvec)->push_back((yyvsp[0].ptree));} #line 2455 "parser.cc" break; case 125: /* r_value: DOUBLE */ #line 670 "../../../../jags-4-3_patched/src/terminal/parser.yy" {(yyval.ptree) = new jags::ParseTree(jags::P_VALUE); (yyval.ptree)->setValue((yyvsp[0].val));} #line 2461 "parser.cc" break; case 126: /* r_value: NA */ #line 671 "../../../../jags-4-3_patched/src/terminal/parser.yy" {(yyval.ptree) = new jags::ParseTree(jags::P_VALUE); (yyval.ptree)->setValue(JAGS_NA);} #line 2467 "parser.cc" break; case 127: /* r_generic_attribute: NAME '=' r_generic_vector */ #line 677 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2473 "parser.cc" break; case 128: /* r_generic_list: r_generic_list_element */ #line 680 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2479 "parser.cc" break; case 129: /* r_generic_list: r_generic_list ',' r_generic_list_element */ #line 681 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2485 "parser.cc" break; case 130: /* r_generic_list_element: r_generic_vector */ #line 684 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2491 "parser.cc" break; case 131: /* r_generic_list_element: NAME '=' r_generic_vector */ #line 685 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2497 "parser.cc" break; case 132: /* r_generic_vector: r_numeric_vector */ #line 688 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2503 "parser.cc" break; case 133: /* r_generic_vector: ASINTEGER '(' r_numeric_vector ')' */ #line 689 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2509 "parser.cc" break; case 134: /* r_generic_vector: r_character_vector */ #line 690 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2515 "parser.cc" break; case 135: /* r_generic_vector: LIST '(' r_generic_list ')' */ #line 691 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2521 "parser.cc" break; case 136: /* r_generic_vector: STRUCTURE '(' r_generic_list ')' */ #line 692 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2527 "parser.cc" break; case 137: /* r_generic_vector: R_NULL */ #line 693 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2533 "parser.cc" break; case 138: /* r_numeric_vector: DOUBLE */ #line 696 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2539 "parser.cc" break; case 140: /* r_double_list: DOUBLE */ #line 700 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2545 "parser.cc" break; case 141: /* r_double_list: r_double_list ',' DOUBLE */ #line 701 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2551 "parser.cc" break; case 142: /* r_character_vector: STRING */ #line 704 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2557 "parser.cc" break; case 143: /* r_character_vector: 'c' '(' r_string_list ')' */ #line 705 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2563 "parser.cc" break; case 144: /* r_string_list: STRING */ #line 708 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2569 "parser.cc" break; case 145: /* r_string_list: r_string_list ',' STRING */ #line 709 "../../../../jags-4-3_patched/src/terminal/parser.yy" {;} #line 2575 "parser.cc" break; case 146: /* get_working_dir: PWD */ #line 715 "../../../../jags-4-3_patched/src/terminal/parser.yy" { std::string name; if (getWorkingDirectory(name)) { std::cout << name << std::endl; } else { std::cout << "ERROR: " << name << std::endl; } } #line 2589 "parser.cc" break; case 147: /* set_working_dir: CD file_name */ #line 726 "../../../../jags-4-3_patched/src/terminal/parser.yy" { if (chdir(((yyvsp[0].stringptr))->c_str()) == -1) { std::cout << "ERROR: Cannot change working directory" << std::endl; } delete (yyvsp[0].stringptr); } #line 2600 "parser.cc" break; case 148: /* read_dir: DIRECTORY */ #line 734 "../../../../jags-4-3_patched/src/terminal/parser.yy" { std::string name; if (!getWorkingDirectory(name)) { std::cerr << "ERROR: Unable to get working directory name\n" << name << std::endl; return 0; } DIR *dir; struct dirent *de; if ((dir = opendir(name.c_str())) != 0) { while ((de = readdir(dir)) != 0) { if (std::strcmp(de->d_name, ".") && std::strcmp(de->d_name, "..")) { std::cout << de->d_name << "\n"; } } closedir(dir); } else { std::cerr << "Unable to open working directory" << std::endl; } } #line 2627 "parser.cc" break; case 149: /* run_script: RUN file_name */ #line 757 "../../../../jags-4-3_patched/src/terminal/parser.yy" { if(open_command_buffer((yyvsp[0].stringptr))) { std::cout << "Running script file " << *(yyvsp[0].stringptr) << std::endl; } else { std::cerr << "Unable to open script file " << *(yyvsp[0].stringptr) << std::endl; } delete (yyvsp[0].stringptr); } #line 2641 "parser.cc" break; #line 2645 "parser.cc" default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; *++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. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == ZZEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; yyerror (YY_("syntax error")); } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= ZZEOF) { /* Return failure if at end of input. */ if (yychar == ZZEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = ZZEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYSYMBOL_YYerror; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", YY_ACCESSING_SYMBOL (yystate), yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturnlab; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturnlab; /*-----------------------------------------------------------. | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | `-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; goto yyreturnlab; /*----------------------------------------------------------. | yyreturnlab -- parsing is finished, clean up and return. | `----------------------------------------------------------*/ yyreturnlab: if (yychar != ZZEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif return yyresult; } #line 768 "../../../../jags-4-3_patched/src/terminal/parser.yy" int zzerror (const char *s) { return_to_main_buffer(); std::cerr << s << std::endl; return 0; } static jags::Range getRange(jags::ParseTree const *var) { /* Blank arguments, e.g. foo[] or bar[,1] are not allowed. */ unsigned int size = var->parameters().size(); std::vector ind_lower(size), ind_upper(size); for (unsigned int i = 0; i < size; ++i) { jags::ParseTree const *range_element = var->parameters()[i]; switch(range_element->parameters().size()) { case 1: ind_lower[i] = (int) (range_element->parameters()[0]->value() + 1.0E-6); ind_upper[i] = ind_lower[i]; break; case 2: ind_lower[i] = (int) (range_element->parameters()[0]->value() + 1.0E-6); ind_upper[i] = (int) (range_element->parameters()[1]->value() + 1.0E-6); break; default: //Error! FIXME break; } } return jags::SimpleRange(ind_lower, ind_upper); } void setMonitor(jags::ParseTree const *var, int thin, std::string const &type) { std::string const &name = var->name(); if (var->parameters().empty()) { /* Requesting the whole node */ console->setMonitor(name, jags::Range(), thin, type); } else { /* Requesting subset of a multivariate node */ console->setMonitor(name, getRange(var), thin, type); } } void clearMonitor(jags::ParseTree const *var, std::string const &type) { std::string const &name = var->name(); if (var->parameters().empty()) { /* Requesting the whole node */ console->clearMonitor(name, jags::Range(), type); } else { /* Requesting subset of a multivariate node */ console->clearMonitor(name, getRange(var), type); } } void doAllCoda (std::string const &stem) { console->coda(stem); } void doCoda (jags::ParseTree const *var, std::string const &stem) { //FIXME: Allow list of several nodes std::vector > dmp; if (var->parameters().empty()) { /* Requesting the whole node */ dmp.push_back(std::pair(var->name(), jags::Range())); } else { /* Requesting subset of a multivariate node */ dmp.push_back(std::pair(var->name(), getRange(var))); } console->coda(dmp, stem); } /* Helper function for doDump that handles all the special cases (missing values etc) when writing a double value */ static void writeValue(double x, std::ostream &out, bool isdiscrete) { using namespace std; if (x == JAGS_NA) { out << "NA"; } else if (jags_isnan(x)) { out << "NaN"; } else if (!jags_finite(x)) { if (x > 0) out << "Inf"; else out << "-Inf"; } else if (isdiscrete) { out << static_cast(x) << "L"; } else { out << x; } } void doDump(std::string const &file, jags::DumpType type, unsigned int chain) { std::map data_table; std::string rng_name; if (!console->dumpState(data_table, rng_name, type, chain)) { return; } /* Open output file */ std::ofstream out(file.c_str()); if (!out) { std::cerr << "Failed to open file " << file << std::endl; return; } if (rng_name.size() != 0) { out << "`.RNG.name` <- \"" << rng_name << "\"\n"; } for (std::map::const_iterator p = data_table.begin(); p != data_table.end(); ++p) { std::string const &name = p->first; jags::SArray const &sarray = p->second; std::vector const &value = sarray.value(); long length = sarray.length(); out << "`" << name << "` <- " << std::endl; std::vector const &dim = sarray.dim(false); bool discrete = sarray.isDiscreteValued(); if (dim.size() == 1) { // Vector if (dim[0] == 1) { // Scalar writeValue(value[0], out, discrete); } else { // Vector of length > 1 out << "c("; for (int i = 0; i < length; ++i) { if (i > 0) { out << ","; } writeValue(value[i], out, discrete); } out << ")"; } } else { // Array out << "structure(c("; for (int i = 0; i < length; ++i) { if (i > 0) { out << ","; } writeValue(value[i], out, discrete); } out << "), .Dim = c("; for (unsigned int j = 0; j < dim.size(); ++j) { if (j > 0) { out << ","; } out << dim[j] << "L"; } out << "))"; } out << "\n"; } out.close(); } void dumpMonitors(std::string const &file, std::string const &type) { std::map data_table; if (!console->dumpMonitors(data_table, type, false)) { return; } /* Open output file */ std::ofstream out(file.c_str()); if (!out) { std::cerr << "Failed to open file " << file << std::endl; return; } out << "`" << type << "` <-\nstructure(list("; std::map::const_iterator p; for (p = data_table.begin(); p != data_table.end(); ++p) { std::string const &name = p->first; jags::SArray const &sarray = p->second; std::vector const &value = sarray.value(); long length = sarray.length(); if (p != data_table.begin()) { out << ", \n"; } out << "\"" << name << "\" = "; std::vector const &dim = sarray.dim(false); bool discrete = sarray.isDiscreteValued(); bool named = !sarray.dimNames().empty(); if (dim.size() == 1 && !named) { // Vector if (dim[0] == 1) { // Scalar writeValue(value[0], out, discrete); } else { // Vector of length > 1 out << "c("; for (int i = 0; i < length; ++i) { if (i > 0) { out << ","; } writeValue(value[i], out, discrete); } out << ")"; } } else { // Array out << "structure(c("; for (int i = 0; i < length; ++i) { if (i > 0) { out << ","; } writeValue(value[i], out, discrete); } out << "), .Dim = "; if (named) { out << "structure("; } out << "c("; for (unsigned int j = 0; j < dim.size(); ++j) { if (j > 0) { out << ","; } out << dim[j] << "L"; } out << ")"; if (named) { std::vector const &dnames = sarray.dimNames(); out << ", .Names = c("; for (unsigned int k = 0; k < dnames.size(); ++k) { if (k > 0) { out << ","; } out << "\"" << dnames[k] << "\""; } out << "))"; } out << ")"; } } out << "), \n.Names = c("; for (p = data_table.begin(); p != data_table.end(); ++p) { if (p != data_table.begin()) { out << ", "; } std::string const &name = p->first; out << "\"" << name << "\""; } out << "))"; out.close(); } void setParameters(jags::ParseTree *p, std::vector *parameters) { /* The parser dynamically allocates vectors of (pointers to) parameters. These vectors must be deleted when we are done with them. */ p->setParameters(*parameters); delete parameters; } void setParameters(jags::ParseTree *p, jags::ParseTree *param1) { /* Wrapper function that creates a vector containing param1 to be passed to jags::ParseTree::setParameters. */ std::vector parameters(1, param1); p->setParameters(parameters); } void setParameters(jags::ParseTree *p, jags::ParseTree *param1, jags::ParseTree *param2) { /* Wrapper function that creates a vector containing param1 and param2, to be passed to jags::ParseTree::setParameters */ std::vector parameters; parameters.push_back(param1); parameters.push_back(param2); p->setParameters(parameters); } void setName(jags::ParseTree *p, std::string *name) { p->setName(*name); delete name; } static void errordump() { if (console->model()) { std::ostringstream fname; for (unsigned int i = 1; i <= console->nchain(); ++i) { fname << "jags.dump" << i << ".R"; std::cout << "Dumping chain " << i << " at iteration " << console->iter() << " to file " << fname.str() << std::endl; doDump(fname.str(), jags::DUMP_ALL, i); fname.str(""); } // Moved clearModel from Console.cc CATCH_ERRORS to here // to allow doDump to work as described in the manual: console->clearModel(); } if (!interactive) exit(1); } static void updatestar(long niter, long refresh, int width) { std::cout << "Updating " << niter << std::endl; bool adapt = console->isAdapting(); if (adapt && console->iter() > 0) { //Turn off iteration immediately if we have some burn-in if (console->adaptOff()) { adapt = false; } else { std::cout << std::endl; errordump(); return; } } if (refresh == 0) { if( !Jtry_dump(console->update(niter/2)) ) return; bool status = true; if (adapt) { if (!console->checkAdaptation(status)) { errordump(); return; } if (!console->adaptOff()) { errordump(); return; } } if( !Jtry_dump(console->update(niter - niter/2)) ) return; if (!status) { std::cerr << "WARNING: Adaptation incomplete\n"; } return; } if (width > niter / refresh + 1) width = niter / refresh + 1; for (int i = 0; i < width - 1; ++i) { std::cout << "-"; } std::cout << "| " << std::min(width * refresh, niter) << std::endl << std::flush; int col = 0; bool status = true; for (long n = niter; n > 0; n -= refresh) { if (adapt && n <= niter/2) { // Turn off adaptive mode half way through burnin if (!console->checkAdaptation(status)) { std::cout << std::endl; errordump(); return; } if (console->adaptOff()) { adapt = false; } else { std::cout << std::endl; errordump(); return; } } long nupdate = std::min(n, refresh); if(Jtry_dump(console->update(nupdate))) { std::cout << "*" << std::flush; } else { std::cout << std::endl; return; } col++; if (col == width || n <= nupdate) { int percent = 100 - (n-nupdate) * 100/niter; std::cout << " " << percent << "%" << std::endl; if (n > nupdate) { col = 0; } } } if (!status) { std::cerr << "WARNING: Adaptation incomplete\n"; } } static void autoadaptstar(long maxiter, long refresh, int width) { if (!console->isAdapting()) { std::cout << "Adaptation skipped: model is not in adaptive mode.\n"; return; } std::cout << "Autoadapting up to " << maxiter << " iterations" << std::endl; if (width > maxiter / refresh + 1) width = maxiter / refresh + 1; long i = 0; bool status = false; if ( refresh == 0 ) { for (i = 0; i < maxiter; i++) { if (!console->checkAdaptation(status)) { errordump(); return; } if(status) break; if( !Jtry_dump(console->update(1)) ) { std::cout << std::endl; return; } } } else { for (int j = 0; j < width - 1; ++j) { std::cout << "-"; } std::cout << "| " << std::min(width * refresh, maxiter) << std::endl << std::flush; int col = 0; for (long n = maxiter; n > 0; n -= refresh) { long nupdate = std::min(n, refresh); for (long j = 0; j < nupdate; j++) { if (!console->checkAdaptation(status)) { errordump(); return; } if(status) break; if( !Jtry_dump(console->update(1)) ) { std::cout << std::endl; return; } i++; } if(status){ std::cout << std::endl; break; } std::cout << "+" << std::flush; col++; if (col == width || n <= nupdate) { int percent = 100 - (n-nupdate) * 100/maxiter; std::cout << " " << percent << "%" << std::endl; if (n > nupdate) { col = 0; } } } } if (!console->checkAdaptation(status)) { errordump(); return; } if (!status) { std::cerr << "Adaptation incomplete\n"; } else { std::cout << "Adaptation completed in " << i << " iterations" << std::endl; if (!console->adaptOff()) { std::cout << std::endl; errordump(); return; } } return; } static void adaptstar(long niter, long refresh, int width, bool force) { if (!console->isAdapting()) { if( force ) { // Missing endl is deliberate - updatestar will write to the same line: std::cout << "Model not in adaptive mode: "; updatestar(niter, refresh, width); } else { std::cerr << "Adaptation skipped: model is not in adaptive mode.\n"; } return; } std::cout << "Adapting " << niter << std::endl; bool status = true; if (refresh == 0) { if( !Jtry_dump(console->update(niter)) ) return; if (!console->checkAdaptation(status)) { errordump(); return; } if (!status) { std::cerr << "Adaptation incomplete\n"; return; } else { std::cerr << "Adaptation successful\n"; return; } } if (width > niter / refresh + 1) width = niter / refresh + 1; for (int i = 0; i < width - 1; ++i) { std::cout << "-"; } std::cout << "| " << std::min(width * refresh, niter) << std::endl << std::flush; int col = 0; for (long n = niter; n > 0; n -= refresh) { long nupdate = std::min(n, refresh); if(Jtry_dump(console->update(nupdate))) std::cout << "+" << std::flush; else { std::cout << std::endl; return; } col++; if (col == width || n <= nupdate) { int percent = 100 - (n-nupdate) * 100/niter; std::cout << " " << percent << "%" << std::endl; if (n > nupdate) { col = 0; } } } if (!console->checkAdaptation(status)) { std::cout << std::endl; errordump(); return; } if (!status) { std::cerr << "Adaptation incomplete.\n"; } else { std::cerr << "Adaptation successful\n"; } } static void loadModule(std::string const &name) { std::cout << "Loading module: " << name; lt_dlhandle mod = lt_dlopenext(name.c_str()); if (mod == NULL) { std::cout << ": " << lt_dlerror() << std::endl; } else { std::cout << ": ok" << std::endl; _dyn_lib.push_front(mod); jags::Console::loadModule(name); } } static void unloadModule(std::string const &name) { std::cout << "Unloading module: " << name << std::endl; jags::Console::unloadModule(name); } int main (int argc, char **argv) { extern std::FILE *zzin; std::FILE *cmdfile = 0; if (argc > 2) { std::cerr << "Too many arguments" << std::endl; } else if (argc == 2) { interactive = false; cmdfile = std::fopen(ExpandFileName(argv[1]).c_str(),"r"); if (cmdfile) { zzin = cmdfile; } else { std::cerr << "Unable to open command file " << argv[1] << std::endl; return 1; } } else { interactive = true; } #ifndef _WIN32 /* - Allows emulation of dynamic loading on platforms that do not support it by preloading modules. - Causes build failures on mingw-w64 (as at 21 April 2010) so not used on Windows platform. */ LTDL_SET_PRELOADED_SYMBOLS(); #endif if(lt_dlinit()) { std::cerr << lt_dlerror() << std::endl; return 1; } /* pt2Func load_base = (pt2Func)(lt_dlsym(base, "load")); if (load_base == NULL) { std::cout << lt_dlerror() << std::endl; return 1; } else{ (*load_base)(); } */ time_t t; time(&t); std::cout << "Welcome to " << PACKAGE_STRING << " on " << ctime(&t); std::cout << "JAGS is free software and comes with ABSOLUTELY NO WARRANTY" << std::endl; loadModule("basemod"); loadModule("bugs"); console = new jags::Console(std::cout, std::cerr); zzparse(); zzlex_destroy(); if (argc==2) { std::fclose(cmdfile); } //Unload modules std::vector mods = jags::Console::listModules(); for (unsigned int i = 0; i < mods.size(); ++i) { jags::Console::unloadModule(mods[i]); } delete console; //Release dynamic libraries. for (unsigned int i = 0; i < _dyn_lib.size(); ++i) { lt_dlclose(_dyn_lib[i]); } lt_dlexit(); } static bool getWorkingDirectory(std::string &name) { char buf[FILENAME_MAX]; #ifdef Win32 if (getCurrentDirectory(FILENAME_MAX, buf)) { name = buf; return true; } else { name = "Error in getCurrentDirectory"; return false; } #else if (getcwd(buf, FILENAME_MAX)) { name = buf; return true; } else { switch(errno) { case EACCES: name = "Access denied"; break; case ENOENT: name = "Not found"; break; case ERANGE: name = "Directory name too long"; break; default: name = "Error in getcwd"; break; } return false; } #endif } static void dumpSamplers(std::string const &file) { std::ofstream out(file.c_str()); if (!out) { std::cerr << "Failed to open file " << file << std::endl; return; } std::vector > sampler_list; console->dumpSamplers(sampler_list); for (unsigned int i = 0; i < sampler_list.size(); ++i) { for (unsigned int j = 1; j < sampler_list[i].size(); ++j) { out << i + 1 << "\t" << sampler_list[i][0] << "\t" //First element is sampler name << sampler_list[i][j] << "\n"; //Rest are node names } } out.close(); } static void delete_pvec(std::vector *pv) { for (unsigned int i = 0; i < pv->size(); ++i) { delete (*pv)[i]; } delete pv; } static void print_unused_variables(std::map const &table, bool data) { std::vector supplied_vars; for (std::map::const_iterator p = table.begin(); p != table.end(); ++p) { supplied_vars.push_back(p->first); } std::vector unused_vars; std::vector model_vars = console->variableNames(); if (!data) { // Initial values table may legitimately contain these names model_vars.push_back(".RNG.name"); model_vars.push_back(".RNG.seed"); model_vars.push_back(".RNG.state"); } // Make sure both vectors are sorted to avoid false positive WARNINGs: std::sort(model_vars.begin(), model_vars.end()); std::sort(supplied_vars.begin(), supplied_vars.end()); /* Test code to check vectors: if(data){ std::cout << "Variables in model:\n"; std::copy(model_vars.begin(), model_vars.end(), std::ostream_iterator(std::cout, ", ")); std::cout << "\n"; std::cout << "Supplied vars:\n"; std::copy(supplied_vars.begin(), supplied_vars.end(), std::ostream_iterator(std::cout, ", ")); std::cout << "\n"; } */ std::set_difference(supplied_vars.begin(), supplied_vars.end(), model_vars.begin(), model_vars.end(), std::inserter(unused_vars, unused_vars.begin())); if (!unused_vars.empty()) { std::cerr << "\nWARNING: Unused variable(s) in "; if (data) { std::cerr << "data table:\n"; } else { std::cerr << "initial value table:\n"; } std::copy(unused_vars.begin(), unused_vars.end(), std::ostream_iterator(std::cerr, "\n")); std::cerr << "\n"; } } std::string ExpandFileName(char const *s) { if(s[0] != '~') return s; std::string name = s; if(name.size() > 1 && s[1] != '/') return s; char const *p = getenv("HOME"); if (p) { std::string UserHOME = p; if (!UserHOME.empty()) { if (name.size() == 1) return UserHOME; else return UserHOME + name.substr(1); } } return name; } void doSystem(std::string const *command) { std::system(command->c_str()); } void listModules(){ std::vector mods = jags::Console::listModules(); std::cout << "Modules:" << std::endl; for (unsigned int i = 0; i < mods.size(); ++i) { std::cout << " " << mods[i] << std::endl; } } void listFactories(jags::FactoryType type) { std::vector > faclist = jags::Console::listFactories(type); std::vector >::const_iterator p; unsigned int max_strlen = 0; for (p = faclist.begin(); p != faclist.end(); ++p) { if (p->first.length() > max_strlen) max_strlen = p->first.length(); } if (max_strlen < 4) max_strlen = 4; //Header std::cout << "Name"; for (int i = max_strlen - 4; i >=0; --i) { std::cout << " "; } std::cout << "Status\n"; //Body for (p = faclist.begin(); p != faclist.end(); ++p) { std::cout << p->first << " "; for (int i = max_strlen - p->first.length(); i >= 0; --i) { std::cout << " "; } if (p->second) { std::cout << "on"; } else { std::cout << "off"; } std::cout << "\n"; } } void setFactory(std::string const &name, jags::FactoryType type, std::string const &status) { if (status == "on") { jags::Console::setFactoryActive(name, type, true); } else if (status == "off") { jags::Console::setFactoryActive(name, type, false); } else { std::cout << "status should be \"on\" or \"off\""; } } void setSeed(unsigned int seed) { if (seed == 0) { std::cout << "seed must be non-zero"; } else { jags::Console::setRNGSeed(seed); } } bool Jtry(bool ok) { if (!ok && !interactive) exit(1); else return ok; } bool Jtry_dump(bool ok) { // Allows doDump to work as described in the manual: if (!ok) { errordump(); console->clearModel(); if (!interactive) exit(1); } return ok; } JAGS-4.3.2/src/terminal/parser.hh0000644000175000017500000001512514400711032013400 00000000000000/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 3 of the License, 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, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ #ifndef YY_ZZ_PARSER_HH_INCLUDED # define YY_ZZ_PARSER_HH_INCLUDED /* Debug traces. */ #ifndef ZZDEBUG # if defined YYDEBUG #if YYDEBUG # define ZZDEBUG 1 # else # define ZZDEBUG 0 # endif # else /* ! defined YYDEBUG */ # define ZZDEBUG 0 # endif /* ! defined YYDEBUG */ #endif /* ! defined ZZDEBUG */ #if ZZDEBUG extern int zzdebug; #endif /* Token kinds. */ #ifndef ZZTOKENTYPE # define ZZTOKENTYPE enum zztokentype { ZZEMPTY = -2, ZZEOF = 0, /* "end of file" */ ZZerror = 256, /* error */ ZZUNDEF = 257, /* "invalid token" */ INT = 258, /* INT */ DOUBLE = 259, /* DOUBLE */ NAME = 260, /* NAME */ STRING = 261, /* STRING */ SYSCMD = 262, /* SYSCMD */ ENDCMD = 263, /* ENDCMD */ MODEL = 264, /* MODEL */ DATA = 265, /* DATA */ IN = 266, /* IN */ TO = 267, /* TO */ INITS = 268, /* INITS */ PARAMETERS = 269, /* PARAMETERS */ COMPILE = 270, /* COMPILE */ INITIALIZE = 271, /* INITIALIZE */ ADAPT = 272, /* ADAPT */ AUTOADAPT = 273, /* AUTOADAPT */ FORCEADAPT = 274, /* FORCEADAPT */ UPDATE = 275, /* UPDATE */ BY = 276, /* BY */ MONITORS = 277, /* MONITORS */ MONITOR = 278, /* MONITOR */ TYPE = 279, /* TYPE */ SET = 280, /* SET */ CLEAR = 281, /* CLEAR */ THIN = 282, /* THIN */ CODA = 283, /* CODA */ STEM = 284, /* STEM */ EXIT = 285, /* EXIT */ NCHAINS = 286, /* NCHAINS */ CHAIN = 287, /* CHAIN */ LOAD = 288, /* LOAD */ UNLOAD = 289, /* UNLOAD */ SAMPLER = 290, /* SAMPLER */ SAMPLERS = 291, /* SAMPLERS */ RNGTOK = 292, /* RNGTOK */ FACTORY = 293, /* FACTORY */ FACTORIES = 294, /* FACTORIES */ MODULES = 295, /* MODULES */ SEED = 296, /* SEED */ LIST = 297, /* LIST */ STRUCTURE = 298, /* STRUCTURE */ DIM = 299, /* DIM */ NA = 300, /* NA */ R_NULL = 301, /* R_NULL */ DIMNAMES = 302, /* DIMNAMES */ ITER = 303, /* ITER */ ARROW = 304, /* ARROW */ ENDDATA = 305, /* ENDDATA */ ASINTEGER = 306, /* ASINTEGER */ DOTDATA = 307, /* DOTDATA */ DIRECTORY = 308, /* DIRECTORY */ CD = 309, /* CD */ PWD = 310, /* PWD */ RUN = 311, /* RUN */ ENDSCRIPT = 312 /* ENDSCRIPT */ }; typedef enum zztokentype zztoken_kind_t; #endif /* Token kinds. */ #define ZZEMPTY -2 #define ZZEOF 0 #define ZZerror 256 #define ZZUNDEF 257 #define INT 258 #define DOUBLE 259 #define NAME 260 #define STRING 261 #define SYSCMD 262 #define ENDCMD 263 #define MODEL 264 #define DATA 265 #define IN 266 #define TO 267 #define INITS 268 #define PARAMETERS 269 #define COMPILE 270 #define INITIALIZE 271 #define ADAPT 272 #define AUTOADAPT 273 #define FORCEADAPT 274 #define UPDATE 275 #define BY 276 #define MONITORS 277 #define MONITOR 278 #define TYPE 279 #define SET 280 #define CLEAR 281 #define THIN 282 #define CODA 283 #define STEM 284 #define EXIT 285 #define NCHAINS 286 #define CHAIN 287 #define LOAD 288 #define UNLOAD 289 #define SAMPLER 290 #define SAMPLERS 291 #define RNGTOK 292 #define FACTORY 293 #define FACTORIES 294 #define MODULES 295 #define SEED 296 #define LIST 297 #define STRUCTURE 298 #define DIM 299 #define NA 300 #define R_NULL 301 #define DIMNAMES 302 #define ITER 303 #define ARROW 304 #define ENDDATA 305 #define ASINTEGER 306 #define DOTDATA 307 #define DIRECTORY 308 #define CD 309 #define PWD 310 #define RUN 311 #define ENDSCRIPT 312 /* Value type. */ #if ! defined ZZSTYPE && ! defined ZZSTYPE_IS_DECLARED union ZZSTYPE { #line 99 "../../../../jags-4-3_patched/src/terminal/parser.yy" int intval; double val; std::string *stringptr; jags::ParseTree *ptree; std::vector *pvec; std::vector *vec; std::vector *ivec; #line 199 "parser.hh" }; typedef union ZZSTYPE ZZSTYPE; # define ZZSTYPE_IS_TRIVIAL 1 # define ZZSTYPE_IS_DECLARED 1 #endif extern ZZSTYPE zzlval; int zzparse (void); #endif /* !YY_ZZ_PARSER_HH_INCLUDED */ JAGS-4.3.2/src/terminal/scanner.cc0000664000175000017500000024601114224054466013544 00000000000000 #line 2 "scanner.cc" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define yy_create_buffer zz_create_buffer #define yy_delete_buffer zz_delete_buffer #define yy_scan_buffer zz_scan_buffer #define yy_scan_string zz_scan_string #define yy_scan_bytes zz_scan_bytes #define yy_init_buffer zz_init_buffer #define yy_flush_buffer zz_flush_buffer #define yy_load_buffer_state zz_load_buffer_state #define yy_switch_to_buffer zz_switch_to_buffer #define yypush_buffer_state zzpush_buffer_state #define yypop_buffer_state zzpop_buffer_state #define yyensure_buffer_stack zzensure_buffer_stack #define yy_flex_debug zz_flex_debug #define yyin zzin #define yyleng zzleng #define yylex zzlex #define yylineno zzlineno #define yyout zzout #define yyrestart zzrestart #define yytext zztext #define yywrap zzwrap #define yyalloc zzalloc #define yyrealloc zzrealloc #define yyfree zzfree #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_SUBMINOR_VERSION 4 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif #ifdef yy_create_buffer #define zz_create_buffer_ALREADY_DEFINED #else #define yy_create_buffer zz_create_buffer #endif #ifdef yy_delete_buffer #define zz_delete_buffer_ALREADY_DEFINED #else #define yy_delete_buffer zz_delete_buffer #endif #ifdef yy_scan_buffer #define zz_scan_buffer_ALREADY_DEFINED #else #define yy_scan_buffer zz_scan_buffer #endif #ifdef yy_scan_string #define zz_scan_string_ALREADY_DEFINED #else #define yy_scan_string zz_scan_string #endif #ifdef yy_scan_bytes #define zz_scan_bytes_ALREADY_DEFINED #else #define yy_scan_bytes zz_scan_bytes #endif #ifdef yy_init_buffer #define zz_init_buffer_ALREADY_DEFINED #else #define yy_init_buffer zz_init_buffer #endif #ifdef yy_flush_buffer #define zz_flush_buffer_ALREADY_DEFINED #else #define yy_flush_buffer zz_flush_buffer #endif #ifdef yy_load_buffer_state #define zz_load_buffer_state_ALREADY_DEFINED #else #define yy_load_buffer_state zz_load_buffer_state #endif #ifdef yy_switch_to_buffer #define zz_switch_to_buffer_ALREADY_DEFINED #else #define yy_switch_to_buffer zz_switch_to_buffer #endif #ifdef yypush_buffer_state #define zzpush_buffer_state_ALREADY_DEFINED #else #define yypush_buffer_state zzpush_buffer_state #endif #ifdef yypop_buffer_state #define zzpop_buffer_state_ALREADY_DEFINED #else #define yypop_buffer_state zzpop_buffer_state #endif #ifdef yyensure_buffer_stack #define zzensure_buffer_stack_ALREADY_DEFINED #else #define yyensure_buffer_stack zzensure_buffer_stack #endif #ifdef yylex #define zzlex_ALREADY_DEFINED #else #define yylex zzlex #endif #ifdef yyrestart #define zzrestart_ALREADY_DEFINED #else #define yyrestart zzrestart #endif #ifdef yylex_init #define zzlex_init_ALREADY_DEFINED #else #define yylex_init zzlex_init #endif #ifdef yylex_init_extra #define zzlex_init_extra_ALREADY_DEFINED #else #define yylex_init_extra zzlex_init_extra #endif #ifdef yylex_destroy #define zzlex_destroy_ALREADY_DEFINED #else #define yylex_destroy zzlex_destroy #endif #ifdef yyget_debug #define zzget_debug_ALREADY_DEFINED #else #define yyget_debug zzget_debug #endif #ifdef yyset_debug #define zzset_debug_ALREADY_DEFINED #else #define yyset_debug zzset_debug #endif #ifdef yyget_extra #define zzget_extra_ALREADY_DEFINED #else #define yyget_extra zzget_extra #endif #ifdef yyset_extra #define zzset_extra_ALREADY_DEFINED #else #define yyset_extra zzset_extra #endif #ifdef yyget_in #define zzget_in_ALREADY_DEFINED #else #define yyget_in zzget_in #endif #ifdef yyset_in #define zzset_in_ALREADY_DEFINED #else #define yyset_in zzset_in #endif #ifdef yyget_out #define zzget_out_ALREADY_DEFINED #else #define yyget_out zzget_out #endif #ifdef yyset_out #define zzset_out_ALREADY_DEFINED #else #define yyset_out zzset_out #endif #ifdef yyget_leng #define zzget_leng_ALREADY_DEFINED #else #define yyget_leng zzget_leng #endif #ifdef yyget_text #define zzget_text_ALREADY_DEFINED #else #define yyget_text zzget_text #endif #ifdef yyget_lineno #define zzget_lineno_ALREADY_DEFINED #else #define yyget_lineno zzget_lineno #endif #ifdef yyset_lineno #define zzset_lineno_ALREADY_DEFINED #else #define yyset_lineno zzset_lineno #endif #ifdef yywrap #define zzwrap_ALREADY_DEFINED #else #define yywrap zzwrap #endif #ifdef yyalloc #define zzalloc_ALREADY_DEFINED #else #define yyalloc zzalloc #endif #ifdef yyrealloc #define zzrealloc_ALREADY_DEFINED #else #define yyrealloc zzrealloc #endif #ifdef yyfree #define zzfree_ALREADY_DEFINED #else #define yyfree zzfree #endif #ifdef yytext #define zztext_ALREADY_DEFINED #else #define yytext zztext #endif #ifdef yyleng #define zzleng_ALREADY_DEFINED #else #define yyleng zzleng #endif #ifdef yyin #define zzin_ALREADY_DEFINED #else #define yyin zzin #endif #ifdef yyout #define zzout_ALREADY_DEFINED #else #define yyout zzout #endif #ifdef yy_flex_debug #define zz_flex_debug_ALREADY_DEFINED #else #define yy_flex_debug zz_flex_debug #endif #ifdef yylineno #define zzlineno_ALREADY_DEFINED #else #define yylineno zzlineno #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #ifndef SIZE_MAX #define SIZE_MAX (~(size_t)0) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ /* begin standard C++ headers. */ /* TODO: this is always defined, so inline it */ #define yyconst const #if defined(__GNUC__) && __GNUC__ >= 3 #define yynoreturn __attribute__((__noreturn__)) #else #define yynoreturn #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an * integer in range [0..255] for use as an array index. */ #define YY_SC_TO_UI(c) ((YY_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. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif 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 #define YY_LESS_LINENO(n) #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE 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. */ int 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; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* 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 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ /* 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". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* 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 = NULL; static int yy_init = 0; /* 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 ( FILE *input_file ); void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); void yy_delete_buffer ( YY_BUFFER_STATE b ); void yy_flush_buffer ( YY_BUFFER_STATE b ); void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); void yypop_buffer_state ( void ); static void yyensure_buffer_stack ( void ); static void yy_load_buffer_state ( void ); static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); void *yyalloc ( yy_size_t ); void *yyrealloc ( void *, yy_size_t ); void yyfree ( void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer( yyin, YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ typedef flex_uint8_t YY_CHAR; FILE *yyin = NULL, *yyout = NULL; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #ifdef yytext_ptr #undef yytext_ptr #endif #define yytext_ptr yytext static yy_state_type yy_get_previous_state ( void ); static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); static int yy_get_next_buffer ( void ); static void yynoreturn yy_fatal_error ( const 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 81 #define YY_END_OF_BUFFER 82 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static const flex_int16_t yy_accept[287] = { 0, 0, 0, 0, 0, 51, 51, 0, 0, 82, 81, 54, 57, 81, 81, 81, 42, 43, 46, 39, 78, 77, 78, 68, 47, 48, 81, 44, 77, 40, 78, 41, 49, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 56, 78, 77, 66, 77, 77, 77, 77, 77, 51, 52, 59, 60, 54, 0, 79, 0, 55, 0, 80, 78, 78, 68, 77, 77, 65, 50, 63, 78, 45, 77, 77, 15, 35, 77, 77, 77, 77, 77, 77, 77, 77, 3, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 4, 77, 77, 77, 56, 66, 77, 67, 71, 77, 77, 0, 75, 77, 77, 51, 52, 52, 53, 59, 65, 77, 63, 78, 0, 78, 77, 77, 77, 77, 77, 77, 77, 34, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 36, 24, 37, 77, 77, 19, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 78, 0, 77, 0, 78, 61, 61, 77, 77, 77, 77, 29, 77, 2, 33, 77, 77, 77, 38, 31, 77, 77, 77, 77, 77, 77, 28, 30, 77, 21, 18, 77, 77, 77, 69, 72, 77, 77, 77, 78, 64, 64, 62, 62, 12, 77, 10, 20, 77, 77, 77, 77, 5, 1, 77, 77, 77, 77, 77, 77, 77, 77, 70, 77, 0, 74, 77, 64, 77, 77, 77, 77, 77, 77, 77, 77, 77, 77, 58, 32, 11, 77, 77, 77, 7, 77, 25, 77, 77, 27, 16, 8, 77, 22, 77, 77, 77, 77, 77, 77, 17, 77, 23, 77, 77, 14, 26, 77, 77, 77, 77, 77, 13, 9, 6, 77, 0, 73, 0, 76, 0 } ; static const YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 5, 6, 1, 1, 1, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 18, 19, 20, 1, 1, 1, 21, 22, 22, 23, 24, 22, 22, 22, 22, 22, 22, 25, 22, 26, 22, 22, 22, 22, 22, 22, 27, 22, 22, 22, 22, 22, 28, 29, 30, 1, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 22, 22, 41, 42, 43, 44, 45, 22, 46, 47, 48, 49, 22, 50, 51, 52, 53, 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 const YY_CHAR yy_meta[54] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 4, 4, 4, 4, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 1, 4, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 } ; static const flex_int16_t yy_base[298] = { 0, 0, 0, 51, 96, 325, 323, 326, 322, 321, 1235, 53, 1235, 310, 306, 301, 1235, 1235, 1235, 1235, 42, 46, 296, 52, 1235, 1235, 289, 1235, 57, 1235, 0, 1235, 1235, 65, 74, 131, 89, 104, 110, 72, 117, 97, 130, 141, 149, 167, 142, 177, 296, 55, 194, 210, 212, 201, 89, 212, 75, 0, 64, 0, 1235, 80, 286, 1235, 278, 1235, 254, 1235, 0, 228, 241, 0, 222, 143, 1235, 213, 82, 1235, 227, 228, 230, 235, 236, 237, 251, 262, 265, 264, 271, 286, 288, 294, 295, 309, 310, 320, 321, 332, 339, 346, 343, 357, 360, 362, 365, 379, 381, 391, 240, 420, 401, 0, 406, 414, 415, 123, 1235, 423, 428, 0, 86, 124, 1235, 0, 441, 95, 445, 137, 215, 214, 446, 444, 460, 454, 457, 471, 460, 478, 479, 481, 486, 489, 492, 504, 510, 515, 517, 518, 520, 525, 528, 539, 544, 551, 558, 546, 569, 571, 569, 579, 582, 584, 597, 603, 592, 605, 176, 198, 197, 189, 188, 184, 181, 610, 616, 624, 627, 629, 634, 648, 651, 650, 656, 665, 666, 674, 680, 688, 698, 699, 701, 701, 713, 720, 724, 726, 731, 733, 734, 739, 741, 748, 756, 793, 771, 180, 162, 147, 137, 124, 758, 774, 787, 795, 803, 811, 785, 817, 822, 824, 827, 827, 842, 846, 848, 855, 860, 857, 870, 876, 160, 1235, 878, 119, 879, 881, 900, 900, 910, 918, 925, 933, 931, 946, 949, 952, 954, 955, 963, 973, 978, 981, 984, 987, 1002, 992, 1005, 995, 1013, 1019, 1024, 1027, 1032, 1038, 1046, 1051, 1045, 1060, 1069, 1075, 1077, 1078, 1083, 1084, 1086, 1092, 1101, 1140, 1109, 1114, 1119, 1150, 193, 1235, 230, 1235, 1235, 1202, 1206, 1210, 1214, 1218, 120, 59, 1222, 1226, 1230, 56 } ; static const flex_int16_t yy_def[298] = { 0, 286, 1, 1, 1, 287, 287, 288, 288, 286, 286, 286, 286, 289, 290, 291, 286, 286, 286, 286, 292, 293, 292, 292, 286, 286, 286, 286, 293, 286, 292, 286, 286, 293, 293, 293, 293, 293, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 286, 292, 293, 292, 293, 35, 35, 35, 45, 294, 295, 296, 286, 286, 289, 286, 290, 286, 291, 286, 292, 292, 292, 297, 45, 297, 286, 292, 292, 286, 45, 45, 45, 45, 45, 45, 35, 45, 45, 45, 45, 45, 45, 45, 45, 35, 35, 35, 35, 35, 35, 35, 45, 45, 45, 45, 45, 45, 35, 35, 286, 292, 45, 292, 45, 45, 45, 286, 286, 45, 45, 294, 295, 295, 286, 296, 292, 297, 292, 292, 286, 292, 45, 35, 35, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 35, 45, 45, 45, 45, 45, 45, 45, 45, 35, 35, 35, 45, 45, 45, 35, 45, 45, 45, 45, 45, 45, 45, 292, 286, 297, 286, 292, 286, 292, 45, 45, 45, 45, 45, 45, 45, 45, 35, 45, 45, 45, 45, 35, 35, 45, 45, 45, 35, 35, 35, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 292, 286, 297, 286, 292, 45, 35, 35, 35, 35, 35, 45, 45, 45, 45, 45, 35, 35, 45, 45, 45, 35, 45, 45, 45, 286, 286, 45, 292, 45, 45, 45, 35, 35, 35, 35, 35, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 286, 286, 286, 286, 0, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286 } ; static const flex_int16_t yy_nxt[1289] = { 0, 10, 11, 12, 11, 13, 14, 15, 16, 17, 18, 10, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 28, 28, 28, 28, 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 28, 28, 39, 40, 41, 42, 28, 43, 44, 45, 46, 47, 28, 28, 28, 28, 48, 61, 69, 61, 70, 71, 71, 71, 73, 72, 49, 50, 75, 51, 70, 69, 71, 109, 71, 71, 121, 71, 76, 52, 71, 122, 71, 71, 61, 53, 61, 54, 71, 71, 76, 71, 71, 115, 55, 128, 71, 129, 286, 116, 56, 48, 78, 286, 71, 71, 71, 71, 167, 72, 168, 49, 50, 72, 51, 72, 79, 90, 72, 71, 71, 71, 71, 85, 52, 118, 68, 115, 80, 72, 53, 86, 54, 116, 72, 71, 121, 233, 72, 55, 72, 122, 209, 93, 88, 56, 71, 72, 71, 71, 169, 72, 170, 72, 72, 208, 89, 87, 72, 91, 72, 73, 71, 92, 230, 207, 94, 72, 81, 125, 231, 72, 82, 72, 83, 95, 72, 84, 72, 72, 206, 125, 72, 103, 72, 72, 72, 72, 104, 167, 72, 205, 72, 96, 97, 72, 105, 282, 233, 172, 98, 99, 171, 283, 72, 100, 209, 208, 72, 71, 72, 71, 73, 72, 72, 207, 206, 101, 72, 110, 72, 102, 106, 72, 107, 71, 75, 71, 109, 71, 71, 126, 172, 171, 284, 112, 76, 111, 78, 127, 285, 113, 72, 71, 72, 108, 124, 72, 76, 72, 114, 127, 79, 72, 117, 72, 72, 75, 92, 70, 72, 130, 72, 67, 72, 72, 72, 76, 72, 72, 132, 72, 72, 72, 72, 133, 72, 72, 131, 76, 72, 72, 72, 65, 72, 72, 72, 72, 134, 72, 72, 72, 72, 63, 72, 135, 72, 72, 72, 72, 72, 108, 72, 72, 77, 72, 138, 139, 74, 72, 67, 65, 136, 137, 72, 72, 72, 63, 72, 72, 72, 72, 72, 286, 72, 72, 72, 60, 72, 143, 141, 60, 72, 72, 140, 58, 72, 58, 72, 286, 72, 286, 72, 142, 72, 72, 144, 72, 72, 72, 72, 146, 72, 72, 145, 72, 72, 72, 148, 286, 286, 72, 72, 72, 72, 286, 72, 72, 147, 72, 286, 286, 149, 72, 286, 72, 72, 72, 72, 286, 72, 152, 72, 72, 150, 72, 286, 72, 286, 72, 151, 72, 72, 153, 72, 154, 72, 72, 72, 72, 72, 286, 286, 72, 156, 286, 286, 72, 286, 155, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 286, 286, 72, 286, 158, 286, 157, 72, 159, 72, 286, 163, 72, 72, 72, 160, 75, 72, 109, 72, 72, 162, 286, 161, 72, 286, 76, 111, 72, 72, 286, 72, 72, 72, 286, 72, 72, 72, 76, 124, 72, 72, 72, 126, 72, 72, 154, 166, 72, 72, 286, 127, 164, 72, 286, 286, 165, 72, 72, 166, 72, 72, 72, 127, 72, 72, 286, 72, 176, 286, 174, 177, 72, 173, 179, 72, 72, 72, 72, 286, 72, 72, 175, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 178, 72, 72, 72, 182, 72, 72, 72, 72, 72, 72, 180, 72, 181, 72, 72, 286, 72, 72, 286, 286, 183, 72, 185, 184, 72, 72, 72, 72, 72, 186, 72, 72, 189, 190, 72, 72, 72, 72, 188, 72, 72, 72, 187, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 286, 72, 72, 72, 72, 192, 72, 286, 72, 72, 191, 72, 72, 72, 72, 286, 72, 72, 72, 72, 194, 72, 286, 72, 72, 72, 193, 72, 72, 72, 72, 72, 286, 196, 72, 286, 72, 198, 195, 197, 72, 72, 72, 72, 72, 72, 72, 72, 201, 72, 72, 286, 200, 72, 72, 72, 199, 72, 72, 72, 72, 72, 72, 72, 286, 72, 203, 72, 72, 202, 72, 72, 72, 286, 211, 72, 286, 72, 72, 72, 204, 72, 72, 72, 210, 72, 72, 72, 72, 72, 72, 72, 72, 212, 72, 286, 72, 286, 72, 213, 214, 72, 72, 72, 286, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 286, 72, 216, 286, 215, 286, 72, 72, 72, 72, 72, 72, 72, 72, 72, 217, 72, 286, 72, 286, 72, 286, 218, 72, 72, 72, 286, 72, 72, 72, 286, 219, 72, 72, 72, 286, 72, 72, 286, 220, 72, 72, 72, 72, 72, 72, 72, 72, 286, 222, 72, 286, 224, 223, 286, 72, 221, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 225, 72, 72, 72, 72, 226, 72, 72, 286, 72, 72, 228, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 227, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 230, 72, 286, 286, 229, 72, 231, 286, 72, 72, 232, 72, 72, 72, 234, 72, 286, 286, 72, 286, 72, 286, 237, 72, 72, 286, 72, 72, 72, 286, 72, 72, 286, 72, 72, 72, 72, 286, 72, 72, 286, 72, 72, 72, 72, 286, 72, 72, 286, 235, 72, 72, 72, 286, 238, 72, 286, 72, 72, 72, 72, 72, 236, 72, 72, 72, 286, 72, 239, 286, 72, 72, 286, 72, 72, 72, 240, 72, 286, 72, 72, 72, 72, 72, 72, 72, 72, 242, 72, 243, 241, 72, 72, 286, 72, 286, 72, 286, 246, 72, 245, 72, 244, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 249, 72, 72, 72, 72, 286, 250, 72, 286, 286, 286, 72, 286, 247, 286, 248, 72, 72, 72, 72, 72, 72, 72, 286, 253, 72, 286, 286, 72, 251, 72, 286, 286, 72, 72, 286, 286, 72, 72, 286, 254, 252, 72, 72, 286, 286, 72, 286, 72, 72, 286, 72, 72, 72, 255, 72, 72, 72, 72, 286, 256, 72, 286, 72, 286, 286, 72, 72, 258, 257, 72, 72, 72, 72, 72, 72, 72, 72, 286, 72, 260, 259, 286, 72, 72, 286, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 286, 72, 72, 72, 261, 72, 72, 72, 72, 263, 262, 264, 72, 72, 286, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, 265, 72, 72, 72, 286, 72, 286, 267, 72, 72, 266, 72, 72, 72, 72, 72, 286, 72, 72, 72, 269, 72, 72, 72, 268, 72, 72, 286, 72, 72, 72, 270, 72, 72, 72, 72, 72, 72, 271, 72, 72, 72, 72, 272, 72, 72, 286, 286, 72, 273, 72, 72, 72, 286, 72, 72, 72, 72, 286, 72, 286, 72, 274, 72, 275, 72, 72, 72, 72, 276, 72, 277, 72, 72, 72, 72, 72, 72, 72, 72, 279, 72, 72, 72, 72, 72, 72, 72, 72, 72, 278, 72, 72, 72, 72, 72, 72, 280, 72, 72, 282, 286, 72, 72, 72, 281, 283, 72, 72, 72, 284, 72, 286, 72, 286, 72, 285, 286, 286, 72, 72, 286, 286, 286, 72, 72, 286, 286, 286, 72, 72, 286, 286, 286, 72, 286, 286, 286, 286, 286, 72, 286, 286, 286, 72, 286, 72, 286, 286, 286, 72, 286, 286, 286, 286, 286, 72, 286, 286, 286, 72, 57, 57, 57, 57, 59, 59, 59, 59, 62, 62, 62, 62, 64, 64, 64, 64, 66, 66, 66, 66, 119, 119, 286, 119, 120, 120, 120, 120, 123, 286, 123, 123, 9, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286 } ; static const flex_int16_t yy_chk[1289] = { 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, 1, 1, 1, 3, 11, 20, 11, 20, 21, 297, 21, 21, 293, 3, 3, 23, 3, 23, 49, 28, 49, 28, 28, 58, 21, 23, 3, 33, 58, 33, 33, 61, 3, 61, 3, 28, 34, 23, 34, 34, 54, 3, 76, 33, 76, 120, 54, 3, 4, 33, 120, 36, 34, 36, 36, 125, 39, 125, 4, 4, 39, 4, 39, 33, 39, 39, 37, 36, 37, 37, 36, 4, 56, 292, 115, 34, 56, 4, 36, 4, 115, 41, 37, 121, 233, 41, 4, 41, 121, 209, 41, 38, 4, 35, 38, 35, 35, 127, 38, 127, 38, 40, 208, 38, 37, 40, 40, 40, 73, 35, 40, 230, 207, 42, 42, 35, 73, 230, 42, 35, 42, 35, 43, 42, 35, 43, 46, 206, 73, 43, 46, 43, 46, 44, 43, 46, 166, 44, 166, 44, 43, 44, 44, 46, 282, 205, 172, 44, 45, 171, 282, 45, 45, 170, 169, 45, 50, 45, 50, 50, 45, 47, 168, 167, 45, 47, 50, 47, 45, 47, 47, 47, 50, 51, 52, 51, 52, 52, 75, 129, 128, 284, 52, 51, 51, 53, 75, 284, 52, 53, 52, 53, 108, 69, 53, 51, 55, 53, 75, 53, 55, 55, 55, 72, 70, 55, 70, 72, 78, 79, 66, 80, 78, 79, 70, 80, 81, 82, 83, 72, 81, 82, 83, 72, 78, 79, 70, 80, 78, 79, 64, 80, 81, 82, 83, 84, 81, 82, 83, 84, 62, 84, 84, 85, 84, 87, 86, 85, 48, 87, 86, 26, 88, 87, 88, 22, 88, 15, 14, 85, 86, 87, 86, 85, 13, 87, 86, 89, 88, 90, 9, 89, 88, 90, 8, 91, 92, 90, 7, 91, 92, 89, 6, 89, 5, 90, 0, 89, 0, 90, 91, 91, 92, 93, 94, 91, 92, 93, 94, 93, 94, 93, 93, 94, 95, 96, 0, 0, 95, 96, 95, 96, 0, 95, 96, 95, 97, 0, 0, 97, 97, 0, 97, 98, 100, 97, 0, 98, 100, 98, 99, 98, 98, 0, 99, 0, 99, 99, 101, 99, 100, 102, 101, 103, 100, 102, 104, 103, 0, 0, 104, 103, 0, 0, 101, 0, 102, 102, 101, 103, 105, 102, 104, 103, 105, 106, 104, 0, 0, 106, 0, 106, 0, 105, 106, 107, 105, 0, 114, 107, 105, 107, 110, 109, 107, 109, 110, 112, 113, 0, 110, 112, 0, 109, 109, 113, 114, 0, 110, 113, 114, 0, 110, 112, 117, 109, 124, 112, 117, 118, 126, 113, 114, 118, 124, 113, 114, 0, 126, 117, 117, 0, 0, 118, 117, 118, 124, 130, 131, 118, 126, 130, 131, 0, 131, 133, 0, 131, 134, 133, 130, 136, 134, 130, 132, 136, 0, 130, 132, 132, 132, 133, 135, 132, 134, 133, 135, 136, 134, 137, 138, 136, 139, 137, 138, 135, 139, 140, 135, 140, 141, 140, 135, 142, 141, 137, 138, 142, 139, 137, 138, 0, 139, 140, 0, 0, 141, 140, 143, 142, 141, 144, 143, 142, 143, 144, 145, 143, 146, 147, 145, 148, 146, 147, 145, 148, 149, 144, 144, 150, 149, 144, 145, 150, 146, 147, 145, 148, 146, 147, 151, 148, 149, 0, 151, 150, 149, 155, 152, 150, 0, 155, 152, 151, 152, 153, 151, 152, 0, 153, 151, 153, 154, 155, 153, 0, 154, 155, 154, 154, 156, 154, 157, 158, 156, 0, 157, 158, 0, 158, 159, 156, 158, 160, 159, 161, 156, 160, 157, 161, 156, 162, 157, 164, 0, 161, 159, 164, 162, 160, 159, 161, 162, 160, 163, 161, 165, 0, 163, 164, 165, 173, 163, 164, 162, 173, 0, 174, 162, 0, 163, 174, 165, 165, 163, 175, 165, 173, 176, 175, 177, 173, 176, 174, 177, 178, 175, 174, 0, 178, 0, 175, 176, 178, 176, 175, 177, 0, 176, 179, 177, 178, 180, 179, 181, 178, 180, 182, 181, 0, 181, 182, 0, 181, 0, 179, 183, 184, 180, 179, 183, 184, 180, 182, 183, 185, 0, 182, 0, 185, 0, 183, 183, 184, 186, 0, 183, 184, 186, 0, 186, 185, 187, 186, 0, 185, 187, 0, 187, 188, 189, 187, 190, 188, 189, 191, 190, 0, 189, 191, 0, 191, 190, 0, 191, 188, 189, 192, 190, 188, 189, 192, 190, 192, 193, 194, 192, 195, 193, 194, 193, 195, 196, 193, 197, 198, 196, 0, 197, 198, 199, 194, 200, 195, 199, 194, 200, 195, 196, 201, 197, 198, 196, 201, 197, 198, 199, 202, 200, 210, 199, 202, 200, 210, 203, 201, 0, 0, 202, 201, 203, 0, 204, 202, 204, 210, 204, 202, 211, 210, 0, 0, 211, 0, 211, 0, 216, 211, 204, 0, 216, 212, 204, 0, 203, 212, 0, 212, 203, 213, 212, 0, 216, 213, 0, 213, 216, 214, 213, 0, 203, 214, 0, 214, 203, 215, 214, 0, 217, 215, 0, 215, 217, 218, 215, 219, 215, 218, 220, 219, 0, 221, 220, 0, 217, 221, 0, 221, 217, 218, 221, 219, 0, 218, 220, 219, 222, 223, 220, 224, 222, 223, 222, 224, 222, 222, 225, 0, 227, 0, 225, 0, 227, 223, 226, 224, 225, 223, 226, 224, 226, 228, 225, 226, 227, 228, 225, 229, 227, 232, 234, 229, 235, 232, 234, 0, 235, 228, 0, 0, 0, 228, 0, 229, 0, 232, 234, 229, 235, 232, 234, 236, 235, 0, 237, 236, 0, 0, 237, 236, 237, 0, 0, 237, 238, 0, 0, 236, 238, 0, 238, 236, 239, 238, 0, 0, 239, 0, 239, 240, 0, 239, 242, 240, 239, 240, 242, 241, 240, 0, 240, 241, 0, 241, 0, 0, 241, 243, 242, 241, 244, 243, 242, 245, 244, 246, 247, 245, 0, 246, 247, 243, 0, 243, 248, 0, 244, 243, 248, 245, 244, 246, 247, 245, 249, 246, 247, 0, 249, 250, 248, 248, 251, 250, 248, 252, 251, 249, 253, 252, 249, 0, 253, 255, 249, 250, 257, 255, 251, 250, 257, 252, 251, 254, 253, 252, 256, 254, 253, 255, 256, 254, 257, 255, 258, 0, 257, 0, 258, 254, 259, 256, 256, 254, 259, 260, 256, 0, 261, 260, 258, 260, 261, 262, 258, 259, 259, 262, 0, 263, 259, 260, 261, 263, 261, 260, 266, 264, 261, 262, 266, 264, 265, 262, 263, 263, 265, 0, 0, 263, 264, 267, 266, 264, 0, 267, 266, 264, 265, 0, 268, 0, 265, 265, 268, 267, 269, 267, 270, 271, 269, 267, 270, 271, 272, 273, 268, 274, 272, 273, 268, 274, 269, 275, 270, 271, 269, 275, 270, 271, 272, 273, 276, 274, 272, 273, 276, 274, 275, 275, 278, 277, 0, 275, 278, 279, 276, 277, 276, 279, 280, 281, 276, 0, 280, 0, 278, 281, 0, 0, 278, 279, 0, 0, 0, 279, 280, 0, 0, 0, 280, 277, 0, 0, 0, 277, 0, 0, 0, 0, 0, 281, 0, 0, 0, 281, 0, 277, 0, 0, 0, 277, 0, 0, 0, 0, 0, 281, 0, 0, 0, 281, 287, 287, 287, 287, 288, 288, 288, 288, 289, 289, 289, 289, 290, 290, 290, 290, 291, 291, 291, 291, 294, 294, 0, 294, 295, 295, 295, 295, 296, 0, 296, 296, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286, 286 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* 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 "../../../../jags-4-3_patched/src/terminal/scanner.ll" /* -*-C++-*- */ #line 3 "../../../../jags-4-3_patched/src/terminal/scanner.ll" #include #include #include #include #include "parser.hh" std::vector file_stack; int command_buffer_count = 0; int buffer_count = 0; void return_to_main_buffer(); void close_buffer(); std::string ExpandFileName(char const *name); #line 1092 "scanner.cc" #line 1094 "scanner.cc" #define INITIAL 0 #define RDATA 1 #define COMMENT 2 #define SYSTEM 3 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals ( void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy ( void ); int yyget_debug ( void ); void yyset_debug ( int debug_flag ); YY_EXTRA_TYPE yyget_extra ( void ); void yyset_extra ( YY_EXTRA_TYPE user_defined ); FILE *yyget_in ( void ); void yyset_in ( FILE * _in_str ); FILE *yyget_out ( void ); void yyset_out ( FILE * _out_str ); int yyget_leng ( void ); char *yyget_text ( void ); int yyget_lineno ( void ); void yyset_lineno ( int _line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap ( void ); #else extern int yywrap ( void ); #endif #endif #ifndef YY_NO_UNPUT static void yyunput ( int c, char *buf_ptr ); #endif #ifndef yytext_ptr static void yy_flex_strncpy ( char *, const char *, int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen ( const char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput ( void ); #else static int input ( void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #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 do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) #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_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ int 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 \ { \ errno=0; \ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #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 /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* 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 /*LINTED*/break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { yy_state_type yy_current_state; char *yy_cp, *yy_bp; int yy_act; if ( !(yy_init) ) { (yy_init) = 1; #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 ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_load_buffer_state( ); } { #line 26 "../../../../jags-4-3_patched/src/terminal/scanner.ll" #line 1317 "scanner.cc" while ( /*CONSTCOND*/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 { 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 >= 287 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 1235 ); 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 28 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=MODEL; return MODEL; YY_BREAK case 2: YY_RULE_SETUP #line 29 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=DATA; return DATA; YY_BREAK case 3: YY_RULE_SETUP #line 30 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=IN; return IN; YY_BREAK case 4: YY_RULE_SETUP #line 31 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=TO; return TO; YY_BREAK case 5: YY_RULE_SETUP #line 32 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=INITS; return INITS; YY_BREAK case 6: YY_RULE_SETUP #line 33 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=PARAMETERS; return PARAMETERS; YY_BREAK case 7: YY_RULE_SETUP #line 35 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=COMPILE; return COMPILE; YY_BREAK case 8: YY_RULE_SETUP #line 36 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=NCHAINS; return NCHAINS; YY_BREAK case 9: YY_RULE_SETUP #line 37 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=INITIALIZE; return INITIALIZE; YY_BREAK case 10: YY_RULE_SETUP #line 38 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=CHAIN; return CHAIN; YY_BREAK case 11: YY_RULE_SETUP #line 40 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=UPDATE; return UPDATE; YY_BREAK case 12: YY_RULE_SETUP #line 41 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=ADAPT; return ADAPT; YY_BREAK case 13: YY_RULE_SETUP #line 42 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=FORCEADAPT; return FORCEADAPT; YY_BREAK case 14: YY_RULE_SETUP #line 43 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=AUTOADAPT; return AUTOADAPT; YY_BREAK case 15: YY_RULE_SETUP #line 44 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=BY; return BY; YY_BREAK case 16: YY_RULE_SETUP #line 46 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=MONITOR; return MONITOR; YY_BREAK case 17: YY_RULE_SETUP #line 47 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=MONITORS; return MONITORS; YY_BREAK case 18: YY_RULE_SETUP #line 48 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=TYPE; return TYPE; YY_BREAK case 19: YY_RULE_SETUP #line 49 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=SET; return SET; YY_BREAK case 20: YY_RULE_SETUP #line 50 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=CLEAR; return CLEAR; YY_BREAK case 21: YY_RULE_SETUP #line 51 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=THIN; return THIN; YY_BREAK case 22: YY_RULE_SETUP #line 52 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=SAMPLER; return SAMPLER; YY_BREAK case 23: YY_RULE_SETUP #line 53 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=SAMPLERS; return SAMPLERS; YY_BREAK case 24: YY_RULE_SETUP #line 54 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=RNGTOK; return RNGTOK; YY_BREAK case 25: YY_RULE_SETUP #line 55 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=FACTORY; return FACTORY; YY_BREAK case 26: YY_RULE_SETUP #line 56 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=FACTORIES; return FACTORIES; YY_BREAK case 27: YY_RULE_SETUP #line 57 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=MODULES; return MODULES; YY_BREAK case 28: YY_RULE_SETUP #line 58 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=SEED; return SEED; YY_BREAK case 29: YY_RULE_SETUP #line 60 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=CODA; return CODA; YY_BREAK case 30: YY_RULE_SETUP #line 61 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=STEM; return STEM; YY_BREAK case 31: YY_RULE_SETUP #line 63 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=LOAD; return LOAD; YY_BREAK case 32: YY_RULE_SETUP #line 64 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=UNLOAD; return UNLOAD; YY_BREAK case 33: YY_RULE_SETUP #line 65 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=EXIT; return EXIT; YY_BREAK case 34: YY_RULE_SETUP #line 67 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=DIRECTORY; return DIRECTORY; YY_BREAK case 35: YY_RULE_SETUP #line 68 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=CD; return CD; YY_BREAK case 36: YY_RULE_SETUP #line 69 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=PWD; return PWD; YY_BREAK case 37: YY_RULE_SETUP #line 70 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=RUN; return RUN; YY_BREAK case 38: YY_RULE_SETUP #line 72 "../../../../jags-4-3_patched/src/terminal/scanner.ll" zzlval.intval=LIST; return LIST; YY_BREAK case 39: YY_RULE_SETUP #line 74 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return ','; YY_BREAK case 40: YY_RULE_SETUP #line 75 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return '['; YY_BREAK case 41: YY_RULE_SETUP #line 76 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return ']'; YY_BREAK case 42: YY_RULE_SETUP #line 77 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return '('; YY_BREAK case 43: YY_RULE_SETUP #line 78 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return ')'; YY_BREAK case 44: YY_RULE_SETUP #line 79 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return '='; YY_BREAK case 45: YY_RULE_SETUP #line 80 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return ARROW; YY_BREAK case 46: YY_RULE_SETUP #line 81 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return '*'; YY_BREAK case 47: YY_RULE_SETUP #line 82 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return ':'; YY_BREAK case 48: YY_RULE_SETUP #line 83 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return ';'; YY_BREAK case 49: YY_RULE_SETUP #line 84 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return '`'; YY_BREAK case 50: YY_RULE_SETUP #line 86 "../../../../jags-4-3_patched/src/terminal/scanner.ll" BEGIN(COMMENT); YY_BREAK case 51: /* rule 51 can match eol */ YY_RULE_SETUP #line 87 "../../../../jags-4-3_patched/src/terminal/scanner.ll" /* Eat up anything that's not a '*' */ YY_BREAK case 52: /* rule 52 can match eol */ YY_RULE_SETUP #line 88 "../../../../jags-4-3_patched/src/terminal/scanner.ll" /* Eat up '*'s not followed by a '/' */ YY_BREAK case 53: YY_RULE_SETUP #line 89 "../../../../jags-4-3_patched/src/terminal/scanner.ll" BEGIN(INITIAL); YY_BREAK case 54: YY_RULE_SETUP #line 91 "../../../../jags-4-3_patched/src/terminal/scanner.ll" /* Eat whitespace */ YY_BREAK case 55: /* rule 55 can match eol */ YY_RULE_SETUP #line 92 "../../../../jags-4-3_patched/src/terminal/scanner.ll" /* Eat single-line comments */ YY_BREAK case 56: /* rule 56 can match eol */ YY_RULE_SETUP #line 93 "../../../../jags-4-3_patched/src/terminal/scanner.ll" /* Eat newlines */ YY_BREAK case 57: /* rule 57 can match eol */ YY_RULE_SETUP #line 94 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return ENDCMD; YY_BREAK case 58: YY_RULE_SETUP #line 96 "../../../../jags-4-3_patched/src/terminal/scanner.ll" BEGIN(SYSTEM); YY_BREAK case 59: YY_RULE_SETUP #line 97 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.stringptr = new std::string(zztext); return SYSCMD; } YY_BREAK case 60: /* rule 60 can match eol */ YY_RULE_SETUP #line 101 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { BEGIN(INITIAL); return ENDCMD; } YY_BREAK case 61: YY_RULE_SETUP #line 105 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.val = atof(zztext); return DOUBLE; } YY_BREAK case 62: YY_RULE_SETUP #line 108 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.val = atof(zztext); return DOUBLE; } YY_BREAK case 63: YY_RULE_SETUP #line 111 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.val = atof(zztext); return DOUBLE; } YY_BREAK case 64: YY_RULE_SETUP #line 114 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.val = atof(zztext); return DOUBLE; } YY_BREAK case 65: YY_RULE_SETUP #line 117 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.val = atof(zztext); return DOUBLE; } YY_BREAK case 66: YY_RULE_SETUP #line 120 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.val = atof(zztext); return DOUBLE; } YY_BREAK case 67: YY_RULE_SETUP #line 123 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.val = atof(zztext); return DOUBLE; } YY_BREAK case 68: YY_RULE_SETUP #line 126 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.intval = atoi(zztext); return INT; } YY_BREAK case 69: YY_RULE_SETUP #line 130 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return DIM; YY_BREAK case 70: YY_RULE_SETUP #line 131 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return DOTDATA; YY_BREAK case 71: YY_RULE_SETUP #line 132 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return NA; YY_BREAK case 72: YY_RULE_SETUP #line 133 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return R_NULL; YY_BREAK case 73: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 9; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 134 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return STRUCTURE; YY_BREAK case 74: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 4; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 135 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return LIST; YY_BREAK case 75: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 136 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return 'c'; YY_BREAK case 76: *yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ (yy_c_buf_p) = yy_cp = yy_bp + 10; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 137 "../../../../jags-4-3_patched/src/terminal/scanner.ll" return ASINTEGER; YY_BREAK case 77: YY_RULE_SETUP #line 139 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.stringptr = new std::string(zztext); return NAME; } YY_BREAK case 78: YY_RULE_SETUP #line 144 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { // More general than NAME which is limited to syntactically valid BUGS names zzlval.stringptr = new std::string(zztext); return STRING; } YY_BREAK case 79: /* rule 79 can match eol */ YY_RULE_SETUP #line 150 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.stringptr = new std::string(zztext); // Remove enclosing quotes zzlval.stringptr->erase(zzlval.stringptr->size() - 1, 1); zzlval.stringptr->erase(0, 1); return STRING; } YY_BREAK case 80: /* rule 80 can match eol */ YY_RULE_SETUP #line 158 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { zzlval.stringptr = new std::string(zztext); zzlval.stringptr->erase(zzlval.stringptr->size() - 1, 1); zzlval.stringptr->erase(0,1); return STRING; } YY_BREAK case YY_STATE_EOF(INITIAL): #line 165 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { if (command_buffer_count) { close_buffer(); --command_buffer_count; } else { yyterminate(); } return ENDSCRIPT; } YY_BREAK case YY_STATE_EOF(RDATA): #line 175 "../../../../jags-4-3_patched/src/terminal/scanner.ll" { close_buffer(); BEGIN(INITIAL); return ENDDATA; } YY_BREAK case 81: YY_RULE_SETUP #line 180 "../../../../jags-4-3_patched/src/terminal/scanner.ll" ECHO; YY_BREAK #line 1859 "scanner.cc" case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(SYSTEM): yyterminate(); 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_LVALUE->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_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->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_LVALUE->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_LVALUE->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 user's declarations */ } /* 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 (void) { char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; char *source = (yytext_ptr); int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->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_LVALUE->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_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; 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. */ yyrealloc( (void *) b->yy_ch_buf, (yy_size_t) (b->yy_buf_size + 2) ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = NULL; 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_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->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_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); /* "- 2" to take care of EOB's */ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->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 (void) { yy_state_type yy_current_state; char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { 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 >= 287 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + 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 ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { int yy_is_jam; char *yy_cp = (yy_c_buf_p); 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 >= 287 ) yy_c = yy_meta[yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; yy_is_jam = (yy_current_state == 286); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_UNPUT static void yyunput (int c, char * yy_bp ) { char *yy_cp; yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ *yy_cp = (yy_hold_char); if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ int number_to_move = (yy_n_chars) + 2; char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size; if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->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_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #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_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (int) ((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 ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return 0; 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; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer( yyin, YY_BUF_SIZE ); } yy_init_buffer( YY_CURRENT_BUFFER, input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); 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_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = 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; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc( 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 *) yyalloc( (yy_size_t) (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; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree( (void *) b->yy_ch_buf ); yyfree( (void *) b ); } /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer( b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { 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( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { 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 NULL; b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = (int) (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 = NULL; 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; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (const char * yystr ) { return yy_scan_bytes( yystr, (int) strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = (yy_size_t) (_yybytes_len + 2); buf = (char *) yyalloc( n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_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; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yynoreturn yy_fatal_error (const char* msg ) { 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. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param _line_number line number * */ void yyset_lineno (int _line_number ) { yylineno = _line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param _in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * _in_str ) { yyin = _in_str ; } void yyset_out (FILE * _out_str ) { yyout = _out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int _bdebug ) { yy_flex_debug = _bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = NULL; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = NULL; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = NULL; yyout = NULL; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer( YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, const char * s2, int n ) { int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (const char * s ) { int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return malloc(size); } void *yyrealloc (void * ptr, yy_size_t size ) { /* 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 realloc(ptr, size); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 180 "../../../../jags-4-3_patched/src/terminal/scanner.ll" int zzwrap() { return 1; } void push_file(FILE *file) { file_stack.push_back(file); } void pop_file() { if (file_stack.empty()) return; fclose(file_stack.back()); file_stack.pop_back(); } bool open_data_buffer(std::string const *name) { FILE *file = fopen(ExpandFileName(name->c_str()).c_str(),"r"); if (file) { zzpush_buffer_state(zz_create_buffer(file, YY_BUF_SIZE)); push_file(file); ++buffer_count; BEGIN(RDATA); return true; } else { return false; } } void close_buffer() { zzpop_buffer_state(); pop_file(); --buffer_count; } bool open_command_buffer(std::string const *name) { FILE *file = fopen(name->c_str(),"r"); if (file) { file_stack.push_back(file); zzpush_buffer_state(zz_create_buffer(file, YY_BUF_SIZE )); ++command_buffer_count; ++buffer_count; return true; } else { return false; } } void return_to_main_buffer() { /* Clear all buffers in the stack and return to the first */ while(buffer_count) { zzpop_buffer_state(); --buffer_count; } command_buffer_count = 0; BEGIN(INITIAL); } JAGS-4.3.2/src/terminal/parser.yy0000664000175000017500000011344214400667267013471 00000000000000/* -*-C++-*- */ %{ #include #ifdef Win32 #include /* For getCurrentDirectory */ #include /* For chdir */ #else #include /* For getcwd, chdir */ #endif //#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //Required for warning about masked distributions after module loading #include #include #include #include "ReadData.h" typedef void(*pt2Func)(); int zzerror(const char *); int zzlex(); int zzlex_destroy(); #define YYERROR_VERBOSE 0 static jags::Console *console; bool interactive; extern int command_buffer_count; void setName(jags::ParseTree *p, std::string *name); std::map _data_table; std::deque _dyn_lib; bool open_data_buffer(std::string const *name); bool open_command_buffer(std::string const *name); void return_to_main_buffer(); void setMonitor(jags::ParseTree const *var, int thin, std::string const &type); void clearMonitor(jags::ParseTree const *var, std::string const &type); void doCoda (jags::ParseTree const *var, std::string const &stem); void doAllCoda (std::string const &stem); void doDump (std::string const &file, jags::DumpType type, unsigned int chain); void dumpMonitors(std::string const &file, std::string const &type); void doSystem(std::string const *command); std::string ExpandFileName(char const *s); static bool getWorkingDirectory(std::string &name); static void errordump(); static void updatestar(long niter, long refresh, int width); // Run adaptation phase until adapted, regardless of iterations: static void autoadaptstar(long maxiter, long refresh, int width); static void adaptstar(long niter, long refresh, int width, bool force); static void setParameters(jags::ParseTree *p, jags::ParseTree *param1); static void setParameters(jags::ParseTree *p, std::vector *parameters); static void setParameters(jags::ParseTree *p, jags::ParseTree *param1, jags::ParseTree *param2); static void loadModule(std::string const &name); static void unloadModule(std::string const &name); static void dumpSamplers(std::string const &file); static void delete_pvec(std::vector *); static void print_unused_variables(std::map const &table, bool data); static void listFactories(jags::FactoryType type); static void listModules(); static void setFactory(std::string const &name, jags::FactoryType type, std::string const &status); static void setSeed(unsigned int seed); static bool Jtry(bool ok); // Needed for update (and adapt) functions to dump variable states: static bool Jtry_dump(bool ok); // Note: on !ok, Jtry(_dump) only exits if !interactive and otherwise returns ok, // so the parent function should evaluate the value and return; if appriopriate %} %defines %define api.prefix {zz} %union { int intval; double val; std::string *stringptr; jags::ParseTree *ptree; std::vector *pvec; std::vector *vec; std::vector *ivec; } %token INT %token DOUBLE %token NAME %token STRING %token SYSCMD %token ENDCMD %token MODEL %token DATA %token IN %token TO %token INITS %token PARAMETERS %token COMPILE %token INITIALIZE %token ADAPT %token AUTOADAPT %token FORCEADAPT %token UPDATE %token BY %token MONITORS %token MONITOR %token TYPE %token SET %token CLEAR %token THIN %token CODA %token STEM %token EXIT %token NCHAINS %token CHAIN %token LOAD %token UNLOAD %token SAMPLER %token SAMPLERS %token RNGTOK %token FACTORY; %token FACTORIES; %token MODULES; %token SEED; %token LIST %token STRUCTURE %token DIM %token NA %token R_NULL %token DIMNAMES %token ITER %token ARROW %token ENDDATA %token ASINTEGER %token DOTDATA %token DIRECTORY %token CD %token PWD %token RUN %token ENDSCRIPT %type var index %type r_assignment r_structure %type range_element r_dim %type r_attribute_list %type r_value %type r_value_list r_assignment_list range_list %type r_value_collection r_integer_collection r_collection r_data %type file_name; %type r_name; %% input: { if (interactive && command_buffer_count == 0) std::cout << ". " << std::flush; } | input line { if (interactive && command_buffer_count == 0) std::cout << ". " << std::flush; } ; line: ENDCMD {} | command ENDCMD {} | error ENDCMD {if(interactive) yyerrok; else exit(1); } | run_script {} | ENDSCRIPT ENDCMD {} | SYSCMD ENDCMD { doSystem($1); delete $1;} ; command: model | data_in | data_to | data_clear | parameters_in | parameters_to | compile | initialize | adapt | autoadapt | forceadapt | update | monitor | monitors_to | coda | load | unload | exit | read_dir | get_working_dir | set_working_dir | samplers_to | list_factories | list_modules | set_factory | set_seed ; model: MODEL IN file_name { std::FILE *file = std::fopen(ExpandFileName(($3)->c_str()).c_str(), "r"); if (!file) { std::cerr << "Failed to open file " << *($3) << std::endl; if (!interactive) exit(1); } else { Jtry(console->checkModel(file)); std::fclose(file); } delete $3; } | MODEL CLEAR { console->clearModel(); } ; data_in: data r_assignment_list ENDDATA { std::string rngname; readRData($2, _data_table, rngname); if (rngname.size() != 0) { std::cerr << "WARNING: .RNG.name assignment ignored" << std::endl; } delete_pvec($2); } | data { // Failed to open the data file if (!interactive) exit(1); } ; data_to: DATA TO file_name { doDump(*$3, jags::DUMP_DATA, 1); delete $3; } ; data: DATA IN file_name { if(open_data_buffer($3)) { std::cout << "Reading data file " << *$3 << std::endl; } else { std::cerr << "Unable to open file " << *$3 << std::endl << std::flush; if (!interactive) exit(1); } delete $3; } ; data_clear: DATA CLEAR { std::cout << "Clearing data table " << std::endl; _data_table.clear(); } ; parameters_in: parameters r_assignment_list ENDDATA { std::map parameter_table; std::string rngname; readRData($2, parameter_table, rngname); delete_pvec($2); /* Set all chains to the same state. If the user sets the RNG state in addition to the parameter values then all chains will be identical! */ if (console->model() == 0) { std::cout << "ERROR: Initial values ignored. " << "(You must compile the model first)" << std::endl; if (!interactive) exit(1); } for (unsigned int i = 1; i <= console->nchain(); ++i) { /* We have to set the name first, because the state or seed might be embedded in the parameter_table */ if (rngname.size() != 0) { Jtry(console->setRNGname(rngname, i)); } Jtry(console->setParameters(parameter_table, i)); } print_unused_variables(parameter_table, false); } | parameters r_assignment_list ENDDATA ',' CHAIN '(' INT ')' { std::map parameter_table; std::string rngname; readRData($2, parameter_table, rngname); delete $2; /* We have to set the name first, because the state or seed might be embedded in the parameter_table */ if (rngname.size() != 0) { Jtry(console->setRNGname(rngname, $7)); } Jtry(console->setParameters(parameter_table, $7)); print_unused_variables(parameter_table, false); } | parameters {} // Failed to open the file ; parameters_to: PARAMETERS TO file_name { doDump(*$3, jags::DUMP_PARAMETERS, 1); delete $3; } | PARAMETERS TO file_name ',' CHAIN '(' INT ')' { doDump(*$3, jags::DUMP_PARAMETERS, $7); delete $3; } ; parameters: PARAMETERS IN file_name { if(open_data_buffer($3)) { std::cout << "Reading parameter file " << *$3 << std::endl; } else { std::cerr << "Unable to open file " << *$3 << std::endl << std::flush; } delete $3; } | INITS IN file_name { /* Legacy option to not break existing scripts */ if(open_data_buffer($3)) { std::cout << "Reading initial values file " << *$3 << std::endl; } else { std::cerr << "Unable to open file " << *$3 << std::endl << std::flush; } delete $3; } ; compile: COMPILE { Jtry(console->compile(_data_table, 1, true)); print_unused_variables(_data_table, true); } | COMPILE ',' NCHAINS '(' INT ')' { Jtry(console->compile(_data_table, $5, true)); print_unused_variables(_data_table, true); } ; initialize: INITIALIZE { if (!console->initialize()) { errordump(); } } ; autoadapt: AUTOADAPT INT { long refresh = interactive ? $2/50 : 0; autoadaptstar($2, refresh, 50); } | AUTOADAPT INT ',' BY '(' INT ')' { autoadaptstar($2,$6, 50); } ; forceadapt: FORCEADAPT INT { long refresh = interactive ? $2/50 : 0; adaptstar($2, refresh, 50, true); } | FORCEADAPT INT ',' BY '(' INT ')' { adaptstar($2,$6, 50, true); } ; adapt: ADAPT INT { long refresh = interactive ? $2/50 : 0; adaptstar($2, refresh, 50, false); } | ADAPT INT ',' BY '(' INT ')' { adaptstar($2,$6, 50, false); } ; update: UPDATE INT { long refresh = interactive ? $2/50 : 0; updatestar($2, refresh, 50); } | UPDATE INT ',' BY '(' INT ')' { updatestar($2,$6, 50); } ; exit: EXIT { return 0; } ; var: NAME { $$ = new jags::ParseTree(jags::P_VAR); setName($$, $1); } | NAME '[' range_list ']' { $$ = new jags::ParseTree(jags::P_VAR); setName($$, $1); setParameters($$, $3); } ; range_list: range_element { $$ = new std::vector(1, $1); } | range_list ',' range_element { $$=$1; $$->push_back($3); } ; range_element: index { $$ = new jags::ParseTree(jags::P_RANGE); setParameters($$, $1); } | index ':' index { $$ = new jags::ParseTree(jags::P_RANGE); setParameters($$, $1, $3); } ; /* FIXME: Use integer value here */ index: INT {$$ = new jags::ParseTree(jags::P_VALUE); $$->setValue($1);} ; monitor: monitor_set | monitor_clear ; monitor_set: MONITOR SET var { setMonitor($3, 1, "trace"); delete $3; } | MONITOR SET var ',' THIN '(' INT ')' { setMonitor($3, $7, "trace"); delete $3; } | MONITOR var { setMonitor($2, 1, "trace"); delete $2; } | MONITOR var ',' THIN '(' INT ')' { setMonitor($2, $6, "trace"); delete $2; } | MONITOR var ',' TYPE '(' NAME ')' { setMonitor($2, 1, *$6); delete $6; } | MONITOR var ',' TYPE '(' NAME ')' THIN '(' INT ')' { setMonitor($2, $10, *$6); delete $6; } | MONITOR var ',' THIN '(' INT ')' TYPE '(' NAME ')' { setMonitor($2, $6, *$10); delete $10; } ; monitor_clear: MONITOR CLEAR var { clearMonitor($3, "trace"); delete $3; } | MONITOR CLEAR var ',' TYPE '(' NAME ')' { clearMonitor($3, *$7); delete $7; } ; monitors_to: MONITORS TO file_name { dumpMonitors(*$3, "trace"); delete $3; } | MONITORS TO file_name ',' TYPE '(' NAME ')' { dumpMonitors(*$3, *$7); delete $3; delete $7; } ; /* File names may optionally be enclosed in quotes, and this is required if the name includes spaces. */ file_name: NAME { $$ = $1;} | STRING { $$ = $1; } ; coda: CODA var { doCoda ($2, "CODA"); delete $2; } | CODA var ',' STEM '(' file_name ')' { doCoda ($2, *$6); delete $2; delete $6; } | CODA '*' { doAllCoda ("CODA"); } | CODA '*' ',' STEM '(' file_name ')' { doAllCoda (*$6); delete $6; } ; load: LOAD file_name { loadModule(*$2); } ; unload: UNLOAD NAME { unloadModule(*$2); } ; samplers_to: SAMPLERS TO file_name { dumpSamplers(*$3); delete $3; } ; list_factories: LIST FACTORIES ',' TYPE '(' SAMPLER ')' { listFactories(jags::SAMPLER_FACTORY); } | LIST FACTORIES ',' TYPE '(' RNGTOK ')' { listFactories(jags::RNG_FACTORY); } | LIST FACTORIES ',' TYPE '(' MONITOR ')' { listFactories(jags::MONITOR_FACTORY); } ; list_modules: LIST MODULES { listModules(); } ; set_factory: SET FACTORY STRING NAME ',' TYPE '(' SAMPLER ')' { setFactory(*$3, jags::SAMPLER_FACTORY, *$4); delete $3; delete $4; } | SET FACTORY NAME NAME ',' TYPE '(' RNGTOK ')' { setFactory(*$3, jags::RNG_FACTORY, *$4); delete $3; delete $4; } | SET FACTORY NAME NAME ',' TYPE '(' MONITOR ')' { setFactory(*$3, jags::MONITOR_FACTORY, *$4); delete $3; delete $4; } ; set_seed: SET SEED INT { setSeed($3); } ; /* Rules for scanning dumped R datasets */ r_assignment_list: r_assignment { $$ = new std::vector(1, $1); } | r_assignment_list r_assignment { $$ = $1; $$->push_back($2); } | r_assignment_list ';' r_assignment { $$ = $1; $$->push_back($3); } ; r_assignment: r_name ARROW r_structure { $$ = $3; setName($$, $1); } | r_name ARROW r_collection { $$ = new jags::ParseTree(jags::P_ARRAY); setName($$, $1); setParameters($$, $3); } | r_name ARROW STRING { /* Allow this for setting the NAME of the random number generator */ $$ = new jags::ParseTree(jags::P_VAR); setName($$, $1); jags::ParseTree *p = new jags::ParseTree(jags::P_VAR); setName(p, $3); setParameters($$, p); } ; r_name: STRING | NAME | '`' NAME '`' { /* R >= 2.4.0 uses backticks for quoted names */ $$ = $2; } r_data: r_collection | DOTDATA '=' r_collection { $$ = $3; } r_structure: STRUCTURE '(' r_data ',' r_attribute_list ')' { $$ = new jags::ParseTree(jags::P_ARRAY); if ($5) setParameters($$, $3, $5); else setParameters($$, $3); } | STRUCTURE '(' r_data ')' { $$ = new jags::ParseTree(jags::P_ARRAY); setParameters($$, $3); } ; /* The only attribute we are interested in is .Dim. The rest are simply discarded - see below */ r_attribute_list: r_dim | r_generic_attribute {$$=0;} | r_attribute_list ',' r_generic_attribute | r_attribute_list ',' r_dim {$$=$3;} ; r_dim: DIM '=' r_collection { $$ = $3; } | DIM '=' range_element { $$ = $3; } ; r_collection: r_integer_collection | r_value_collection ; r_integer_collection: ASINTEGER '(' r_value_collection ')' {$$ = $3;} ; r_value_collection: r_value { $$ = new jags::ParseTree(jags::P_VECTOR); setParameters($$, $1); } | 'c' '(' r_value_list ')' { $$ = new jags::ParseTree(jags::P_VECTOR); setParameters($$, $3); } ; r_value_list: r_value {$$ = new std::vector(1, $1); } | r_value_list ',' r_value {$$ = $1; $$->push_back($3);} ; r_value: DOUBLE {$$ = new jags::ParseTree(jags::P_VALUE); $$->setValue($1);} | NA {$$ = new jags::ParseTree(jags::P_VALUE); $$->setValue(JAGS_NA);} ; /* Rules for parsing generic attributes. We don't want to do anything with the results, just have the parser accept them */ r_generic_attribute: NAME '=' r_generic_vector {;} ; r_generic_list: r_generic_list_element {;} | r_generic_list ',' r_generic_list_element {;} ; r_generic_list_element: r_generic_vector {;} | NAME '=' r_generic_vector {;} ; r_generic_vector: r_numeric_vector {;} | ASINTEGER '(' r_numeric_vector ')' {;} | r_character_vector {;} | LIST '(' r_generic_list ')' {;} | STRUCTURE '(' r_generic_list ')' {;} | R_NULL {;} ; r_numeric_vector: DOUBLE {;} | 'c' '(' r_double_list ')' ; r_double_list: DOUBLE {;} | r_double_list ',' DOUBLE {;} ; r_character_vector: STRING {;} | 'c' '(' r_string_list ')' {;} ; r_string_list: STRING {;} | r_string_list ',' STRING {;} ; /* Rules for interacting with the operating system */ get_working_dir: PWD { std::string name; if (getWorkingDirectory(name)) { std::cout << name << std::endl; } else { std::cout << "ERROR: " << name << std::endl; } } set_working_dir: CD file_name { if (chdir(($2)->c_str()) == -1) { std::cout << "ERROR: Cannot change working directory" << std::endl; } delete $2; } read_dir: DIRECTORY { std::string name; if (!getWorkingDirectory(name)) { std::cerr << "ERROR: Unable to get working directory name\n" << name << std::endl; return 0; } DIR *dir; struct dirent *de; if ((dir = opendir(name.c_str())) != 0) { while ((de = readdir(dir)) != 0) { if (std::strcmp(de->d_name, ".") && std::strcmp(de->d_name, "..")) { std::cout << de->d_name << "\n"; } } closedir(dir); } else { std::cerr << "Unable to open working directory" << std::endl; } } run_script: RUN file_name { if(open_command_buffer($2)) { std::cout << "Running script file " << *$2 << std::endl; } else { std::cerr << "Unable to open script file " << *$2 << std::endl; } delete $2; } ; %% int zzerror (const char *s) { return_to_main_buffer(); std::cerr << s << std::endl; return 0; } static jags::Range getRange(jags::ParseTree const *var) { /* Blank arguments, e.g. foo[] or bar[,1] are not allowed. */ unsigned int size = var->parameters().size(); std::vector ind_lower(size), ind_upper(size); for (unsigned int i = 0; i < size; ++i) { jags::ParseTree const *range_element = var->parameters()[i]; switch(range_element->parameters().size()) { case 1: ind_lower[i] = (int) (range_element->parameters()[0]->value() + 1.0E-6); ind_upper[i] = ind_lower[i]; break; case 2: ind_lower[i] = (int) (range_element->parameters()[0]->value() + 1.0E-6); ind_upper[i] = (int) (range_element->parameters()[1]->value() + 1.0E-6); break; default: //Error! FIXME break; } } return jags::SimpleRange(ind_lower, ind_upper); } void setMonitor(jags::ParseTree const *var, int thin, std::string const &type) { std::string const &name = var->name(); if (var->parameters().empty()) { /* Requesting the whole node */ console->setMonitor(name, jags::Range(), thin, type); } else { /* Requesting subset of a multivariate node */ console->setMonitor(name, getRange(var), thin, type); } } void clearMonitor(jags::ParseTree const *var, std::string const &type) { std::string const &name = var->name(); if (var->parameters().empty()) { /* Requesting the whole node */ console->clearMonitor(name, jags::Range(), type); } else { /* Requesting subset of a multivariate node */ console->clearMonitor(name, getRange(var), type); } } void doAllCoda (std::string const &stem) { console->coda(stem); } void doCoda (jags::ParseTree const *var, std::string const &stem) { //FIXME: Allow list of several nodes std::vector > dmp; if (var->parameters().empty()) { /* Requesting the whole node */ dmp.push_back(std::pair(var->name(), jags::Range())); } else { /* Requesting subset of a multivariate node */ dmp.push_back(std::pair(var->name(), getRange(var))); } console->coda(dmp, stem); } /* Helper function for doDump that handles all the special cases (missing values etc) when writing a double value */ static void writeValue(double x, std::ostream &out, bool isdiscrete) { using namespace std; if (x == JAGS_NA) { out << "NA"; } else if (jags_isnan(x)) { out << "NaN"; } else if (!jags_finite(x)) { if (x > 0) out << "Inf"; else out << "-Inf"; } else if (isdiscrete) { out << static_cast(x) << "L"; } else { out << x; } } void doDump(std::string const &file, jags::DumpType type, unsigned int chain) { std::map data_table; std::string rng_name; if (!console->dumpState(data_table, rng_name, type, chain)) { return; } /* Open output file */ std::ofstream out(file.c_str()); if (!out) { std::cerr << "Failed to open file " << file << std::endl; return; } if (rng_name.size() != 0) { out << "`.RNG.name` <- \"" << rng_name << "\"\n"; } for (std::map::const_iterator p = data_table.begin(); p != data_table.end(); ++p) { std::string const &name = p->first; jags::SArray const &sarray = p->second; std::vector const &value = sarray.value(); long length = sarray.length(); out << "`" << name << "` <- " << std::endl; std::vector const &dim = sarray.dim(false); bool discrete = sarray.isDiscreteValued(); if (dim.size() == 1) { // Vector if (dim[0] == 1) { // Scalar writeValue(value[0], out, discrete); } else { // Vector of length > 1 out << "c("; for (int i = 0; i < length; ++i) { if (i > 0) { out << ","; } writeValue(value[i], out, discrete); } out << ")"; } } else { // Array out << "structure(c("; for (int i = 0; i < length; ++i) { if (i > 0) { out << ","; } writeValue(value[i], out, discrete); } out << "), .Dim = c("; for (unsigned int j = 0; j < dim.size(); ++j) { if (j > 0) { out << ","; } out << dim[j] << "L"; } out << "))"; } out << "\n"; } out.close(); } void dumpMonitors(std::string const &file, std::string const &type) { std::map data_table; if (!console->dumpMonitors(data_table, type, false)) { return; } /* Open output file */ std::ofstream out(file.c_str()); if (!out) { std::cerr << "Failed to open file " << file << std::endl; return; } out << "`" << type << "` <-\nstructure(list("; std::map::const_iterator p; for (p = data_table.begin(); p != data_table.end(); ++p) { std::string const &name = p->first; jags::SArray const &sarray = p->second; std::vector const &value = sarray.value(); long length = sarray.length(); if (p != data_table.begin()) { out << ", \n"; } out << "\"" << name << "\" = "; std::vector const &dim = sarray.dim(false); bool discrete = sarray.isDiscreteValued(); bool named = !sarray.dimNames().empty(); if (dim.size() == 1 && !named) { // Vector if (dim[0] == 1) { // Scalar writeValue(value[0], out, discrete); } else { // Vector of length > 1 out << "c("; for (int i = 0; i < length; ++i) { if (i > 0) { out << ","; } writeValue(value[i], out, discrete); } out << ")"; } } else { // Array out << "structure(c("; for (int i = 0; i < length; ++i) { if (i > 0) { out << ","; } writeValue(value[i], out, discrete); } out << "), .Dim = "; if (named) { out << "structure("; } out << "c("; for (unsigned int j = 0; j < dim.size(); ++j) { if (j > 0) { out << ","; } out << dim[j] << "L"; } out << ")"; if (named) { std::vector const &dnames = sarray.dimNames(); out << ", .Names = c("; for (unsigned int k = 0; k < dnames.size(); ++k) { if (k > 0) { out << ","; } out << "\"" << dnames[k] << "\""; } out << "))"; } out << ")"; } } out << "), \n.Names = c("; for (p = data_table.begin(); p != data_table.end(); ++p) { if (p != data_table.begin()) { out << ", "; } std::string const &name = p->first; out << "\"" << name << "\""; } out << "))"; out.close(); } void setParameters(jags::ParseTree *p, std::vector *parameters) { /* The parser dynamically allocates vectors of (pointers to) parameters. These vectors must be deleted when we are done with them. */ p->setParameters(*parameters); delete parameters; } void setParameters(jags::ParseTree *p, jags::ParseTree *param1) { /* Wrapper function that creates a vector containing param1 to be passed to jags::ParseTree::setParameters. */ std::vector parameters(1, param1); p->setParameters(parameters); } void setParameters(jags::ParseTree *p, jags::ParseTree *param1, jags::ParseTree *param2) { /* Wrapper function that creates a vector containing param1 and param2, to be passed to jags::ParseTree::setParameters */ std::vector parameters; parameters.push_back(param1); parameters.push_back(param2); p->setParameters(parameters); } void setName(jags::ParseTree *p, std::string *name) { p->setName(*name); delete name; } static void errordump() { if (console->model()) { std::ostringstream fname; for (unsigned int i = 1; i <= console->nchain(); ++i) { fname << "jags.dump" << i << ".R"; std::cout << "Dumping chain " << i << " at iteration " << console->iter() << " to file " << fname.str() << std::endl; doDump(fname.str(), jags::DUMP_ALL, i); fname.str(""); } // Moved clearModel from Console.cc CATCH_ERRORS to here // to allow doDump to work as described in the manual: console->clearModel(); } if (!interactive) exit(1); } static void updatestar(long niter, long refresh, int width) { std::cout << "Updating " << niter << std::endl; bool adapt = console->isAdapting(); if (adapt && console->iter() > 0) { //Turn off iteration immediately if we have some burn-in if (console->adaptOff()) { adapt = false; } else { std::cout << std::endl; errordump(); return; } } if (refresh == 0) { if( !Jtry_dump(console->update(niter/2)) ) return; bool status = true; if (adapt) { if (!console->checkAdaptation(status)) { errordump(); return; } if (!console->adaptOff()) { errordump(); return; } } if( !Jtry_dump(console->update(niter - niter/2)) ) return; if (!status) { std::cerr << "WARNING: Adaptation incomplete\n"; } return; } if (width > niter / refresh + 1) width = niter / refresh + 1; for (int i = 0; i < width - 1; ++i) { std::cout << "-"; } std::cout << "| " << std::min(width * refresh, niter) << std::endl << std::flush; int col = 0; bool status = true; for (long n = niter; n > 0; n -= refresh) { if (adapt && n <= niter/2) { // Turn off adaptive mode half way through burnin if (!console->checkAdaptation(status)) { std::cout << std::endl; errordump(); return; } if (console->adaptOff()) { adapt = false; } else { std::cout << std::endl; errordump(); return; } } long nupdate = std::min(n, refresh); if(Jtry_dump(console->update(nupdate))) { std::cout << "*" << std::flush; } else { std::cout << std::endl; return; } col++; if (col == width || n <= nupdate) { int percent = 100 - (n-nupdate) * 100/niter; std::cout << " " << percent << "%" << std::endl; if (n > nupdate) { col = 0; } } } if (!status) { std::cerr << "WARNING: Adaptation incomplete\n"; } } static void autoadaptstar(long maxiter, long refresh, int width) { if (!console->isAdapting()) { std::cout << "Adaptation skipped: model is not in adaptive mode.\n"; return; } std::cout << "Autoadapting up to " << maxiter << " iterations" << std::endl; if (width > maxiter / refresh + 1) width = maxiter / refresh + 1; long i = 0; bool status = false; if ( refresh == 0 ) { for (i = 0; i < maxiter; i++) { if (!console->checkAdaptation(status)) { errordump(); return; } if(status) break; if( !Jtry_dump(console->update(1)) ) { std::cout << std::endl; return; } } } else { for (int j = 0; j < width - 1; ++j) { std::cout << "-"; } std::cout << "| " << std::min(width * refresh, maxiter) << std::endl << std::flush; int col = 0; for (long n = maxiter; n > 0; n -= refresh) { long nupdate = std::min(n, refresh); for (long j = 0; j < nupdate; j++) { if (!console->checkAdaptation(status)) { errordump(); return; } if(status) break; if( !Jtry_dump(console->update(1)) ) { std::cout << std::endl; return; } i++; } if(status){ std::cout << std::endl; break; } std::cout << "+" << std::flush; col++; if (col == width || n <= nupdate) { int percent = 100 - (n-nupdate) * 100/maxiter; std::cout << " " << percent << "%" << std::endl; if (n > nupdate) { col = 0; } } } } if (!console->checkAdaptation(status)) { errordump(); return; } if (!status) { std::cerr << "Adaptation incomplete\n"; } else { std::cout << "Adaptation completed in " << i << " iterations" << std::endl; if (!console->adaptOff()) { std::cout << std::endl; errordump(); return; } } return; } static void adaptstar(long niter, long refresh, int width, bool force) { if (!console->isAdapting()) { if( force ) { // Missing endl is deliberate - updatestar will write to the same line: std::cout << "Model not in adaptive mode: "; updatestar(niter, refresh, width); } else { std::cerr << "Adaptation skipped: model is not in adaptive mode.\n"; } return; } std::cout << "Adapting " << niter << std::endl; bool status = true; if (refresh == 0) { if( !Jtry_dump(console->update(niter)) ) return; if (!console->checkAdaptation(status)) { errordump(); return; } if (!status) { std::cerr << "Adaptation incomplete\n"; return; } else { std::cerr << "Adaptation successful\n"; return; } } if (width > niter / refresh + 1) width = niter / refresh + 1; for (int i = 0; i < width - 1; ++i) { std::cout << "-"; } std::cout << "| " << std::min(width * refresh, niter) << std::endl << std::flush; int col = 0; for (long n = niter; n > 0; n -= refresh) { long nupdate = std::min(n, refresh); if(Jtry_dump(console->update(nupdate))) std::cout << "+" << std::flush; else { std::cout << std::endl; return; } col++; if (col == width || n <= nupdate) { int percent = 100 - (n-nupdate) * 100/niter; std::cout << " " << percent << "%" << std::endl; if (n > nupdate) { col = 0; } } } if (!console->checkAdaptation(status)) { std::cout << std::endl; errordump(); return; } if (!status) { std::cerr << "Adaptation incomplete.\n"; } else { std::cerr << "Adaptation successful\n"; } } static void loadModule(std::string const &name) { std::cout << "Loading module: " << name; lt_dlhandle mod = lt_dlopenext(name.c_str()); if (mod == NULL) { std::cout << ": " << lt_dlerror() << std::endl; } else { std::cout << ": ok" << std::endl; _dyn_lib.push_front(mod); jags::Console::loadModule(name); } } static void unloadModule(std::string const &name) { std::cout << "Unloading module: " << name << std::endl; jags::Console::unloadModule(name); } int main (int argc, char **argv) { extern std::FILE *zzin; std::FILE *cmdfile = 0; if (argc > 2) { std::cerr << "Too many arguments" << std::endl; } else if (argc == 2) { interactive = false; cmdfile = std::fopen(ExpandFileName(argv[1]).c_str(),"r"); if (cmdfile) { zzin = cmdfile; } else { std::cerr << "Unable to open command file " << argv[1] << std::endl; return 1; } } else { interactive = true; } #ifndef _WIN32 /* - Allows emulation of dynamic loading on platforms that do not support it by preloading modules. - Causes build failures on mingw-w64 (as at 21 April 2010) so not used on Windows platform. */ LTDL_SET_PRELOADED_SYMBOLS(); #endif if(lt_dlinit()) { std::cerr << lt_dlerror() << std::endl; return 1; } /* pt2Func load_base = (pt2Func)(lt_dlsym(base, "load")); if (load_base == NULL) { std::cout << lt_dlerror() << std::endl; return 1; } else{ (*load_base)(); } */ time_t t; time(&t); std::cout << "Welcome to " << PACKAGE_STRING << " on " << ctime(&t); std::cout << "JAGS is free software and comes with ABSOLUTELY NO WARRANTY" << std::endl; loadModule("basemod"); loadModule("bugs"); console = new jags::Console(std::cout, std::cerr); zzparse(); zzlex_destroy(); if (argc==2) { std::fclose(cmdfile); } //Unload modules std::vector mods = jags::Console::listModules(); for (unsigned int i = 0; i < mods.size(); ++i) { jags::Console::unloadModule(mods[i]); } delete console; //Release dynamic libraries. for (unsigned int i = 0; i < _dyn_lib.size(); ++i) { lt_dlclose(_dyn_lib[i]); } lt_dlexit(); } static bool getWorkingDirectory(std::string &name) { char buf[FILENAME_MAX]; #ifdef Win32 if (getCurrentDirectory(FILENAME_MAX, buf)) { name = buf; return true; } else { name = "Error in getCurrentDirectory"; return false; } #else if (getcwd(buf, FILENAME_MAX)) { name = buf; return true; } else { switch(errno) { case EACCES: name = "Access denied"; break; case ENOENT: name = "Not found"; break; case ERANGE: name = "Directory name too long"; break; default: name = "Error in getcwd"; break; } return false; } #endif } static void dumpSamplers(std::string const &file) { std::ofstream out(file.c_str()); if (!out) { std::cerr << "Failed to open file " << file << std::endl; return; } std::vector > sampler_list; console->dumpSamplers(sampler_list); for (unsigned int i = 0; i < sampler_list.size(); ++i) { for (unsigned int j = 1; j < sampler_list[i].size(); ++j) { out << i + 1 << "\t" << sampler_list[i][0] << "\t" //First element is sampler name << sampler_list[i][j] << "\n"; //Rest are node names } } out.close(); } static void delete_pvec(std::vector *pv) { for (unsigned int i = 0; i < pv->size(); ++i) { delete (*pv)[i]; } delete pv; } static void print_unused_variables(std::map const &table, bool data) { std::vector supplied_vars; for (std::map::const_iterator p = table.begin(); p != table.end(); ++p) { supplied_vars.push_back(p->first); } std::vector unused_vars; std::vector model_vars = console->variableNames(); if (!data) { // Initial values table may legitimately contain these names model_vars.push_back(".RNG.name"); model_vars.push_back(".RNG.seed"); model_vars.push_back(".RNG.state"); } // Make sure both vectors are sorted to avoid false positive WARNINGs: std::sort(model_vars.begin(), model_vars.end()); std::sort(supplied_vars.begin(), supplied_vars.end()); /* Test code to check vectors: if(data){ std::cout << "Variables in model:\n"; std::copy(model_vars.begin(), model_vars.end(), std::ostream_iterator(std::cout, ", ")); std::cout << "\n"; std::cout << "Supplied vars:\n"; std::copy(supplied_vars.begin(), supplied_vars.end(), std::ostream_iterator(std::cout, ", ")); std::cout << "\n"; } */ std::set_difference(supplied_vars.begin(), supplied_vars.end(), model_vars.begin(), model_vars.end(), std::inserter(unused_vars, unused_vars.begin())); if (!unused_vars.empty()) { std::cerr << "\nWARNING: Unused variable(s) in "; if (data) { std::cerr << "data table:\n"; } else { std::cerr << "initial value table:\n"; } std::copy(unused_vars.begin(), unused_vars.end(), std::ostream_iterator(std::cerr, "\n")); std::cerr << "\n"; } } std::string ExpandFileName(char const *s) { if(s[0] != '~') return s; std::string name = s; if(name.size() > 1 && s[1] != '/') return s; char const *p = getenv("HOME"); if (p) { std::string UserHOME = p; if (!UserHOME.empty()) { if (name.size() == 1) return UserHOME; else return UserHOME + name.substr(1); } } return name; } void doSystem(std::string const *command) { std::system(command->c_str()); } void listModules(){ std::vector mods = jags::Console::listModules(); std::cout << "Modules:" << std::endl; for (unsigned int i = 0; i < mods.size(); ++i) { std::cout << " " << mods[i] << std::endl; } } void listFactories(jags::FactoryType type) { std::vector > faclist = jags::Console::listFactories(type); std::vector >::const_iterator p; unsigned int max_strlen = 0; for (p = faclist.begin(); p != faclist.end(); ++p) { if (p->first.length() > max_strlen) max_strlen = p->first.length(); } if (max_strlen < 4) max_strlen = 4; //Header std::cout << "Name"; for (int i = max_strlen - 4; i >=0; --i) { std::cout << " "; } std::cout << "Status\n"; //Body for (p = faclist.begin(); p != faclist.end(); ++p) { std::cout << p->first << " "; for (int i = max_strlen - p->first.length(); i >= 0; --i) { std::cout << " "; } if (p->second) { std::cout << "on"; } else { std::cout << "off"; } std::cout << "\n"; } } void setFactory(std::string const &name, jags::FactoryType type, std::string const &status) { if (status == "on") { jags::Console::setFactoryActive(name, type, true); } else if (status == "off") { jags::Console::setFactoryActive(name, type, false); } else { std::cout << "status should be \"on\" or \"off\""; } } void setSeed(unsigned int seed) { if (seed == 0) { std::cout << "seed must be non-zero"; } else { jags::Console::setRNGSeed(seed); } } bool Jtry(bool ok) { if (!ok && !interactive) exit(1); else return ok; } bool Jtry_dump(bool ok) { // Allows doDump to work as described in the manual: if (!ok) { errordump(); console->clearModel(); if (!interactive) exit(1); } return ok; } JAGS-4.3.2/src/terminal/scanner.ll0000664000175000017500000001427514224052515013564 00000000000000/* -*-C++-*- */ %{ #include #include #include #include #include "parser.hh" std::vector file_stack; int command_buffer_count = 0; int buffer_count = 0; void return_to_main_buffer(); void close_buffer(); std::string ExpandFileName(char const *name); %} %option prefix="zz" EXPONENT [eE][+-][0-9]+ BRACKET [ \t]*\( %s RDATA %x COMMENT %x SYSTEM %% model zzlval.intval=MODEL; return MODEL; data zzlval.intval=DATA; return DATA; in zzlval.intval=IN; return IN; to zzlval.intval=TO; return TO; inits zzlval.intval=INITS; return INITS; parameters zzlval.intval=PARAMETERS; return PARAMETERS; compile zzlval.intval=COMPILE; return COMPILE; nchains zzlval.intval=NCHAINS; return NCHAINS; initialize zzlval.intval=INITIALIZE; return INITIALIZE; chain zzlval.intval=CHAIN; return CHAIN; update zzlval.intval=UPDATE; return UPDATE; adapt zzlval.intval=ADAPT; return ADAPT; forceadapt zzlval.intval=FORCEADAPT; return FORCEADAPT; autoadapt zzlval.intval=AUTOADAPT; return AUTOADAPT; by zzlval.intval=BY; return BY; monitor zzlval.intval=MONITOR; return MONITOR; monitors zzlval.intval=MONITORS; return MONITORS; type zzlval.intval=TYPE; return TYPE; set zzlval.intval=SET; return SET; clear zzlval.intval=CLEAR; return CLEAR; thin zzlval.intval=THIN; return THIN; sampler zzlval.intval=SAMPLER; return SAMPLER; samplers zzlval.intval=SAMPLERS; return SAMPLERS; rng zzlval.intval=RNGTOK; return RNGTOK; factory zzlval.intval=FACTORY; return FACTORY; factories zzlval.intval=FACTORIES; return FACTORIES; modules zzlval.intval=MODULES; return MODULES; seed zzlval.intval=SEED; return SEED; coda zzlval.intval=CODA; return CODA; stem zzlval.intval=STEM; return STEM; load zzlval.intval=LOAD; return LOAD; unload zzlval.intval=UNLOAD; return UNLOAD; exit zzlval.intval=EXIT; return EXIT; dir zzlval.intval=DIRECTORY; return DIRECTORY; cd zzlval.intval=CD; return CD; pwd zzlval.intval=PWD; return PWD; run zzlval.intval=RUN; return RUN; "list" zzlval.intval=LIST; return LIST; "," return ','; "[" return '['; "]" return ']'; "(" return '('; ")" return ')'; "=" return '='; "<-" return ARROW; "*" return '*'; ":" return ':'; ";" return ';'; "`" return '`'; "/*" BEGIN(COMMENT); [^*]* /* Eat up anything that's not a '*' */ "*"+[^*/]* /* Eat up '*'s not followed by a '/' */ "*"+"/" BEGIN(INITIAL); [ \t\r\f]+ /* Eat whitespace */ "#".*\n /* Eat single-line comments */ [\n]+ /* Eat newlines */ [\n] return ENDCMD; "system" BEGIN(SYSTEM); .+ { zzlval.stringptr = new std::string(zztext); return SYSCMD; } [\n] { BEGIN(INITIAL); return ENDCMD; } "-"?([0-9]+){EXPONENT} { zzlval.val = atof(zztext); return DOUBLE; } "-"?([0-9]+"."[0-9]*){EXPONENT} { zzlval.val = atof(zztext); return DOUBLE; } "-"?([0-9]+"."[0-9]*) { zzlval.val = atof(zztext); return DOUBLE; } "-"?("."[0-9]+){EXPONENT} { zzlval.val = atof(zztext); return DOUBLE; } "-"?("."[0-9]+) { zzlval.val = atof(zztext); return DOUBLE; } "-"?[0-9]+ { zzlval.val = atof(zztext); return DOUBLE; } "-"?[0-9]+"L" { zzlval.val = atof(zztext); return DOUBLE; } "-"?[0-9]+ { zzlval.intval = atoi(zztext); return INT; } ".Dim" return DIM; ".Data" return DOTDATA; "NA" return NA; "NULL" return R_NULL; "structure"/{BRACKET} return STRUCTURE; "list"/{BRACKET} return LIST; "c"/{BRACKET} return 'c'; "as.integer"/{BRACKET} return ASINTEGER; [a-zA-Z\.]+[a-zA-Z0-9\._\-\\\/]* { zzlval.stringptr = new std::string(zztext); return NAME; } [a-zA-Z0-9\._\-\\\/]+ { // More general than NAME which is limited to syntactically valid BUGS names zzlval.stringptr = new std::string(zztext); return STRING; } \"[^\"]*\" { zzlval.stringptr = new std::string(zztext); // Remove enclosing quotes zzlval.stringptr->erase(zzlval.stringptr->size() - 1, 1); zzlval.stringptr->erase(0, 1); return STRING; } \'[^\']*\' { zzlval.stringptr = new std::string(zztext); zzlval.stringptr->erase(zzlval.stringptr->size() - 1, 1); zzlval.stringptr->erase(0,1); return STRING; } <> { if (command_buffer_count) { close_buffer(); --command_buffer_count; } else { yyterminate(); } return ENDSCRIPT; } <> { close_buffer(); BEGIN(INITIAL); return ENDDATA; } %% int zzwrap() { return 1; } void push_file(FILE *file) { file_stack.push_back(file); } void pop_file() { if (file_stack.empty()) return; fclose(file_stack.back()); file_stack.pop_back(); } bool open_data_buffer(std::string const *name) { FILE *file = fopen(ExpandFileName(name->c_str()).c_str(),"r"); if (file) { zzpush_buffer_state(zz_create_buffer(file, YY_BUF_SIZE)); push_file(file); ++buffer_count; BEGIN(RDATA); return true; } else { return false; } } void close_buffer() { zzpop_buffer_state(); pop_file(); --buffer_count; } bool open_command_buffer(std::string const *name) { FILE *file = fopen(name->c_str(),"r"); if (file) { file_stack.push_back(file); zzpush_buffer_state(zz_create_buffer(file, YY_BUF_SIZE )); ++command_buffer_count; ++buffer_count; return true; } else { return false; } } void return_to_main_buffer() { /* Clear all buffers in the stack and return to the first */ while(buffer_count) { zzpop_buffer_state(); --buffer_count; } command_buffer_count = 0; BEGIN(INITIAL); } JAGS-4.3.2/src/terminal/ReadData.cc0000664000175000017500000001051414224052515013546 00000000000000#include #include "ReadData.h" #include #include #include using std::cout; using std::cerr; using std::endl; using std::map; using std::string; using std::vector; using jags::SArray; using jags::ParseTree; using jags::P_VAR; using jags::P_VECTOR; using jags::P_ARRAY; using jags::P_RANGE; bool readRData(vector const *array_list, map &table, string &rngname) { /* Check validity of expressions */ for (vector::const_iterator p = array_list->begin(); p != array_list->end(); ++p) { if ((*p)->treeClass() == P_VAR) { /* Assignments of the form "foo" <- "bar" The only type currently allowed is ".RNG.name" <- "bar" */ if ((*p)->name() != ".RNG.name") { cout << "Unrecognized string assignment. " << "Expecting \".RNG.name\""; return false; } if (((*p)->parameters().size() != 1) || ((*p)->parameters()[0]->treeClass() != P_VAR)) { cout << "Invalid .RNG.name"; return false; } rngname = (*p)->parameters()[0]->name(); } else if ((*p)->treeClass() != P_ARRAY) { cout << "Error reading S data."; return false; } } for (vector::const_iterator p = array_list->begin(); p != array_list->end(); ++p) { if ((*p)->treeClass() == P_VAR) { /* Skip any string assignments and break if one comes at the end */ ++p; if (p == array_list->end()) break; } string const &name = (*p)->name(); /* Check to see if name is already in table */ if (table.find(name) != table.end()) { cerr << "WARNING: Replacing " << name << endl; table.erase(table.find(name)); } /* Get the length of the data */ ParseTree const *vec = (*p)->parameters()[0]; unsigned long length = vec->parameters().size(); /* Get the number of dimensions of the array */ ParseTree const *pdim = 0; int ndim = 1; if ((*p)->parameters().size() == 2) { // Array has dimension attribute pdim = (*p)->parameters()[1]; if (pdim->treeClass() == P_VECTOR) { ndim = pdim->parameters().size(); } else if (pdim->treeClass() == P_RANGE) { // R dump can store a contiguous integer sequence // using the ":" notation e.g. c(3,4,5) is written 3:5 int lower = (int) pdim->parameters()[0]->value(); int upper = (int) pdim->parameters()[1]->value(); ndim = upper - lower + 1; if (ndim < 0 || lower <= 0) { cerr << "Invalid dimension attribute for variable " << name << endl; return false; } } else { cerr << "Invalid dimension attribute for variable " << name << endl; return false; } } /* Get the dimensions of the array */ vector dim(ndim); if (pdim) { if (pdim->treeClass() == P_VECTOR) { for (int i = 0; i < ndim; ++i) { int dim_i = (int) (pdim->parameters()[i]->value() + 1.0E-6); if (dim_i <= 0) { cerr << "Non-positive dimension for variable " << name << endl; return false; } dim[i] = (unsigned int) dim_i; } } else if (pdim->treeClass() == P_RANGE) { int lower = (int) pdim->parameters()[0]->value(); for (int i = 0; i < ndim; ++i) { dim[i] = (unsigned int) (lower + i); } } /* Check that dimension is consistent with length */ unsigned long dimprod = 1; for (int i = 0; i < ndim; i++) { dimprod *= dim[i]; } if (dimprod != length) { cerr << "Bad dimension for variable " << name << endl; return false; } } else { dim[0] = length; } /* Get the data */ vector values(length); for (unsigned long i = 0; i < length; ++i) { values[i] = vec->parameters()[i]->value(); } /* Now assign it to an SArray */ SArray sarray(dim); sarray.setValue(values); /* Since there is no default constructor for SArray, we can't use the shorthand table[names[i]] = par; */ table.insert(map::value_type(name, sarray)); /* std::cout << "Reading " << name << "["; for(unsigned int j = 0; j < dim.length(); j++) { if (j > 0) { std::cout << ","; } std::cout << dim[j]; } std::cout << "]" << std::endl; */ } return true; } JAGS-4.3.2/src/terminal/jags.in0000664000175000017500000000161114224052371013044 00000000000000#!/bin/sh if test -z "${LD_LIBRARY_PATH}"; then LD_LIBRARY_PATH="@libdir@" else LD_LIBRARY_PATH="@libdir@:${LD_LIBRARY_PATH}" fi export LD_LIBRARY_PATH JAGS_binary=@libexecdir@/@jterm@ LTDL_LIBRARY_PATH="${JAGS_LIBS}:@jagsmoddir@" export LTDL_LIBRARY_PATH ### Argument loop debugger= debugger_args= while test -n "${1}"; do case ${1} in -d|--debugger) if test -n "`echo ${2} | sed 's/^-.*//'`"; then debugger="${2}"; shift else error "option '${1}' requires an argument" fi ;; --debugger=*) debugger=`echo "${1}" | sed -e 's/[^=]*=//'` ;; --debugger-args=*) debugger_args=`echo "${1}" | sed -e 's/[^=]*=//'` ;; *) args="${args} ${1}" ;; esac shift done ## Startup if test -z "${debugger}"; then exec "${JAGS_binary}" ${args} "${@}" else exec ${debugger} ${debugger_args} "${JAGS_binary}" ${args} "${@}" fi JAGS-4.3.2/etc/0000755000175000017500000000000014400711327010017 500000000000000JAGS-4.3.2/etc/Makefile.am0000664000175000017500000000012514224052371011774 00000000000000EXTRA_DIST = jags.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = jags.pc JAGS-4.3.2/etc/Makefile.in0000644000175000017500000003656014400675235012025 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = etc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = jags.pc CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/jags.pc.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = jags.pc.in pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = jags.pc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu etc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): jags.pc: $(top_builddir)/config.status $(srcdir)/jags.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgconfigDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags-am uninstall uninstall-am \ uninstall-pkgconfigDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/etc/jags.pc.in0000664000175000017500000000047314224052371011623 00000000000000# File for pkg-config # prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ jagsincludedir=@includedir@/JAGS moduledir=@libdir@/JAGS/modules-@JAGS_MAJOR@ Name: libjags Version: @PACKAGE_VERSION@ Description: JAGS library for Bayesian modelling using MCMC Libs: -L${libdir} -ljags Cflags: -I${jagsincludedir} JAGS-4.3.2/win/0000755000175000017500000000000014400711327010041 500000000000000JAGS-4.3.2/win/Makefile.am0000664000175000017500000000040614224053175012023 00000000000000SUBDIRS = runtime64 EXTRA_DIST=jags.nsi AdvUninstLog.nsh README.WIN clean-local: rm -rf inst installer: makensis -nocd -DVERSION=${PACKAGE_VERSION} \ -DMAJOR=${JAGS_MAJOR} -DJAGSINC=$(srcdir) \ -DLICENSE=$(top_srcdir)/COPYING $(srcdir)/jags.nsi JAGS-4.3.2/win/Makefile.in0000644000175000017500000004663314400675236012052 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = win ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = runtime64 EXTRA_DIST = jags.nsi AdvUninstLog.nsh README.WIN all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu win/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu win/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am distclean distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PRECIOUS: Makefile clean-local: rm -rf inst installer: makensis -nocd -DVERSION=${PACKAGE_VERSION} \ -DMAJOR=${JAGS_MAJOR} -DJAGSINC=$(srcdir) \ -DLICENSE=$(top_srcdir)/COPYING $(srcdir)/jags.nsi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/win/jags.nsi0000775000175000017500000002325014224641553011436 00000000000000!define APP_NAME "JAGS" !define PUBLISHER "JAGS" ;Name used for JAGS registry keys !define JAGS_KEYNAME "${APP_NAME}-${VERSION}" ;Name visible to users, for shortcuts, installation directories, etc. !define JAGS_VISIBLE_NAME "${APP_NAME} ${VERSION}" !define MULTIUSER_MUI !define MULTIUSER_EXECUTIONLEVEL Highest !define MULTIUSER_INSTALLMODE_COMMANDLINE !define INSTDIR_REG_ROOT "SHELL_CONTEXT" !define INSTDIR_REG_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JAGS_KEYNAME}" !define MULTIUSER_INSTALLMODE_INSTDIR "${PUBLISHER}\${JAGS_KEYNAME}" !define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "SOFTWARE\${PUBLISHER}\${JAGS_KEYNAME}" !define MULTIUSER_INSTDIR_REGISTRY_VALUENAME "InstallDir" !define MULTIUSER_USE_PROGRAMFILES64 !addincludedir ${JAGSINC} !include AdvUninstLog.nsh !include "MultiUser.nsh" !include "MUI2.nsh" !include "Sections.nsh" !include "x64.nsh" !include LogicLib.nsh Name "${JAGS_VISIBLE_NAME}" OutFile "${APP_NAME}-${VERSION}.exe" Var SM_FOLDER !define APP_REG_KEY "Software\${PUBLISHER}\${JAGS_KEYNAME}" !define PUB_REG_KEY "Software\${PUBLISHER}" ;Start Menu Folder Page Configuration !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${APP_NAME}" !define MUI_STARTMENUPAGE_REGISTRY_ROOT "${INSTDIR_REG_ROOT}" !define MUI_STARTMENUPAGE_REGISTRY_KEY "${APP_REG_KEY}" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "StartMenuFolder" ; Installer pages !insertmacro UNATTENDED_UNINSTALL !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE ${LICENSE} !insertmacro MULTIUSER_PAGE_INSTALLMODE !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_STARTMENU Application $SM_FOLDER !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH ; Uninstaller pages !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH !insertmacro MUI_LANGUAGE "English" Section #Default section SetRegView 64 WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "InstallDir" "$INSTDIR" WriteRegStr ${INSTDIR_REG_ROOT} "${APP_REG_KEY}" "InstallDir" "$INSTDIR" # Information for uninstaller WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "DisplayName" "${JAGS_VISIBLE_NAME}" WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "UninstallString" "${UNINST_EXE} /$MultiUser.InstallMode" WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "QuietUninstallString" "${UNINST_EXE} /$MultiUser.InstallMode /S" WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "Publisher" "${PUBLISHER}" WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "DisplayVersion" "${VERSION}" WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "URLInfoAbout" "http://mcmc-jags.sourceforge.net" WriteRegDWORD ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "NoModify" 1 WriteRegDWORD ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "NoRepair" 1 WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "InstallLocation" "$INSTDIR" Call GetInstalledSize pop $0 WriteRegDWORD ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "EstimatedSize" "$0" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$SM_FOLDER" !insertmacro MUI_STARTMENU_WRITE_END SectionEnd Section "64-bit installation" Sec64 SetOutPath "$INSTDIR\x64" !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /r inst64\bin !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath "$INSTDIR\x64\bin" !insertmacro UNINSTALL.LOG_OPEN_INSTALL File inst64\libexec\jags-terminal.exe !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath "$INSTDIR\x64\lib" !insertmacro UNINSTALL.LOG_OPEN_INSTALL File inst64\lib\*.dll.a File inst64\lib\*.la !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SetOutPath "$INSTDIR\x64\modules" !insertmacro UNINSTALL.LOG_OPEN_INSTALL File /r inst64\lib\JAGS\modules-${MAJOR}\* !insertmacro UNINSTALL.LOG_CLOSE_INSTALL Push @JAGS_HOME@ #text to be replaced Push $INSTDIR\x64 #replace with Push all #replace all occurrences Push all #replace all occurrences Push $INSTDIR\x64\bin\jags.bat #file to replace in Call AdvReplaceInFile AccessControl::GrantOnFile "$INSTDIR\x64\bin\jags.bat" "BUILTIN\USERS" "GenericRead + GenericExecute" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application # The CreateShortCut function takes the current output path to be # the working directory for the shortcut SetOutPath "%USERPROFILE%" CreateShortCut "$SMPROGRAMS\$SM_FOLDER\${JAGS_VISIBLE_NAME}.lnk" "$INSTDIR\x64\bin\jags.bat" SetOutPath "" !insertmacro MUI_STARTMENU_WRITE_END SectionEnd #64-bit installation Section "Header files" SecHeader SetOutPath "$INSTDIR\include" !insertmacro UNINSTALL.LOG_OPEN_INSTALL File inst64\include\JAGS\*.h File /r inst64\include\JAGS\* !insertmacro UNINSTALL.LOG_CLOSE_INSTALL SectionEnd !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${Sec64} "Files for 64-bit Windows" !insertmacro MUI_DESCRIPTION_TEXT ${SecHeader} "For developers who need to compile programs linked to JAGS" !insertmacro MUI_FUNCTION_DESCRIPTION_END Function .onInit !insertmacro MULTIUSER_INIT !insertmacro UNINSTALL.LOG_PREPARE_INSTALL FunctionEnd Function .onInstSuccess ;create/update log always within .onInstSuccess function !insertmacro UNINSTALL.LOG_UPDATE_INSTALL FunctionEnd Section "Uninstall" ;uninstall from path, must be repeated for every install logged path individually !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\include" !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\x64\bin" !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\x64\lib" !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\x64\modules" !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR\x64" !insertmacro UNINSTALL.LOG_UNINSTALL "$INSTDIR" !insertmacro UNINSTALL.LOG_END_UNINSTALL !insertmacro MUI_STARTMENU_GETFOLDER Application $SM_FOLDER Delete "$SMPROGRAMS\$SM_FOLDER\${JAGS_VISIBLE_NAME}.lnk" ;Delete empty start menu parent diretories StrCpy $SM_FOLDER "$SMPROGRAMS\$SM_FOLDER" startMenuDeleteLoop: ClearErrors RMDir $SM_FOLDER GetFullPathName $SM_FOLDER "$SM_FOLDER\.." IfErrors startMenuDeleteLoopDone StrCmp $SM_FOLDER $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop startMenuDeleteLoopDone: SetRegview 64 DeleteRegKey ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" DeleteRegKey ${INSTDIR_REG_ROOT} "${APP_REG_KEY}" DeleteRegKey /ifempty ${INSTDIR_REG_ROOT} "${PUB_REG_KEY}" SectionEnd # end of uninstall section Function un.onInit !insertmacro MULTIUSER_UNINIT !insertmacro UNINSTALL.LOG_BEGIN_UNINSTALL FunctionEnd #This is a function taken from the NSIS Wiki to replace one text string #with another. It doesn't work properly if there is more than one instance #of the replacement string on a line Function AdvReplaceInFile Exch $0 ;file to replace in Exch Exch $1 ;number to replace after Exch Exch 2 Exch $2 ;replace and onwards Exch 2 Exch 3 Exch $3 ;replace with Exch 3 Exch 4 Exch $4 ;to replace Exch 4 Push $5 ;minus count Push $6 ;universal Push $7 ;end string Push $8 ;left string Push $9 ;right string Push $R0 ;file1 Push $R1 ;file2 Push $R2 ;read Push $R3 ;universal Push $R4 ;count (onwards) Push $R5 ;count (after) Push $R6 ;temp file name GetTempFileName $R6 FileOpen $R1 $0 r ;file to search in FileOpen $R0 $R6 w ;temp file StrLen $R3 $4 StrCpy $R4 -1 StrCpy $R5 -1 loop_read: ClearErrors FileRead $R1 $R2 ;read line IfErrors exit StrCpy $5 0 StrCpy $7 $R2 loop_filter: IntOp $5 $5 - 1 StrCpy $6 $7 $R3 $5 ;search StrCmp $6 "" file_write2 StrCmp $6 $4 0 loop_filter StrCpy $8 $7 $5 ;left part IntOp $6 $5 + $R3 StrCpy $9 $7 "" $6 ;right part StrCpy $7 $8$3$9 ;re-join IntOp $R4 $R4 + 1 StrCmp $2 all file_write1 StrCmp $R4 $2 0 file_write2 IntOp $R4 $R4 - 1 IntOp $R5 $R5 + 1 StrCmp $1 all file_write1 StrCmp $R5 $1 0 file_write1 IntOp $R5 $R5 - 1 Goto file_write2 file_write1: FileWrite $R0 $7 ;write modified line Goto loop_read file_write2: FileWrite $R0 $R2 ;write unmodified line Goto loop_read exit: FileClose $R0 FileClose $R1 SetDetailsPrint none Delete $0 Rename $R6 $0 Delete $R6 SetDetailsPrint both Pop $R6 Pop $R5 Pop $R4 Pop $R3 Pop $R2 Pop $R1 Pop $R0 Pop $9 Pop $8 Pop $7 Pop $6 Pop $5 Pop $4 Pop $3 Pop $2 Pop $1 Pop $0 FunctionEnd ; Return on top of stack the total size of the selected (installed) sections, formated as DWORD ; Assumes no more than 256 sections are defined Var GetInstalledSize.total Function GetInstalledSize Push $0 Push $1 StrCpy $GetInstalledSize.total 0 ${ForEach} $1 0 256 + 1 ${if} ${SectionIsSelected} $1 SectionGetSize $1 $0 IntOp $GetInstalledSize.total $GetInstalledSize.total + $0 ${Endif} ; Error flag is set when an out-of-bound section is referenced ${if} ${errors} ${break} ${Endif} ${Next} ClearErrors Pop $1 Pop $0 IntFmt $GetInstalledSize.total "0x%08X" $GetInstalledSize.total Push $GetInstalledSize.total FunctionEnd JAGS-4.3.2/win/AdvUninstLog.nsh0000775000175000017500000002572714224052371013073 00000000000000 ;_____________________________ HEADER FILE BEGIN ____________________________ # Advanced Uninstall Log NSIS header # Version 1.0 2007-01-31 # By Red Wine (http://nsis.sf.net/User:Red_Wine) # Usage: See included examples Uninstall_Log_Default_UI.nsi - Uninstall_Log_Modern_UI.nsi !verbose push !verbose 3 !ifndef ADVANCED_UNINSTALL.LOG_NSH !define ADVANCED_UNINSTALL.LOG_NSH !ifndef INSTDIR_REG_ROOT | INSTDIR_REG_KEY !error "You must properly define both INSTDIR_REG_ROOT and INSTDIR_REG_KEY" !endif !ifndef UNINSTALL_LOG !define UNINSTALL_LOG "Uninstall" !endif !ifndef UNINST_LOG_VERBOSE !define UNINST_LOG_VERBOSE "3" !endif !verbose pop !echo "Advanced Uninstall Log NSIS header v1.0 2007-01-31 by Red Wine (http://nsis.sf.net/User:Red_Wine)" !verbose push !verbose ${UNINST_LOG_VERBOSE} !define UNINST_EXE "$INSTDIR\${UNINSTALL_LOG}.exe" !define UNINST_DAT "$INSTDIR\${UNINSTALL_LOG}.dat" !define UNLOG_PART "$PLUGINSDIR\part." !define UNLOG_TEMP "$PLUGINSDIR\unlog.tmp" !define EXCLU_LIST "$PLUGINSDIR\exclude.tmp" !define UNLOG_HEAD "=========== Uninstaller Log please do not edit this file ===========" var unlog_tmp_0 var unlog_tmp_1 var unlog_tmp_2 var unlog_tmp_3 var unlog_error !include FileFunc.nsh !include TextFunc.nsh !insertmacro Locate !insertmacro un.Locate !insertmacro DirState !insertmacro un.DirState !insertmacro FileJoin !insertmacro TrimNewLines !insertmacro un.TrimNewLines ;.............................. Uninstaller Macros .............................. !macro UNINSTALL.LOG_BEGIN_UNINSTALL !verbose push !verbose ${UNINST_LOG_VERBOSE} IfFileExists "${UNINST_DAT}" +3 MessageBox MB_ICONSTOP|MB_OK "${UNINST_DAT} not found, unable to perform uninstall." /SD IDOK Quit StrCmp "$PLUGINSDIR" "" 0 +2 InitPluginsDir CopyFiles "${UNINST_DAT}" "${UNLOG_TEMP}" FileOpen $unlog_tmp_2 "${UNLOG_TEMP}" r !verbose pop !macroend !macro UNINSTALL.LOG_END_UNINSTALL !verbose push !verbose ${UNINST_LOG_VERBOSE} FileClose $unlog_tmp_2 DeleteRegValue ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "${UNINSTALL_LOG}.dat" DeleteRegValue ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "${UNINSTALL_LOG}Directory" !verbose pop !macroend !macro UNINSTALL.LOG_UNINSTALL TargetDir !verbose push !verbose ${UNINST_LOG_VERBOSE} !ifndef INTERACTIVE_UNINSTALL & UNATTENDED_UNINSTALL !error "You must insert either Interactive or Unattended Uninstall neither both, neither none." !endif !ifdef INTERACTIVE_UNINSTALL GetTempFileName $unlog_tmp_5 "$PLUGINSDIR" FileOpen $unlog_tmp_4 "$unlog_tmp_5" a !endif ${PerfomUninstall} "${TargetDir}" "${UnLog_Uninstall_CallBackFunc}" !ifdef INTERACTIVE_UNINSTALL FileClose $unlog_tmp_4 !endif !verbose pop !macroend !define PerfomUninstall "!insertmacro PERFORMUNINSTALL" !macro PERFORMUNINSTALL TargetDir UninstCallBackFunc !verbose push !verbose ${UNINST_LOG_VERBOSE} !define ID ${__LINE__} ${un.Locate} "${TargetDir}" "/L=F" "${UninstCallBackFunc}" loop_${ID}: StrCpy $unlog_tmp_1 0 ${un.Locate} "${TargetDir}" "/L=DE" "${UninstCallBackFunc}" StrCmp $unlog_tmp_1 "0" 0 loop_${ID} ${un.DirState} "${TargetDir}" $unlog_tmp_0 StrCmp "$unlog_tmp_0" "0" 0 +2 RmDir "${TargetDir}" IfErrors 0 +2 MessageBox MB_ICONEXCLAMATION|MB_OK "${UNINSTALL_LOG} Log error" /SD IDOK !undef ID !verbose pop !macroend !macro INTERACTIVE_UNINSTALL !verbose push !verbose ${UNINST_LOG_VERBOSE} !ifdef INTERACTIVE_UNINSTALL !error "INTERACTIVE_UNINSTALL is already defined" !endif var unlog_tmp_4 var unlog_tmp_5 !define INTERACTIVE_UNINSTALL !ifdef INTERACTIVE_UNINSTALL & UNATTENDED_UNINSTALL !error "You must insert either Interactive or Unattended Uninstall neither both, neither none." !endif !ifdef UnLog_Uninstall_CallBackFunc !undef UnLog_Uninstall_CallBackFunc !endif !ifndef UnLog_Uninstall_CallBackFunc !insertmacro UNINSTALL.LOG_UNINSTALL_INTERACTIVE !define UnLog_Uninstall_CallBackFunc "un._LocateCallBack_Function_Interactive" !endif !verbose pop !macroend !macro UNATTENDED_UNINSTALL !verbose push !verbose ${UNINST_LOG_VERBOSE} !ifdef UNATTENDED_UNINSTALL !error "UNATTENDED_UNINSTALL is already defined" !endif !define UNATTENDED_UNINSTALL !ifdef INTERACTIVE_UNINSTALL & UNATTENDED_UNINSTALL !error "You must insert either Interactive or Unattended Uninstall neither both, neither none." !endif !ifdef UnLog_Uninstall_CallBackFunc !undef UnLog_Uninstall_CallBackFunc !endif !ifndef UnLog_Uninstall_CallBackFunc !insertmacro UNINSTALL.LOG_UNINSTALL_UNATTENDED !define UnLog_Uninstall_CallBackFunc "un._LocateCallBack_Function_Unattended" !endif !verbose pop !macroend !macro UNINSTALL.LOG_UNINSTALL_UNATTENDED Function un._LocateCallBack_Function_Unattended start: FileRead $unlog_tmp_2 "$unlog_tmp_3" ${NSIS_MAX_STRLEN} ${un.TrimNewLines} "$unlog_tmp_3" "$unlog_tmp_3" StrCmp "$unlog_tmp_3" "$R9" islog IfErrors nolog goto start islog: IfFileExists "$R9\*.*" isdir isfile: Delete "$R9" goto end isdir: RmDir "$R9" IntOp $unlog_tmp_1 $unlog_tmp_1 + 1 goto end nolog: ClearErrors StrCmp "$R9" "${UNINST_EXE}" isfile StrCmp "$R9" "${UNINST_DAT}" isfile end: FileSeek $unlog_tmp_2 0 SET Push $unlog_tmp_0 FunctionEnd !macroend !macro UNINSTALL.LOG_UNINSTALL_INTERACTIVE Function un._LocateCallBack_Function_Interactive start: FileRead $unlog_tmp_2 "$unlog_tmp_3" ${NSIS_MAX_STRLEN} ${un.TrimNewLines} "$unlog_tmp_3" "$unlog_tmp_3" StrCmp "$unlog_tmp_3" "$R9" islog IfErrors nolog goto start islog: IfFileExists "$R9\*.*" isdir isfile: Delete "$R9" goto end isdir: RmDir "$R9" IntOp $unlog_tmp_1 $unlog_tmp_1 + 1 goto end nolog: ClearErrors FileSeek $unlog_tmp_4 0 SET read: FileRead $unlog_tmp_4 "$unlog_tmp_3" ${un.TrimNewLines} "$unlog_tmp_3" "$unlog_tmp_3" StrCmp "$unlog_tmp_3" "$R9" end IfErrors +2 goto read ClearErrors StrCmp "$R9" "${UNINST_EXE}" isfile StrCmp "$R9" "${UNINST_DAT}" isfile IfFileExists "$R9\*.*" msgdir MessageBox MB_ICONQUESTION|MB_YESNO \ 'Delete File "$R9"?' /SD IDNO IDYES isfile IDNO nodel msgdir: MessageBox MB_ICONQUESTION|MB_YESNO \ 'Delete Directory "$R9"?' /SD IDNO IDYES isdir IDNO nodel nodel: FileSeek $unlog_tmp_4 0 END FileWrite $unlog_tmp_4 "$R9$\r$\n" end: FileSeek $unlog_tmp_2 0 SET Push $unlog_tmp_0 FunctionEnd !macroend ;................................. Installer Macros ................................. !macro UNINSTALL.LOG_INSTALL_UNATTENDED Function _LocateCallBack_Function_Install loop: FileRead $unlog_tmp_2 "$unlog_tmp_3" ${NSIS_MAX_STRLEN} ${TrimNewLines} "$unlog_tmp_3" "$unlog_tmp_3" IfErrors 0 +4 ClearErrors FileSeek $unlog_tmp_2 0 SET goto next StrCmp "$R9" "$unlog_tmp_3" end goto loop next: FileWrite $unlog_tmp_1 "$R9$\r$\n" end: Push $unlog_tmp_0 FunctionEnd !macroend !ifdef UnLog_Install_Func_CallBack !undef UnLog_Install_Func_CallBack !endif !ifndef UnLog_Install_Func_CallBack !insertmacro UNINSTALL.LOG_INSTALL_UNATTENDED !define UnLog_Install_Func_CallBack "_LocateCallBack_Function_Install" !endif !macro UNINSTALL.LOG_PREPARE_INSTALL !verbose push !verbose ${UNINST_LOG_VERBOSE} Push $0 Push $1 ClearErrors ReadRegStr "$0" ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "${UNINSTALL_LOG}Directory" IfErrors next ${DirState} "$0" $1 StrCmp "$1" "-1" next StrCmp "$1" "0" next IfFileExists "$0\${UNINSTALL_LOG}.dat" next MessageBox MB_ICONEXCLAMATION|MB_OK \ "Previous installation detected at $0.$\n\ Required file ${UNINSTALL_LOG}.dat is missing.$\n$\nIt is highly recommended \ to select an empty directory and perform a fresh installation." /SD IDOK StrCpy $unlog_error "error" next: ClearErrors StrCmp "$PLUGINSDIR" "" 0 +2 InitPluginsDir GetTempFileName "$1" FileOpen $0 "$1" w FileWrite $0 "${UNLOG_HEAD}$\r$\n" FileClose $0 Rename "$1" "${UNLOG_TEMP}" Pop $1 Pop $0 !verbose pop !macroend !macro UNINSTALL.LOG_UPDATE_INSTALL !verbose push !verbose ${UNINST_LOG_VERBOSE} Delete "${UNINST_DAT}" Rename "${UNLOG_TEMP}" "${UNINST_DAT}" WriteUninstaller "${UNINST_EXE}" WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "${UNINSTALL_LOG}.dat" "${UNINST_DAT}" WriteRegStr ${INSTDIR_REG_ROOT} "${INSTDIR_REG_KEY}" "${UNINSTALL_LOG}Directory" "$INSTDIR" !verbose pop !macroend !define uninstall.log_install "!insertmacro UNINSTALL.LOG_INSTALL" !macro UNINSTALL.LOG_INSTALL FileOpenWrite FileOpenRead TargetDir !verbose push !verbose ${UNINST_LOG_VERBOSE} FileOpen $unlog_tmp_1 "${FileOpenWrite}" w FileOpen $unlog_tmp_2 "${FileOpenRead}" r ${Locate} "${TargetDir}" "/L=FD" "${UnLog_Install_Func_CallBack}" StrCmp $unlog_error "error" 0 +2 ClearErrors IfErrors 0 +2 MessageBox MB_ICONEXCLAMATION|MB_OK "Error creating ${UNINSTALL_LOG} Log." /SD IDOK FileClose $unlog_tmp_1 FileClose $unlog_tmp_2 !verbose pop !macroend !define uninstall.log_mergeID "!insertmacro UNINSTALL.LOG_MERGE" !macro UNINSTALL.LOG_MERGE UnlogPart !verbose push !verbose ${UNINST_LOG_VERBOSE} ${FileJoin} "${UNLOG_TEMP}" "${UnlogPart}" "${UNLOG_TEMP}" !verbose pop !macroend !macro UNINSTALL.LOG_OPEN_INSTALL !verbose push !verbose ${UNINST_LOG_VERBOSE} StrCmp $unlog_error "error" +2 ${uninstall.log_install} "${EXCLU_LIST}" "${UNINST_DAT}" "$OUTDIR" !verbose pop !macroend !macro UNINSTALL.LOG_CLOSE_INSTALL !verbose push !verbose ${UNINST_LOG_VERBOSE} !define ID ${__LINE__} ${uninstall.log_install} "${UNLOG_PART}${ID}" "${EXCLU_LIST}" "$OUTDIR" ${uninstall.log_mergeID} "${UNLOG_PART}${ID}" !undef ID ${__LINE__} !verbose pop !macroend !endif !verbose pop ;_____________________________ HEADER FILE END ____________________________ JAGS-4.3.2/win/README.WIN0000664000175000017500000000111714224052371011300 00000000000000JAGS uses the nullsoft scriptable installer (http://nsis.sourceforge.net) to create a binary package for Windows. The File jags.nsi is an NSIS script file for building the installer (and uninstaller). This script uses the header AdvUninstLog.nsh which is not distributed with NSIS itself. Therefore, a copy is included in the JAGS distribution. We also use a patched version of the standard MultiUser.nsh header file (MultiUser64.nsh) so that JAGS installs into "Program Files" and not "Program Files (x86)" See the JAGS installation manual for full details on compiling JAGS for Windows. JAGS-4.3.2/win/runtime64/0000755000175000017500000000000014400711327011676 500000000000000JAGS-4.3.2/win/runtime64/Makefile.am0000664000175000017500000000003614224052371013654 00000000000000EXTRA_DIST = README.RUNTIME64 JAGS-4.3.2/win/runtime64/Makefile.in0000644000175000017500000003173214400675236013701 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = win/runtime64 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = README.RUNTIME64 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu win/runtime64/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu win/runtime64/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/win/runtime64/README.RUNTIME640000664000175000017500000000042314224053155013775 00000000000000If you wish to distribute runtime libraries with the JAGS installer, put the DLLs (*.dll) and, if required, the import libraries (*.dll.a) in this subdirectory of the build tree. They will be detected and included in the installation. This directory is for 64-bit files. JAGS-4.3.2/doc/0000755000175000017500000000000014400711327010011 500000000000000JAGS-4.3.2/doc/Makefile.am0000664000175000017500000000011314224052371011763 00000000000000SUBDIRS = manual dist_man_MANS = jags.1 docs: (cd manual && $(MAKE) $@) JAGS-4.3.2/doc/jags.10000664000175000017500000000165114224052371010745 00000000000000.\" Man page contributed by Dirk Eddelbuettel and GPL'ed .TH JAGS 1 "June 2010" "IARC" .SH NAME jags - just another gibbs sampler .SH SYNOPSIS .BR jags\ [options]\ [scriptfile] .SH DESCRIPTION .PP \fIjags\fP is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) simulation not wholly unlike BUGS. If given a scriptfile argument, jags will be started in batch mode. Otherwise it will be started in interactive mode. .SH OPTIONS \fIjags\fP accepts the following options: .TP \fB\-d\fR, \fB\-\-debugger\fR=\fINAME\fR Run jags through debugger NAME .TP \fB\-\-debugger\-args\fR=\fIARGS\fR Pass ARGS as arguments to the debugger .RE .SH SEE ALSO .IR http://mcmc-jags.sourceforge.net .SH AUTHORS Martyn Plummer This manual page was contributed by Dirk Eddelbuettel for the Debian GNU/Linux distribution but may be used by others. JAGS-4.3.2/doc/Makefile.in0000644000175000017500000005442214400675235012014 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(dist_man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = manual dist_man_MANS = jags.1 all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(dist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 .PRECIOUS: Makefile docs: (cd manual && $(MAKE) $@) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/doc/manual/0000755000175000017500000000000014400711327011266 500000000000000JAGS-4.3.2/doc/manual/Makefile.am0000664000175000017500000000205314224052514013244 00000000000000EXTRA_DIST = jags_user_manual.tex jags_user_manual.bib \ jags_installation_manual.tex jags_developer_manual.tex docs: jags_user_manual.pdf jags_installation_manual.pdf jags_developer_manual.pdf jags_user_manual.pdf: jags_user_manual.bbl jags_user_manual.tex TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_user_manual.tex jags_user_manual.bbl: jags_user_manual.bib TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_user_manual.tex BIBINPUTS="$(srcdir):$$BIBINPUTS" bibtex jags_user_manual TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_user_manual.tex jags_developer_manual.pdf: jags_developer_manual.tex TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_developer_manual.tex TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_developer_manual.tex jags_installation_manual.pdf: jags_installation_manual.tex TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_installation_manual.tex TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_installation_manual.tex clean: rm -f jags_*_manual.{log,aux,dvi,bbl,blg,toc} distclean: clean rm -f jags_*_manual.pdf Makefile JAGS-4.3.2/doc/manual/Makefile.in0000644000175000017500000003364214400675235013272 00000000000000# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/manual ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/R.m4 \ $(top_srcdir)/m4/ax_lapack.m4 $(top_srcdir)/m4/axx_blas.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltargz.m4 \ $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BLAS_LIBS = @BLAS_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CPPUNIT_CFLAGS = @CPPUNIT_CFLAGS@ CPPUNIT_LIBS = @CPPUNIT_LIBS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ FGREP = @FGREP@ FILECMD = @FILECMD@ FLIBS = @FLIBS@ GREP = @GREP@ INCLTDL = @INCLTDL@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JAGS_MAJOR = @JAGS_MAJOR@ JAGS_MINOR = @JAGS_MINOR@ LAPACK_LIBS = @LAPACK_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBADD_DL = @LIBADD_DL@ LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ LIBADD_DLOPEN = @LIBADD_DLOPEN@ LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLDEPS = @LTDLDEPS@ LTDLINCL = @LTDLINCL@ LTDLOPEN = @LTDLOPEN@ LTLIBOBJS = @LTLIBOBJS@ LT_ARGZ_H = @LT_ARGZ_H@ LT_CONFIG_H = @LT_CONFIG_H@ LT_DLLOADERS = @LT_DLLOADERS@ LT_DLPREOPEN = @LT_DLPREOPEN@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ jagsmoddir = @jagsmoddir@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ ltdl_LIBOBJS = @ltdl_LIBOBJS@ ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sys_symbol_underscore = @sys_symbol_underscore@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = jags_user_manual.tex jags_user_manual.bib \ jags_installation_manual.tex jags_developer_manual.tex all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/manual/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/manual/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am .PRECIOUS: Makefile docs: jags_user_manual.pdf jags_installation_manual.pdf jags_developer_manual.pdf jags_user_manual.pdf: jags_user_manual.bbl jags_user_manual.tex TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_user_manual.tex jags_user_manual.bbl: jags_user_manual.bib TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_user_manual.tex BIBINPUTS="$(srcdir):$$BIBINPUTS" bibtex jags_user_manual TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_user_manual.tex jags_developer_manual.pdf: jags_developer_manual.tex TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_developer_manual.tex TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_developer_manual.tex jags_installation_manual.pdf: jags_installation_manual.tex TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_installation_manual.tex TEXINPUTS="$(srcdir):$$TEXINPUTS" pdflatex jags_installation_manual.tex clean: rm -f jags_*_manual.{log,aux,dvi,bbl,blg,toc} distclean: clean rm -f jags_*_manual.pdf Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: JAGS-4.3.2/doc/manual/jags_user_manual.tex0000664000175000017500000041656314224052514015270 00000000000000\documentclass[11pt, a4paper, titlepage]{report} \usepackage{amsmath} \usepackage{natbib} \usepackage{a4wide} \usepackage{url} \usepackage{multirow} \usepackage{amsfonts} \usepackage{graphicx} \newcommand{\release}{4.3.0} \newcommand{\JAGS}{\textsf{JAGS}} \newcommand{\rjags}{\textsf{rjags}} \newcommand{\BUGS}{\textsf{BUGS}} \newcommand{\OpenBUGS}{\textsf{OpenBUGS}} \newcommand{\R}{\textsf{R}} \newcommand{\CODA}{\textsf{coda}} \begin{document} \title{JAGS Version \release\ user manual} \author{Martyn Plummer} \date{28 June 2017} \maketitle \tableofcontents \chapter{Introduction} \JAGS\ is ``Just Another Gibbs Sampler''. It is a program for the analysis of Bayesian models using Markov Chain Monte Carlo (MCMC) which is not wholly unlike \OpenBUGS\ (\url{http://www.openbugs.info}). \JAGS\ is written in C++ and is portable to all major operating systems. %Cite the bugs book \JAGS\ is designed to work closely with the \R\ language and environment for statistical computation and graphics (\url{http://www.r-project.org}). You will find it useful to install the \CODA\ package for \R\ to analyze the output. Several \R\ packages are available to run a \JAGS\ model. See chapter~\ref{chapter:R}. \JAGS\ is licensed under the GNU General Public License version 2. You may freely modify and redistribute it under certain conditions (see the file \texttt{COPYING} for details). \section{Downloading \JAGS} \JAGS\ is hosted on Sourceforge at \url{https://sourceforge.net/projects/mcmc-jags/}. Binary distributions of \JAGS\ for Windows and macOS can be downloaded directly from there. Binaries for various Linux distributions are also available, but not directly from Sourceforge. See \url{http://mcmc-jags.sourceforge.net} for details. You can also download the source tarball from Sourceforge. Details on installing \JAGS\ from source are given in a separate \JAGS\ Installation manual. \section{Getting help} \label{section:help} The best way to get help on \JAGS\ is to use the discussion forums hosted on Sourceforge at \url{https://sourceforge.net/p/mcmc-jags/discussion/}. You will need to create a Sourceforge account in order to post. Bug reports can be sent to \url{martyn_plummer@users.sourceforge.net}. Occasionally, \JAGS\ will stop with an error instructing you to send a message to this address. I am particularly interested in the following issues: \begin{itemize} \item Crashes, including both segmentation faults and uncaught exceptions. \item Incomprehensible error messages \item Models that should compile, but don't \item Output that cannot be validated against other software such as \OpenBUGS \item Documentation erors \end{itemize} If you submit a bug report, it must be reproducible. Please send the model file, the data file, the initial value file and a script file that will reproduce the problem. Describe what you think should happen, and what did happen. \section{Acknowledgements} Many thanks to the \BUGS\ development team, without whom \JAGS\ would not exist. Thanks also to Simon Frost for pioneering \JAGS\ on Windows and Bill Northcott for getting \JAGS\ on Mac OS X to work. Kostas Oikonomou found many bugs while getting \JAGS\ to work on Solaris using Sun development tools and libraries. Bettina Gruen, Chris Jackson, Greg Ridgeway and Geoff Evans also provided useful feedback. Special thanks to Jean-Baptiste Denis who has been very diligent in providing feedback on JAGS. Matt Denwood is a co-developer of \JAGS\ with full access to the Sourceforge repository. \chapter{The BUGS language} \label{chapter:bugslang} A \JAGS\ model is defined in a text file using a dialect of the \BUGS\ language \citep{LunnEtal2012}. The model definition consists of a series of {\em relations} inside a block delimited by curly brackets \verb+{+ and \verb+}+ and preceded by the keyword \verb+model+. Here is a simple linear regression example: \begin{verbatim} model { for (i in 1:N) { Y[i] ~ dnorm(mu[i], tau) mu[i] <- alpha + beta * (x[i] - x.bar) } x.bar <- mean(x) alpha ~ dnorm(0.0, 1.0E-4) beta ~ dnorm(0.0, 1.0E-4) sigma <- 1.0/sqrt(tau) tau ~ dgamma(1.0E-3, 1.0E-3) } \end{verbatim} %Something about verbosity \section{Relations} Each relation defines a node in the model. The node on the left of a relation is defined in terms of other nodes -- referred to as parent nodes -- that appear on the right hand side. Taken together, the nodes in the model form a directed acyclic graph (with the parent/child relationships represented as directed edges). The very top-level nodes in the graph, with no parents, are constant nodes, which are defined either in the model definition ({\em e.g.} \verb+1.0E-3+), or in the data when the model is compiled ({\em e.g.} \verb+x[1]+). Relations can be of two types. A {\em stochastic relation} (\verb+~+) defines a stochastic node, representing a random variable in the model. A {\em deterministic relation} (\verb+<-+) defines a deterministic node, the value of which is determined exactly by the values of its parents. The equals sign (\verb+=+) can be used for a deterministic relation in place of the left arrow (\verb+<-+). \section{Arrays and subsetting} Nodes defined by a relation are embedded in named arrays. Arrays can be vectors (one-dimensional), or matrices (two-dimensional), or they may have more than two dimensions. Array names may contain letters, numbers, decimal points and underscores, but they must start with a letter. In the code example above, the node array \verb+mu+ is a vector of length $N$ containing $N$ nodes (\verb+mu[1]+, $\ldots$, \verb+mu[N]+). The node array \verb+alpha+ is a scalar. \JAGS\ follows the S language convention that scalars are considered as vectors of length 1. Hence the array \verb+alpha+ contains a single node \verb+alpha[1]+. \subsection{Subsetting vectors} Subsets of node arrays may be obtained with expressions of the form \verb+alpha[e]+ where \verb+e+ is any expression that evaluates to an integer vector. Typically expressions of the form \verb+L:U+ are used, where $L$ and $U$ are integer arguments to the operator ``\texttt{:}''. This creates an integer vector of length $U - L + 1$ with elements $L, L+1, \ldots U-1, U$.\footnote{If $L > U$ then the operator $:$ returns a vector of length zero, which may not be used to take array subsets} Both the arguments $L$ and $U$ must be fixed because JAGS does not allow the length of a node to change from one iteration to the next. \subsection{Subsetting matrices} For a two-dimensional array \verb+B+, the element in row $r$ and column $c$ is accessed as \verb+B[r,c]+. Complex subsets may be obtained with expressions of the form \verb+B[rows, cols]+ where \verb+rows+ is an integer vector of row indices and \verb+cols+ is an integer vector of column indices. An index expression in any dimension may be omitted, and this implies taking the whole range of possible indices. So if \verb+B+ is an $M \times N$ matrix then \verb+B[r,]+ is the whole of row $r$, and is equivalent to \verb+B[r,1:N]+. Likewise \verb+B[,c]+ is the whole of column $c$ and is equivalent to \verb+B[1:M,c]+. Finally, \verb+B[,]+ is the whole matrix, equivalent to \verb+B[1:M,1:N]+. In this case, one may also simply write \verb+B+ without any square brackets. Note that writing \verb+B[]+ for a 2-dimensional array will result in a compilation error: the number of indices separated by commas within the square brackets must match the dimensions of the array. \subsection{Restrictions on index expressions} There are some restrictions on index expressions that are allowed on the left hand side of a relation. Firstly, they must be fixed, meaning that they must be expressed in terms of data, or constants defined in the model, or the index of an enclosing for loop (see below). As a counter-example, the following code snippet is illegal: \begin{verbatim} i ~ dcat(p) x[i] ~ dnorm(0, 1) \end{verbatim} unless $i$ is observed and is supplied with the data. This restriction ensures that the node \verb+x[i]+ can be unambiguously referred to elsewhere in the model -- e.g. as a function argument or the parameter for a distribution -- and does not change from one iteration to another. Secondly, for vector-valued subsets, the same index must not be repeated. For example, supposed $\mu$ is a 2-vector and $T$ is a $2 \times 2$ matrix. Then \verb+dmnorm(mu, T)+ defines a bivariate normal random variable. However, this code snippet is illegal: \begin{verbatim} indices <- c(1,1) x[indices] ~ dmnorm(mu, T) \end{verbatim} as it implies writing two different values to the same element \verb+x[1]+. \section{Constructing vectors} Vectors can be constructed using the combine function \texttt{c} from the \textsf{bugs} module, {\em e.g.} \begin{verbatim} y <- c(x1, x2, x3) \end{verbatim} creates a new vector $y$ combining the elements of $x1$, $x2$, and $x3$. The combine function can be used with a single array argument \begin{verbatim} v <- c(a) \end{verbatim} In this case the return value $v$ is a vector with the values of the input array $a$ in column-major order (i.e. with the left hand index moving fastest). For example if $a$ is a $2 \times 2$ matrix then this is equivalent to \begin{verbatim} v <- c(a[1,1], a[2,1], a[1,2], a[2,2]) \end{verbatim} \section{For loops} \label{section:forloops} For loops are used in the the \BUGS\ language to simplify writing repeated expressions. A for loop takes the form: \begin{verbatim} for (i in exp) { } \end{verbatim} where \texttt{exp} is any expression that evaluates to an integer vector. The contents of the for loop inside the curly braces will then be expanded with the index \texttt{i} taking each value in the vector \texttt{exp}. For example \begin{verbatim} for (i in 1:3) { Y[i] ~ dnorm(mu, tau) } \end{verbatim} is equivalent to \begin{verbatim} Y[1] ~ dnorm(mu, tau) Y[2] ~ dnorm(mu, tau) Y[3] ~ dnorm(mu, tau) \end{verbatim} As in the above example, for loops generally use the sequence operator \verb+:+ to generate an increasing sequence of integers. This operator has high precedence, so is important to use brackets to ensure that the expression is interpreted correctly. For example, to get a for loop from $1$ to $m+1$ the correct expression is \begin{verbatim} for (i in 1:(m+1)) { } \end{verbatim} Omitting the brackets as in the following expression: \begin{verbatim} for (i in 1:m+1) { } \end{verbatim} gives a for loop from $2$ to $m+1$. The sequence operator \verb+:+ can only produce increasing sequences. If $n < m$ then \verb+m:n+ produces a vector of length zero and when this is used in a for loop index expression the contents of loop inside the curly brackets are skipped. Note that this behaviour is different from the sequence operator in R, where \verb+m:n+ will produce a {\em decreasing} sequence if $n < m$. \section{Data transformations} \label{section:data:tranformations} Sometimes it is useful to transform the data before analysing them. For example, a transformation of outcomes may be necessary to reduce skewness and allow the outcome to be represented by a normal or other symmetric distribution. You can transform the data supplied to \JAGS\ in a separate block of relations preceded by the keyword \texttt{data}. Here for example, the input data \texttt{y} is transformed via a square-root transformation to \texttt{z}, which is then used as an outcome variable in the model block: \begin{verbatim} data { for (i in 1:N) { z[i] <- sqrt(y[i]) } } model { for (i in 1:N) { z[i] ~ dnorm(mu, tau) } ... } \end{verbatim} In effect, the data block defines a distinct model, which describes how the data are generated. Each node in this model is forward-sampled once, and then the node values are read back into the data table. \subsection{Modelling simulated data} The data block is not limited to logical relations, but may also include stochastic relations. You may therefore use it in simulations, generating data from a stochastic model that is different from the one used to analyse the data in the \texttt{model} statement. This example shows a simple location-scale problem in which the ``true'' values of the parameters \texttt{mu} and \texttt{tau} are generated from a given prior in the \texttt{data} block, and the generated data is analyzed in the \texttt{model} block. \begin{verbatim} data { for (i in 1:N) { y[i] ~ dnorm(mu.true, tau.true) } mu.true ~ dnorm(0,1); tau.true ~ dgamma(1,3); } model { for (i in 1:N) { y[i] ~ dnorm(mu, tau) } mu ~ dnorm(0, 1.0E-3) tau ~ dgamma(1.0E-3, 1.0E-3) } \end{verbatim} Beware, however, that every node in the \texttt{data} statement will be considered as data in the subsequent \texttt{model} statement. This example, although superficially similar, has a quite different interpretation. \begin{verbatim} data { for (i in 1:N) { y[i] ~ dnorm(mu, tau) } mu ~ dnorm(0,1); tau ~ dgamma(1,3); } model { for (i in 1:N) { y[i] ~ dnorm(mu, tau) } mu ~ dnorm(0, 1.0E-3) tau ~ dgamma(1.0E-3, 1.0E-3) } \end{verbatim} Since the names \texttt{mu} and \texttt{tau} are used in both \texttt{data} and \texttt{model} blocks, these nodes will be considered as {\em observed} in the model and their values will be fixed at those values generated in the \texttt{data} block. \section{Node Array dimensions} \subsection{Array declarations} \JAGS\ allows the option of declaring the dimensions of node arrays in the model file. The declarations consist of the keyword \texttt{var} (for variable) followed by a comma-separated list of array names, with their dimensions in square brackets. The dimensions may be given in terms of any expression of the data that returns a single integer value. In the linear regression example, the model block could be preceded by \begin{verbatim} var x[N], Y[N], mu[N], alpha, beta, tau, sigma, x.bar; \end{verbatim} \subsection{Undeclared nodes} If a node array is not declared then JAGS has three methods of determining its size. \begin{enumerate} \item {\bf Using the data.} The dimension of an undeclared node array may be inferred if it is supplied in the data file. \item {\bf Using the left hand side of the relations.} The maximal index values on the left hand side of a relation are taken to be the dimensions of the node array. For example, in this case: \begin{verbatim} for (i in 1:N) { for (j in 1:M) { Y[i,j] ~ dnorm(mu[i,j], tau) } } \end{verbatim} $Y$ would be inferred to be an $N \times M$ matrix. This method cannot be used when there are empty indices ({\em e.g.} \verb+Y[i,]+) on the left hand side of the relation. \item {\bf Using the dimensions of the parents} If a whole node array appears on the left hand side of a relation, then its dimensions can be inferred from the dimensions of the nodes on the right hand side. For example, if \verb+A+ is known to be an $N \times N$ matrix and \begin{verbatim} B <- inverse(A) \end{verbatim} Then \verb+B+ is also an $N \times N$ matrix. \end{enumerate} \subsection{Querying array dimensions} The \JAGS\ compiler has two built-in functions for querying array sizes. The \verb+length()+ function returns the number of elements in a node array, and the \verb+dim()+ function returns a vector containing the dimensions of an array. These two functions may be used to simplify the data preparation. For example, if \verb+Y+ represents a vector of observed values, then using the \verb+length()+ function in a for loop: \begin{verbatim} for (i in 1:length(Y)) { Y[i] ~ dnorm(mu[i], tau) } \end{verbatim} avoids the need to put a separate data value \verb+N+ in the file representing the length of \verb+Y+. For multi-dimensional arrays, the \verb+dim+ function serves a similar purpose. The \verb+dim+ function returns a vector, which must be stored in an array before its elements can be accessed. For this reason, calls to the \verb+dim+ function must always be in a data block (see section \ref{section:data:tranformations}). \begin{verbatim} data { D <- dim(Z) } model { for (i in 1:D[1]) { for (j in 1:D[2]) { Z[i,j] <- dnorm(alpha[i] + beta[j], tau) } } ... } \end{verbatim} Clearly, the \verb+length()+ and \verb+dim()+ functions can only work if the size of the node array can be inferred, using one of the three methods outlined above. Note: the \verb+length()+ and \verb+dim()+ functions are different from all other functions in \JAGS: they do not act on nodes, but only on node {\em arrays}. As a consequence, an expression such as \verb+dim(a %*% b)+ is syntactically incorrect. \chapter{Steps in running a model} \label{chapter:running} \JAGS\ is designed for inference on Bayesian models using Markov Chain Monte Carlo (MCMC) simulation. Running a model refers to generating samples from the posterior distribution of the model parameters. This takes place in five steps: \begin{enumerate} \item Definition of the model \item Compilation \item Initialization \item Adaptation and burn-in \item Monitoring \end{enumerate} The next stages of analysis are done outside of \JAGS: convergence diagnostics, model criticism, and summarizing the samples must be done using other packages more suited to this task. There are several \R\ packages designed for running a \JAGS\ model and analyzing the output. See chapter~\ref{chapter:R} for details. \section{Modules} \label{section:modules} The \JAGS\ library is distributed along with dynamically loadable modules that extend its functionality. A module can define new objects of the following classes: \begin{enumerate} \item {\bf Functions} and {\bf distributions}, the basic building blocks of the BUGS language. \item {\bf Samplers}, the objects which update the parameters of the model at each iteration, and {\bf sampler factories}, the objects that create new samplers for specific model structures. \item {\bf Monitors}, the objects that record sampled values for later analysis, and {\bf monitor factories} that create them. \item {\bf Random number generators}, the objects that drive the MCMC algorithm and {\bf RNG factories} that create them. \end{enumerate} The \texttt{base} module and the \texttt{bugs} module are loaded automatically at start time. Others may be loaded by the user. It is important to load the modules you need {\rm before} running the model. The two most useful optional modules are the \texttt{glm} module (chapter~\ref{chapter:glm}), which provides efficient samplers for generalized linear mixed modules, and the \texttt{dic} module (chapter~\ref{chapter:dic}), which provides novel monitors for assessing model fit using deviance statistics. \section{Compilation} When a \JAGS\ model is compiled, the model description is combined with the data to create a {\em virtual graphical model}, which is a representation of the model as a directed acyclic graph (DAG) in computer memory.%compilation vs interpretation One of the interesting features of the \BUGS\ language is that it does not clearly distinguish between data and parameters. A stochastic node -- {\em i.e.} a node defined on the left hand side of a stochastic relation -- may be either observed (data) or unobserved (parameter). The distinction is made only when the model is compiled and depends entirely on whether a data value was supplied or not. Data may also be supplied for {\em constant nodes}. These are nodes that are used on the right hand side of a relation (or in the index expression of a for loop) but are never defined on the left hand side. In fact you must supply data for these nodes or the \JAGS\ compiler will stop with an error message. Data may not be supplied for deterministic nodes -- {\em i.e.} those defined on the left hand side of a deterministic relation. These nodes always calculate their value according to the current value of the parents. Recall the simple linear regression model from chapter~\ref{chapter:bugslang}. \begin{verbatim} model { for (i in 1:N) { Y[i] ~ dnorm(mu[i], tau) mu[i] <- alpha + beta * (x[i] - x.bar) } x.bar <- mean(x) alpha ~ dnorm(0.0, 1.0E-4) beta ~ dnorm(0.0, 1.0E-4) sigma <- 1.0/sqrt(tau) tau ~ dgamma(1.0E-3, 1.0E-3) } \end{verbatim} This model may be compiled by combining with data values for \texttt{x}, \texttt{Y} and \texttt{N}. Exactly how the data are supplied depends on which interface is being used. With any of the \R\ interfaces to \JAGS, the user can create a list of values to be supplied as data, e.g. \begin{verbatim} line_data <- list("x" = c(1, 2, 3, 4, 5), "Y" = c(1, 3, 3, 3, 5), "N" = 5) \end{verbatim} and then supply this list as the \texttt{data} argument to any of the modelling functions (NB the above is \R\ code, not \BUGS\ code). This is explored in more detail in chapter~\ref{chapter:R}. With the command line interface, the data are supplied in a separate file with values written in the \texttt{dump()} format of the \R\ language, e.g. \begin{verbatim} #contents of file line-data.R "x" <- c(1, 2, 3, 4, 5) "Y" <- c(1, 3, 3, 3, 5) "N" <- 5 \end{verbatim} See section~\ref{section:cmdline:data} for more details. In our simple linear regression model, data values must always be supplied for \texttt{N}, since it is used to index the for loop. Data must also be supplied for \texttt{x} since it is used on the right hand side of the relation defining \texttt{mu} but never defined on the left hand side of a relation. %One way to think about the minimal data for a model is that it %\JAGS\ be able to sample values from the prior distribution. In this example, data values are also supplied for the outcome variables \verb+Y[1]+ to \verb+Y[5]+. The parameters of the model are the three stochastic nodes for which no data are supplied: \texttt{alpha}, \texttt{beta} and \texttt{tau}. \JAGS\ will generate samples from the posterior distribution of these parameters given \texttt{Y}. As can be seen from the example above, data values are supplied for whole node arrays If a node array contains both observed and unobserved nodes, then the data should contain missing values (\texttt{NA}) for the unobserved elements. Suppose that if \verb+Y[2]+ and \verb+Y[5]+ were unobserved, then the data supplied for the node array \texttt{Y} would be. \begin{verbatim} Y = c(1, NA, 3, 3, NA) \end{verbatim} Then \verb+Y[2]+ and \verb+Y[5]+ are parameters and \JAGS\ will generate samples from their posterior predictive distributions, given the observed \texttt{Y} values. Multivariate nodes cannot be partially observed, so if a node takes up two or more elements of a node array, then the corresponding data values must be all present or all missing. \subsection{Compilation failures} Compilation may fail for a number of reasons. The three most common are: \begin{enumerate} \item The model uses a function or distribution that has not been defined in any of the loaded modules. %crossref \item The graph contains a directed cycle. These are forbidden in \JAGS. \item A node is used in an expression but never defined by a relation or supplied with the data. \end{enumerate} %Causes \subsection{Parallel chains} The number of parallel chains to be run by \JAGS\ is also defined at compilation time. Each parallel chain should produce an independent sequence of samples from the posterior distribution. \section{Initialization} Before a model can be run, it must be initialized. There are three steps in the initialization of a model: \begin{enumerate} \item The initial values of the model parameters are set. \item A Random Number Generator (RNG) is chosen for each parallel chain, and its seed is set. \item The Samplers are chosen for each parameter in the model. \end{enumerate} \subsection{Initial values} The user may supply initial value files -- one for each chain -- containing initial values for the model parameters. Initial values may not be supplied for logical or constant nodes. The format for initial values is the same as the one used for data (i.e. a list using the R interface or a separate file when using the command line interface). As with the data, initial values are supplied for whole node arrays and may include missing values for elements of the array that are not to be initialized. This need typically arises with contrast parameters. Suppose $X$ is a categorical covariate, taking values from 1 to 4, which is used as a predictor variable in a linear model: \begin{verbatim} for (i in 1:N) { Y[i] ~ alpha + beta[x[i]] } # Prior distribution alpha ~ dnorm(0, 1.0E-3) beta[1] <- 0 for(i in 2:4) { beta[i] ~ dnorm(0, 1.0E-3) } \end{verbatim} There is one parameter for each level of x ($\beta_1 \ldots \beta_4$), but the first parameter $\beta_1$ is set to zero for identifiability. The remaining parameters $\beta_2 \ldots \beta_4$ represent contrasts with respect to the first level of $X$. A suitable set of initial values (for a single chain) would be \begin{verbatim} list(alpha = 0, beta = c(NA, 1.03, -2.03, 0.52)) \end{verbatim} This allows parameter values to be supplied for the stochastic elements of \verb+beta+ but not the constant first element. If initial values are not supplied by the user, then each parameter chooses its own initial value based on the values of its parents. The initial value is chosen to be a ``typical value'' from the prior distribution. The exact meaning of ``typical value'' depends on the distribution of the stochastic node, but is usually the mean, median, or mode. If you rely on automatic initial value generation and are running multiple parallel chains, then the initial values will be the same in all chains.\footnote{This is undesirable behaviour and it will be changed in a future release of \JAGS.} You are advised to set the starting values manually. \subsection{Random Number Generators} \label{section:rngs} Each chain in \JAGS\ has its own random number generator (RNG). RNGs are more correctly referred to as {\em pseudo}-random number generators. They generate a sequence of numbers that merely looks random but is, in fact, entirely determined by the initial state. You may optionally set the name of the RNG and its initial state with the initial values for the parameters. There are four RNGs supplied by the \texttt{base} module in \JAGS\ with the following names: \begin{verbatim} "base::Wichmann-Hill" "base::Marsaglia-Multicarry" "base::Super-Duper" "base::Mersenne-Twister" \end{verbatim} There are two ways to set the starting state of the RNG. The simplest is to supply the name of the RNG and its seed (a single integer value) with the initial values, {\em e.g.} using the \R\ interface to \JAGS: \begin{verbatim} list(".RNG.name" = "base::Wichmann-Hill", ".RNG.seed" = 314159, ...) \end{verbatim} Here we use \texttt{...} to denote that the same list includes initial values for the parameters (not shown). It is also possible to save the state of the RNG from one JAGS session and use this as the initial state of a new chain. The state of any RNG in JAGS can be saved and loaded as an integer vector with the name \texttt{.RNG.state}. For example, \begin{verbatim} list(".RNG.name" = "base::Marsaglia-Multicarry", ".RNG.state" = as.integer(c(20899,10892,29018)), ...) \end{verbatim} is a valid state for the Marsaglia-Multicarry generator. You cannot supply an arbitrary integer vector to \texttt{.RNG.state}. Both the length of the vector and the permitted values of its elements are determined by the class of the RNG. The only safe way to use \texttt{.RNG.state} is to re-use a previously saved state. If no RNG names are supplied, then RNGs will be chosen automatically so that each chain has its own independent random number stream. The exact behaviour depends on which modules are loaded. The \texttt{base} module uses the four generators listed above for the first four chains, then recycles them with different seeds for the next four chains, and so on. By default, \JAGS\ bases the initial state on the time stamp. This means that, when a model is re-run, it generates an independent set of samples. If you want your model run to be reproducible, you must explicitly set the \texttt{.RNG.seed} for each chain. \subsection{Samplers} A Sampler is an object that acts on a set of parameters and updates them from one iteration to the next. During initialization of the model, samplers are chosen automatically for all parameters. \JAGS\ holds a list of {\em sampler factory} objects, which inspect the graph, recognize sets of parameters that can be updated with specific methods, and generate sampler objects for them. The list of sampler factories is traversed in order, starting with sampling methods that are efficient, but limited to certain specific model structures and ending with the most generic, possibly inefficient, methods. If no suitable sampler can be generated for one of the model parameters, an error message is generated. The user has no direct control over the process of choosing samplers. However, you may indirectly control the process by loading a module that defines a new sampler factory. The module will insert the new sampler sactory at the beginning of the list, where it will be queried before all of the other sampler factories. You can also optionally turn on and off sampler factories. %crossref \section{Adaptation and burn-in} In theory, output from an MCMC sampler converges to the target distribution ({\em i.e.} the posterior distribution of the model parameters) in the limit as the number of iterations tends to infinity. In practice, all MCMC runs are finite. By convention, the MCMC output is divided into two parts: an initial ``burn-in'' period, which is discarded, and the remainder of the run, in which the output is considered to have converged (sufficiently close) to the target distribution. Samples from the second part are used to create approximate summary statistics for the target distribution. By default, \JAGS\ keeps only the current value of each node in the model, unless a monitor has been defined for that node. The burn-in period of a \JAGS\ run is therefore the interval between model initialization and the creation of the first monitor. When a model is initialized, it may be in {\em adaptive mode}, meaning that the Samplers used by the model may modify their behaviour for increased efficiency. Since this adaptation may depend on the entire sample history, the sequence generated by an adapting sampler is no longer a Markov chain, and is not guaranteed to converge to the target distribution. Therefore, adaptive mode must be turned off at some point during burn-in, and a sufficient number of iterations must take place {\em after} the adaptive phase to ensure successful burnin. All samplers have a built in test to determine whether they have converged to their optimal sampling behaviour. If any sampler fails this validation test, a warning will be printed. To ensure optimal sampling behaviour, the model should be run again from scratch using a longer adaptation period. \section{Monitoring} \label{section:monitoring} A {\em monitor} in \JAGS\ is an object that records sampled values. The simplest monitor is a {\em trace monitor}, which stores the sampled value of a node at each iteration. Other types of monitor are available: monitors of type ``mean'' and ``variance'' defined by the base module store the running mean and variance, respectively, of a given node (See section \ref{section:base:monitors}). The dic module defines various monitors based on deviance statistics for model criticism (See chapter~\ref{chapter:dic}). \section{Errors} There are two kinds of errors in \JAGS: runtime errors, which are due to mistakes in the model specification, and logic errors which are internal errors in the JAGS program. Logic errors are generally created in the lower-level parts of the \JAGS\ library, where it is not possible to give an informative error message. The upper layers of the \JAGS\ program are supposed to catch such errors before they occur, and return a useful error message that will help you diagnose the problem. Inevitably, some errors slip through. Hence, if you get a logic error, there is probably an error in your input to \JAGS, although it may not be obvious what it is. Please send a bug report (see ``Getting help'' on page~\pageref{section:help}) whenever you get a logic error. Error messages may also be generated when parsing files (model files, data files, command files). The error messages generated in this case are created automatically by the program \texttt{bison}. They generally take the form ``syntax error, unexpected FOO, expecting BAR'' and are not always abundantly clear, but this is out of my control. \chapter{Running JAGS from R} \label{chapter:R} The native interface from R to \JAGS\ is the \texttt{rjags} package \citep{Plummer2016}. This provides an object-based functional interface to \JAGS, in which most of the steps of running a model are separated into different function calls. Several alternative packages have been developed that offer a unified interface to \JAGS. The main ones are detailed below, but there are many other R packages that interface to \JAGS. See the list of reverse depends, imports, suggests and enhances at \url{https://cran.r-project.org/package=rjags} To illustrate each package, we consider the linear regression model from chapter~\ref{chapter:bugslang} with a trivial data set of 5 observations. The data and initial values for this model are given below and are used by all R interfaces: \begin{verbatim} line_data <- list("x" = c(1, 2, 3, 4, 5), "Y" = c(1, 3, 3, 3, 5), "N"=5) line_inits <- list(list("alpha" = 3, "beta"= 0, "tau" = 1.5), list("alpha" = 0, "beta" = 1, "tau" = 0.375)) \end{verbatim} \section{rjags} \label{section:rjags} To run a model with the \texttt{rjags} package, we first create a model object with the \texttt{jags.model()} function. \begin{verbatim} library(rjags) model <- jags.model("line.bug", data=line_data, inits=line_inits, n.chains=2) \end{verbatim} This compiles and initializes the model, and if necessary runs an adaptive phase for 1000 iterations (see chapter~\ref{chapter:running} for an explanation of these steps). If adaptation is required then a progress bar made of \texttt{'+'} signs will be printed. The object created by \texttt{jags.model} is of class ``jags''. It is an R interface to the virtual graphical model created by \JAGS\ and does not contain any samples. To get samples from the posterior distribution of the parameters, we use the \texttt{coda.samples} function after first using the \texttt{update} function to run the Markov Chain for a burn-in period of 1000 iterations. \begin{verbatim} update(model, n.iter=1000) samples <- coda.samples(model, variable.names=c("alpha", "beta", "sigma"), n.iter=1000) \end{verbatim} The \texttt{samples} object is of class \texttt{mcmc.list} defined by the \texttt{coda} package \citep{PlummerEtal2005}. It contains monitored samples of the variables \texttt{alpha}, \texttt{beta}, and \texttt{sigma} for the two parallel chains. To get an informative summary of the samples, we use the \texttt{summary} function: \begin{verbatim} > summary(samples) Iterations = 1001:2000 Thinning interval = 1 Number of chains = 2 Sample size per chain = 1000 1. Empirical mean and standard deviation for each variable, plus standard error of the mean: Mean SD Naive SE Time-series SE alpha 3.0001 0.5344 0.011949 0.012392 beta 0.7997 0.3921 0.008769 0.009133 sigma 1.0326 0.7120 0.015920 0.030337 2. Quantiles for each variable: 2.5% 25% 50% 75% 97.5% alpha 1.95654 2.7452 2.9916 3.2488 4.158 beta 0.01763 0.6178 0.8037 0.9877 1.559 sigma 0.41828 0.6376 0.8276 1.1838 2.804 \end{verbatim} The \texttt{mcmc.list} class also has a plot method. Hence \begin{verbatim} plot(samples) \end{verbatim} will produce trace plots and density plots for the sampled values. \section{runjags} The \texttt{runjags} package \citep{Denwood2016} includes many enhancements to \JAGS, including a custom \JAGS\ module that contains some additional distributions in the Pareto family. The basic function for running a model with the \texttt{runjags} package is \texttt{run.jags()}, which can be used as follows: \begin{verbatim} library(runjags) out <- run.jags(model="line.bug", monitor=c("alpha","beta","sigma","dic"), data=line_data, n.chains=2, inits=line_inits) \end{verbatim} The optional \texttt{method} argument to \texttt{run.jags} allows the user to choose whether the model is run through the \texttt{rjags} interface (section~\ref{section:rjags}) or through the command line interface of \JAGS\ (chapter~\ref{chapter:cmdline}). In addition, the \texttt{method} argument controls how parallel chains are run. Running parallel chains in different processes can offer considerable speed improvements on a multi-processor computer. The output of the \texttt{run.jags()} function is an object of class ``runjags''. The print method for ``runjags'' objects prints a summary of the posterior distribution of the parameters. \begin{verbatim} > print(out) JAGS model summary statistics from 20000 samples (chains = 2; adapt+burnin = 5000): Lower95 Median Upper95 Mean SD Mode MCerr MC%ofSD SSeff alpha 1.9171 3.0004 4.0096 2.9971 0.54331 2.9936 0.0037325 0.7 21189 beta 0.046318 0.79919 1.5288 0.79989 0.39328 0.79952 0.0028322 0.7 19283 sigma 0.31105 0.82308 2.155 1.0107 0.73651 0.68375 0.0094755 1.3 6042 AC.10 psrf alpha -0.0029037 1 beta -0.0044582 1.0004 sigma -0.00090713 1 Model fit assessment: DIC = 21.16815 [PED not available from the stored object] Estimated effective number of parameters: pD = 8.24059 Total time taken: 0.9 seconds \end{verbatim} The print method also shows some convergence diagnostics for each parameter: \texttt{SSeff} is the effective sample size, controlling for autocorrelation of the Markov chain; \texttt{AC.10} is the autocorrelation at lag 10; and \texttt{psrf} is the Gelman-Rubin convergence diagnostic \citep{GelmanRubin1992}, or the {\em potential scale reduction factor}. If the chain is showing signs of poor mixing then the \texttt{extend.jags} function can be used to continue running the model. The \texttt{autorun.jags} is an alternative to \texttt{run.jags} that takes control of the run-length of the MCMC process and runs the chain until convergence. The default plot method for ``runjags'' objects shows a traceplot, the cumulative distribution function, the density function and the autocorrelation function for each variable. A cross-correlation plot for all variables is also generated. There are a number of other methods available for ``runjags'' objects, including \texttt{as.mcmc.list} for extraction of the MCMC objects, and \texttt{as.jags} for conversion to an object that can be used with the rjags package. The reverse operation is also possible by using \texttt{as.runjags} on an rjags model. One of the motivations for the runjags package is to allow comments embedded directly within the the \JAGS\ model code to specify variables to be monitored, and to indicate any variables for which data or initial values should be extracted automatically from the \R\ session. The \texttt{template.jags} function uses these features to create complete model, data and initial value definitions based on a data frame and formula-based representation of a generalised linear mixed model as provided by the user. \section{R2jags} The R2jags package \citep{SuYajima2015} was modelled on the pre-existing R2WinBUGS package \citep{SturtzEtal2005} which provided the first interface from WinBUGS to R. With R2jags and R2WinBUGS the user may switch between the two BUGS engines while keeping a consistent R interface. The R2OpenBUGS package is an updated version of R2WinBUGS that works with OpenBUGS. Like the \texttt{runjags} package, the \texttt{R2jags} package offers a single interface to \JAGS\ that carries out all the steps of running the model, with reasonable default values. The interface function is \texttt{jags()}. \begin{verbatim} library(R2jags) out <- jags(data=line_data, inits=line_inits, parameters.to.save=c("alpha","beta","sigma"), model.file="line.bug", n.chains=2) \end{verbatim} The output from the \texttt{jags} function is an object of class ``rjags''. The print method for ``rjags'' objects summarizes the output (There is also a \texttt{plot} method). \begin{verbatim} > out Inference for Bugs model at "line.bug", fit using jags, 2 chains, each with 2000 iterations (first 1000 discarded) n.sims = 2000 iterations saved mu.vect sd.vect 2.5% 25% 50% 75% 97.5% Rhat n.eff alpha 2.992 0.552 1.888 2.757 3.002 3.258 4.037 1.001 2000 beta 0.797 0.381 0.041 0.618 0.795 0.988 1.549 1.005 1000 sigma 1.014 0.664 0.417 0.636 0.840 1.165 2.581 1.002 2000 deviance 12.981 3.595 8.832 10.358 12.104 14.660 22.215 1.002 1100 For each parameter, n.eff is a crude measure of effective sample size, and Rhat is the potential scale reduction factor (at convergence, Rhat=1). DIC info (using the rule, pD = var(deviance)/2) pD = 6.5 and DIC = 19.4 DIC is an estimate of expected predictive error (lower deviance is better). \end{verbatim} In addition to summaries of the posterior distribution, the print method for ``rjags'' objects includes \texttt{Rhat}, the Gelman-Rubin convergence diagnostic \citep{GelmanRubin1992} and \texttt{n.eff} the effective sample size. If an ``rjags'' object shows signs of lack of convergence, then it can be passed to the \texttt{autojags} function which will update it until convergence. \section{jagsUI} The \texttt{jagsUI} package offers similar facilities to the \texttt{runjags} and \texttt{R2jags} package. In fact \texttt{jagsUI} offers two interface functions -- \texttt{jags()} and \texttt{autojags()} -- with the same names as the ones in the \texttt{R2jags} package. It is therefore not a good idea to load both packages in the same \R\ session. Compared with the other packages, the output from \texttt{jagsUI} tends to be more verbose and didactic. It may therefore be suitable for users who are not familiar with MCMC. The \texttt{jags} function is illustrated below. \begin{verbatim} library(jagsUI) out <- jags(data=line_data, inits=line_inits, parameters.to.save=c("alpha","beta","sigma"), model.file="line.bug", n.chains=2, n.iter=2000, n.burnin=1000) \end{verbatim} Note that you must supply arguments \texttt{n.iter} and \texttt{n.burnin}. However, noted above, there is also an \texttt{autojags()} function that controls the run length for you. The output of the \texttt{jags} function is an object of class ``jagsUI''. The print method for ``jagsUI'' objects gives summary statistics and diagnostics similar to the \texttt{R2jags} package, but with more explanation. \begin{verbatim} JAGS output for model 'line.bug', generated by jagsUI. Estimates based on 2 chains of 1000 iterations, burn-in = 0 iterations and thin rate = 1, yielding 2000 total samples from the joint posterior. MCMC ran for 0.001 minutes at time 2017-06-27 17:57:07. mean sd 2.5% 50% 97.5% overlap0 f Rhat n.eff alpha 2.995 0.615 1.883 2.984 4.053 FALSE 0.997 1.002 2000 beta 0.798 0.402 0.062 0.813 1.486 FALSE 0.977 1.011 332 sigma 1.041 0.768 0.420 0.828 3.218 FALSE 1.000 1.023 2000 deviance 12.984 3.880 8.849 11.921 23.821 FALSE 1.000 1.002 2000 Successful convergence based on Rhat values (all < 1.1). Rhat is the potential scale reduction factor (at convergence, Rhat=1). For each parameter, n.eff is a crude measure of effective sample size. overlap0 checks if 0 falls in the parameter's 95% credible interval. f is the proportion of the posterior with the same sign as the mean; i.e., our confidence that the parameter is positive or negative. DIC info: (pD = var(deviance)/2) pD = 7.5 and DIC = 20.51 DIC is an estimate of expected predictive error (lower is better). \end{verbatim} \chapter{Running \JAGS\ on the command line} \label{chapter:cmdline} \JAGS\ has a command line interface. To invoke jags interactively, simply type \texttt{jags} at the shell prompt on Unix, a Terminal window on MacOS, or the Windows command prompt on Windows. To invoke JAGS with a script file, type \begin{verbatim} jags